0% found this document useful (0 votes)
81 views

Documentation

Uploaded by

Victor Heise
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views

Documentation

Uploaded by

Victor Heise
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3797

Delta DIAView SCADA introduction

Background
With the development of industrial and social economy, information
technology based on computers and high speed Internet is
becoming more and more mature and advanced; its application
range includes industrial manufacturing, import and export trading,
transportation, power energy, oil, chemical industry, metallurgy and
the everyday life, culture and entertainment of people etc.
Information technology is also gradually developing towards
automation and intelligence, promoting productivity revolution and
increasing people’s living standards.
The SCADA (Supervisory Control And Data Acquisition) system is
a data acquisition and monitoring system. It is a computer-based
automated production process control and management system that
can monitor and control the executing devices on-site in order to
realize functions including data acquisition, device control,
measurement, parameter control, various signal alarms and
generate charts and reports etc. The SCADA system has significant
effects for increasing the reliability, safety, economic benefits and
work efficiency of industrial production and management control; it
reduces personnel burden and labor, realizing automation and
modernization.
Since releasing its first inverter in 1995, Delta continues to
increase the reliability and precision of its products, and focused on
innovative development of inverters and the power quality control,
sensing, control and motion control fields. As its product lines
become more and more complete, Delta also integrated the PLC,
HMI, inverter, network communication devices, video and other
industrial automation products manufactured by itself to provide
comprehensive industrial automation solutions. With the gradual
promotion and global distribution of Delta’s own brand development
strategy, and to further increase Delta’s influence in the industrial
automation field, adapt to the customers’ need for Delta’s industrial
automation products and market development features, Delta
developed its own brand of SCADA system - - the Delta Industrial
Automation View system, abbreviated as DIAView.

Function features
Ø Based on the Windows operating system with wide, flexible
and reliable applications.
Ø Supports the communication and networking of domestic
and international mainstream PLC, DCS, PAC and IPC
devices.
Ø Based on the .NET Framework; uses WPF (Windows
Presentation Foundation) technology to display beautiful
images and fully supports the XML technology.
Ø Friendly user interface, rich graphic elements, easy
operations, easy configurations, easy usage and easy
maintenance.
Ø Distributed architecture with powerful scalability.
Ø Stable industrial communication design.
Ø Powerful alarm management.
Ø Easy-learning and easy-to-use scripting language
(VBScript).
Ø Highly efficient recipe management.
Ø Reliable user management.
2.1 Installation and configuration requirements
Configuration item Minimum HW/SW system requirement
CPU 2GHz or above
Memory 4GB or above
Hard disk 20GB or above
Display 1024 x 768 resolution or above
Windows 7 SP1 32bit/64bit (Professional/Ultimate/Enterprise)
Windows 8 32bit/64bit (Professional/Ultimate/Enterprise)
Windows 10 32bit/64bit (Professional/Ultimate/Enterprise)
Operation system
Windows Server 2008 R2 SP1 64bit
Windows Server 2012 64bit
Language: English,Simplified Chinese, Traditional Chinese
System Privilege Windows users must have administrator rights
Installation of Microsoft .NET Framework4.5.2 or above is
Execution Platform
required
Chromium-based browsers (version 45 or above) are required.
Browser
Chrome is recommended
Database SQL Server 2008 R2 or above
Note : Users must prevent the computer system from entering standby modes or
dormant state while DIAView runtime environment executes in order to prevent
"Unrecognized Encryption -dongle" exception.
2.2 DotNet installation
DIAView is developed based on the Microsoft .NET Framework
environment; .NET Framework4.5.2 or above must first be installed
before using DIAView. Installation steps are as follows (Taking
Windows7 Professional Edition as the example):

Step 1: Start up the computer,click to start the DIAViewSetup.exe


installer,as shown in the figure below:

Once the installation program has started, it will enter the install
navigation interface; there is a list of buttons on the right of the install
navigation interface, when you move the mouse cursor onto one of
the buttons, the text of the button will change from white to yellow.
The functions of each button are as follows:
l Installation guide: Includes the system requirements for
installing DIAView, problems that might encounter during the
installation and the features of the new version.

l DIAView Full: Installing DIAView main program or DIAView


Client.

l DIAView Client: Installing DIAView Client.

l SenseLock (Encryption -dongle): Installs an encryption -


dongle driver.

l .Net Framework: Installs Microsoft .NET Framework (version


4.5.2 and above).

Step 2: Click the “.Net” button to enter the installation interface of


Microsoft .NET Framework, as shown in the figure below:

Step 3: The “-License Terms-” dialog will appear as shown in the


figure below. If the user agrees to the terms in this agreement, check
the “-I have read and accept the license terms-” checkbox and then
press the “-Install-” button to continue the installation. If user does
not agree, press the “-Cancel-” button to exit the installation
program:
Step 4: Select accept license agreement and then press the “-
Install-” button to continue installation and enter the installation
stage:
Step 5: When installation is complete, the dialog shown in the figure
below will appear; click the “-Finish-” button to complete the
installation of -.NET Framework:
2.3 Install DIAView
Installation steps are as follows (Using Windows7 Professional
Edition as the example):

Step 1: Start the computer and click the DIAViewSetup.exe file to


execute the installation program, as shown in the figure below:

Step 2: Click the “DIAView Full” or “DIAView Client” button to enter


the DIAView installation interface, as shown in the figure below:
Step 3: Click “-Next-” and the “-User License Agreement-” dialog will
appear. The content of the dialog is the legal agreement between “-
Delta Electronics,Inc.” and the DIAView software user. If the user
agrees to the terms in this agreement, check the “-I accept the terms
in the license agreement-” checkbox and then press the “-Next-”
button to continue the installation; users can also press the “-Print-”
button to print this agreement. If user does not agree, press the “-
Cancel-” button to exit the installation program:
Step 4: Select accept license agreement and then press the “-Next-”
button to continue installation; the select installation folder dialog will
appear:
The system’s -default installation path is: C:\Program Files\DIAView\,
if the user wants to change the installation folder, press the “-
Change-” button to select the installation path.

Step 5: Press “-Next-” and the installation program will analyze the
installation environment and then the following window will appear:
Step 6: Click “-Install-” to start installing the DIAView main program;
the installation progress window will appear:
Step 7: When installation is complete, the dialog shown in the figure
below will appear; click the “-Finish-” button to complete the
installation of the DIAView software. If user checked the “-Start
DIAView-”checkbox, then the DIAView software will start when the “-
Finish-” button is pressed:
2.4 Install senselock driver
Installation steps are as follows (Using Windows7 Professional
Edition as the example):
Step 1: Start the computer and click the DIAViewSetup.exe file on
the disc to execute the installation program, as shown in the figure
below:

Step 2: Click the Senselock button to enter the installation


navigation interface, as shown in the figure below:

Step 3: Click “-Next-” and select install parameters:


Step 4: Click the “-Next-” button to enter the program installation
stage; when installation is complete, the screen will appear as shown
in the figure below:


2.5 Install SQL server database
DIAView adds new "History Variable" function and optimize the query
efficiency, use new version of "History Variable" need install SQL
Server database and database version can't under the SQL Server
2008 Express R2. DIAView package has contain SQL Server 2008
R2 package(language version: en,x86 and x64), if user want to install
other language version or higher version, please go to microsoft
website(https://www.microsoft.com) to download. Installation steps
are as follows (Taking Windows7 Professional Edition as the
example):
Step 1: Right_click "Computer", click "properies", go to computer
system view, check the "system type", as shown in the figure below:

Step 2: Install SQL Server package in "sql" folder at DIAView
package, if your computer System type is 32-bit Operating System,
install package in "x86" folder, if your computer System type is 64-bit
Operating System, install package in "x64" folder, as shown in the
figure below:
Step 3: Click SQL Server package, go to installation view, as shown
in the figure below:

Step 4: Select "Installation" node and click "New installation or add


features to an existing installation", go to "Lisence Terms" view, as
shown in the figure below:

Step 5: Select "I accept the license terms" after read license and click
"Next", go to "Feature Selection" view, as shown in the figure below:

Step 6: In this view, suggert install all, click "Next", go to "Instance


Configuration" view, as shown in the figure below:

Step 7: Click "Next", go to "Server Configuration" view after check the


hard dist space, as shown in the figure below:

Step 8: Click "Next", go to "Database Engine Configuration" view, as


shown in the figure below:

Step 9: In "Database Engine Configuration" view, suggest select


"Mixed Mode" at "Authentication Mode", create a SQL Server
account(usrename: sa), other computer can connect your SQL
Server service use account, as shown in the figure below:

Step 10: Click "Next" and go to "Error Reporting" view, as shown in


the figure below:

Step 11: Click "Next", go to "Installation Progress" view, start


installing, as shown in the figure below:

Step 12: If install success, as shown in the figure below:


Step 13: Click "Close" after install success. If user want other
computer connect this SQL Server service, right_click computer, click
"Manage", go to Computer Management view, click "Services and
Applications" , click "SQL Server Configuration Manager", click "SQL
Server Network Configuration", select SQL Server service we
installed(default: SQLEXPRESS), check the status of "Named Pipes"
and "TCP/IP" is enabled, if status is disabled, right_click and click
"Enabled",as shown in the figure below:

Step 14: Click "SQL Server Services", right_click service, select


"Restart",as shown in the figure below:

Step 15: Open Dvstudio after install DIAView, right_click "History


Variable", select "Database Configuration", click "Connect Test",
check SQL Server databse has installed correctly, as shown in the
figure below:

2.6 Uninstalling DIAView main program and
senselock driver
1. There are three ways to uninstall the DIAView main program; the
steps are as follows (using Windows 7 Professional Edition as the
example):
Method 1: Go to the “Control Panel” and select “Programs and
Features,” then select “DIAView” and use your mouse to right-click on
it. The right-click menu will appear as shown in the figure below:

Select “-Uninstall-” from the right-click function menu and the system
will automatically uninstall the program, as shown in the figure below:


Method 2: Click the DIAViewSetup.exe file on the disc to execute the
installation program. Select “DIAView” from the navigation window
that pops up, and then select “-Delete-” from the next screen that
appears; the system will automatically uninstall the program:

Method 3: Open the “Start” menu → All Programs → DIAView →


Uninstall:

2. Uninstalling Senselock driver (the USB license key must be


inserted): Open “Computer Management”→ search for “Senselock
EliteIV v2.x” in “Device Manager” and the right-click on it:

Select “-Uninstall-” and the “-Confirm device uninstall-” window will


appear; check “-Delete driver software for this device-” and then click
“-OK-” to uninstall it:

Quick start to project development
In order to quickly and skillfully use the DIAView software to develop
projects efficiently, this chapter introduces the common steps used to
develop projects with the DIAView software. Users may refer to
these steps for common project developments, but since there are
different project applications, users should select the development
steps suitable for their specific needs.
Common steps of project development with DIAView are as follows:
Step 1: Execute the DIAView software development environment.
Step 2: Add project: Click the “Add project item from the “File” or
“Start menu in the main interface of the development environment
and configure information including the project name and project
storage path etc., and then the system will generate and display the
initial tree index in the “(Project)” window.
Step 3: Define variables: Variables are medias used to record the
changes of certain data of the DIAView software in real-time. It
dynamically displays the data source and display form of the
controlled field site data. Therefore, all variables participating in the
information handshake of the project must be defined.
Step 4: Create IO Communication: Create a physical data channel
between the upper and lower machines of the DIAView software and
the monitoring and control field equipment, and set the information
including connection method, communication parameters and
communication variables etc.
Step 5: Create window: This means creating the graphic interface
for the system. Draw the graphics for field simulation pictures and
configure related information including properties and charts etc.
Step 6: Define animations and events: Defines the changes and
actions for the graphic objects in the window to take when its
properties changes according to the data acquired during project
execution.
Step 7: User program configuration: Defines condition programs
and set the project to perform script programs for specific function
when related data changes, and configure time program to define
operation programs to execute when the screen starts/stops or at
specific times.
Step 8: Alarm configuration: Sets the warning value of the range
of variable value changes, and specify the alarm level and related
alarm configurations when the range of the changed variable value is
lower than or exceeded the warning value.
Step 9: History record setting: Specifies certain more important
variables and records their value changes in order to use the “
(History chart)” or “ (Report)” to connect these variables to perform
data summary and analysis.
Step 10: Database Access: Sets the related parameters for the
connection between the DIAView software and third-party databases
in order to achieve handshakes between the real-time project data
and other commercial databases.
Step 11: Security zone setting: Sets the project operating
authority. Divides the various components in the project into different
security zones. Objects have different operating authorities in
different security zones
Step 12: User setting: Sets the account and authority (security
level) of the system operators.
Step 13: Project configuration: Set project operation options,
including IP address, port number, password, etc., and finally
configure the initial startup window of WPF and Web.
Step 14: Runtime: Executes the project and view whether the
screen effects and functions meet the design requirements. If it
does, then it can be executed and used, or else please redesign
starting from Step 3 to perfect the project according to your need.
4.1 Common terms and concepts​
This chapter introduces common technical terms used in the
DIAView software to help users properly learn how to use the
DIAView software.

Ø Project
A project is a set of automated application system developed with
the DIAView software according to user requirement; it mainly
includes a collection of the development of automated monitoring
and control systems and its configuration information. A project
includes graphic window interface, IO communication, alarm,
variable and other parts, and the project developer can perform
centralized management for each part of the project.Project also can
be called "Engineering".

Ø Development environment and runtime


environment
The DIAView software is composed of the two parts: Development
environment and Runtime environment.

The development environment is the operating platform for system


users to perform project design and development, including
designing graphical interface, setting IO communication parameters
and configuration functions etc.

The user creates projects through the development environment,


and then creates IO communication and channels, and defines
variable dictionaries in the project. Users also use a sketchpad to
draw the simulation pictures of field sceneries,configure animations,
events, alarm information, configure reports and curves etc.; they
can even write back-end scrips according to the data and calculation
formula to perform logic operations.

The runtime environment is the platform where project are


dynamically executed; it provides an execution display and control
interface. The system user uses the runtime environment to perform
real-time monitoring.

Ø IO communication, channel,and device


IO communication refers to collecting data information of on-site
equipment, and use communication medias to read/write the
information from/to equipment or save it to the system database to
further analyze and process.

In which the communication media is what is called a “channel”; it is


the bridge for the DIAView software and other equipment to connect
and achieve data information transmission.

Equipment: This is the hardware products that the DIAView software


uses to perform data acquisition; common equipment includes: PLC
programmable logic controllers, inverters, boards, digital
instrumentations, smart controllers and monitoring probes etc.

IO communication connections currently supported by the DIAView


software includes serial port and Ethernet; supported communication
interface standards include: Modbus TCPIP, Modbus RTU, Modbus
ASCII, OPC,MQTT, Delta TCPIP, Delta RTU, Delta ASCII,Omron,
Mitsubishi,Siemens,Rockwell common series of mainstream brands
and simulators etc.
Ø Variable dictionary and variable
The variable dictionary is a collection of variables in the project; it
manages the following variables;

Variables are values of the project that can change at any time; they
are important participants for system data information handshakes.

The variable dictionary of the DIAView software can perform group


management for variables; multiple variable groups can be created
and multiple variables can be created under a variable group.

Ø Window
The window is a core component of the DIAView software for users
to draw field simulation pictures, configure parameters and display
information. It is the basis to realize real-time visualization of the
DIAView software -- it provides various drawing elements including
basic graphic group, window controls group and advanced controls
group etc., system’s built-in graphics and the customized graphics
library that users can add on their own; it also provides windows that
allow configuring of image object properties, animations and events.
In the DIAView software, one windows is one screen.

Ø Property
In the DIAView software, properties describes the features or
characteristic information that all objects in a window; for example
name, size and background color etc

Ø Animation
Animation refers to the process of setting the properties of an
graphic object, including the size, color, rotation angle and position,
to change according to the changes in the variable data while the
project is executing.

Ø Event
An event refers to the process of specifying the properties of an
graphic object, including the size, color, rotation angle and position,
to change with mouse or keyboard operations.

Ø Alarm and alarm variable


Alarms refer to related notifications or warnings (such as: E-mail or
sound) triggered to remind related personnel to pay attention
when

a certain data or status of the system is over or under the default


value during the project execution process. The alarm is
composed of alarm

variables and alarm configurations.

Alarm variables: Generates alarm information variables, sets the


related variables that the alarm variables must connect to, and
sets

the alarm level and related alarm configuration information. The


DIAView software performs group management for alarm
variables; each

alarm variable belongs to a certain alarm group.


Alarm configuration: Configures and alarm method--E-mail or sound
alarm.

Ø Operation variable
Refers to saving the operation record to the database when the
values of certain variables in the variable dictionary changed due to
user operations in order to query and check user operations.

Ø History record
Refers to saving the changing record of certain variable values in the
variable dictionary and defines the recording method for data
statistics and analysis.

Ø Security zone
Refers to dividing and setting the graphic objects, control units and
equipment etc. in the project to specific security levels so that only
users in that security level can access them. It is a method to control
user rights in order to guarantee the reliability and security of the
DIAView software execution.

Ø User
System operators and administrators with related operating
authorities set for the project development and execution. Different
authorities can be set for different users in order to achieve
specialization so that the DIAView software and execute securely.

Ø Recipe and element


Recipes refer to the ratio of raw materials and automated
management of process control provided for specific production
processes.The

use of recipes can increase the efficiency of automated production.

The recipe of the DIAView software is composed of two parts: recipe


item and recipe ingredient.

The recipe ingredients are the main components of the recipe item.
The recipe ingredient is controlled by the engineering variables of
the

engineer. The adjustment of recipe ratio is completed by changing


the variable values.

Ø User script
The user program of the DIAView software is mainly divided into
“condition program” , “time program” and "Global Function".

Condition program refers to executing related program functions


when the conditions set matches the engineering variables.

Time program refers to executing related program functions when


the system time reaches the time condition set for the program.

Global function refers to user can package the reusable script code,
and use it in other script.

Ø DatabaseAccess and DatabaseAccessItem


DatabaseAccess provides users with the ability to access external
databases and read and write external database data.

The DatabaseAccessItem represents connection information for


connecting to an external database.

Ø Global
Global refers to user can change content of text and image in
window by switch language.

Ø Project configuration
Project configuration includes the configuring of the database,
configuring of the execution screen and the configuration of the
starting screen. Users can achieve handshakes between real-time
data of the project and other commercial databases through
engineering configuration by setting related configurations of the
execution environment of the DIAView software

Ø Runtime
Runtime refers to dynamically running the project completed in the
development environment in the runtime environment according to
the development design requirements and configured parameters,
achieving real-time data acquisition of the system, dynamic display
of the screen, real-time response of commands, automatic display of
reports and manual dispatching and control in order to exert the
functions and effects of the various parts of the project.
4.2.1 Framework
Start the DIAView software development environment and enter the
main window of the system, as shown in the figure below:

Composition of the DIAView software development environment:


1. Quick tool bar: Provides frequently used buttons for project
development.
2. Menu bar: Provides various basic operation functions for project
development.
3. Tool buttons: Shortcut buttons for operating commands.
4. Toolbox: Provides frequently used basic graphic elements and
control units for drawing.
5. Gallery: Frequently used graphic elements built-in the system
and containers for users to freely expand customized graphics.
6. Sketchpad area: The area for project management, graphic
image drawing and editing.
7. Project window: Tree index display window of the project;
displays various compositions of the project and provides
various portals for operation and configuration functions.
8. Object browser window: Displays all object members in the
window.
9. Property window: Displays the properties of the object;
provides an operating portal to modify properties.
10. Animation window: Portal to configure animations for objects.
11. Event window: Portal to configure events for objects.
12. Extension window: Portal to configure extended properties for
objects.
The windows of the DIAView software development environment can
also be rearranged by dragging them with the mouse, as shown in
the figure below:

The rearranged windows are as shown in the figure below:

4.2.2 New project
There are four main ways to add new projects in the DIAView
software development environment.
Method 1: Select the “File” menu of the DIAView software
development environment and then press “New”.

Method 2: Select the “Start” menu of the DIAView software


development environment and then press “New”.

Method 3: Press the “New” button in the toolbar on the starting page
of the DIAView software development environment to add a new
project.


Method 4: Right-click the mouse on the starting page of the DIAView
software development environment and then select “New” from the
right-click menu to add a new project.

Clicking the add project button adds a new project and related
information on project configuration, as shown in the figure below:

Name: Name defined for the project (required); the system will
choose a name by default but the user can also change it. The
project name customized by the user must comply with the naming
rules of the VB Script scripting language:
1. Composed of English letters,numbers,Chinese characters and
underscore,and the name must start with English letters or Chinese
characters.
2. No case Sensitive.
3. Spaces, periods, exclamation marks and special characters such
as @$#&*? etc. cannot be used in the name.
4. The length of the name cannot exceed 100 characters or 25
Chinese characters.
5. The name of the project cannot be repeated as other created
projects placed under the same project folder.
6. The name only supports three languages: Simplified Chinese,
Traditional Chinese and English.

Position: Specified the storage path of the project; press the ​button
to select the path.
Description: Allows users to define project-related explanation or
description information.
Project Template
When creating a new project, the "Select Project Template" window
will pop up, and the user can select the project template as needed,
as shown in the figure below:

There are two kinds of project templates by default(Empty,


DefaultTemplate):

Empty: there is nothing in this template.


DefaultTemplate: which contains some general windows and
can set the size of the window.
Delete:delete the project template
In the select project template interface, you can delete the user-
defined project template. The built-in project template cannot be
deleted.
Project Save as Project Template
Users can customize the project template. After creating the project,
select the project root node, and click "Save as Template" in the right-
click menu to save the current project as a project template. as
shown in the figure below:

In the save as project template interface, you can configure project


template information, as shown in the figure below:

Name: the name defined for the template (required). The current
project name will be used as the template name by default. You can
also customize it.
Template description: you can define the description or description
information of the project template.
4.2.3 Manage project
To manage project refers to performing centralized management of
the projects in the DIAView software to make it easier for users to
perform related operations to the projects. There are two methods to
manage the projects in the DIAView software: First is through the
starting page of the development environment and second is through
operating the function menu (please refer to “4.4.1 File menu”).
Start Page
Open the DIAView software development environment and the
starting page will be opened on the main interface by default. Project
item information will be opened if a project was previously being
developed, including project name, time of creation, modification
time, resolution, project path and project description information.
Operations such as add new, add, delete, clear, backup, restore and
set project as preset project etc. can be performed on the starting
page, as shown in the figure below:


Right-click menu can also be performed to do related operations on
the starting page, as shown in the figure below:


Introductions to the buttons and right-click menu item functions on the
start page:
1. Open: Opens the project selected from the project list on the
starting page; this can also be achieved by double-clicking the row of
project to be opened in the project list. Once the project is opened,
the project tree index will be displayed in the project window to the
right as shown in the figure below:

​ . New: Adds a new project; the created project will be added to the
2
project list on the starting page, and be opened in the project window.
Please refer to “4.2.2 New project”.​
3. Add: Adds a project that already exists under the specified path
into the starting page project list. Click the “Add” button or right-click
menu to open the folder selection box:


4. Delete: Deletes the selected project on the starting page project
list. Click the “Delete” button or right-click menu to open the project
deletion selection box:


There are two delete options:
Delete list items of start page: Deletes the project information
from the starting page, but the project file is not deleted.
Delete project file and item, unrecoverable: Deletes the project
from the starting page list and also deletes the project file completely.
5.Modify project: Modify project name and description, click "Modify
Project" button or right-click menu to open the modifying project box:

6.Open project folder: Opens the folder where the project is located
7.Clean: Clears the project information on the starting page list. It will
be cleared if the project file was already deleted but still exists in the
project list.
8.Backup: Backup: Backs up the selected project. The backed up
project file will have the extension “.projectzip”, as shown in the figure
below:

9.Restore: Restores the backed up project file.


10.Set to default: Selects the selected project as the preset project.
This project will be executed when the DIAView execution
environment is enabled.
11.Runtime: Executes the selected project.
Right click menu of project node
Once a project is successfully created, the project tree index will be
displayed in the project window to the right. Right-click project name
and the right-click menu will display the functions.
“Open project folder”, “Statistics”, “Rename“, “ Password”, “Package“,
“User Authorization“ and “Close” as shown in the figure below:


​1.Open project folder: Open the folder where the project is located.
2.Copy Project Path:Copy the project's path.
3.Statistics: Show the statistics about IO points and the variable
dictionary of the project.
4.Rename: Renames the project name.
5.Password: Sets a password for the project so that it can only be
opened when the correct password is entered.
Right-click the mouse on the root of the project in the project tree
index and then click “Password” to open the “Set and change
password” window, as shown in the figure below:

The meanings of each setting in the configuration window are as
follows:
Old password: Enter the original password of the project (if setting
the project password for the first time, the preset original password is
empty.
New password: Enter the new password.
Confirm new password: Enter the new password again.
Opening password-protected projects requires entering the
password, as shown in the figure below:


6.Save As Template: Save the project as a project template (see
"4.2.2 New project" for details)
7.Package: Group the user project and the run environment into
installation packages,Users can run projects directly after installation.
After the packaged project is installed, some project configurations
can be modified, and the configuration page opens to the path: "Start
Menu" - "Delta DIAView" - "Project Configuration"
Project directory tree,Right click on the project root node,Click
“Package”,Open “Packaging box” install page,as shown in the
figure below:


Project Path:The path to the project to be packaged (Selectable,
not editable)
Shortcut Name:The name of the shortcut generated after the
installation of the packaged file(Default is project name)
Install Language:Package the language for file installation(The
default is the current DVStudio language)
Output Directory:Package file generation path(The default is the
current user's Document\DIAViewSetup directory)
More Install Options:Open the custom installation options Settings
window
Pack:Package and pop up the progress display box
Select "More installation options",More installation options install as
shown in the figure below:

Install Location:The default is C:\Program Files(X86)
Shortcut Icon:Select the shortcut icon generated after the
installation of the packaged file (The default is an HMI icon)
License Agreement:Only valid RTF files can be uploaded,
otherwise the license agreement may be empty(The default is the
user protocol corresponding to the current DIAView)
Use default:Use default Settings,“Install Options”Return to the
default configuration
8.User Authorization: Bind the current project to the dongle,after
binding, the project can only run if the dongle to which it is bound is
inserted.
Ø Obtain the "User Authorization" license file
Use the "Computer fingerprint extraction tool" to extract
computer information


Computer fingerprint extraction tool:Is
"machinecodegenerator.exe" in C:\Program Files (x86)\DIAView path
Storage Path:Select the file storage path
Close:Close "computer fingerprint extraction tool"

Exchange the acquired files for a license with DIAView technical


support
Put the License under the C:\Program Files
(x86)\DIAView\License path to use the "User Authorization"
function
Ø Use the "User Authorization"function
Project directory tree,Right click on the project root node,Click
“User Authorization”,Open“User Authorization”install,as shown in
the figure below:

Add:From the identified dongles, select the one you want to add to
the main screen
Delete:Remove dongles that do not require binding projects from the
list
Enable Authorization:When you check "Enable Authorization", all
the dongles in the list will be bound to the project
Authorization Password Change:Configure the password you
need to turn on "User Authorization"
Save:Save when the configuration is complete(After enabling
authorization, you must set the authorization password to save)
Close:Close the "User Authorization" configuration box
9.Close: Close the currently opened project.
4.2.4 GUI development window introduction
After adding a project in the DIAView software development
environment, right-click on the “Window” node in the project tree
index to the right →“Add window” and the system will create a
window that allows graphic drawing and editing, as shown in the
figure below:

Its components are based on “4.2.1 Framework”.
4.3 DIAView quick toolbar introduction
The quick tool bar provide some common used operations to users,such as save,undo,redo etc.The
functions of each button are as follows:

Button Command Descriptiom

Saves the sketchpad information currently editing in the graphic


​ Save
interface development window.

Save All Saves all sketchpad and other configuration information of the current project,"A

Reverse cancels the previous operation starting from the last
​ Undo
operation.
Reverse cancels the previous operation starting from the last
​ Redo
“Undo.”

Enable the "Auto save" function to save all sketchpad configuration information of the current project
according to the set time:
4.4.1 File menu


The file menu is used to manage the project; its function items and
functions are as follows:

New: Create a new project.


Open: Open a created project in the development environment.
Close: Close an opened project in the development
environment.
UpgradeDongleKey: Upgrade the dongle key of the DIAView

DongleKey version information:

DongleKey
Number of clients
version
NO DongleKey(trial 1 client(C/S client or B/S client),unlimited
version) number of points,Trial of additional functions
standalone version 1 client(C/S client or B/S client)
N clients,Determined by DongleKey(all C/S
C/S version
clients)
B/S version N clients,Determined by DongleKey(the sum of
the number of C/S clients and B/S clients)

Example of UpgradeDongleKey : Network version 5 client 1000 point


no additional functions dongle upgrade to 10 client 1500 point
additional functions 1
Step 1:Insert network version 5 client 1000 point no additional
functions dongle and 1500 point upgrade dongle into the computer,
click upgrade dongle from the file menu, and open the upgrade
dongle configuration window, as shown in the figure below:


Step 2:Select the options of dongle and upgrade dongle respectively,
and click the merge upgrade button at the bottom right to upgrade the
dongle data point (unplug the dongle during the upgrade process), as
shown in the figure below:

Step 3:After merging and upgrading, a new 1500 no additional
functions encryption dog is generated for 5 clients. The upgraded
encryption dog can only be used once and then fails, as shown in the
figure below:


Step 4:Network version 5 client 1500 point no additional functions
dongle and 10 client upgrade dongle into the computer, in the
upgrade dongle window select the dongle and upgrade dongle to
upgrade the combination, as shown in the figure below:


Step 5:Merge and upgrade to generate a new 10 client 1500 point no
additional functions dongle, as shown in the figure below:

Step 6:Insert network version 10 client 1500 point no additional
functions dongle and additional function 1 upgrade dongle into the
computer, in the upgrade dongle window select the dongle and
upgrade dongle to upgrade the combination, as shown in the figure
below:


Step 7:Merge and upgrade to generate a new 10 client 1500 point
additional functions 1 dongle, as shown in the figure below:

SoftLicense: Apply for the license file and activate the


authorization code online. After successful activation, the
software authorization has the same effect as the dongle key:
Step 1:Place the license file provided by "DIAView technical support"
in the C: \ program files (x86) \ diaview \ license path, and open the
file menu to see the "Soft License" function item, as shown in the
figure below:

Step 2:Apply for the authorization code from "DIAView technical
support". Activate the authorization code on the client network. After
successful activation, it can be used equally with the dongle key, as
shown in the figure below:

Info: View the related version information of the DIAView,the


specific steps are as follows:

Step 1:Click on about in the file menu to display the version


information of DIAView, as shown in the figure below:
Step 2:Click the webpage link in the technical support, you can
directly jump to the official website, as shown in the figure below:

4.4.2 Start menu


The function of the start menu is mainly used for project management and layout operations of the
location, layer and arrangement of the graphic objects in the graphic interface development. The
availability of each button is determined by the selected graphic object and operations in the sketchpad.
When the mouse cursor is placed on top of the button, the system will display the reminder window with
the description of this button function below the mouse. The functions of each button are as follows:

Button Command Description

​ New Create a new project

Open Open a created project in the development environment.

​ Run Execute the project currently opened in the development environ

​ Cut Cut one or multiple selected graphic objects from the sketchpad t

​ Copy Copy one or multiple selected graphic objects from the sketchpad

​ Paste Paste one or multiple graphic objects on the clipboard to the sket

​ Align Left Align two or more selected graphic objects in the sketchpad to th

​ Align Center Align two or more selected graphic objects in the sketchpad to th

​ Align Right Align two or more selected graphic objects in the sketchpad to th

​ Align Top Align two or more selected graphic objects in the sketchpad to th

​ Align Middle Align two or more selected graphic objects in the sketchpad to th

​ Align Bottom Align two or more selected graphic objects in the sketchpad to th

​ Distribute Vertical Distribute three or more selected graphic objects in the sketchpa

​ Distribute Horizontal Distribute three or more selected graphic objects in the sketchpa

​ Same Center Align two or more selected graphic objects in the sketchpad to th
Make two or more selected graphic objects in the sketchpad have
​ Same Width
the same width.
Make two or more selected graphic objects in the sketchpad have
​ Same Height
the same height.
Make two or more selected graphic objects in the sketchpad have
​ Same Size
the same width and height.

​ Group Groups the selected multiple graphic objects into a new graphic w

​ Ungroup Splite the group graphic into separated graphic objects.

​ Bring to Front Move the selected graphic object at the top layer when there are

​ Send to Back Move the selected graphic object at the bottom layer when there
​ Bring Forward Move the selected graphic object up one layer when there are m

​ Send Backward Move the selected graphic object down one layer when there are

​ Rotate Clockwise Rotates the selected graphic object in the sketchpad 90 degrees
Rotates the selected graphic object in the sketchpad 90 degrees
​ Rotate Counter Clockwise
counterclockwise using the center of the graphic object as the or
Flip the selected graphic object in the sketchpad vertically using
​ Flip Vertical
the Xaxis of the center of the graphic object as the axis of symme

​ Flip Horizontal Flip the selected graphic object in the sketchpad horizontally usin

​ Show Ruler Display or hide the framework ruler.

​ Enable Snap When enable snap function, draw and move objects by the grid.

​ Enable Pan When enable pan function, handshape tool will be displayed to m

​ Zoom Ratio Adjuest the zoom ratio of the canvas.


4.4.3 View menu


The view menu is used to open the configuration windows including
the property window and project tree index etc. under the
development environment; its button functions are as follows:

Button Command Description

​ Start Page Open the starting page window

​ Project Open the project folder window.

​ Object Open the object browser window.

​ Property Open the property window.

​ Extension Open the extended property window.

​ Animation Open the animation window.

​ Event Open the event window.

​ Toolbox Open the toolbox.

​ Gallery Open the gallery

​ Error list Display compilation error messages.

​ Save layout Save the window layout

​ Reset layout Restore the window layout


Full Screen Open full screen editing mode
4.5 DIAView right-click menu introduction
Right-clicking the mouse in the sketchpad of the DIAView software
graphic interface development window will open the right-click menu,
as shown in the figure below:


The functions of the sketchpad right-click menu are as follows:

Command Description

Cut Cut the selected graphic object onto the clipboard.


Copy Copy the selected graphic object onto the clipboard.
Paste the graphic object on the clipboard onto the
Paste
sketchpad.
Remove the selected graphic object from the
Delete
sketchpad.
SelectAll Select all of the graphic objects in the sketchpad.
Make the multiple selected base graphic objects as a
Group new group graphic object or split the group graphic
object to individual sub graphic objects.
Arrangement Align or distribute multiple graphic objects according
to different methods.
Resize the graphic object all of the graphic objects
Size
according to different methods.
Change the layer of graphic objects according to
Layer
different methods.
Rotate the graphic objects according to different
Rotation
methods.
4.6 DIAView shortcut key introduction
Shortcut key is also called hot key. It uses specific buttons or
button combinations to execute an operation or command to replace
certain tasks with the mouse; it is convenient and fast to use.
Shortcut key available for the DIAView software is as shown in the
table below:

Shortcut key Function/command

Ctrl + O Open project


Ctrl + N Create new project
Ctrl + R Execute the project
Maximize/restore runtime
F11
environment
Ctrl + C Copy
Ctrl + C Copy
Ctrl + X Cut
Ctrl + V Paste
Advanced copy; equivalent to the
Ctrl + D
combination of Ctrl + C and Ctrl + V.
Ctrl + Z Undo
Ctrl + Y Redo
Ctrl + S Save
Ctrl+ G Group
Ctrl + U Cancel group
Delete Delete
↑ Move up
↓ Move down
← Move left
→ Move right
4.7 DIAView toolbox window introduction
The tool window of the DIAView software refers to the “Toolbox” in
the graphic development window. They provide basic graphics,
window controls and extend controls.

1.C/S version toolbox

Basic graphics, Window controls, Extended controls in the “Toolbox”


are as follows:
2、B/S version toolbox
Basic graphics, Window controls, Extended controls in the “Toolbox”
are as follows:
4.8 DIAView gallery window introduction
The gallery window of the DIAView software refers to the “Gallery”
in the graphic development window. It provide frequently used
graphic components and models required for graphic drawing. Users
can also develop and define graphic models on their own and add it
to the graphic library.

1、Gallery introduction

The Gallery is as follows:


4.9 DIAView project window introduction
The project window is the project tree index display window. It lists
all of the function nodes of the project and each node is for
configuring project related functions and administrators. Click a
certain node and the node will be selected. Then, users can double-
click on it or use the right-click menu to perform related configuration
operations. If related sub-items are already configured for this node,
there will be a “▷ ” symbol in front of the node. Click this symbol to
expand the sub-items and then double-click the sub-item to open it in
the sketchboard and edit configuration operations of the sub-item
content, as shown in the figure below:

4.10 DIAView object window introduction
The object window is mainly used to display the current graphic
components of the sketchboard in the opened window. When a
certain component is selected, the corresponding graphic objects of
this component are also selected in the sketchboard, as shown in
the figure below:
4.11 DIAView property window introduction
The property window manages related properties of objects. When
any graphic is selected in the sketchboard, this window will display
its corresponding properties in real-time. Properties include the
name, position, size and color etc. of the graphic object. The user
can modify and configure the property values in the property dialog,
as shown in the figure below:
4.12 DIAView animation window introduction
The animation window is used to manage the animation
configuration information of graphic objects. Users can add or delete
animations for the graphic. Animation configuration requires
connecting to related properties and variable data, as shown in the
figure below:
4.13 DIAView event window introduction
The event window is used to manage the event configuration
information of graphic objects. Users can add or delete graphic
events. Event configuration requires connecting to related mouse
and keyboard events and variable data, as shown in the figure
below:


4.14 Extended property window introduction
Extended property allows user to configure self-defined property
for group graphics,in this window,users can not only add or delete
extended property but also can rename, select type, set default
value, add description and relate script with the property in the
popups, as shown in the figure below:
5.1 Overview
IO communication refers to the DIAView software connecting to a
southbound equipment through specific communication protocols to
perform data acquisition and transmission. It has high reliability,
stability, instantaneity and powerful data processing capability.

The IO communication of the DIAView software has the


following features:

Ø Supports various connection methods;

Ø Supports standard Modbus communication protocol;

Ø Able to test the connection status of the equipment directly during


communication configuration;

Ø Supports communication status feedback and dynamic starting


and stoping of devices;

Ø Supports OPC service and MQTT;

Ø Has comprehensive troubleshooting strategies;

Ø Supports equipment communication gateway function to save


hardware gateway costs;

Ø The collection of Delta’s communication driver can perfectly match


all Delta series products, making communication parameter
configurations easier, more flexible and more efficient.
5.2 Channel and device
A channel is the data transmission media during the IO
communication process; for example: cable circuit interfaces, cable
mounts, hub devices and software channels etc. Channels
supported by the DIAView software includes: serial port channel,
Ethernet channel, OPC channel and simulator channel.
Device is the physical object for the DIAView software to perform
IO communication. The DIAView software can read data from the
device and also write data into the device.
The Device is divided into hardware device and software device,
including programmable logic controllers (PLC), inverters, modules,
digital instrumentation, smart controllers, monitoring sensors,
distributed control systems (DCS), loop controllers, remote terminal
units (RTU) and third-party software etc.
Specific device and example:

Device Example

PLC Delta, Modicon

Siemens,Mitsubishi,Rockwell,Omron

etc.

OPC Third-party OPC servers

Simulator Simulator

Power Meter Delta Power Meter


MQTT Delta MQTT Client
5.3 Driver
The driver is a set of program that can operate the device. It
determine show to operate the device register or device memory, and
it is an important bridge for communication between the DIAView
software and field devices. Different device manufacturers support
different device drivers, but they generally support standard
communication protocols.
Protocols currently supported by the DIAView software includes:
Modbus, OPC,MQTT, PPI,MPI,S7,Ethernet/IP,FINS, HostLink etc.
Frequently used drivers for the IO Server of the DIAView software are
as shown in the table below:

Driver type Example

Modbus TCP
Modbus Serial RTU
Modicon
Modbus Serial ASCII

OPC OPC DA、OPC UA

FINS TCP
FINS UDP
Omron
FINS ASCII
HostLink ASCII
Delta AS series:TCP、
RTU、ASCII
Delta
Delta AH series:TCP、
RTU、ASCII
Delta DVP series:TCP、
RTU、ASCII
Delta MC TCP、DIALink
PLC、DIALink
Mitsubishi FX Serial
Mitsubishi ProFX Serial
Mitsubishi Q Serial
Mitsubishi
Mitsubishi Q EtherNet
Mitsubishi FX EtherNet
S7300 TCP
Siemens S71200 TCP
S7300 MPI
S7200 TCP
S7200 PPI
S7200 Smart TCP

Simulator Simulator
DPM-C530 Ethernet
Delta Power Meter
DPM-C530 Serial
Rockwell Controllogix
Rockwell
Ethernet

MQTT Delta MQTT Client

ØWhen creating a new driver, you can quickly find the driver
through the retrieval function:
Step 1: Right-click on the “IODevice” node in the project
management area and select” New Device”; the menu selection in

the figure below will appear:


​ tep 2: After clicking the search button, the IO communication driver
S
search box as shown in the following figure. Enter the driver name in
the keyword box and click the search button to find the desired driver.

5.4 Troubleshooting strategies
When the communication is interrupted or disconnected during
system execution,the DIAView software will try to restore the
communication between devices by processing following the
troubleshooting strategies.
The troubleshooting strategies set for the DIAView software is as
shown in the figure below:

Communication property:

Property Description

DeviceAddress Address number of the connected device

ScanCycle The scan cycle of the IO communication


data is preset to 100 milliseconds.
If the device did not respond for an
extended period of time, it will be
determined to have communication timeout
Timeout
according to the time length set. The
timeout length is preset to 1000
milliseconds
This is the number of times the system will
try to reconnect to the device when there is
Retries
communication timeout. The default
number of retries is 3 times.
This option is used to set the period of time
of delay before trying to reconnect again
when the number of retries have reached
ReconnectDelay
the limit and reconnect was unsuccessful.
The reconnect delay time is default to 30
seconds.
Default to 0 minutes: No time limit, which
means it will continually try to reconnect
with the device;

ReconnectTime Other value: sets the reconnect time


length. If the system cannot connect and
receive responds from the device within
the reconnect time limit, it will discard the
connection to that device.
The current configuration equipment will be
Disable disabled from communicating with the
DIAView software.
5.5.1 Create IO variable

The IO variables are the external device variables created in the


DIAView software. They are acquired directly from the register
addresses inside related devices. Association mapping between the
IO variables and the project variables inside the DIAView software is
created to allow the DIAView software to connect with devices to
perform information handshake.

The IO parameters are related to device register addresses. They


have different access mode including read/write, read-only and write-
only, and are able to acquire linear data and root operations.
IO variables naming rules:
(1) Composed of English letters, numbers, Chinese characters and
underline, and can only begin with an English letter or Chinese
character;
(2) not case sensitive;
(3) the length cannot exceed 200 characters and cannot exceed
25 Chinese characters;
(4) IO variables names cannot be repeated under the same device;
(5)The name only supports three languages: Simplified Chinese,
Traditional Chinese and English.
1. Creating IO variable

Example 1: Creating IO variables based on the "Serial port


device" Step 1: Double-click the created “Serial port device” under
the “IO Device” node of the project tree index to open the serial port
device IO variable configuration window, as shown in the figure
below:​​
Step 2: Click the “Add ” button to add IO variable:

Step 3: Rename the IO variable name “Address” to “D0” and click the
button in the Address field to open the address property configuration
window to configure the address:
Parameter descriptions
Register type

Read/Write
Register type Mode Description Remark

Counter bit DVP,


CB: Counter (Bit) Read/write
device AH500
Counter
CW: Counter DVP,
Read/write character
(Word) AH500
device
32 bit high
HCB: High Speed
Read/write speed counter AH500
Counter(Bit)
bit
HCDW: 32Bit 32 bit high
Read/write AH500
Counter(DWord) speed counter
D: Data Register Read/write Data register DVP,
character AH500
SED: DR (SE Data register
Read/write DVP 12SE
Device) character
Stepping point DVP,
S: StepSpot Read/write
relay bit device AH500
SM: Special
Special auxiliary
Auxiliary Read/write AH500
flag bit device
Relay(Bit)
SR: Special Data Special data
Read/write AH500
Register(Word) register
DVP,
TB: Timer (Bit) Read/write Timer bit device
AH500
Timer character DVP,
TW: Timer (Word) Read/write
device AH500
X: External Input Input relay bit DVP,
Read only
Relay device AH500
XB: External Input Input relay bit
Read only AH500
Relay(Bit) device
XW: External Input relay
Input Read only character AH500
Relay(Word) device
Y: External Output relay bit DVP,
Read/write
Output Relay device AH500
YB: External Output relay bit
Read/write AH500
Output Relay(Bit) device
YW: External Output relay
Output Read/write character AH500
Relay(Word) device
Auxiliary relay DVP,
M: Auxiliary Relay Read/write
bit device AH500
E: Pointer Read/write Indexed register AH500

Value type

Value type Description

BYTE Byte
UBYTE Unsigned byte
WORD Word
UWORD Unsigned word
DWORD Double word
UDWORD Unsigned double word
FLOAT Single-precision floating point
DOUBLE Double-precision floating point
STRING String

Character exchange

Byte exchange Name

No Swap (01)
No Swap (0123) No exchange
No Swap (01234567)
Swap BYTE (10) Byte exchange (Word)
Swap BYTE (3210)
Swap WORD BYTE (1032) Byte exchange (DWord)
Swap WORD (2301)
Swap BYTE (76543210) Byte exchange (Double)
Swap WORD BYTE (10325476)
Swap DWORDBYTE (32107654)
Swap WORD (67452301)
Swap DWORD (23016745)
Swap DWORD (45670123)

Step 4: Select register type: “D:WORD R/W (D: Data register (WORD
R/W))”, unit number: 0, keep the default value for other items, as
shown in the figure below:


Step 5: Click the button in the【Variable】field to open the variable
browser and select the previously created internal project variables,
to complete the association mapping between the IO variables and
internal project variables:
Step 6: Use default values for the bits in other fields; this completes
the creation of an IO variable:

Example 2: Creating IO variables based on the "Serial port RTU


device"
Step 1: Double-click the created “Serial port RTU device” under the
“IO Communication” node of the project tree index to open the serial
port RTU device IO variable configuration window, as shown in the
figure below:

Step 2: Click the “Add” button to add IO variable


Step 3: Rename the IO variable name “Address” to “D0” and click the
button in the " Address" field to open the address property
configuration window to configure the address Parameter
descriptions:

Register type:

Function Default
Register Description Property
code value

1 Coil output Read/write 1,5 Bool


2 Switch input Read only 2 Bool
3 Holding register Read/write 3,16 Word

Analog value
4 Read only 4 Word
input

Expanded output
5 Read/write 21 Word
register

Expanded input
6 Read only 20 Word
register

Value type:

Value type Description

BYTE Byte
UBYTE Unsigned byte
WORD Word
UWORD Unsigned word
DWORD Double word
UDWORD Unsigned double word
FLOAT Single-precision floating point
DOUBLE Double-precision floating point
STRING String

Character exchange:

Byte exchange Name

No Swap (01) No exchange


Swap BYTE (10) Byte exchange (Word)

Step 4: Select register type: “3: Holding register (R/W)”, unit number:
4096, keep the default value for other items, as shown in the figure
below:

Step 5: Click the button in the "Variable" field to open the variable
browser and select the “Analog value" type variables:
Step 6: Use preset values for the bits in other fields; this completes
the creation of an IO variable D0:


Step 7: Create another IO variable Y0: The other steps are the same
as creating D0, only its "Address" field parameters are as shown in
the figure below:
Step 8: Complete the creation of the two IO variables D0 and Y0, as
shown in the figure below:


2、Creating IO variables in batches
Step 1: Click the “Batch Add " button on the IO variable configuration
window toolbar of the “Serial port device”:
Meanings of configuration items:

Type: Sets the register type;


Use Bit: Whether to use a specified bit of the access communication
address;
Offset: Relative to the size of the register’s starting address;
Address: Sets the starting value of the address index for the batch
creation of IO variables;
IO Name:The name of the IO variable; this name will be used as the
basis with gradually increasing numbers-at-the-end during batch add;
IO Description: Explanation information on the IO variable;
Count: The number for creating IO variables in batches;
To selected the item to reference(not used): If selected, the IO
name will use the selected IO variable name from the IO variable
table as the basis and gradually increase; the register type will be the
same as the selected IO variable type and the starting address will
gradually increase from the selected item’s address. If not selected,
the IO name will gradually increase using the name preset by the
system, the register type will be the preset item and the starting
address is 0.
Not supported to batch the type of 'STRING'
Step 2:Set "count" as: 10, and other terms remain unchanged:


Step 3: Batch add 10 IO variables D1~D10, as shown in the figure
below:


Step 4: Associate the variables and set the bits in other fields; this
completes the batch creation of IO variables.
5.5.2 IO toolbar

The IO toolbar is used to create new IO variables, test variable


values, and find replacement variables in the development
environment. Its button functions are as follows:

Button Command Description

​ Add Add new IO variable

Insert Insert new IO variable

Delete Delete the selected IO variable

Batch Add Batch adding IO variables

​ Import Import IO variable table

​ Export Export IO variable table in Excel file format

​ Test Read the data value in PLC register

​ Stop Stop reading IO variable value in PLC

​ KeyWord Enter the keyword you want to find

​ Search Retrieve IO variables by keyword

​ Replace Replace the retrieved IO variable

1、 Add IO Variable
Double-click the created "device 0" to open the device IO variable
configuration window on the “IODevice” node in the project
management area.Click "Add" to add an IO variable named
"Address0" by default, as shown in the following figure:

2、 Insert IO Variable
In the IO variable configuration window, select the IO variable
"Address1", click "Insert", and insert a new IO variable "Address3"
above "Address1", as shown in the following figure:
3、 Delete IO Variable
In the IO variable configuration window, select the IO variable
"Address1", click "Delete" to delete "Address1", as shown in the
following figure:
4、 Batch Add IO Variables
In the IO variable configuration window, click "Batch Add" to add
multiple IO variables, as shown in the following figure:
5. Export IO variable table

Step 1: Under the IO communication node of the project directory


tree, double-click the created device 9 to open the serial device IO
variable configuration window and export the IO variable table, as
shown in the following figure:
Step 2: Select the file storage path and save the IO variable table

6. Import IO variable table

DIAView configuration software can import IO variables through


different file formats, he IO variables in the import file must be correct
and valid data.
Import From Excel

Step 1: Under the "IO communication" node of the project directory


tree, double-click the created "device 10" to open the serial device IO
variable configuration window, and import the IO variable table in
Excel format, as shown in the following figure:

Import Tag From DIADesigner

The tag table of DIADesigner is to read the tag directly by


establishing the communication between softwares instead of
importing it in the form of file, so the precondition of software
communication must be satisfied first

Step 1: Install the software DIADesigner and DIAScreen, as shown in


the following figure:

​Step 2: Run DIAView without administrator permission, and click


"import Tag from DIADesigner" to open the Tag reading window,
When the precondition is not met, a prompt window will pop up:
Step 3: After meeting the preconditions, successfully open the tag
reading window, select the device that needs to read variables in the
DIADesigner, and check "Create the corresponding Variables in the
Variable Dictionary":

Step 4: Successfully imported the variables in "device 1", and


automatically generated and bound the variable dictionary data:
Import Tag From DIADesigner-AX

Step 1: Under the "IO communication" node of the project directory


tree, double-click the created "device 1" to open the IO variable
configuration window of the serial port device, and import the tag
variable table in XML format, as shown in the following figure:


Step 2: Select the tag file path and check "Create the corresponding
Variable in the Variable Dictionary":
Step 3: The tag in the XML file is imported successfully, and the
variable dictionary data is automatically generated and bound:

7、 Test and Stop


Several IO variables have been added in the IO variable configuration
window. Click "Test" to read the value of IO variables, as shown in the
following figure:

Click "Stop" to stop reading the value of IO variable.

8、 Search
Several IO variables have been added in IO variable configuration
window. Enter "KeyWord" and click "Search". The IO variable
configuration window only displays IO variables that meet the
"keyword" filter criteria. When "KeyWord" is empty, all IO variables
are displayed.The keyword matches both name and address of IO
variable:
9、 Replace
Name replacement is to replace the name of an IO variable with
another name.
Step 1: Before replacement, use the keyword "D: 8" to retrieve the IO
variable names corresponding to addresses D: 8, D80, D81... D87 as
Address 8, Address 80, Address 81... Address 87, as shown in the
following figure:

Step 2: Click "Replace" to replace the IO variable name starting with


"Address 8" with "test8", and click "OK":
Step 3: After replacement, use the keyword "D: 8" to retrieve the IO
variable names corresponding to addresses D: 8, D80, D81... D87 as
test8, test80, test81... test87, as shown in the following figure:
5.6 Communication status
There are three types of communication status: Connected,
disconnected, stopped.
Ø View device communication status:
Draw a basic “text” graphic in any window of an existing project
and configure “Expression(E)” in the Text animation window, as
shown in the figure below:

The communication status of the “serial port device” can be


checked once executed; please refer to the table blow:

Status Flag bit status value

Communication normal IO.serial port device.Status = 0

Communication disconnected IO.serial port device.Status = 2

Communication stopped IO.serial port device.Status =2


5.7 Communication control
There are three types of communication status: connected,
disconnected and stopped. In real applications, the communication
status returned by the DIAView software can be used to determine
whether the connected device communication is normal, and
dynamically control to start or stop its communication when
necessary.
Device communication status flag can be changed to perform
control to the communication status,,that is to change the property
value of the device Status ,please refer to the example below:
Ø Control device communication status:
Step 1: Draw two buttons and two texts in the window of an existing
project, as shown in the figure below:
Step 2: Configure a “Left-click” event for the “Start button”, as shown
in the figure below:


Step 3: Configure a “Left-click” event for the “Stop” button, as shown
in the figure below:
Step 4: Configure a “Expression(E)” for the “Status value” text, as
shown in the figure below:

Step 5: Once executed the initial communication status of the


“Device0” is as follows:

Step 6: The communication status is as follows after connects to the
machine and reconnection mechanism:


Step 7: The communication status of “Device0” is as follows after
clicking the “Stop” button:
Step 8: The communication status of “Device0” is as follows after
clicking the “Start” button:
5.8.1 Modicon
Modicon is the sub-brand of Schneider Electric,its Chinese
name is "Mo Di Kang".
DIAView software supports the communication of Modicon
PLC,the protocols include Modicon RTU,Modicon
ASCII,Modicon TCP.
Supporting communication network interface: Ethernet and
serial.
² Noted: Modicon address description,as shown in the table below:

Register Range Default type Description

1 0~65535 Bool Coil output


2 0~65535 Bool Digital input
3 0~65535 Word Holding register
4 0~65535 Word Analog output
Extended output
5 0~65535 Word
register
Extended input
6 0~65535 Word
register
5.8.1.1 Modbus TCP
DIAView can communicate with modicon PLC by computer
Ethernet port Modbus protocol.

Example 1:

Please refer to Delta PLC TCP communication configuration


5.8.1.2 Modbus Serial RTU
DIAView can communicate with modicon PLC by computer serial
port Modbus protocol, with the way of RTU encoding.

Example 1:

Please refer to the Delta PLC serial port communication


configuration
5.8.1.3 Modbus Serial ASCII
DIAView can communicate with modicon PLC by computer serial
port Modbus protocol, with the way of ASCII encoding.

Example 1:

Please refer to Delta PLC serial port communication configuration.


5.8.2 Omron
DIAView software supports the communication of Omron
PLC,the protocols include FINS TCP, FINS ASCII, HostLink
ASCII.

Supporting device: CS/CJ(CP) series,CV series( Untested ).

Supporting command format: C-mode command and FINS


command.

Supporting communication network interface: Ethernet


and serial.
5.8.2.1 FINS TCP
The equipments that current test environment requires are Omron SYSMAC
CJ2M CPU32 and Omron SYSMAC CP1H.
The example that DIAView software communicates with equipments by
Ethernet is as follows.
Ø Creating communication between DIAView software and Omron CJ2M
through Ethernet:
Step 1: Create the following hardware framework ,Omron programming
software set CJ2M address as"192.168.1.5", the computer IP address is
"192.168.1.200" (keep the PLC and the computer in the same LAN):


Step 2: In the project management area, right click on "IO Device "node and
select "New Device".

Step 3: Select "Omron" →"FINS TCP" in the driver selection window, as
shown in the figure below:


Step 4: Configure the Omron FINS TCP communication parameters, as
shown in the figure below:


Step 5: Set "IP" in the "Base" as 192.168.1.5, set port number as 9420, as
shown in the figure below:

Step 6: Other options can be the default value, click "Test" button to test
whether the connection is successful.


Step 7: Click “Next” button to go to Omron FINS TCP specific configuration
interface, Source node: 65, Destination node: 5, other unchanged,as shown in
the figure below:

Network Address:
If there is only one local network, then the network numbers are all set to 0,
representing only one network. If there are multiple networks, in order to avoid
conflict, then you must specify different network number at all levels, the range
is 1-127.
Node Address:
In the same level of the network, the node number of each connection node
needs to be set as a different number, a node corresponds to a PLC. If it is an
Ethernet network, the node number is the last field of the IP address generally.
Unit Address:
In the same PLC, each module unit number is different from each other,
CPU unit number has always been 0, the rest of their own settings.
Step 8: Click “OK” button when all parameters have been configured and the
device with default name “Device0” will appear under “IO Device” node, and
open IO variable configuration window for Device0, as shown in the figure
below:

Step 9: Rename the newly-built IO device as "Omron_CSCJ" and complete
Omron FINS TCP driver communication configuration, as shown in the figure
below:


Step 10: Double click "IO Device" node to open IO device list window and
confirm that the device is added successfully, as shown in the following figure:

Ø Noted: FINS(CS/CJ):Omron address description is as shown in the table
below:
Default
Register Range Description
type
CIO_B 0.0~6143.15 Bool for example:CIO_B:0.15/BOOL
CIO_W 0~6143 Word CIO_W:6143/WORD
WR_B 0.0~511.15 Bool WR_B:511.15/BOOL
WR_W 0~511 Word WR_W:511/WORD
HR_B 0.0~511.15 Bool HR_B:0.15/BOOL
HR_W 0~511 Word HR_W:511/WORD
00000~44715(only read),AR_B:0.15/BOOL
AR_B 0.0~959.15 Bool
44800~95915(read/write),AR_B:959.15/BOOL
000~447(only read),AR_W:0/WORD
AR_W 0~959 Word
448~959(read/write),AR_W:448/WORD
DM_B 0.0~32767.15 Bool DM_B:0.15/BOOL
DM_W 0~32767 Word DM_W:511/WORD
EM_B 0.0~32767.15 Bool EM bank 0 to bank F: E0_0000000 to
3276715 to EF_0000000 to 3276715 like :
EM_B0:3276715,for
example:EM_B:0/1.15/BOOL
EM bank 10 to bank 18: E0_0000000 to
3276715 to EF_0000000 to 3276715
EM current bank: E0000000 to E3276715
EM bank 0 to bank F: E0_00000 to 32767 to
EF_00000 to 32767,like: EM_B0:32767,for
example:EM_W:0/1/WORD
EM_W 0~32767 Word
EM bank 10 to bank 18: E0_00000 to 32767
to E18_00000 to 32767
EM current bank: E00000 to E32767
TIM_PV 0~4095 Word TIM_PV:0/WORD
CNT_PV 0~4095 Word CNT_PV:0/WORD
IR_W 0~15 Word IR_W:0/WORD
DR_W 0~15 Word DR_W:0/WORD
5.8.2.2 FINS UDP
The equipment that current test environment requires is Omron
NX1P2.

The example that DIAView software communicates with equipments


by Ethernet is as follows, FINS UDP and FINS TCP configuration are
similar.

Ø Creating communication between DIAView software and


Omron CJ2M through Ethernet:

Step 1: Create the following hardware framework ,Omron


programming software set CJ2M address as"192.168.1.5", the
computer IP address is "192.168.1.200" (keep the PLC and the
computer in the same LAN):

Step 2: In the project management area, right click on "IO Device


"node and select "New Device".
Step 3: Select "Omron" →"FINS UDP" in the driver selection window,
as shown in the figure below:
Step 4: Configure Omron FINS UDP communication parameters, as
shown in the figure below:
Step 5: Set "IP" in the "Base" as 192.168.1.5, set port number as
9600,and set local port number as 10001, as shown in the figure
below:
Step 6: Other options can be the default value, click "Test" button to
test whether the connection is successful.
Step 7: Click “Next” button to go to the Omron FINS UDP specific
configuration interface,Source node: 65, destination node: 5, other
unchanged,as shown in the figure below:
Network Address:

If there is only one local network, then the network numbers are all
set to 0, representing only one network. If there are multiple
networks, in order to avoid conflict, then you must specify different
network number at all levels, the range is 1-127.

Node Address:

In the same level of the network, the node number of each


connection node needs to be set as a different number, a node
corresponds to a PLC. If it is an Ethernet network, the node number
is the last field of the IP address generally.

Unit Address:
In the same PLC, each module unit number is different from each
other, CPU unit number has always been 0, the rest of their own
settings.

Step 8: click the “OK” button when all parameters have been
configured and the device with the default name “Device0” will appear
under the “IO Device” node, and open IO variable configuration
window for Device0, as shown in the figure below:

Step 9: Rename the newly-built IO device as "Omron_NX1P2" and


complete Omron FINS UDP driver communication configuration, as
shown in the figure below:
Step 10: Double click "IO Device" node to open IO device list window
and confirm that the device is added successfully, as shown in the
following figure:
5.8.2.3 FINS ASCII
The example that DIAView software communicates with equipments
by serial port is as follows,using FA command:
Ø Creating communication between DIAView software and
Omron CJ2M through serial port:

Step 1: Create the following hardware framework, set CJ2M


communication port parameters as "9600,8,E,1,ASCII",set Station
number as 1,as shown in the figure below:


Step 2: In the project management area, right click on "IO Device"
node and select "New Device":

Step 3: select "Omron" → "FINS ASCII" in the driver selection
window, as shown in the figure below:

Step 4:Configure Omron FINS ASCII communication parameters, as


shown in the figure below:

DeviceAddress: Device unit number
Step 5: Set SerialPort as COM2 (you can see that the detected
currently assigned serial communication port is COM2 in device
manager), as shown in the figure below:

Step 6: Click button to the right of “Base”→ “SerialPort”, open “Set
the Serial Parameters” window, set serial port communication
parameters: “9600,8,E,1” ,as shown in the figure below:


Step 7:Click "Next",configure Omron FINS ASCII communication
parameters, as shown in the figure below:


Step 8: Click “OK” button when all parameters have been configured
and the device with the default name “Device0” will appear under the
“IO Device” node, and open IO variable configuration window for
Device0, as shown in the figure below:

Step 9: Rename the newly-built IO device as "Omron_FINS_ASCII"
and complete Omron FINS ASCII driver communication configuration,
as shown in the figure below:

Step 10: Double click "IO Device" node to open IO device list window
and confirm that the device is added successfully, as shown in the
following figure:


5.8.2.4 HostLink ASCII
The example that DIAView software communicates with
equipments by serial is as follows,using C-mode command:
Ø Creating communication between DIALink and Omron CJ2M
through serial port:

Step 1: Create the following hardware framework, set CJ2M


communication port parameters as “9600, 8,E,1,ASCII”, set Station
number as 1, as shown in the figure below:

Step 2: Right-click on “IO Device” node in the project management


area and select” New Device”; the menu selection in the figure below
will appear:
Step 3:Select "Omron" → “HostLink ASCII” in the driver selection
window, as shown in the figure below:
Step 4:Configure Omron HostLink ASCII communication parameters,
as shown in the figure below:
Step 5: Set SerialPort as COM2 (you can see that the detected
currently assigned serial communication port is COM2 in device
manager), as shown in the figure below:
Step 6: Click button to the right of “Base”→ “SerialPort”, open “Set
the Serial Parameters” window, set serial port communication
parameters: “9600,8,E,1” ,as shown in the figure below:
Step 7: Click “OK” button when all parameters have been configured
and the device with the default name “Device0” will appear under the
“IO Device” node, and open IO variable configuration window for
Device0, as shown in the figure below:

Step 8: Rename the newly-built IO device as


"Omron_HostLink_ASCII" and complete Omron HostLink ASCII driver
communication configuration, as shown in the figure below:
Step 9: Double click "IO Device" node to open IO device list window
and confirm that the device is added successfully, as shown in the
following figure:

Ø Noted: HostLink:Omron address description, as shown in the table


below:
Register Range Default Description
type
CIO 0~6143 Word /
LR 0~199 Word /
HR 0~511 Word Holding relay
DM 0~9999 Word Data memory
EM 0~9999 Word /
TC_PV 0~4095 Word (0~2047) Counter
/(2048~4095) Counter
TC_STATUS 0.0~4095.15 Bool Counter/Counter status
flag
AR 0~959 Word Auxiliary relay
5.8.3 Delta
Delta PLC includes DVP series 、AS series and AH series.
²Noted1:Delta Modbus DVP address description, as shown in the
table below:
Register Range Default type Description
CB 0~255 Bool Counter
CW 0~199 word Counter
CDW 200~255 Double word Counter
D 0~9999 Word Data register
SED 10000~11999 Word Data register
S 0~1023 Bool Stepping relay
TB 0~255 Bool Timer
TW 0~255 Word Timer
X 0~377 (OCT) Bool External input relay
Y 0~377 (OCT) Bool External output relay
M 0~4095 Bool Auxiliary relay

²Noted2:Delta Modbus AS300 address description, as shown in the


table below:
Register Range Default type Description
CB 0~511 Bool Counter
CW 0~511 Word Counter
HCB 0~255 High-speed
Bool
counter
Register Range Default type Description
HCDW 0~255 Double word 32 bit counter HC
D 0~ 29999 Word Data register
S 0~2047 Bool Stepping relay
SM 0~4095 Special auxiliary
Bool
relay
SR 0~2047 Special data
Word
register
TB 0~511 Bool Timer
TW 0~511 Word Timer
XB 0.0~63.15 Bool Input relay
XW 0~63 Word Input relay
YB 0.0~63.15 Bool Output relay
YW 0~63 Word Output relay
M 0~8191 Bool Auxiliary relay
E 0~9 Indirect specified
Word
regiser
²Noted3:Delta Modbus AH address descirption, as shown in the
table below:
Register Range Default type Description
CB 0~2047 Bool Counter
CW 0~2047 Word Counter
HCB 0~63 Bool High-speed counter

HCDW 0~63 Double word 32 bit counter HC


DB 0~ 65535 Bool Data register
D 0~ 65535 Word Data register
S 0~1023 Bool Stepping relay
Special auxiliary
SM 0~2047 Bool
relay
SR 0~2047 Word Special data register
TB 0~2047 Bool Timer
TW 0~2047 Word Timer
XB 0.0~511.15 Bool Input relay
XW 0~511 Word Input relay
YB 0.0~511.15 Bool Output relay
YW 0~511 Word Output relay
M 0~8191 Bool Auxiliary relay
Indirect specified
E 0~31 Word
regiser
5.8.3.1 Delta AS MC TCP
The DIAView software supports communication with the Delta AS
MC.

The example of configuring IO communication with Delta AS MC in


DIAView configuration software is as follows:

ØCreating communication between DIAView software and Delta


AS MC through Ethernet:

Step 1: Set up the hardware framework shown as the figure below,


set AS515E-B IP address : “192.168.1.1”, the computer IP address
:“192.168.1.200” (keep PLC and the computer in the same LAN), as
shown in the figure below:

Step 2: Right-click on the “IO Device” node in the project


management area and select” New Device”; the menu selection in
the figure below will appear:
Step 3: Select “Delta”→ "DVP AS MC TCP” in the “Driver Selection”
window:
Step 4: Configure the Delta AS MC TCP communication
parameters,Set the “IP” in the “Base” configuration as: 192.168.1.1
and the “Port” as: 502, as shown in the figure below:
Step 5: Other options can be defaults,click the “Test” button to test
whether the connection is successful, as shown in the figure below:
If you are prompted with "connection status: failed", please check the
"IP address" and "port number".

Step 6: click the “OK” button when all parameters have been
configured and the device with the default name “Device0” will appear
under the “IO Device” node, and open IO variable configuration
window for Device0, as shown in the figure below:
Step 7: Rename the newly-built IO device as "Delta AS MC TCP"
and complete Delta AS MC TCP driver communication configuration,
as shown in the figure below:
Step 8: Double click the "IO Device" node to open the IO device list
window and confirm that the device is added successfully, as shown
in the following figure:
5.8.3.2 Delta ES3 TCP
The DIAView software supports communication with the Delta ES3
TCP.

The example of configuring IO communication with Delta ES3 TCP. in


DIAView configuration software is as follows:

ØCreating communication between DIAView software and Delta


ES3 through Ethernet:

Step 1: Set up the hardware framework shown as the figure below,


set Delta ES3 IP address : “192.168.1.1”, the computer IP address
:“192.168.1.200” (keep PLC and the computer in the same LAN), as
shown in the figure below:

Step 2: Right-click on the “IODevice” node in the project


management area and select” New Device”; the menu selection in
the figure below will appear:
Step 3: Select “Delta”→ "DVP ES3 TCP” in the “Driver Selection”
window:
Step 4: Configure the Delta ES3 TCP communication parameters,Set
the “IP” in the “Base” configuration as: 192.168.1.1 and the “Port” as:
502, as shown in the figure below:
Step 5: Other options can be defaults,click the “Test” button to test
whether the connection is successful, as shown in the figure below:
If you are prompted with "connection status: failed", please check the
"IP address" and "port number".

Step 6: click the “OK” button when all parameters have been
configured and the device with the default name “Device0” will appear
under the “IODevice” node, and open IO variable configuration
window for Device0, as shown in the figure below:
Step 7: Rename the newly-built IO device as "Delta AS MC TCP"
and complete Delta ES3 TCP driver communication configuration, as
shown in the figure below:
Step 8: Double click the "IO Device" node to open the IO device list
window and confirm that the device is added successfully, as shown
in the following figure:
5.8.3.3 Delta AS TCP
The DIAView software supports communication with the Delta AS.

The example of configuring IO communication with Delta AS in


DIAView configuration software is as follows:

ØCreating communication between DIAView software and Delta


AS through Ethernet:

Step 1: Set up the hardware framework shown as the figure below,


set AS515E-B IP address : “192.168.1.1”, the computer IP address
:“192.168.1.200” (keep PLC and the computer in the same LAN), as
shown in the figure below:

Step 2: Right-click on the “IODevice” node in the project


management area and select” New Device”; the menu selection in
the figure below will appear:
Step 3: Select “Delta”→ "DVP AS TCP” in the “Driver Selection”
window:
Step 4: Configure the Delta AS TCP communication parameters,Set
the “IP” in the “Base” configuration as: 192.168.1.1 and the “Port” as:
502, as shown in the figure below:
Step 5: Other options can be defaults,click the “Test” button to test
whether the connection is successful, as shown in the figure below:
If you are prompted with "connection status: failed", please check the
"IP address" and "port number".

Step 6: click the “OK” button when all parameters have been
configured and the device with the default name “Device0” will appear
under the “IO Device” node, and open IO variable configuration
window for Device0, as shown in the figure below:
Step 7: Rename the newly-built IO device as "Delta AS TCP" and
complete Delta AS TCP driver communication configuration, as
shown in the figure below:
Step 8: Double click the "IO Device" node to open the IO device list
window and confirm that the device is added successfully, as shown
in the following figure:
5.8.3.4 Delta AS Serial RTU & ASCII
The example that DIAView software communicates with equipments
by serial port is as follows:

ØCreating communication between DIAView software and Delta


PLC AS332T through serial port:

Step 1: Set up the hardware framework shown as the figure below,


set AS332T COM2 communication data as 9600,7,E,1,ASCII,
Station1, as shown in the figure below:

Step 2: Right-click on the “IODevice” node in the project


management area and select” New Device”; the menu selection in
the figure below will appear:
Step 3: Select “Delta” → “Delta AS ASCII” in the “Driver Selection”
window:
Step 4: Configure the Delta AS ASCII communication parameters, as
shown in the figure below:
Step 5: Set SerialPort as COM2 (you can see that the detected
currently assigned serial communication port is COM2 in device
manager), as shown in the figure below:
Step 6: Click the button to the right of “Base”→ “SerialPort”, open the
“Set the Serial Parameters” window, set the serial port
communication parameters: “9600,7,E,1,ASCII” ,as shown in the
figure below:
Step 7: Configure the serial port communication parameters, then
click the “OK” button to return to the Delta AS ASCII communication
parameter configuration window. Set the communication and
troubleshooting parameters. The “DeviceAddress” must be the same
as the PLC station number, therefore set it as “1”. Default values can
be used for the other options, as shown in the figure below:
Step 8: click the “OK” button when all parameters have been
configured and the device with the default name “Device0” will appear
under the “IODevice” node, and open IO variable configuration
window for Device0, as shown in the figure below:
Step 9: Rename the newly-built IO device as "Delta AS ASCII" and
complete Delta AS ASCII driver communication configuration, as
shown in the figure below:
Step 10: Double click the "IO Device" node to open the IO device list
window and confirm that the device is added successfully, as shown
in the following figure:
5.8.3.5 AH Modbus TCP
The DIAView software supports communication with the AH Modbus
TCP.

The example of configuring IO communication with AH Modbus TCP


in DIAView configuration software is as follows:

ØCreating communication between DIAView software and Delta


PLC AH through Ethernet:

Step 1: Set up the hardware framework shown as the figure below,


set AH Modbus TCP IP address : “192.168.1.1”, the computer IP
address :“192.168.1.200” (keep PLC and the computer in the same
LAN), as shown in the figure below:

Step 2: Right-click on the “IO Device” node in the project


management area and select” New Device”; the menu selection in
the figure below will appear:
Step 3: Select “Delta”→ "AH Modbus TCP” in the “Driver Selection”
window:
Step 4: Configure the AH Modbus TCP communication
parameters,Set the “IP” in the “Base” configuration as: 192.168.1.1
and the “Port” as: 502, as shown in the figure below:
Step 5: Other options can be defaults,click the “Test” button to test
whether the connection is successful, as shown in the figure below:
If you are prompted with "connection status: failed", please check the
"IP address" and "port number".

Step 6: click the “OK” button when all parameters have been
configured and the device with the default name “Device0” will appear
under the “IODevice” node, and open IO variable configuration
window for Device0, as shown in the figure below:
Step 7: Rename the newly-built IO device as "AH Modbus TCP" and
complete AH Modbus TCP driver communication configuration, as
shown in the figure below:
Step 8: Double click the "IO Device" node to open the IO device list
window and confirm that the device is added successfully, as shown
in the following figure:
5.8.3.6 AH Modbus Serial RTU & ASCII
The example that DIAView software communicates with equipments
by serial port is as follows:

ØCreating communication between DIAView software and Delta


PLC AH through serial port:

Step 1: Set up the hardware framework shown as the figure below,


set AH-CPU500H COM2 communication data as 9600,7,E,1,ASCII,
Station1, as shown in the figure below:

Step 2: Right-click on the “IO Device” node in the project


management area and select” New Device”; the menu selection in
the figure below will appear:
Step 3: Select “Delta” → “AH Modbus Serial ASCII” in the “Driver
Selection” window:
Step 4: Configure the AH Modbus Serial ASCII communication
parameters, as shown in the figure below:
Step 5: Set SerialPort as COM2 (you can see that the detected
currently assigned serial communication port is COM2 in device
manager), as shown in the figure below:
Step 6: Click the button to the right of “Base”→ “SerialPort”, open the
“Set the Serial Parameters” window, set the serial port
communication parameters: “9600,7,E,1,ASCII” ,as shown in the
figure below:
Step 7: Configure the serial port communication parameters, then
click the “OK” button to return to the AH Modbus Serial ASCII
communication parameter configuration window. Set the
communication and troubleshooting parameters. The
“DeviceAddress” must be the same as the PLC station number,
therefore set it as “1”. Default values can be used for the other
options, as shown in the figure below:
Step 8: click the “OK” button when all parameters have been
configured and the device with the default name “Device0” will appear
under the “IODevice” node, and open IO variable configuration
window for Device0, as shown in the figure below:
Step 9: Rename the newly-built IO device as "AH Modbus Serial
ASCII" and complete AH Modbus Serial ASCII driver communication
configuration, as shown in the figure below:
Step 10: Double click the "IO Device" node to open the IO device list
window and confirm that the device is added successfully, as shown
in the following figure:
5.8.3.7 DVP Modbus TCP
DIAView software supports the communication of the equipment
based on Modbus communication protocol standard by Ethernet
(TCPIP).
The example that DIAView software communicates with
equipments by Ethernet is as follows:
ØCreating communication between DIAView software and DVP
12SE through Ethernet:
Step 1: Set up the hardware framework shown as the figure below,
set 12SE IP address : “192.168.1.10”, the computer IP address
:“192.168.1.200” (keep PLC and the computer in the same LAN).

Step 2: Right-click on the “IO Device” node in the project


management area and select” New Device”; the menu selection in
the figure below will appear:

Step 3: Select “Delta”→ "DVP Modbus TCP” in the “Driver Selection”
window

Step 4: Configure the Delta DVP TCP communication parameters, as
shown in the figure below:

Step 5: Set the “IP” in the “Base” configuration as: 192.168.1.5 and
the “Port” as: 502, as shown in the figure below:

Step 6: Click the “Test” button to test whether the connection is
successful, as shown in the figure below:

Step 7: click the “OK” button when all parameters have been
configured and the device with the default name “Device0” will appear
under the “IODevice” node, as shown in the figure below:

Step 8: Rename the newly-built IO communication device as "DVP
Modbus TCP" and complete Ethernet driver communication
configuration, as shown in the figure below:

Step 8: Double click the "IO Device" node to open the IO device list
window and confirm that the device is added successfully, as shown
in the following figure:

5.8.3.8 DVP Modbus Serial RTU & ASCII
The example that DIAView software communicates with equipments
by serial port is as follows:

Ø Creating communication between DIAView software and Delta


DVP 12SE through serial port:

Step 1: Set up the hardware framework shown as the figure below,


set 12SE COM2 communication data as 9600,7,E,1,ASCII, Station1:

Step 2: Right-click on the “IODevice” node in the project


management area and select” New Device”; the menu selection in
the figure below will appear:
Step 3: Select “Delta” → “DVP Modbus Serial ASCII” in the “Driver
Selection” window:
Step 4: Configure the DVP Modbus Serial ASCII communication
parameters, as shown in the figure below:
Step 5: Set SerialPort as COM8 (you can see that the detected
currently assigned serial communication port is COM8 in device
manager), as shown in the figure below:
Step 6:Click the button to the right of “Base”→ “SerialPort”, open the
“Set the Serial Parameters” window, set the serial port
communication parameters: “9600,7,E,1,ASCII” , as shown in the
figure below:
Step 7: Configure the serial port communication parameters, then
click the “OK” button to return to the DVP Modbus Serial ASCII
communication parameter configuration window. Set the
communication and troubleshooting parameters. The
“DeviceAddress” must be the same as the PLC station number,
therefore set it as “1”. Default values can be used for the other
options, as shown in the figure below:
Step 8: click the “OK” button when all parameters have been
configured and the device with the default name “Device0” will appear
under the “IO Device” node, as shown in the figure below:
Step 9: Rename the newly-built IO device as
"DVPModbusSerialASCII" and complete AH Modbus TCP driver
communication configuration, as shown in the figure below:
Step 10: Double click the "IO Device" node to open the IO device list
window and confirm that the device is added successfully, as shown
in the following figure:
5.8.3.9 DVP MC TCP
The DIAView software supports communication with the DVP MC.

The example of configuring IO communication with DVP MC in


DIAView configuration software is as follows:

ØCreating communication between DIAView software and DVP


MC through Ethernet:

Step 1: Set up the hardware framework shown as the figure below,


set DVP50MC11T IP address : “192.168.1.5”, the computer IP
address :“192.168.1.200” (keep PLC and the computer in the same
LAN), as shown in the figure below:

Step 2: Right-click on the “IO Device” node in the project


management area and select” New Device”; the menu selection in
the figure below will appear:
Step 3: Select “Delta”→ "DVP MC TCP” in the “Driver Selection”
window:
Step 4: Configure the DVP MC TCP communication parameters,Set
the “IP” in the “Base” configuration as: 192.168.1.5 and the “Port” as:
502, as shown in the figure below:
Step 5: Other options can be defaults,click the “Test” button to test
whether the connection is successful, as shown in the figure below:
If you are prompted with "connection status: failed", please check the
"IP address" and "port number".

Step 6: click the “OK” button when all parameters have been
configured and the device with the default name “Device0” will appear
under the “IO Device” node, and open IO variable configuration
window for Device0, as shown in the figure below:
Step 7: Rename the newly-built IO device as "DVP MC TCP" and
complete DVP MC TCP driver communication configuration, as
shown in the figure below:
Step 8: Double click the "IO Device" node to open the IO device list
window and confirm that the device is added successfully, as shown
in the following figure:
5.8.3.10 DIALink PLC
The DIAView configuration software supports communication with
the DIALink PLC server.
The example of configuring IO communication with DIALink PLC
server in DIAView configuration software is as follows:
Ø Creating communication between DIAView software and
DIALink PLC server:
Step 1: In the project window tree directory, the "IODevice" node
right-click on the "New Device"

Step 2: In the select drive window, select "Delta" to "DIALink PLC":


Step 3: Configuring DIALink PLC communication parameters, the
default values can be kept as follows: ​
The meaning of each configuration item in the window:


Computer: IP or the full name of the computer.
Port:The default value is 9000.
CommunicationFormat: Default Json format, fixed.
Step 4: Each parameter configuration is completed by clicking the
"confirm" button. The default name of the device will appear under
the "IODevice" node of the project tree directory:

Step 5: Rename the new IO communication device to "DIALinkPLC"
and complete the DIALink PLC driver communication configuration:
Step 6: The new address or the modified address is as follows:

​ ​
Step 7: Batch new address, as follows:
​ ​
Effect picture:

​Step 8: Can be tested(saved the address first)


5.8.3.11 DIALink
The DIAView configuration software supports communication with
the DIALink server.
The example of configuring IO communication with DIALink server in
DIAView configuration software is as follows:
Ø Creating communication between DIAView software and
DIALink server:
Step 1: In the project window tree directory, the "IODevice" node
right-click on the "New Device" and pop up the following menu,In the
select drive window, select "Delta" to "DIALink":

Step 2: Configuring DIALink communication parameters, the default


values can be kept as follows:
The meaning of each configuration item in the window:
Computer: IP or the full name of the computer.
UserName:Login name of DIALink.
Password: The password used to log into DIALink.
Step 3: Each parameter configuration is completed by clicking the
"confirm" button. The default name of the device will appear under
the "IODevice" node of the project tree directory:

Step 4: Rename the new IO communication device to "DIALinkCNC"
and complete the DIALink driver communication configuration:

5.8.4 Mitsubishi
DIAView software supports the communication of Mitsubishi PLC.

Supporting device: Mitsubishi FX COM serial、Mitsubishi FX


Ethernet serial,Mitsubishi Q COM serial,Mitsubishi Q Ethernet serial.

Supporting command format: Mitsubishi format 1 - format 5


communication,Mitsubishi ASCII/Binary communication.

Supporting communication network interface: Ethernet and


serial.
5.8.4.1 Mitsubishi FX Serial
DIAView software supports the communication of the equipment
based on Mitsubishi communication protocol standard by serial port
(format 1, format 4).
Supporting devices:
FX3U,FX3G,FX3S,FX2N,FX1N,FX2C,FX1S,FX0N.
The example that DIAView software communicates with equipments
by serial port is as follows:
Ø Creating communication between DIAView software and
Mitsubishi-FX through serial port:
Example 1: Taking “FX3U, format 4” as an example:
Step 1: Create the following hardware framework,the
communication parameters are 19200,8,N,1,universal QCPU, format
4, station2:


Step 2: In the project management area, right click on “IO Device
“node and select “ New Device “, select " Mitsubishi " →“Mitsubishi
FX Series” in the driver selection window, as shown in the figure
below:
​ ​
Step 3: Configure FX3U, Format 1 communication parameters, as
shown in the figure below:

Step 4: Click the button on the right side of "Serial Port" in the
"Basic" to open the "Serial Port Parameter Setting" window, set the
serial port communication parameters: "9600, 7, e, 1", and the
communication port is COM6 (it can be seen in the Device Manager
that the currently assigned serial communication port is COM6), as
shown in the following figure:

Step 5: Click "OK" button when serial communication parameters
have been all configured, return to the window of communication
parameter configuration to set communication parameters and fault
processing parameters, the device address should be consistent
with PLC station number, should be all set to "2". Other parameters
can be the default value, as shown in the figure below:

Step 6: Click “next” button to open “Mitsubishi FX Serial”to set
communication parameters, as shown in the figure below(Check 'FX-
485-PC-IF' for RS485 communication):


Step 7: Click the "OK" button when all parameters have been
configured and the device with default name will appear under “IO
Device” node of the project tree directory:
​​
Step 8: Rename the newly-built communication device as
"Serial_Device", complete the serial port driver communication
configuration, as shown in the figure below:


Ø Noted: Mitsubishi FX3U address description, as shown in the
table below:
Register Range Default type Description
X 0.0 - 377.15 bool Input register
Y 0.0 - 377.15 bool Output register
M 0.0 - 7679.15 bool Auxiliary register
S 0.0 - 4095.15 bool Status register
SM 8000.0-8511.15 bool Special auxiliary
register
TS 0.0 - 511.15 bool Counter contact
register
CS 0.0 - 2047.15 bool Counter contact
register
TN word Timer register
0 - 511

CN16 word
0 - 199 16 bit counter
register

CN32 word
200 - 255 32 bit counter
register
D word Data register
0 - 7999

SD 8000-8511 word Special data register


R word Extended register
0 - 32767
5.8.4.2 Mitsubishi ProFX Serial
DIAView software supports the communication of the equipment
based on Mitsubishi communication protocol standard by
programming port.
Supporting device: FX3U.
The example that DIAView software communicates with equipments
by Ethernet is as follows:
Ø Create communication between DIAView software and
Mitsubishi-FX3U through programnimg port:
Example 1: Taking“FX3U, programming port”driver as an example
Step 1: Create the following hardware framework, set programming
port parameters to 9600, 7, E, 1, FX3UC, Program:

Step 2: In the project management area, right click on “IO Device


“node and select “ New Device “, select “Mitsubishi ProFX Serial” in
the driver selection window, as shown in the figure below:
Step 3: Configure FX3U, program port communication parameters,
as shown in the figure below:
Step 4: Click the button on the right side of "Serial Port" in the
"Basic" to set serial port communication parameters to:“9600,7,E,1”,
serial port is COM1(In the computer device manager, you can see
the current serial port detected is COM1), as shown in the figure
below:
Step 5: Click "OK" button when serial communication parameters
are all configured, return to the window of communication parameter
configuration to set communication parameters and fault processing
parameters, the device address should be consistent with PLC
station number, should be all set to "2". Other parameters can be the
default value, as shown in the figure below:
Step 6: Click “Next” button to open “Mitsubishi ProFX Serial”to set
communication parameters, as shown in the figure below:

Step 7: Click the "OK" button when all parameters have been
configured and the device with default name will appear under “IO
Device” node of the project tree directory.
Step 8: Rename the newly-built IO communication device as
"Programming_Port_Device" and complete programming port driver
communication configuration, as shown in the figure below:

Ø Noted: Mitsubishi FX3U address description, as shown in the


table below:

Register Range Default type Description


X 0.0- 377.15 bool Input register
Y 0.0 - 377.15 bool Output register
M 0.0 - 7679.15 bool Auxiliary register
S 0.0- 4095.15 bool Status register
TS 0.0 - 511.15 bool Timer contact
register
CS 0.0 - 255.15 bool Counter contact
register
TN word Timer register
0 - 511
CN16 word
0 - 199 16 bit counter
register

CN32 word
200 - 255 32 bit counter
register

D word Data register


0 - 7999

SD 8000-8511 word Special data register


R word Extended register
0 - 32767
5.8.4.3 Mitsubishi Q Serial
DIAView software supports the communication of the equipment
based on Mitsubishi communication protocol standard by serial port
(format 1~5).
Supporting device:
Basic QCPU: Q00JCPU, Q00CPU, Q01CPU.
High-performance QCPU: Q02CPU, Q02HCPU, Q06HCPU,
Q12HCPU, Q25HCPU.
General QCPU: Q00UJCPU, Q00UCPU, Q01UCPU, Q02UCPU,
Q03UDCPU, Q04UDHCPU, Q06UDHCPU,
Q10UDHCPU,Q13UDHCPU, Q20UDHCPU, Q26UDHCPU,
Q03UDECPU, Q04UDEHCPU, Q06UDEHCPU, Q10UDEHCPU,
Q13UDEHCPU, Q20UDEHCPU, Q26UDEHCPU, Q50UDEHCPU,
Q100UDEHCPU.
The example that DIAView configuration software communicates
with equipments by serial port is as follows:
Ø Creating communication between DIAView software and
Mitsubishi-Q through serial port:
Example 1: Taking“general QCPU, format4”driver as an example
Step 1: Create the following hardware framework, the
communication parameters are 19200,8,N,1,universal QCPU, format
4, station3:

Step 2: Right-click on the “IODevice” node in the project
management area and select “New Device”, select “Mitsubishi”
→“Mitsubishi Q Serial” in the menu selection as shown in the figure
below:

Step 3: configure the CPU, format 4communication parameters, as
shown in the figure below:

Step 4: Click the button on the right side of "Serial Port" in the
"Basic" to open the “Set the Serial Parameters” window, set the
serial port communication parameters: “19200,8,N,1” and set the
communication port as COM6 (you can see that the detected
currently assigned serial communication port is COM6 in device
manager), as shown in the figure below:

Step 5: Click the “OK” button when all parameters have been
configured to return communication parameter configuration window,
set communication and troubleshooting parameters,
“DeviceAddress” should be the same as PLC station number, both
are set as “3”, other parameters can be default value, as shown in
the figure below:

Step 6: Click “Next” button, open “Mitsubishi Q Serial” window, the
parameters are as shown in the figure below:


Step 7: Click the “OK” button when all parameters have been
configured and the device with the default name “Device” will appear
under the “IODevice” node:
Step 8: Rename the newly-built IO communication device as
"Serial_Device" and complete the serial port driver communication
configuration as shown in the figure below:

Ø Noted: Mitsubishi general QCPU address description as shown in


the table below:
Register Range Default type
Description
SM 0.0 - 2047.15 bool Specical relay
X 0.0 - 0x1FFF.15 bool Input register
Y 0.0 - 0x1FFF.15 bool Output register
M 0.0 - 8191.15 bool Interior relay
L 0.0 - 8191.15 bool Latch register
F 0.0 - 2047.15 bool Alarm
V 0.0 - 2047.15 bool Index relay
B 0.0 - 0x1FFF.15 bool Link relay
TS 0.0 - 2047.15 bool Timer contact
TC 0.0 - 2047.15 bool Timer coil
CC 0.0 - 1023.15 bool Counter coil
CS 0.0 - 1023.15 bool Counter contact
SB 0.0 - 0x7FF.15 bool Link special relay
S 0.0 - 8191.15 bool Stepping relay
SD 0 - 2047 word Special register
D 0 - 12287 word Data register
W 0 - 0x1FFF word Link register
TN 0 - 2047 word Timer current value
CN 0 - 1023 word Counter current
value
SW 0 - 0x7FF word Link special register
5.8.4.4 Mitsubishi Q EnterNet
DIAView software supports the communication of the equipment
based on Mitsubishi communication protocol standard by
Ethernet(Binary Code, ASCII Code).
Supporting device:
Basic QCPU: Q00JCPU, Q00CPU, Q01CPU.
High performance QCPU: Q02CPU, Q02HCPU, Q06HCPU,
Q12HCPU, Q25HCPU.
General QCPU: Q00UJCPU, Q00UCPU, Q01UCPU, Q02UCPU,
Q03UDCPU, Q04UDHCPU, Q06UDHCPU,
Q10UDHCPU,Q13UDHCPU, Q20UDHCPU, Q26UDHCPU,
Q03UDECPU, Q04UDEHCPU, Q06UDEHCPU, Q10UDEHCPU,
Q13UDEHCPU, Q20UDEHCPU, Q26UDEHCPU, Q50UDEHCPU,
Q100UDEHCPU.
FX-5U
The example that DIAView software communicates with equipments
by Ethernet is as follows:
Ø Creating communication between DIAView software and
Mitsubishi-Q series through Ethernet:
Example 1: Taking“General QCPU, Binary”driver as an example
Step1: Create the following hardware framework, set IP address as
“192.168.1.20”, the computer IP address is “192.168.1.200” (keep
PLC and the computer in the same LAN), as shown in the figure
below:

Step2: Right-click on the “IODevice” node in the project


management area and select “New Device”, select “Mitsubishi”
→“Mitsubishi Q EtherNet ” in the menu selection as shown in the
figure below:
Step3: Configure the universal QCPU, Binary communication
parameters and set the IP address in the Basic setting as:
192.168.1.1, set “Port” as: 502, as shown in the figure below:
Step4: Other option can use the default values, click “Test” button to
test the connection, as shown in the figure below:

Step5: Click “Next” button to open “Mitsubishi Q EtherNet” window,


the parameters are as shown in the figure below:
Step6: Click the “OK” button when all parameters have been
configured and the device with the default name “Device” will appear
under the “IODevice” node:

Step7: Rename the newly-built IO communication device as


"Ethernet_Device" and complete Ethernet driver communication
configuration, as shown in the figure below:
Ø Noted: Mitsubishi general QCPU address description as shown in
the table below:
Register Range Default type Description
SM 0.0 - 2047.15 bool Special relay
X 0.0 - 0x1FFF.15 bool Input register
Y 0.0- 0x1FFF.15 bool Output register
M 0.0 - 8191.15 bool Interior relay
L 0.0 - 8191.15 bool Latch relay
F 0.0 - 2047.15 bool Alarm
V 0.0 - 2047.15 bool Index relay
B 0.0 - 0x1FFF.15 bool Link relay
TS 0.0 - 2047.15 bool Timer contact
TC 0.0 - 2047.15 bool Timer coil
CS 0.0 - 1023.15 bool Counter contact
CC 0.0 - 1023.15 bool Counter coil
CS 0.0 - 1023.15 bool Counter contact
SB 0.0 - 0x7FF.15 bool Link special relay
S 0.0 - 8191.15 bool Stepping relay
SD word Special register
0 - 2047
D word Data register
0 - 12287
W word Link register
0 - 0x1FFF

TN word Timer current value


0 - 2047

CN word Counter current


0 - 1023 value

SW word Link special register


0 - 0x7FF
5.8.4.5 Mitsubishi FX EnterNet
DIAView software supports the communication of the equipment
based on Mitsubishi communication protocol standard by
Ethernet(Binary Code, ASCII Code).
Supporting devices:
PLC: FX3UC.
Ethernet Module: FX3U-ENET-L.
The example that DIAView software communicates with equipments
by Ethernet is as follows:
Ø Creating communication between DIAView software and
Mitsubishi-FX3U-ENET-L through Ethernet:
Example 1: Taking “FX3UC, FX3U-ENET-L, ASCII” driver as an
example
Step 1: Create the following hardware framework, set IP address as
192.168.1.8”, the computer IP address is "192.168.1.200" (keep the
PLC and the computer in the same LAN):


Step 2: In the project management area, right click on “IODevice”
and select “New Device”, select “Mitsubishi FX EtherNet” in the
driver selection window, as shown in the figure below:

Step 3: Configure universal FX3UC, ASCII communication
parameters, and set the "IP" as: 192.168.1.201 in the “Base” setting,
set the port number as: 1500, as shown in the figure below:

Step 4: Other parameters can be the default, click “ Test “button to
test the connection

Step 5: Click “Next” to open Mitsubishi-FX communication


parameters configuration window to set parameters, as shown in the
figure below:

Step 6: Click the "OK" button when all parameters have been
configured and the device with default name will appear under
“IODevice” node of the project tree directory.


Step 7: Rename the newly-built IO communication device as
"Ethernet_Device" and complete Ethernet driver communication
configuration, as shown in the figure below:

Ø Noted: Mitsubishi FX3UC address description, as shown in the


figure below:
Register Range Default type Description
X 0.0 - 377.15 bool Input register
Y 0.0 - 0x1FFF.15 bool Output register
M 0.0 - 7679.15 bool Auxiliary register
SM 8000.0 - 8511.15 bool special auxiliary
register
S 0.0 - 4095.15 bool Status register
TS 0.0 - 511.15 bool Timer contact
register
CS 0.0 - 255.15 bool Counter contact
register
TN word Timer register
0 - 511

CN16 word
0 - 199 16 bit counter
register

CN32 word
200 - 255 32 bit counter
register

D word Data register


0 - 7999

SD word Special data register


8000 - 8511

R word Extended register


0 - 32767
5.8.5 Siemens
The PLCs produced by SIEMENS are applied widely in our country.
They are used in metallurgy,chemical engineering and printing etc.
field.(SIEMENS)PLC products include LOGO, S7-200, S7-1200, S7-
300, S7-400 etc. Siemens S7 series PLC is with small size, fast
speed and standard. In addition, it has network communication
capability,stronger function and higher reliability.S7 series PLC
products can be divided into micro PLC(S7-200), small-scale
performance requirement (S7-300)and middle, high performance
requirement PLC(S7-400)etc.
5.8.5.1 S7300 TCP
Description: S7300 TCP driver also supports S7 1200,when
creating a new device, the parameter "device address" is set as 0.
Note that when using Siemens software to configure:
1, It must be an unoptimizable block.
2, Slot number and rack number must be 0,0.
3, Put or Get access must be enabled.
Ø Creating communication between DIAView software and
Siemens S7300 TCP through Ethernet:
Step 1: Create the following hardware framework: Set S7300
address as “192.168.1.2”, set the computer IP address as
“192.168.1.200” (keep PLC and the computer in the same LAN):


Step 2: Right-click on the “IODevice” node in the project
management area and select “New Device”
Step 3: Select “Siemens” →“S7300 TCP” in the menu selection, as
shown in the figure below:

Step 4: Configure S7300 communication parameters, as shown in


the figure below:

Step 5: Set the IP address in the base setting as: 192.168.1.2, set
“Port” as: 102, click“test”button to test the connection ,as shown in
the figure below:

Step 6: Click the “OK” button when all parameters have been
configured and the device with the default name “Device” will appear
under the “IODevice” node,as shown in the figure below:
Ø Noted: Siemens S7300 TCP address description(different CPU
models and ranges), as shown in the table below:
Register Range Default type Description

ID 0~65532 DWORD Input register

IW 0~65534 WORD Input register

IB 0.0~65535.15 BOOL Input register

QD 0~65532 DWORD Output register

QW 0~ 65534 WORD Output register

QB 0~65535 BYTE Output register


MD 0~65532 DWORD Bit register

MW 0~65534 WORD Bit register

MB 0~65535 BYTE Bit register

DB 0~65535 WORD DB data block register

T 0~65535 WORD Timer

C 0~65535 WORD Counter


5.8.5.2 S71200 TCP
The example that DIAView software communicates with equipments
by Ethernet is as follows:
Ø Creating communication between DIAView configuration
software and Siemens S71200 TCP through Ethernet:
Step 1: (keep PLC and the computer in the same LAN) Right-click
on the “IODevice” node in the project management area and select
“New Device”
Step 2:Select “Siemens” →“S71200 TCP” in the menu selection, as
shown in the figure below:

Step 3: Configure S71200 TCP communication, as shown in the


figure below:
Step 4: Click the “OK” button when all parameters have been
configured and the device with the default name “Device” will appear
under the “IODevice” node, as shown in the figure below:
Ø Noted:Siemens S71200 TCP address description(different CPU
models and ranges), as shown in the table below:
Register Range Default type Description

ID 0~65532 DWORD Input register

IW 0~65534 WORD Input register

IB 0.0~65535.15 BOOL Input register

QD 0~65532 DWORD Output register

QW 0~ 65534 WORD Output register

QB 0~65535 BYTE Output register

MD 0~65532 DWORD Bit register

MW 0~65534 WORD Bit register

MB 0~65535 BYTE Bit register

DB 0~65535 WORD DB data block register


5.8.5.3 S7300 MPI
Ø Creating communication between DIAView software and
Siemens S7300 MPI by Ethernet:
Step 1: Set up the following hardwork framework, as shown in the
figure below:

The DP connection line is as follows:

Step 2: Right-click on the "IODevice"node in the project


management area and select "New Device",
Step 3: Select “Siemens” → “S7300 MPI” in the driver selection, as
shown in the figure below:
Step 4: Configure Simens S7300 MPI communication parameters,
as follows:
Step 5: Set“Station address”as: 2, “Slot numbei”as: 2, as shown in
the figure below:

Ø Noted:Siemens S7300 MPI address description(different CPU


models and ranges), as shown in the table below:
Register Range Default type Description

ID 0~65532 DWORD Input register

IW 0~65534 WORD Input register

IB 0.0~65535.15 BOOL Input register

QD 0~65532 DWORD Output register

QW 0~ 65534 WORD Output register

0~65535 BYTE Output register


QB
MD 0~65532 DWORD Bit register

MW 0~65534 WORD Bit register

MB 0~65535 BYTE Bit register

DB 0~65535 WORD DB data block register

T 0~65535 WORD Timer

C 0~65535 WORD Counter


5.8.5.4 S7200 TCP
The example that DIAView software communicates with
equipments by Ethernet is as follows:
Ø Creating communication between DIAView configuration
software and Siemens S7200 TCP through Ethernet:
Step 1: Create the following hardware framework as shown in the
figure below: set S7200 address as “192.168.1.3”, the computer IP is
“192.168.1.200” (keep PLC and the computer in the same LAN):


Step 2: Right-click on the “IODevice” node in the project
management area and select “New Device”

Step 3:Select “Siemens” →“S7200 TCP” in the menu selection, as


shown in the figure below:
Step 4: Configure S7200 TCP communication
Step 5: Set the “IP” in the “Base” setting as: 192.168.1.3, set “Port”
as: 102, Click“Test”button to test the connection, as shown in the
figure below:

Step 6: Click the “OK” button when all parameters have been
configured and the device with the default name “Device” will appear
under the “IODevice” node, as shown in the figure below:
Ø Noted: Siemens S7200 TCP address description(different CPU
models and ranges), as shown in the table below:
Register Range Default type Description

ID 0~65532 DWORD Input register

IW 0~65534 WORD Input register

IB 0~65535 BYTE Input register

QD 0~65532 DWORD Output register

QW 0~ 65534 WORD Output register

QB 0~65535 BYTE Output register

MD 0~65532 DWORD Bit register

MW 0~65534 WORD Bit register

MB 0~65535 BYTE Bit register

VD 0~65532 DWORD V data block register

VW 0~65534 WORD V data block register

0~65535 V data block register


VB BYTE

T 0~32767 WORD Timer

C 0~32767 WORD Counter


5.8.5.5 S7200 PPI
The example that DIAView software communicates with
equipments by serial port is as follows:
Ø Creating communication betweeen DIAView software and
Siemens S7200 PPI through serial port:
Step 1: Create the following hardware framework as shown in the
figure below:

PC-PPI line is as follows:

Step 2: Right-click on the “IODevice” node in the project


management area and select “New Device”
Step 3: Select “Siemens” →“S7200 PPI” in the menu selection, as
shown in the figure below:

Step 4: Configure Siemens S7200 PPI communication parameters,


as shown in the figure below:
Step 5: Click the button beside "SerialPort"in the “Base”setting and
pop up the interface as follows:
Step 6: Click the “OK” button when all parameters have been
configured and the device with the default name “Device0” will
appear under the “IODevice” node as shown in the figure below:

Ø Noted: Siemens S7200 PPI address description(different CPU


models and ranges) as shown in the table below:

Register Range Default type Description

ID 0~9996 DWORD Input register


IW 0~9998 WORD Input register
IB 0~9999 BYTE Input register
QD 0~9996 DWORD Output register
QW 0~9998 WORD Output register
QB 0~9999 BYTE Output register
MD 0~9996 DWORD Bit register
MW 0~9998 WORD Bit register
MB 0~9999 BYTE Bit register
VD 0~65532 DWORD V data block register
VB 0~65535 BYTE V data block register
VW 0~65534 WORD V data block register
C 0~32767 WORD Counter
T 0~32767 WORD Timer
5.8.5.6 S7200 Smart TCP
The example that DIAView software communicates with
equipments by Ethernet is as follows:
Ø Creating communication between DIAView configuration
software and Siemens S7200 Smart TCP through Ethernet:
Step 1:(keep PLC and the computer in the same LAN)Right-click on
the “IODevice” node in the project management area and select
“Add device” ​
Step 2: Select “Siemens” →“S7200 Smart TCP” in the menu
selection, as shown in the figure below:

Step 3: Configure S7200 Smart TCP communication, as shown in


the figure below:

Ø Noted: Siemens S7200 Smart TCP address description(different
CPU models and ranges), as shown in the table below:
Default value
Register Range Instructions
type

ID 0~65532 DWORD Input register

IW 0~65534 WORD Input register

IB 0~65535 BYTE Input register

QD 0~65532 DWORD Output register

0~ 65534
Output register
QW WORD

QB 0~65535 BYTE Output register

MD 0~65532 DWORD Bit register

MW 0~65534 WORD Bit register

MB 0~65535 BYTE Bit register

0~65532 V data block


VD DWORD register

0~65534 V data block


VW WORD register

0~65535 V data block


VB BYTE register

T 0~32767 WORD Counter

C 0~32767 WORD Timer


5.8.6 Delta power meter
DIAView software supports the communication of Delta power
meter.

Supporting device: DPM-C530 series.

Supporting communication protocol: TCP/IP protocol, RS-485


protocol.

Supporting communication network interface: Ethernet and


serial.
5.8.6.1 DPM-C530 Serial
DIAView software supports the communication of the
equipment based on MODBUS RTU communication protocol
standard by RS-485.
Supporting device: Delta Power Meter DPM-C530。
The Example DIAView software communicates with
equipments by RS-485 is as follows:
Ø Creating communication between DIAView software and Delta
power meter DMP-C530 through RS-485.

Step 1: Create the following hardware framework, set COM1


communication port as RTU, 9600,8,E,1,as shown in the figure
below:

Step 2: In the project management area, right click on “IODevice“


node and select “ New Device “,select "Delta Power Meter"→"DPM-
C530 Serial" in the driver selection window, as shown in the figure
below:

Step 3: Configure DPM-C530, RS-485 communication
parameters,communication port is COM1(It can be detected in the
computer device manager that the current serial communication port
allocated is COM1), as shown in the figure below:

Step 4: Click“Base”→ the button on the right of "SerialPort" , open
"Set the Serial Parameters" window to set serial port communication
parameter:"9600,8,E,1", as shown in the figure below:


Step 5: Click the "OK" button when the parameters have been
configured to return to communication parameter configuration
window and set communication and troulbeshooting parameter.
"DeviceAddress " should be the same with DPM-C530 station
number,set it as "2", other option can be default, as shown in the
figure below:


Step 6: Click the "OK" button when all parameters have been
configured and the device with default name "Device" will appear
under “IODevice” node of the project tree directory:

Step 7: Rename the newly-built IO communication device as
"DPM_C530_Serial" and complete Ethernet driver communication
configuration, as shown in the figure below:

5.8.6.2 DPM-C530 Ethernet
DIAView software supports the communication of the
equipment based on MODBUS RTU communication protocol
standard by Ethernet to transform delta IFD9506 to RS-485.

Supporting device: Delta power meter DPM-C530.

The example DIAView software communicates with equipments


by Ethernet is as follows:

Ø Creating communication between DIAView software and Delta


power meter DPM-C530 through Ethernet:

Step 1: Create following hardware framework, set IP address as


“192.168.1.5”, the computer IP address is “192.168.1.200” (keep PLC
and the computer in the same LAN),as shown in the figure below:
Step 2: In the project management area, right click on "IODevice"
node and select "NewDevice", select "Delta Power Meter"→“DPM-
C530 Ethernet”in the driver selection window, as shown in the figure
below:
Step 3: Configure DPM-C530 Ethernet communication parameter
and set the "IP address" as: 192.168.1.1, “port number” is set as :
502, as shown in the figure below:
Step 4: Other option can be default and click "Test" button to test
whether the connection is OK, as shown in the figure below:

Step 5: Click the "OK" button when the parameters have been
configured and the device with default name "Device" will appear
under "IODevice" node of the project tree directory, as shown in the
figure below:
Step 6: Rename the newly-built IO communication device as
"DPM_C530_Ethernet" and complete Ethernet driver communication
configuration, as shown in the figure below:
5.8.7 Rockwell
DIAView software supports the communication of Rockwell PLC.

Supporting device: ControlLogix series

Supporting communication protocol: EtherNet/IP protocol.

Supporting communication network interface: Ethernet.


5.8.7.1 Rockwell ControlLogix Ethernet
DIAView software supports the communication of the equipment
based on Rockwell communication protocol standard by EtherNet/IP.
Supporting devices: based on 1756-EN2TR Ethernet module.
ControlLogix 5550 / 5553 / 5555 / 5561 / 5562 / 5563 / 5564 / 5565
/ 5571 / 5572 / 5573 / 5574 / 5575 processors.
The example that DIAView software communicates with equipments
by Ethernet is as follows:
Ø Creating communication between DIAView software and
Rockwell-ControlLogix by Ethernet:
Example 1: Taking “Controllogix EtherNet”driver as an example
Step 1: Create the following hardware framework, Set the IP
address as "192.168.1.15", the computer IP address is
"192.168.1.200" (keep the PLC and the computer in the same LAN):


Step 2: In the project management area, right click on “IODevice “
node and select “ New Device “,select "Rockwell" →"Rockwell
ControlLogix Ethernet" in the driver selection window, as shown in
the figure below:

Step 3: Configure the ControlLogix Ethernet communication
parameters and set the "IP" in the base settings as 192.168.1.15, set
the port number to: 44818, as shown in the figure below:

Step 4: Click the "OK" button when all parameters have been
configured and the device with default name "Device" will appear
under “IODevice” node of the project tree directory:


Step 5: Rename the newly-built IO communication device as
"Ethernet_Device" and complete Ethernet driver communication
configuration, as shown in the figure below:

Step 6: There is no default register address in Rockwell equipment,


so it is necessary to create new tag address, as shown in the figure
below:
Step 7: The driver supports reading array elements and supports 3-
dimensional arrays at most. For example, "t18 [0,1,0]", t18 refers to
tag address name, and [0,1,0] refers to specific 3D array elements,
as shown in the figure below:
Ø Attachment 1: description of Rockwell ControlLogix Ethernet register
types, as follows:
Data type on
Register type Data type Unit length
PLC
Base
BYTE SINT 1

WORD INT 2

DWORD DINT 4

FLOAT REAL 4
STRING STRING
4
BOOL BOOL

BYTE SINT 1

WORD INT 2

Array DWORD DINT 4

FLOAT REAL 4

STRING STRING 4
5.9 OPC
DIAView software supports OPC relative protocol.
5.9.1 OPC DA
DIAView supports communication with OPC server
The IO communication between DIAView configuration software
and OPC server is as follows:
Ø Creating the communication between DIAView software and
OPC UA Server:
Step 1: Configure “AH500 OPC Server”, read data in the address of
AH500, as shown in the figure below:


Step 2: In the project management area, right click on “IODevice
“node and select “ New Device “, Select “OPC” in the "Driver
Selection" window“OPC” → “OPC DA”, as shown in the figure below:
Step 3: Configure the common communication parameters or keep
the default values, as shown in the figure below:


Step 4: Click “next”, appear “OPC DA” configuration window, Select
"Delta.AHModbus EthernetDA.1" in the drop-down list of the "OPC
server" option and keep other items the default value:


The meaning of each setting are is as follows:
OPC server : Select OPC server.
Computer (Null(Empty) value represents the local computer):
Install the OPC server computer. If the OPC server and the DIAView
configuration software are installed on the same computer, it will be
empty; if the OPC server is installed on the LAN or other computer,
then click "..." button to select remote computer name.
Synchronization: If the data is wrong, use it again
Using hierarchical namespace:Whether this function is checked
or not determines the display mode of IO variable "address" under
the drive - if checked, it will be displayed according to the file
directory, and if not checked, the variable path will be displayed
directly:
Checked effect:

Unchecked effect:


Step 5: The batch addition function is added in the new version. The
item "IO Name" needs to be filled in and cannot be blank, as shown
in the figure below:

Step 6: You can test (When adding an address, if you want to test,
please save it),the following figure:

Step 7: Click the "OK" button after all the configuration is done,a
device with the default name will appear under the "IO
Communication" node of project directory tree, as shown in the
figure below:
5.9.2 OPC UA
DIAView supports communication with OPC UA server.
The IO communication between DIAView configuration software and
OPC UA server is as follows:
ØCreating the communication between DIAView software and
Delta AH500 OPC Server:
Step 1: Install "OPC UA Local Discovery Server 1.02" of OPC foundation
to discover the server. Find the path: "Installation package" - "OPC" -
"LDS".​

Step2:Right click the "IO Device" node in the tree directory of the project
window, and select OPC UA, as shown in the figure below:


Step3:Configure OPC UA communication parameters, as shown in the
figure below:

​Step4:Enter the server address in the "ServerUrlNode" box, click the
"Select" button to display different security policy nodes, select the required
security policy and complete the configuration, as shown in the figure
below:

Step5:After the IO communication device is successfully created, click
"Add" on the variable configuration page and select the data points to be
read by the server, as shown in the figure below:

Step6:After the data point is configured successfully, click the "Test" button
to read the current data value, as shown in the figure below:


ØCommunication mode verification:
1、Certificate verification
In the case of certificate verification, the certificates of the server and the
client need to trust each other to communicate:
DIAView OPC UA Client
1)Create Certificate
When the client does not have a certificate, you can manually create a
certificate. Click the "Create Certificate" button:


The initial status of the create certificate page is gray,click the "Edit" button
to configure the hosting program successfully, and then you can create the
certificate. The parameter configuration is shown in the figure below:

​The storage location of the certificate generated by "Store Path" is under the
"MachineDefault" folder by default.
The default value of "Application Name" is UA local discovery server, and
the name "DIAView OPC UA" used in the test is shown in the figure.​
The default value of "Application URI". Check the check box on the right.
Double click the content area to modify it manually.
The default value of "Subject Name". Check the check box on the right.
Double click the content area to modify it manually.
The default value of "Domains" (computer name). Check the check box on
the right. Double click the content area to modify it manually.
Configure Managed Application:

Click "OK" to generate the certificate after the configuration is completed in
the create certificate page.
2)Browse Certificate
Click the "Browse Certificate" button:

On the certificate list page, select the required certificate and right-click
"view":

Display details of the selected certificate; When the client establishes
communication with the server, and the server cannot automatically obtain
the client certificate, you need to export the certificate and manually import
the server trust list:

3)Import Certificate
When the server certificate needs to be trusted, you can choose to import the
certificate and click the "Import Certificate" button:

Select the certificate to be trusted, click OK, and then import:

The imported certificate is stored in "RejectedCertificates", which is a denial
of trust; Take out the certificates that need to be trusted and store them in the
folders of "MachineDefault", "UA Applications" and "UA Certificate
Authorities":


Server
1)Certificate trust:
The server selects the trusted client, the third-party OPC UA server, take
KEPServer as an example, as shown in the figure below:

2、User authentication
In the case of user authentication, when the server has no user
authentication, the client can log in anonymously; When the server has user
authentication, the client needs to enter the correct user name and password:
DIAView OPC UA Client
When there is no user authentication on the server, do not check user
configuration, and the input box is gray; When the server has user
authentication, check the user configuration and enter the correct user name
and password in the input box:

5.9.3 OPC UA AX
OPC UA drive for Delta AX-8 series PLC.
ØEstablish OPC UA communication between DIAView
configuration software and AX-8 series P​LC:
Driving method please refer to“5.9.2 OPC UA”


5.10 Simulator
DIAView software supports the communication with simulator,
simulator can offer data with regular changes when there is no filed
data.
5.10.1 Simulator
The IO communication between DIAView software and stimulator is
as follows:

Ø Creating communication between DIALink and Simulator:


Step 1: In the project management area , right click on “IODevice
“node and select “ New Device “,The menu selection in the figure
below will appear:

Step 2: Select “simulator” in the driver selection window ,as shown


in the figure below :
Step 3: Configure the system simulator communication parameters,
default values can be kept ,as shown in the figure below:
Step 4: Click "next", and "Simulator" window will appear:

Simulation parameters:
Register Range Description
Increase 0~63 Increase
Decrease 0~63 Decrease
Random 0~63 Random
Sine 0~63 Sine wave
Square 0~63 Square wave
Triangle 0~63 Triangle wave
Memory 0~63 Memory, read-write

² Refresh cycle: Data change cycle


² Minimum value: (Int32 type value, minimum value),
-2,147,483,648
² Maximum value: (Int32 type value, Maximum value),
2,147,483,647
² Cycle: Partially used; a data cycle
² Duty ratio: Refers to the position of positive pulse in the pulse
period (only can be set for Triangle and Square)
Step 5: Click the "OK" button after all the configuration is done,a
device with the default name will appear under the "IODevice" node
of project directory tree, as shown in the figure below:
5.11 MQTT
MQTT is a lightweight broker-based publish/ subscribe
messaging protocol designed to be open, simple, lightweight and
easy to implement. These characteristics make it a good choice for
many scenarios, especially for limited environments, such as
machine to machine communication (M2M) and Internet of Things
(IoT).
5.11.1 Delta MQTT Client
DIAView software supports communication with MQTT broker or IoT.

An example of configuring IO communication with MQTT is as


follows:

Ø Creating communication between DIAView and MQTT Broker:

Step 1: Right-click on the “IODevice” node in the project


management area and select” New Device”; the menu selection in
the figure below will appear:
Step2:Select “MQTT”→ "Delta MQTT Client” in the “Driver Selection”
window:

Step 3: Configure the Delta MQTT Client communication parameters,


as shown in the figure below:

The meanings of each configuration in the window are as follows:

Kepp Alive Period:In seconds, the default value is 6000, which


defines the maximum time interval for the server to receive messages
from the client; When idle, keep the heartbeat interval of the
connection
Host name: Computer name or IP address
Port number: The default value is 1883,it is modified to 8883 during
certificate authentication
ClientID: Each client has a unique ClientID flag. Diaview generates a
random ClientID for mqtt clients by default
CleanSession : If checked, the session will be cleared and offline
messages will not be retained; Unchecked means to keep the
session and offline messages
User: Check to enable user authentication , enter user name and
password
CA:Check to enable certificate authentication, configure the Ca file,
cert file,the absolute path of key file,and configure the password of
key file

Step 4: Click the “OK” button when all parameters have been
configured and the device with the default name “Device0” will appear
under the “IODevice” node, as shown in the figure below:
Step 5: Double click "Device0" , add an address and configure
address parameters, as shown in the following figure:
The meanings of each configuration in the window are as follows:

Topic: Topics subscribed and published by the client


QOS_AT_LEAST_ONCE: At least once, ensure that the message
arrives, and a message repetition will occur
QOS_AT_MOST_ONCE: At least once, the message will be lost
QOS_EXACTLY_ONCE: Only once, make sure the message arrives
once
Retain:If checked, the sent message will be saved for a long time. It
will not only be sent to the current subscriber, but also the new
subscriber who subscribes to this topic will get the latest message
with retain flag = 1;Unchecked means that this message is only
pushed for the current subscriber.
Address: It consists of Topic and QoS

Step 6: Click the “OK” button when all parameters have been
configured and the address with default name "Address" will appear
under the "Device0” window,no retain by default,as shown in the
figure below:

Step 7: Click "Test",Diaview can receive messages of subscribed


topics and publish messages of corresponding topics:
6.1 Overview
Project created by using the DIAView software requires various
types of variables for data interaction in order to display and control
the field production status in real-time.

There are two types of variables in the DIAView software: System


variables and project variables. System variables are variables built-
in the DIAView system and cannot be modified;

Project variables are variables customized by the user in the


project, and they are usually managed by the “variable dictionary”.

The variable dictionary is a collection manager of all the variables


in the system, and is able to perform uniformed and centralized
management of all the variables; variable groups and variables can
be created in the variable dictionary, and functions such as browsing
variable references, variable statistics and variable replacement etc.
Operations such as adding, deleting, copying, pasting, cutting,
importing,exporting and search of variables can also be performed.
6.2 Variable group
A variable group is a unit for grouping managing variables.
The DIAView software can group and manage the variables in the
project by creating variable group and then adding variables in the
variable group. To use the variables in a variable group, the name of
the variable group must first be appointed; the variable group name
and variable name is separated with “.”, for example
“Var.NewVariableGroup.NewVariable”.
Several variable groups can be created under a variable dictionary,
and variable groups can also be created under variable groups.
Variable group naming rules:Refer to the naming rules for IO
variable in section “5.5.1 Create IO variable ”,and If there are
variables and variable groups under similar class nodes within the
same project, the variables and variable group names cannot be
repeated.
Adding variable group
Ø Right-click the “VariableDictionary” node in the project window tree
index and then click the “New Variable Group” from the right-click
menu. The system will create a new variable group with the default
name, as shown in the figure below:


Ø Double-click the created “variable group” sub-node and open the
variable operation window to perform operations including adding,
inserting, deleting, bach add,import,and export of variables, as shown
in the figure below:
Ø Right-click the created variable sub-node to perform operations
including “New Variable Group”,"Import Variable Group","Export
Variable Group", “Copy”,“Delete”,"Rename", “Paste” etc. (file must be
saved before copying), as shown in the figure below:
Edit variables directly under “variable dictionary”
Ø Users can also double-click on the “variable dictionary” node to
open the variable configuration window without adding a variable
group, then operations such as adding, deleting, copying, pasting,
cutting, importing,exporting and search of variables can also be
performed.
6.3 Variables
System variables: Fixed variables built-in the system; the DIAView
has 17 system variables which can be used directly by the users:


Variables are values that can change at any time in a project; they
are important participants for the information interaction of the
system. Variable information in the DIAView is as follows:

Basic properties of variables:


² Name: Name of the variable.
Naming rules:Refer to the naming rules for IO variable in
section"5.5.1 Create IO variable",and If there are variables
and variable groups under similar class nodes within the
same project, the variables and variable group names
cannot be repeated.
Variable Type:Defines the value type of the variable,There are 3 types
of variables:
Text: Character type (the maximum length of this type of
variable is two thousand characters)
Digital: Digital type (False, True).
Analog: Integer type and real type.
nitial Value: The initial value of the variable
Retentive Value: If checked, the “initial value” for this variable will be
saved as the last acquired value when the system execution ends; or
else it will remain the same.
Minimum Value and Maximum Value:Specifies the value range of the
variable (these two properties are only available for the “analog
value” type variable).
Deadband:Specifies a value as the deadzone value and forms a
deadzone interval with the current value of the variable:
(Current variable value - deadzone value) <= deadzone
interval <= (current variable value + deadzone value);
l Effect: Data filtering.
l Principle: When the next variable value acquired is within the
deadzone interval range, no new values will be acquired for the
variable value and the original value will remain the same. If it
is not in the deadzone interval range, then acquire a new
variable value and the deadzone interval will also change
accordingly. It will keep looping this way. (This property is only
available for the “analog value” type variable).
Decimal Digit: Specifies the number of decimal places for the variable
(this property is only available for the “analog amount” type variable).
Eng Units: Sets the unit of the variable; for example: second/s,
milliliter/ml and kilogram/kg. Variable value can be acquired and also
display this project’s unit when using variables; for example:
Var.NewVariableGroup.NewVariable.ValueAndUnit (this property is
only available for the “analog value” type variable).
Extended Domain: Set Secondary naming of the variable dictonary,get
the value of variable in batch by script through the domain.The
extended domain is named as:Domain Name + "#" + "Serial Number"
(Multiple domains can be set,with each domain separated by
commas or semicolon),available scripts:
GetExtendedDomainVars: Get the set of variables which
specified the domain and types
GetExtendedDomainCount: Get the number of variables
which specified the domain and types
For Example: Please refer to "20.4 Programming model"
Description: Add explanation information for the variable.
6.4 Variable toolbar

Variable toolbar is used to create new variables, test variable values,


and search variables in the development environment. Its button
functions are as follows:

Button Command Description

Add Add new variable

​ Insert Insert new variable


Delete Delete the selected variable
Batch Add Batch adding variable
Import Import variable table
Export Export variable table in Excel file format
KeyWord Enter the keyword you want to find
Search Retrieve variables by keyword

1、 Add Variable
Double-click "Variable Dictionary" node or double-click the created
variable group node to open the variable configuration window.Click
"Add" to add an variable namde "Variable" by default,as shown in the
following figure:
2、 Insert Variable
In the variable configuration window, select the variable
"Variable1",click "Insert", and insert a new variable "Variable3" above
"Variable1", as shown in the following figure:
3、 Delete Variable
In the variable configuration window, select the variable
"Variable1",click "Delete" to delete "Variable1", as shown in the
following figure:
4、 Batch Add Variable
In the variable configuration window, click "Batch Add" to add multiple
variables,as shown in the following figure:
5、 Export Variable
Step 1: Under project directory tree, double-click "Variable
Dictionary" node or double-click the created variable group node
to open the variable configuration window, export variable table,
as shown in the following figure:
Step 2: Select file storage path and save variable table:
6、 Import Variable
DIAView configuration software can import variables through Excel
file formats, the variables in the import file must be correct and valid
data.
Import From Excel

Step 1: Under project directory tree, double-click "Variable


Dictionary" node or double-click the created variable group node
to open the variable configuration window, import variable table,
as shown in the following figure:

7、 Search
Several variables have been added in the variable configuration
window. Enter "KeyWord" and click "Search". The variable
configuration window only displays variables that meet "keyword"
filter criteria. When "KeyWord" is empty, all variables are
displayed.The keyword matches variable name:
6.5 Variables usage browsing
The variable usage browser refers to the window used to view the
status of all variable references in the variable dictionary. It can be
used to view whether a variable is referenced and information on the
reference path.

Ø Right-click the “VariableDictionary” node in the project window tree


index and then click the “Variable Reference Browser” from the right-
click menu, or click the “Variable Reference Browser” in the right-click
menu of the variable group node, as shown in the figure below:

Ø The variable reference browser will pop-up, as shown in the figure


below:
1. The left side of the variable usage browser is the tree index of
the variable dictionary, and the right side is the display window of
variable references.

2. In the tree index to the left, if the round symbol in front of the
variable displays as “yellow”, it means that this variable is referenced.
If it is “gray,” it means that it is not yet referenced.

3. Select the variable to view from the tree index to the left, and the
variable reference display window on the right will display all objects
in the project that uses that variable. They are displayed using an
expanded tree index in order for users to pinpoint the objects that
actually uses this variable.
4. Click the pull-down button to filter the variables, as shown in the
figure below:
6.6 Variables substitution
Variable substitution refers to substituting a referenced variable in
the project into another variable.

Ø Right-click the “VariableDictionary” node in the project window tree


index and then click the “Variable Substitution” from the right-click
menu, or click the “Variable Substitution” in the right-click menu of
the variable group node, as shown in the figure below:
Select the variable to substitute from the “OriginalVariable” field. It
can be selected by pressing the variable selection button to the right
and opening the variable browser. The selected variable must be
referenced in order for it to be replaced. When a variable is selected,
the reference level list of this variable will be listed in the window. If
there is no reference level list, then it means that this variable is not
referenced, as shown in the figure below:
Select the new variable to substitute the original variable from the
“NewVariable” field, and then select the variable to substitute in the
reference level list (preset to select all). Users may press the “Select
All” button to select all, and then press the “Replace” button to
perform variable substitution. Substituted result is as shown in the
figure below:
※ Variable substitution is not supported for variables associated with
historic curves and reports.
6.7 Variables statistics
Variable statistics is the statistics for the total number of variables
in the project and the usage situations of the variables.
Ø Right-click the “VariableDictionary” node in the project window tree
index and then click the “Variable Statistics” from the right-click
menu, or click the “Variable Statistics” in the right-click menu of the
variable group node to open the variable statistics window, as shown
in the figure below:

Click the “Clean Non-Referenced Variables” button to delete all
unused variables in the variable dictionary.
6.8 Variable parameter setting
Variable parameter setting , display the variable value in the event
of a communication failure.
Ø Right-click the “VariableDictionary” node in the project window tree
index and then click the “Variable Parameter Setting” from the right-
click menu. The system will open the variable parameter setting
window, as shown in the figure below:



1.Analog
Click the drop-down list on the right of Analog,and the option of
display value of analog pops up,as shown in the figure below:


² KeepPreviousValue:In the event of a communication failure,the
variable displays the previous value.
² 0:In the event of a communication failure,the variable displays
0.
² -9999:In the event of a communication failure,the variable
displays -9999.
2.Digital
Click the drop-down list on the right of Digital,and the option of
display value of analog pops up,as shown in the figure below:


² KeepPreviousValue:In the event of a communication failure,the
variable displays the previous value.
² True:In the event of a communication failure,the variable
displays True.
² False:In the event of a communication failure,the variable
displays False.
3.String
Click the drop-down list on the right of String,and the option of
display value of analog pops up,as shown in the figure below:


² KeepPreviousValue:In the event of a communication failure,the
variable displays the previous value.
² ????:In the event of a communication failure,the variable
displays ????.
6.9 Variables browser
The variable browser is the window that displays all variables in the
"Variable dictionary”; many functions in the DIAView project need to
use variables. For example, configurations such as recipes and
variable operations etc. need associated variables, so “Variable
Browser” can be opened to search for the variable that needs to be
used, as shown in the figure below:

Once the “Variable Browser” is opened, all variable groups in the


project will be displayed in the left part of the tree index; press the
variable group and all variables in the variable group will be displayed
in the right part of the window. Click and select the variable and then
press the “OK” button, or double-click the variable need to select the
variable and use it.
Toolbar
Step 1:Toolbar button and the add variable group dialog
will pop-up, which allows you to add variable groups:

Step 2:Edit variable, press the button and the variable editor
window will pop-up, which allows you to perform variable operations:
Step 3:Variable type filter, the background of the button will change to
blue when selected ,which means display
all this type of variables in the variable dictionary; when it is not
selected, it means do not display this type of variables: a. Only
browse “Analog value”
b. Browse “Analog value” and “Digital value”
Step 4:Search variable, enter the variable
name keyword in the input frame to search for variables in real-
time.
6.10 Expressions
Expressions are meaningful arrangement method combinations of digits,
operators, digital grouping symbols (brackets etc.) and variables used to
determine a value.
Expressions are used for configuring animations and events in the DIAView
software project and writing user program scripts etc. Operations such as logical
operations, arithmetic operations and relational operations and performed through
expressions to generate a new result for the program to use in order to satisfy the
configuration needs of project animations, events and scripts, and achieve certain
functions in the project.
Common operators used in expressions:

Type Operator Discription Example Result Priority

^ power 5^2 25

* product 80*2 160

/ quotient, the 5/3 2.5


result is float
divisor, returns
Arithmetic \ the integer part 20\6 3
operator of quotient
Seeking mode, From high
Mod returns the 20Mod6 2 to low
remainder (relational
operators
+ summation 50+50.1 100.1
have
- 50-50.1 -0.1 the same
differencing priority);
Connects two student, small
& "stu"&"dent","1"&2 brackets
strings (& has 12
can be
the used to
String function to change
operator automatically
+ "1"+"2" 12 the priority
covert to of
string operations.
operations)
Relational < Less than 4<7 True
(comparison) <= Less than or 39<=10 False
operators equal to
> Greater than "abc">"abced" False

>= Greater than or 39>=10 True


equal to
= Equal to "A"="a" False

<> Not equal to 9<>8 True

Logical “Not”
operator operations
(performs
logical Not 39>10 False
Not negation
Not 10>39 True
operations to
the
expression to
the right)
“And”
operations (if
the conditional
operations of
both sides of
the And
And operator are 39>10 And 8>10 False
valid
simultaneously,
it
will return
True; or else it
will return
False)
Or “Or” operations 39>10 Or 8>10 True
(if the
conditional
operations of
both sides of
the Or
operator are
invalid
simultaneously,
it will return
False; or else it
will return
True)
1 Xor 1
False
0 Xor 1
True
Xor “Xor” 1 Xor 0
operations True
1 Xor 1
False

0 Eqv 0 True
0 Eqv 1 False
Eqv “Equivalent”
operations 1 Eqv 0 False
1 Eqv 1 True

0 Imp 0 True

“Implication” 0 Imp 1 True


Imp
operations 1 Imp 0 False
1 Imp 1 True

Expression editing window used for configuring animations:


Conditional expression editing window used for configuring animations and
conditional programs:

The meanings of each item in the window are as follows (the “Variable
dictionary” node is selected in the figure):
1. Project object tree index window: Includes objects such as system variables,
project variable dictionary, alarm and communication etc.
2. System function tree index window: Includes system functions.
3. Object list: Display area of the list of variable and other objects; double-clicking
an object allows it to be used.
4. Object properties list (this list is displayed according to the object selected): The
display area of the object property list; double-clicking an object property allows
it to be used.
5. Expression editing window: Allows editing of expressions.
6. Expression operator and digital button area: Selected operators and digits etc.
can be used.
7.1 Overview
Graphical interface development refers to draw vividly field
facilities, equipment, site structure and instruments etc. on the
DIAView, forming a stimulation picture of the industrial field. It can
even configure and connect data acquisition equipments such as
field equipment and instruments to display the data on the window in
real-time, making it easy for workers to monitor the field status.
Simulator switches and controllers etc in the window interface can
also be used to transmit commands and control field equipment .

Graphical interface development is an important part to realize


monitoring and control systems; it is the core of the project that
integrates various resources of the system to achieve function
requirements of the project. Its effect is to make the window become
the platform to display system information in realtime and allow
system administrators to perform system operation controls.

The basic component of the graphical interface is called “graphics”


or “graphic objects”. The DIAView window provides a drawing
sketchpad and tools for drawing, including basic graphic
components, control units and graphic models etc.; it also provides
windows to configure graphic object properties, animations and
events, providing an operating platform for graphical interface
development.
7.2.1.1 Window root node operation
In the DIAView, windows are core components to perform field
stimulation picture drawing, parameter configuration and data display;
it is the basis to achieve DIAView visualization.

Function introduction of right-click menu item of window root node:

1.Add window:Create a new blank window with the default name

Right-click on the “Window” node in the project window tree index


and then click the “New Window” item in the right-click menu, as
shown in the figure below:

After clicking “New Window”, the system will generate a window sub-
node under the “Window” node using a default name, and the new
window will be opened in the sketchpad work area, as shown in the
figure below:

2.Add template window:Select the required window template to


generate a new window as a prototype.

Right click the "Window" node in the tree directory of the project
window, and click the "New Window From Templates" item in the
right-click menu, as shown in the figure below:

After clicking "New Window From Templates", the template selection


page will pop up. Select the required window template and click OK.
A window sub node with default name will be generated under the
"Window" node:(marks 1-3 correspond to system templates, user-
defined template and window template display area respectively)

3.Add window group: In the project, windows of different types


and purposes can be grouped and managed by creating a new
window group.

Right click the "window" node in the tree directory of the project
window, and click the "new window group" item in the right-click
menu, as shown in the figure below:
After clicking “New Window Group”, the system will generate a
window sub-node under the “Window” node using a default name, as
shown in the figure below:
4.Export window:Export the window to the specified location,
select the window node, right-click, and click "Export Window" in the
right-click menu.

5.Import window:Import window to window node, select window


node, right-click, and click "Import Window" in the right-click menu.

6.Paste:Paste the copied window under the window node, select the
window node, right-click, and click Paste in the right-click menu.

7.Extract multi language:Extract strings, pictures and sounds in


all windows of the project into multilingual resources. In the tree
directory of the project window, select the window node, right-click,
and click "Extract Multi Language" in the right-click menu.
8.Manage window templates:It is convenient for users to view,
rename, delete, import and export window templates.

Right click the "Window" node in the tree directory of the project
window, and click the "Manage Window Templates" item in the right-
click menu, as shown in the figure below:

On the manage window templates page, you can perform new,


delete, import, export, rename, zoom in, zoom out and other
operations on the template group and template window.
9.Global shortcut program:For global shortcut program, see "
9.11 Shortcut program event "
7.2.1.2 Window operation
1.Open window:
When a new window is added, it will automatically be opened at the
sketchpad work area;
If the window already exists in the “Window” node, a window sub-
node can be opened by double clicking on it. Several windows can be
opened simultaneously in the sketchpad work area, as shown in the
figure below:


2.Close window:
There are several ways to close a window:
Method 1: To close an opened window in the sketchpad work area,
simply click the“ ​”to the right of the window name:

Method 2:In the sketchpad work area, select the closing method (3
types) from the field to the right of the opened window:
1. Close: Closes the current window
2. Close All But This: Closes all other windows besides the current
window
3. Close All: Closes all windows

3.Copy window:
Select the window node to copy in the project window tree index
and right-click on it, and the select the “Copy” item from the right-click
menu, completes the copy window,as shown in the example in the
figure below:

If users want to paste it,click the right-key at the "Window" root
node,select the "Paste" item from the right-click menu,as shown in
the figure below:


4.Delete window:
Select the window node to delete from the project window tree
index and right-click on it, then select the “Delete” item from the right-
click menu to delete the window:


5.Rename window:
Select the window node to rename in the project window tree index
and right-click on it, and the select the “Rename” item from the right-
click menu. The window name will become an editable status and just
input the new window name, as shown in the example in the figure
below:

​² Window naming rules:


(1) Composed of English letters, numbers, Chinese characters and
underscore, and can only begin with an English letter or Chinese
character;
(2) Not case sensitive;
(3) The length cannot exceed 100 characters and cannot exceed
25 Chinese characters;
(4) The names of windows under the same project cannot be
repeated.
6.Extract Multi Language:
Extracts strings, images, and sounds from a window into a
multilingual resource.In the project window tree directory, select the
window node to be operated, right-click, and click "extract multi-
language" in the right-click menu, as shown in the figure below:

7.Save As Window Template:
In the tree directory of the project window, select the window to be
collected, right-click, and click "Save As Window Template" in the
right-click menu, as shown in the figure below:
​Enter the template name and description, select the template group
where the template is stored, and click OK to save


8.Canvas:
The canvas where users draw and arrange the size, location and
layer of graphical controls. It also supports many auxiliary operations,
such as adding and changing selected controls, previewing locations
of dragged controls, limiting boundaries of moved controls, and auto
adjustment the offset value of the visiable work area etc.
7.2.1.3 Window group operation
In DIAView configuration software, windows of different types and
purposes can be grouped and managed. Window group operation is
the operation of the current grouping.

New Window: Create multiple blank windows under the window


group. Select the window group node, right-click, and click "New
Window" in the right-click menu.
New Window From Templates:Multiple template windows can be
created under the window group. Select the window group node,
right-click, and click "New Window From Template" in the right-click
menu.
New Window Group:This refers to nest a created window group
under a window group; select a window group node, right-click on it
and then select the “New Window Group” item from the right-click
menu.
Export Window:This refers to export a window from a window
group; select a window group node, right-click on it and then select
the “Export Window” item from the right-click menu.
Import Window:This refers to import a window under a window
group; select a window group node, right-click on it and then select
the “Import Window” item from the right-click menu.
Paste:Paste the copied window into the current window group.
Delete:Delete a window group; select the window group node to
delete, right-click on it and then select the “Delete” item from the
right-click menu.
Rename:Rename the window group name. Select the window group
node to rename, right-click on it and then select the “Rename” item
from the right-click menu. The window name will become an editable
status and just input the new window name.Window group naming
rules are the same as window naming.
Extract Multi Language:Extracts strings, images, and sounds from
a window into a multilingual resource.In the project window tree
directory, right-click to select the window group node to operate on,
and in the right-click menu, click the extract multilingual item.Window
group naming rules are the same as window naming.
7.2.1.4 Window basic properties
Once a window is opened, click on an empty space on the
sketchpad to display the properties of the window in the “Property
window”, as shown in the figure below:

Basic properties of windows:

Ø Grid display: Whether to display grid of the window


sketchpad. Displaying grids makes it easier to align and arrange
the positions of graphic objects for graphic interface
development. Grids are only visible in the development
environment, and are invisible during system execution.

Ø Background: Sets the background color of the sketchboard.


Fill styles include: monochrome, icons, images, gradient
brushes and radiation brushes etc.
Ø Name: Name of the window; it is the same name as the
window node in the project window tree index.

Ø Title: Displays the title name of this window as a dialog


box.For example, execute the script
HMICmd.OpenDialogWindow ("Window0").

Ø Location: Sets the display location of the window during


execution.

Ø Size: Sets the width and height (unit: pixels) of the window.
7.2.2.1 Web window root node
In the DIAView, windows are core components to perform field
stimulation picture drawing, parameter configuration and data
display; it is the basis to achieve DIAView visualization.
1.Steps to add window:
Right-click on the “Web Window” node in the project window tree
index and then click the “New Web Window” item in the right-click
menu, as shown in the figure below:

After clicking “New Web Window”, the system will generate a window
sub-node under the “Web Window” node using a default name, and
the new window will be opened in the sketchpad work area, as
shown in the figure below:
2.Add new window group steps: The window group is a unit to
perform grouped management of windows; group management can
be performed to the different types and uses of windows in the
project.
Step 1:Right-click on the “Web Window” node in the project window
tree index and then click the “New Web Window Group” item in the
right-click menu, as shown in the figure below:


Step 2:After clicking “New Web Window Group”, the system will
generate a window sub-node under the “Web Window” node using a
default name, as shown in the figure below:

3.Export Web Window


This refers to export a web window from a web window group;
select a web window group node, right-click on it and then select the
“Export Web Window” item from the right-click menu.
4.Import Web Window
This refers to import a web window under a web window group;
select a web window group node, right-click on it and then select the
“Import Web Window” item from the right-click menu.
5.Paste
Paste the copied web window into the current web window group.

7.2.2.2 Web window operation
1.Open window
When a new window is added, it will automatically be opened at the
sketchpad work area;
If the window already exists in the “Web Window” node, a window
sub-node can be opened by double clicking on it. Several windows
can be opened simultaneously in the sketchpad work area, as shown
in the figure below:
2.Close window
There are several ways to close a window:
Method 1: To close an opened window in the sketchpad work area,
simply click the“ ​”to the right of the window name:

Method 2:In the sketchpad work area, select the closing method (3
types) from the field to the right of the opened window:
1. Close: Closes the current window
2. Close All But This: Closes all other windows besides the current
window
3. Close All: Closes all windows
3.Copy window
Select the window node to copy in the project window tree index
and right-click on it, and the select the “Copy” item from the right-click
menu, completes the copy window,as shown in the example in the
figure below:


If users want to paste it,click the right-key at the "Web Window" root
node,select the "Paste" item from the right-click menu,as shown in
the figure below:

4.Delete window:
Select the window node to delete from the project window tree
index and right-click on it, then select the “Delete” item from the right-
click menu to delete the window:


5.Rename window
Select the window node to rename in the project window tree index
and right-click on it, and the select the “Rename” item from the right-
click menu. The window name will become an editable status and just
input the new window name, as shown in the example in the figure
below:

​² Window naming rules:


(1) Composed of English letters, numbers, Chinese characters and
underscore, and can only begin with an English letter or Chinese
character;
(2) Not case sensitive;
(3) The length cannot exceed 100 characters and cannot exceed
25 Chinese characters;
(4) The names of windows under the same project cannot be
repeated.
7.2.2.3 Web window group operation
Multiple web windows can be added under a web window group;
select the web window group node, right-click on it and then click the
“New Web Window” item from the right-click menu, as shown in the
figure below:

​New Web Window Group


This refers to nest a created web window group under a web
window group; select a web window group node, right-click on it and
then select the “New Web Window Group” item from the right-click
menu.
Export Web Window
This refers to export a web window from a web window group;
select a web window group node, right-click on it and then select the
“Export Web Window” item from the right-click menu.
Import Web Window
This refers to import a web window under a web window group;
select a web window group node, right-click on it and then select the
“Import Web Window” item from the right-click menu.
Paste
Paste the copied web window into the current web window group.
Delete
Delete a web window group; select the web window group node to
delete, right-click on it and then select the “Delete” item from the
right-click menu.
Rename
Rename the web window group name. Select the web window group
node to rename, right-click on it and then select the “Rename” item
from the right-click menu. The web window name will become an
editable status and just input the new window name.
Window group naming rules are the same as window naming.
7.2.2.4 Web window basic properties
Once a window is opened, click on an empty space on the
sketchpad to display the properties of the window in the “Property
window”, as shown in the figure below:

Basic properties of windows:

² Name: Name of the window; it is the same name as the window


node in the project window tree index.

² CenterOnScreen: Set whether this window is centered on the


screen at runtime.

² FillColor: Sets the background color of the sketchboard. Fill


styles include: monochrome, icons, images, gradient brushes
and radiation brushes etc.
² Title: Displays the title name of this window as a dialog
box.For example, execute the script
HMICmd.OpenDialogWindow ("Window0").

² Location: Sets the display location of the window during


execution.

² Size: Sets the width and height (unit: pixels) of the window.
7.3 Graphic universal properties
All graphic objects have shared properties including names,
coordinates, sizes and display etc., and some graphic objects have
their own unique properties (graphic properties listed in section 7.5
and 7.6 are unique properties of those graphics). Universal
properties of graphic objects in the DIAView software are as follows:

² Name: Name of the graphic in the sketchpad; the names of graphic


objects in the same sketchpad cannot be repeated.

Naming rules:

(1) Composed of English letters, numbers, Chinese characters and


underscore,and the name must start with English letters or Chinese
characters.

(2) Not case sensitive.

(3) Spaces,periods,exclamation marks and special characters


such as @$#&*? etc. cannot be used in the name.

(4) The length cannot exceed 200 English letters and cannot
exceed 25 Chinese characters.

(5) Cannot be the same as the name of the window where the
graphic object is located.Cannot be the same as the name of the
other objects in the same window.

(6) The name only supports three languages:Simplified Chinese,


Traditional Chinese and English.
² Display: Whether to display or hide the graphic during execution.
² Lock: Whether to lock the graphic; once it is locked, mouse
operations will become invalid, operations can only be performed
to other properties of that graphic from the property frame. Dotted
line frame will appear around the graphics that are locked.
² Security zone: Sets operating authorities for the graphic; allows
the graphic to belong to one or several security zone in order to
perform user rights management.
² Fill color: Sets the fill color inside the graphic.
² Fill level direction: The horizontal fill direction when filling inside
the graphic (from left to right/from right to left/from middle to the
edges).
² Fill level ratio: The graphic width ratio of the part to be filled;
ranges between 0 to 1 up to two decimal places. The default
value is 1.
² Vertical fill direction: The vertical fill direction when filling inside
the graphic (from top to bottom/from bottom to top/from middle to
the edges).
² Vertical fill ratio: The graphic height ration of the part to be filled;
ranges between 0 to 1 up to two decimal places. The default
value is 1.
² Coordinates: The X coordinate and Y coordinate of the graphic in
the sketchboard.
² Size: The width and height of the graphic (unit: pixels).
² Horizontal distortion: The distortion level of the graphic in the
horizontal direction; ranges between - 80 to 80 up to two decimal
places. The default value is 0.
² Vertical distortion: The distortion level of the graphic in the vertical
direction; ranges between -80 to 80 up to two decimal places.
The default value is 0.
² Horizontal zoom: The zooming level of the graphic horizontally;
ranges between 0.1 to 100 up to two decimal places. The default
value is 1.
² Vertical zoom: The zooming level of the graphic vertically; ranges
between 0.1 to 100 up to two decimal places. The default value is
1.
² Horizontal offset: Graphic position offsets to the left or right
horizontally; a positive value offsets it to the right and a negative
value offsets it to the left. The default value is 0.
² Vertical offset: Graphic position offsets to the top or bottom
vertically; a positive value offsets it to the bottom and a negative
value offsets it to the top. The deafault value is 0.
² Center: The ratio between the X and Y coordinates of the center of
the graphic to the width and height of the graphic. The default
value is 0.5,0.5.
² Rotation angle: Rotation angle of the graphic (unit: degrees).
² Line: When the graphic has border lines, it sets the properties of
the boarder lines including the style, thickness and color etc.
² Transparency: Sets the transparency of the graphic; ranges
between 0 to 1 up to two decimal places. The default value is 1.
² Background color: Sets the background color of the graphic.
² Tooltip:Sets the content of the prompt when the mouse hovers
over the graphics,Support for multilingual functionality.
Noted: Supporting modifying properties of mutiple itens at the same
time
7.4.1 Line

Ø Open the window interface and click on “Toolbox” → “Basic


Graphics” → “Line” in the tools window to the left; the toolbar as
shown in the figure above.

Ø Move the mouse to the working area of the window, select a


starting point and press the left mouse button and drag the
mouse (the straight line is already drawn at this point). If press
the shift key while dragging the mouse, it would be allowed to
draw the line with mutiples of 15°. After releasing the left mouse
button, the drawing of a straight line is complete, and a straight
line will be generated.

Ø Just repeat the steps above if another straight line needs to be


drawn.

Graphic introduction:

F The figure above is a straight line under editing status; press the
stright line with the mouse under non-editing status to enter the
editing status.
F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.

F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.
Straight line properties
² For property settings please refer to the section “7.3 Graphic
universal properties”.
7.4.2 Rectangle

Ø Open the window interface and click on “Toolbox” → “Basic


Graphics” → “Rectangle” in the tools window to the left. The
toolbar is as shown in the figure above.

Ø Move the mouse to the working area of the window, select a


starting point and press the left mouse button and drag the
mouse towards the bottom-right (the rectangle is already drawn at
this point). After releasing the left mouse button, the drawing of a
rectangle is complete, and a rectangle will be generated.

Ø Just repeat the steps above if another rectangle needs to be


drawn.

Graphic introduction:

F The figure above is a selected rectangle; click the mouse on the


rectangle when under the unselected status to enter the selected
status.
F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.

F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.
Rectangle properties
² For property settings please refer to the section “7.3 Graphic
universal properties”.
7.4.3 RoundedRectangle

Ø Open the window interface and click on “Toolbox” → “Basic


Graphics” → “RoundedRectangle” in the tools window to the left;
the toolbar is as shown in the figure above.

Ø Move the mouse to the working area of the window, select a


starting point and press the left mouse button and drag the
mouse towards the bottom-right (the rounded rectangle is already
drawn at this point). After releasing the left mouse button, the
drawing of a rounded rectangle is complete, and a rounded
rectangle will be generated.

Ø Adjusting the round angles of the rounded rectangle: Move the


mouse on top of the blue diamond adjustment point and then left-
click on it and drag the adjustment point; the closer you drag it to
the center of the graphic the larger the round angle will be, and
when the adjustment point lines on the edge of the graphic it will
become a rectangle.

Ø Just repeat the steps above if another rounded rectangle needs to


be drawn.

Graphic introduction:
F The figure above is a selected rounded rectangle; click the mouse
on the rounded rectangle when under the not selected status to
enter the selected status.

F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center, 11 and 12 are the
adjustment points to adjust the shape of the round angle.

F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.
Rounded rectangle properties
² Arc of the horizon: Sets the ratio between the radius of the round
angle and the width of the graphic (value range: 0 ~ 100).

² Arc of the vertical: Sets the ratio between the radius of the round
angle and the height of the graphic (value range: 0 ~ 100).

² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.4.4 Ellipse

Ø Open the window interface and click on “Toolbox” → “Basic


Graphics” → “Ellipse” in the tools window to the left; the toolbar is
as shown in the figure above.

Ø Move the mouse to the working area of the window, select a


starting point and press the left mouse button and drag the
mouse towards the bottom-right (the ellipse is already drawn at
this point). After releasing the left mouse button, the drawing of a
ellipse is complete, and a ellipse will be generated.

Ø Just repeat the steps above if another Ellipse needs to be drawn.

Graphic introduction:

F The figure above is a selected ellipse; click the mouse on the


ellipse when under the not selected status to enter the selected
status.
F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.

F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.
Ellipse properties
² For property settings please refer to the section “7.3 Graphic
universal properties”.
7.4.5 Polyline

Ø Open the window interface and click on “Toolbox” → “Basic
Graphics” → “Polyline” in the tools window to the left; the toolbar
is as shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and click the mouse. Move the mouse to another
point and left-click the mouse (the polyline is drawn at this point),
left-click the mouse to generate a polyline point of the polyline
and draw polyline points according to your needs. If press the
shift key while moving the mouse, it would be allowed to draw the
polyline with mutiples of 15°. Double-click the left mouse button to
finish the drawing of a polyline and generate the polyline.
Ø Just repeat the steps above if another polyline needs to be drawn.
Graphic introduction:


F The figure above is a selected polyline; click the mouse on the
polyline when under the not selected status to enter the selected
status.
F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

F The figure above is an adjustable polyline; double-click the mouse
on the polyline when under the unadjustable status to enter the
adjustable status.
F In figure, 1 is the starting point, 2 and 3 are the polyline points and
4 is the ending point; when the mouse is moved on top of a point,
the mouse cursor will change to“ ​”。Press and hold the left
mouse button and move the position of the point to adjust the
shape of the polyline.
Polyline properties
² For property settings please refer to the section “7.3 Graphic
universal properties”
7.4.6 Polygon

Ø Open the window interface and click on “Toolbox” → “Basic
Graphics” → “Polygon” in the tools window to the left; the toolbar
is as shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and click the mouse. Move the mouse to another
point and left-click the mouse to draw one side of the polygon (the
polygon is drawn at this point), draw the inflections according to
the shape of the polygon required. Every time the left mouse
button is pressed, the inflection of one side will be drawn. Double-
click the left mouse button to end the drawing of a polygon and
generate the polygon.
Ø Just repeat the steps above if another polygon needs to be drawn.
Graphic introduction:


F The figure above is a selected polygon; click the mouse on the
polygon when under the not selected status to enter the selected
status.
F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.


F The figure above is an adjustable polygon; double-click the mouse
on the polygon when under the unadjustable status to enter the
adjustable status.
F In the figure, 1 is the starting point, 2 and 3 are the inflection points
and 4 is the ending point; when the mouse is moved on top of a
point, the mouse cursor will change to “ ​”.Press and hold the
left mouse button and move the position of the point to adjust the
shape of the polygon.
Polygon properties
² For property settings please refer to the section “7.3 Graphic
universal properties”.
7.4.7 BezierCurve

Ø Open the window interface and click on “Toolbox” → “Basic


Graphics” → “BezierCurve” in the tools window to the left; the toolbar
is as shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mousebutton and drag the mouse
towards the bottom-right (the BezierCurve is already drawn at this
point). After releasing the left mouse button, the drawing of a
BezierCurve is complete, and a BezierCurve will be generated.
Ø Just repeat the steps above if another bezier needs to be drawn.
Graphic introduction:

F The figure above is a selected bezier; click the mouse on the


bezier when under the not selected status to enter the selected
status.
F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.
F The figure above is an adjustable bezier; double-click the mouse
on the polygon when under the unadjustable status to enter the
adjustable status.
F The figure, 1 is the starting point, 2 and 3 are the inflection points
and 4 is the ending point; when the mouse is moved on top of a
point, the mouse cursor will change to“ ”,Press and hold the left
mouse button and move the position of the point to adjust the shape
of the bezier.
Bezier properties
² For property settings please refer to the section “7.3 Graphic
universal properties”.
7.4.8 ClosedCurve

Ø Open the window interface and click on “Toolbox” → “Basic


Graphics” → “ClosedCurve” in the tools window to the left; the
toolbar is as shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and click the mouse. Move the mouse to another point
and left-click the mouse to draw one side of the closed curve (the
closed curve is drawn at this point), draw the inflections according to
the shape of the closed curve required. Every time the left mouse
button is pressed, the inflection of one side will be drawn. Double-
click the left mouse button to end the drawing of a closed curve and
generate the closed curve.
Ø Just repeat the steps above if another closed curve needs to be
drawn.
Graphic introduction:

F The figure above is a selected closed curve; click the mouse on


the closed curve when under the not selected status to enter the
selected status.
F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

F The figure above is an adjustable closed curve; double-click the


mouse on the closed curve when under the unadjustable status to
enter the adjustable status. F In the figure, 1 is the starting point, 2
and 3 are the inflection points and 4 is the ending point; when the
mouse is moved on top of a point, the mouse cursor will change to“
”.Press and hold the left mouse button and move the position of
the point to adjust the shape of the polygon.
Polygon properties
² For property settings please refer to the section "7.3 Graphic
universal properties".
7.4.9 Arc

Ø Open the window interface and click on “Toolbox” → “Basic
Graphics” → “Arc” in the tools window to the left; the toolbar is as
shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right (the arc is already drawn at this point). After
releasing the left mouse button, the drawing of an arc is complete,
and an arc will be generated.
Ø Adjusting the lenth of the arc: Double click the arc to enter the
adjustable status; place the mouse on any of the yellow diamond
adjustment point, press and hold the left mouse button to drag the
adjustment point to change the length of the arc.
Ø Just repeat the steps above if another arc needs to be drawn.
Graphic introduction:


F The figure above is a selected arc; click the mouse on the arc
when under the not selected status to enter the selected status.
F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

F The figure above is an adjustable arc; double-click the mouse on
the arc when under the unadjustable status to enter the adjustable
status.
F Points 1 and 2 in the figure are adjustment points to adjust the
length of the arc; when the mouse moves on top of a point, the
mouse cursor will change to“ ​”,Press and hold the left mouse
button and drag the position of the adjustment point to adjust the
length of the arc.
Arc properties
² Starting angle: Sets the starting angle of the arc length (unit:
degrees).
² Scan angle: Sets the ending angle of the arc length (unit: degrees).
² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.4.10 Arch

Ø Open the window interface and click on “Toolbox” → “Basic
Graphics” → “Arch” in the tools window to the left; the toolbar is as
shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right (the arch is already drawn at this point).
After releasing the left mouse button, the drawing of an arch is
complete, and an arch will be generated.
Ø Adjusting the angle of the arc: Double click the arc to enter the
adjustable status; place the mouse on any of the yellow diamond
adjustment point, press and hold the left mouse button to drag the
adjustment point to change the angle of the arc.
Ø Just repeat the steps above if another arch needs to be drawn.
Graphic introduction:


F The figure above is a selected arch; click the mouse on the arch
when under the not selected status to enter the selected status.
F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.


F The figure above is an adjustable arch; double-click the mouse on
the arch when under the unadjustable status to enter the adjustable
status.
F Points 1 and 2 in the figure are adjustment points to adjust the
angle of the arch; when the mouse moves on top of a point, the
mouse cursor will change to“ ​”. Press and hold the left mouse
button and drag the position of the adjustment point to adjust the
angle of the arch .
Arch properties
² Starting angle: Sets the starting angle of the fan-shape angle (unit:
degrees)
² Scan angle: Sets the ending angle of the fan-shape angle (unit:
degrees)
² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.4.11 Pie

Ø Open the window interface and click on “Toolbox” → “Basic


Graphics” → “Pie” in the tools window to the left; the toolbar is as
shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right (the pie is already drawn at this point). After
releasing the left mouse button, the drawing of a pie is complete, and
a pie will be generated.
Ø Adjusting the angle of the pie: Double click the pie to enter the
adjustable status; place the mouse on the yellow diamond
adjustment point, press and hold the left mouse button to drag the
adjustment point to change the angle of the pie.
Ø Just repeat the steps above if another pie needs to be drawn.
Graphic introduction:

F The figure above is a selected pie; click the mouse on the pie
when under the not selected status to enter the selected status.
F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.
F The figure above is an adjustable pie; double-click the mouse on
the pie when under the unadjustable status to enter the adjustable
status.
F Points 1 and 2 in the figure are adjustment points to adjust the
angle of the pie; when the mouse moves on top of a point, the
mouse cursor will change to“ ”.Press and hold the left mouse
button and drag the position of the adjustment point to adjust the
angle of the pie.
Pie properties
² Starting angle: Sets the starting angle of the pie angle (unit:
degrees).
² Scan angle: Sets the ending angle of the pie angle (unit: degrees).
² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.4.12 Pipe

Ø Open the window interface and click on “Toolbox” → “Basic


Graphics” → “Pipe” in the tools window to the left; the toolbar is as
shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and click the mouse. Move the mouse to another point
and left-click the mouse (the pipe is drawn at this point), left-click the
mouse to generate an inflection point of the pipe and draw inflection
points according to shape of the pipe needed. If press the shift key
while moving the mouse, it would be allowed to draw the pipe with
mutiples of 15°. Double-click the left mouse button to finish the
drawing of a the pipe and generate the pipe.
Ø Just repeat the steps above if another pipe needs to be drawn.
Graphic introduction:

F The figure above is a selected pipe; click the mouse on the tube
when under the not selected status to enter the selected status.
F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.
F The figure above is an adjustable pipe; double-click the mouse on
the pie when under the unadjustable status to enter the adjustable
status.
F In the figure, 1 is the starting point, 2 is the inflection point to adjust
the shape of the pipe and 3 is the ending point; when the mouse is
moved on top of a point, the mouse cursor will change to“ ”.Press
and hold the left mouse button and move the position of the point to
adjust the shape of the pipe.
Pipe properties
² Whether to flow positively: Sets the direction which the liquid inside
the pipe flows; check it for positive flowing and uncheck for reverse
flowing.
² Liquid color: Sets the color of the liquid inside the pipe.
² Liquid width: Sets the sectional width of the liquid inside the pipe,
which is the liquid flow.
² Pipe color: Sets the color for the exterior of the pipe.
² Pipe width: Sets the diameter of the pipe.
² For other property settings please refer to the section “7.3 Graphic
universal properties".
7.4.13 Text

Ø Open the window interface and click on “Toolbox” → “Basic


Graphics” → “Text” in the tools window to the left; the toolbar as
shown in the figure above.

Ø Move the mouse to the working area of the window, select a


starting point and press the left mouse button and drag the mouse
towards the bottom-right (the text outline is already drawn at this
point);after releasing the left mouse button, the drawing of a text is
complete, and a text will be generated.

Ø Just repeat the steps above if another text needs to be drawn.

Graphic introduction:

F The figure above is a selected text; click on the text to enter


selected status.

F There are two points on 1 in the figure above: the tensile point and
the center; 2-8 are the tensile points to adjust the graphic size; 9 is
the rotation point.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

Text properties

² Content: Text contents of the text,Support for multilingual


functionality.

² Auto zoom: Sets whether the text content will zoom according to
the zooming size of the frame.

² Font: Sets the font format of the text; for example font style, size
and bold etc.

² Text color: Sets the color of the text.

² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.5.1 Button

Ø Open the window interface and click on “Toolbox” → “Window
Controls” → “Button” in the tools window to the left; the toolbar is as
shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of a button is complete, and a button will be generated.
Ø Just repeat the steps above if another button needs to be drawn.

Graphic introduction:

F The figure above is a selected button; click on the button to enter


selected status.
F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.
Button properties
² Content: The text displayed on the button,Support for multilingual
functionality.
² Font: Sets the font format of the text displayed on the button; for
example font style, size and bold etc.
² Text color: Sets the text color of the button’s text.
² Border color: Sets the color of the button’s border.
² Account Check: Sets the runtime account confirmation
properties;None: user account password confirmation is not
required;General check: under the running environment, the
operation of the control requires an account password
confirmation;Double check: under the running environment, each
operation of this control requires account password confirmation.
² Enable: Sets the availability of the button.
² Default style: Set whether to use the default style of button(the
default style of button owns some animation,but it may conflict with
customer background animation.User can choose depending on the
circumstances).
² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.5.2 CheckBox

Ø Open the window interface and click on “Toolbox” → “Window


Controls” → “CheckBox” in the tools window to the left; the toolbar is
as shown in the figure above.

Ø Move the mouse to the working area of the window, select a


starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of a check box is complete, and a check box will be
generated.

Ø Just repeat the steps above if another check box needs to be


drawn.

Graphic introduction:

F The figure above is a selected check box; click on the check box to
enter selected status.
F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.

F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

Check box properties

² Content: Text content of the check box options,Support for


multilingual functionality.

² Selected: Whether to allow the check box to be in a selected status.

² Font: Sets the font format of the check box; for example font style,
size and bold etc.

² Text color: Sets the color of the text in the check box.

² Enable: Sets the availability of the check box.

² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.5.3 ComboBox

Ø Open the window interface and click on “Toolbox” → “Window
Controls” → “ComboBox” in the tools window to the left; the toolbar
is as shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of a combo box is complete, and a combo box will be
generated.
Ø Just repeat the steps above if another combo box needs to be
drawn.

Graphic introduction:

F The figure above is a combo box; click on the combo box to enter
selected status.
F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

Combo box properties


² Text:Text content displayed in the combo box in a non-executing
environment,Support for multilingual functionality.
² Horizontal alignment: Sets the horizontal alignment method for the
text content of the combo box in an execution environment.
² Vertical alignment: Sets the vertical alignment method for the text
content of the combo box in an execution environment.
² Font: Sets the font format of the text in the combo box; for example
font style, size and bold etc.
² Text color: Sets the color of the text in the combo box.
² Border color: Sets the color of the border of the combo box.
² Enable: Sets the availability of the combo box.
² Read-only: Sets whether the combo box is read-only; it is read-only
if selected.

² Subset: Drop-down option contents of the combo box; click“ ​”,and


the subset editor shown in the figure below will appear:

(The “Add” button on the left adds a new member; the “Content” on
the right allows entering the text content of the member,support for
multilingual functionality.)
² Index: Sets the default option of the ComboBox.
² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.5.4 Label

Ø Open the window interface and click on “Toolbox” → “Window


Controls” → “Label” in the tools window to the left; the toolbar is as
shown in the figure above.

Ø Move the mouse to the working area of the window, select a


starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of a tag is complete, and a tag will be generated.

Ø Just repeat the steps above if another label needs to be drawn.

Graphic introduction:

F The figure above is a selected tag; click on the tag to enter


selected status.

F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.

F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

Tag properties

² Content: Text contents of the tag,Support for multilingual


functionality.

² Font: Sets the font format of the text in the tag; for example font
style, size and bold etc.

² Text color: Sets the color of the text in the tag.

² Enable: Sets the availability of the tag.

² Horizontal alignment: Sets the horizontal alignment of label text.

² Vertical alignment: Sets the vertical alignment of label text.

² Line feed: Sets the line feed method of the text of the tag (overflow
line feed, no execution line feed, perform line feed).

² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.5.5 TextBox

Ø Open the window interface and click on “Toolbox” → “Window
Controls” → “TextBox” in the tools window to the left; the toolbar is
as shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of a text box is complete, and a text box will be generated.
Ø Just repeat the steps above if another text box needs to be drawn.
Graphic introduction:


F The figure above is a selected text box; click on the text box to
enter selected status.
F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

Text box properties


² Content: Text contents of the text box,Support for multilingual
functionality.
² Font: Sets the font format of the text box; for example font style,
size and bold etc.
² Text color: Sets the color of the text in the text box.
² Border color: Sets the color of the text box’s border.
² Enable: Sets the availability of the text box
² Line feed: Sets whether it will automatically line feed when entering
text in the text box.
² Horizontal alignment: Sets the horizontal alignment of text in a text
box.
² Vertical alignment: Sets the vertical alignment of text in a text box.
² Line feed method: Sets the line feed method of the text in the text
box; there are 3 ways:
Overflow line feed: When there are both English and Chinese text
contents, if the length exceeds the length of the text box, change
rows if the content is Chinese. If the content is in English letters,
change rows if there is a space between letters and do not change
rows if there is no space in between.

No execution row change: Do not change rows when the length of


the inputted text exceeds the length of the text box.
Perform row change: Change rows when the length of the inputted
text exceeds the length of the text box.
² For other property settings please refer to the section “7.3 Graphic
universal properties”.
Difference between “text box” and “text”:
1. The text box has frames and the color of the frame and fill color
inside can be set; these cannot be done for texts;
2. The line feed method of the text content inside the text box can
be set, but line wrap cannot be performed for texts;
3. They have different “animation” configurations; for example
“rotating” and “zooming” animations can be configured for text but
these cannot be set for text boxes.
7.5.6 PasswordBox

Ø Open the window interface and click on “Toolbox” → “Window


Controls” → “PasswordBox” in the tools window to the left; the
toolbar is as shown in the figure above.

Ø Move the mouse to the working area of the window, select a


starting point and press the left mouse button and drag the mouse
towards the bottom-right. After releasing the left mouse button, the
drawing of the password box is complete, and the password box will
be generated.

Ø Just repeat the steps above if another passwordbox needs to be


drawn.

Graphic introduction:

F The figure above is a selected password box; click on the


password box to enter selected status.
F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.

F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

Password box properties

² Password: Password content that can be entered into the password


box.

² Font: Sets the font format of the password box; for example font
style, size and bold etc.

² Text color: Sets the color of the password box text.

² Border color: Sets the color of the border of the password box.

² Enable: Sets the availability of the password box.

² Horizontal alignment: Sets the horizontal alignment method of the


password box text.

² Vertical alignment: Sets the vertical alignment method of the


password box text.

² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.5.7 DateTimePicker

Ø Open the window interface and click on “Toolbox” → “Window
Controls” → “DateTimePicker” in the tools window to the left; the
toolbar is as shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of the date time picker is complete, and the date time picker
will be generated.
Ø Just repeat the steps above if another date time picker needs to
be drawn.

Graphic introduction:

F The figure above is a selected date time picker; click on the date
time picker to enter selected status.
F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.
F 11 is the text block of the date ,12 is the date increase and
decrease button and 13 is the date selection button.
Date time picker properties
² Date: Text contents displayed in the date time picker.
² Maximum value: Set the maximum value of the selected range.
² Minimum value: Set the minimum value of the selected range.
² Date format: Sets the display format of the date time picker.
² Alignment: Sets the alignment method of the date time picker text
box.
² Time interval: Set the time interval of the date time picker.
² Upper and lower buttton: Set the availability of the date time.
² DisplayCurrentTime.
² Read-only: Sets whether the date time picker is read-only.
² Font: Sets the font format of the text in the date time picker; for
example font style, size and bold etc.
² Text color: Sets the color of the text in the date time picker.
² Enable: Sets the availability of the date time picker.
² Alignment: Sets the alignment method of the date time picker.
² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.5.8 DatePicker

Ø Open the window interface and click on “Toolbox” → “Window


Controls” → “DatePicker” in the tools window to the left; the toolbar
is as shown in the figure above.

Ø Move the mouse to the working area of the window, select a


starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of the date picker is complete, and the date picker will be
generated.

Ø Just repeat the steps above if another date needs to be drawn.

Graphic introduction:

F The figure above is a selected date picker; click on the date picker
to enter selected status.

F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

F 11 is the text block of the date and 12 is the date selection button.

Date picker properties

² Text: Text contents displayed in the date text block.

² Start date: Sets the start date of the date selection range.

² End date: Sets the end date of the date selection range.

² First day of the week: Sets which day of the week is the first day of
the week in the date.

² Highlight today: Highlight today’s date in the date selection frame.

² Date format: Sets date display format of the date: There are two
formats: Short and Long.

² Font: Sets the font format of the text displayed on the date; for
example font style, size and bold etc.

² Text color: Sets the color of the text of the date.

² Border color: Sets the color of the date’s border.

² Enable: Sets the availability of the date.


² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.5.9 Calendar

Ø Open the window interface and click on “Toolbox” → “Window
Controls” → “Calendar” in the tools window to the left; the toolbar is
as shown in the figure above.
Ø Move the mouse to the working area of the window, select a
position and press the mouse to generate a calendar.
Ø Just repeat the steps above if another calendar needs to be
drawn.

Graphic introduction:


F The figure above is a selected calendar; click on the calendar to
enter selected status.

Calendar properties
² Date selection: The selected year, month and day from the
calendar displayed on the calendar with a base color.
² Start date: Sets the start date of the calendar.
² End date: Sets the end date of the calendar.
² First day of the week: Sets which day of the week is the first day of
the week on the calendar.
² Font: Sets the font format of the text displayed on the calendar; for
example font style, size and bold etc.
² Border color: Sets the color of the calendar’s border.
² Enable: Sets the availability of the calendar.
² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.5.10 Image

Ø Open the window interface and click on “Toolbox” → “Window


Controls” → “Image” in the tools window to the left; the toolbar is as
shown in the figure above.

Ø Move the mouse to the working area of the window, select a


starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of the image is complete, and the image will be generated.

Ø Just repeat the steps above if another image needs to be drawn.

Graphic introduction:

F The figure above is a selected image; click on the image to enter


selected status.

F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

Image properties

² TheImagePath:: Sets the source path of the image; press the“


”button to select,Support for multilingual functionality.

² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.5.11 GIFImage

Ø Open the window interface and click on “Toolbox” → “Window
Controls” → “GIFImage” in the tools window to the left; the toolbar is
as shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of the gif image is complete, and the gif image will be
generated.
Ø Just repeat the steps above if another gif image needs to be
drawn.

Graphic introduction:


F The figure above is a selected image; click on the image to enter
selected status.
F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

Image properties

² TheImagePath: Sets the source path of the image; press the“ ​


”button to select,Support for multilingual functionality.
² Enable:Sets image availability.
² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.5.12 NixieTube

Ø Open the window interface and click on “Toolbox” → “Window


Controls” → “NixieTube” in the tools window to the left; the toolbar is
as shown in the figure above.

Ø Move the mouse to the working area of the window, select a


starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of the nixie tube is complete, and the nixie tube will be
generated.

Ø Just repeat the steps above if another nixie tube needs to be


drawn.

Graphic introduction:
The figure above is a selected nixie tube; click on the nixie tube to
enter selected status.The control point usage is the same with other
controls.

Nixie tube properties

² Digit: Sets the digit displayed of the nixie tube integer part.

² FullDigit:Sets the total display digit of the NixieTube.

² Color: Sets the color of the NixieTube.

² Number: Set the value displayed of the NixieTube.

² Enable:Sets the digital tube availability.

For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.5.13 CurvedRuler​

Ø Open the window interface and click on “Toolbox” → “Window


Controls” → “CurvedRuler” in the tools window to the left; the toolbar
is as shown in the figure above.

Ø Move the mouse to the working area of the window, select a


starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of the CurvedRuler is complete, and the CurvedRuler will be
generated.

Ø Just repeat the steps above if another CurvedRuler needs to be


drawn.

Graphic introduction:
F The figure above is a selected CurvedRuler; click on the
CurvedRuler to enter selected status.
F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

CurvedRuler properties
Ø StartAngle:Sets the starting angle of the CurvedRuler (unit:
degrees).
Ø ScanAngle:Sets the scaning angle of the CurvedRuler (unit:
degrees).
Ø StartValue:Sets the starting value of the CurvedRuler.
Ø EndValue:Sets the ending value of the CurvedRuler.
Ø BigTickNumber:Sets the big tick number of the CurvedRuler.
Ø SmallTickNumber:Sets the small tick number of the CurvedRuler.
Ø TickHeight:Sets the tick height of the CurvedRuler.
Ø TickPosition:Sets the tick position of the CurvedRuler.
Ø IsTextShow:Sets whether text is displayed of CurvedRuler.
Ø IsArcShow:Sets whether arc is displayed of CurvedRuler.
Ø LineBrush:Sets the current color of CurvedRuler.
Ø Font:Sets the font format of the text displayed on the CurvedRuler.
Ø TextMargin:Sets the distance between text and surrounding lines.
Ø For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.5.14 Table​

Ø Open the window interface and click on “Toolbox” → “Window


Controls” → “Table” in the tools window to the left; the toolbar is as
shown in the figure above.

Ø Move the mouse to the working area of the window, select a


starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of the Table is complete, and the Table will be generated.

Ø Just repeat the steps above if another Table needs to be drawn.

Graphic introduction:

F The figure above is a selected Table; click on the Table to enter


selected status.
F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

Table properties
Ø FirstRowBackground: Sets background of the first row.
Ø FirstColumnBackground: Sets background of the first column(It
only works if the oblique line property is checked).
Ø DataBackground: Sets background of data area(It only works if the
row cross display property is unchecked).
Ø BorderStyle: Sets border style of the Table.
Ø GridStyle:Sets grid style of the Table.


Ø TableDesign: Sets the rows and columns of the Table.
Ø ObliqueLine: Sets whether to display the oblique line in the upper
left corner.
Ø RowCrossDisplay: Sets whether to enable row cross display.

Ø For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.5.15 UniBarcode

Ø Open the window interface and click on “Toolbox” → “Window
Controls” → “UniBarcode” in the tools window to the left; the toolbar
is as shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right. After releasing the left mouse button, the
drawing of the barcode is complete, and the barcode will be
generated.
Ø Just repeat the steps above if another UniBarcode needs to be
drawn.

Graphic introduction:


F The figure above is a selected UniBarcode; click on the
UniBarcode to enter selected status.
F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

UniBarcode properties
² Symbology: Sets the symbology of the UniBarcode.Currently
supports EAN, Code39, Codabar, Code128, etc.
² BarColor: Sets the bar color the UniBarcode .
² FillColor: Sets the fill color of the UniBarcode.
² Content: Sets the content of the UniBarcode.

² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.5.16 QRCode

Ø Open the window interface and click on “Toolbox” → “Window


Controls” → “QRCode” in the tools window to the left; the toolbar is
as shown in the figure above.

Ø Move the mouse to the working area of the window, select a


starting point and press the left mouse button and drag the mouse
towards the bottom-right. After releasing the left mouse button, the
drawing of the QRCcode is complete, and the barcode will be
generated.

Ø Just repeat the steps above if another QRCode needs to be


drawn.

Graphic introduction:
F The figure above is a selected QRCode; click on the QRCode to
enter selected status.

F Points 1-8 in the figure are the tensile points to adjust the graphic
size; 9 is the rotation point and 10 is the center.

F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

QRCode properties

² ImagePath: Sets the image file path of the QRCode, support multi-
language function.
² BarColor: Sets the bar color of the QRCode.

² FillColor: Sets the fill color of the QRCode.

² Content: Sets the content of the QRCode, currently only supports


characters, numbers, etc., not Chinese characters

² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.6.1 RealtimeChart

Ø Open the window interface and click on “Toolbox” → “Extended


controls” → “RealtimeChart” in the tools window to the left; the toolbar
as shown in the figure above.

Ø Move the mouse to the working area of the window, select a


starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of a real-time chart is complete, and a real-time chart will be
generated.

Ø Just repeat the steps above if another real-time chart needs to be


drawn.

Graphic introduction:
F The figure above is a selected real-time curve; click on the real-time
curve to enter selected status.
F There are two points on 1 in the figure above: the tensile point and
the center; 2-8 are the tensile points and 9 is the rotation point,10 is
the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.
F It is the toolbar on the top of the figure, which is mainly used to
operate the chart.
Usage of the toolbar

² Set series: ​configure the realtime chart in the runtime


environment

​² Stop: ​ ​stop loading the real-time curve

² Display positioning line: ​whether to display the position line

² Save: ​current chart is saved as picture

² Print: ​print current chart

² First: ​move to the left most side

² Farword: ​move left

² Page range: ​choose the section of the current chart

² Backward: move right

² Last: ​move to the right most side

² Fixed YAxis: ​Scroll the mouse to scale the horizontal axis ²

Fixed XAxis: ​Scroll the mouse to shrink the indulgence axis ²


Reset: ​display current realtime chart

RealtimeChart properties
Appearence
² Title: The text contents of the title , it can be left empty,Support for
multilingual functionality.
² TitleFont: Set the font for the title
² TitleColor: Set the color of the title font
² DisplayLegend: Whether display legend of a chart.
² MajorGrid: Set major grid.
² MinorGrid: Set minor grid
² Background: Set control background.
Series
² PositionLine: whether to display position line
² PositionLineColor: set the color of position line
² PositionLineFont: set the font type of position line
² TimeAxis&NumericalAxis:Set time axis or numerical axis of a
chart,take datetime axis as an example,as shown below:

The left part is the effect preview,the right part is the datetime axis
properties Please refer to the table below:

Property Description

AxisCenter Set whether the time axis is centered


AxisColor Set axis and text color
Set whether to transform the position
AxisPositionChange
of the axis
CustomScrollBar Set whether the scrollbar can be
customized
DateFormat Display date format
Font Set the title font
LabelRotationAngle Set rotation angle of time axis
ScrollBar Whether to display scrollbar
Set the ratio of scrollbar,the value
ScrollBarSizeRatio
range is 0.1~1
ShowAxis Set whether to display the axis
ShowGridline Set whether to display the gridline
Set the title of time axis,Support for
Title
multilingual functionality

Series Collection
The left part is add or delete members, each member is a
series(Series types include Line, Column, Scatter, SplineLine,
StepLine); the middle part can rank this series, the right part is the
selected series properties, as shown in the table below:

Property Description

SeriesName Set the name of the curve


Display Set whether to display the curve
FrameColor Set the color of the curve frame
MultiAxisDisplay Set whether to display the multi axis
SeriesColor Set the color of the series
Symbol Set whether to display the symbol
SymbolColor Set the color of symbol
SymbolHeight Set the height of symbol
SymbolStyle Set the style of the dat symbol
SymbolWidth Set the width of symbol
Text Set whether to display the text
TextColor Set text color
TextFont Set text font
TextFormat Set text format
TextType Set text type
TextPosition Set text position
VariablePath Set variable path
Sets the parameters of the vertical
VerticalAxis
axis displayed by multiple axes
Width Set the thickness of series

​Series naming rules:


(1) Composed of English letters, numbers, Chinese characters and
underscore,and the name must start with English letters or Chinese
characters.
(2) Not case sensitive.
(3) Spaces,periods,exclamation marks and special characters such
as @$#&*? etc. cannot be used in the name.
(4) The length cannot exceed 200 English letters and cannot
exceed 25 Chinese characters.
(5) Cannot be the same as the name of the other curves in the
same Controls.
RealtimeChart properties
Limit Line
² Thickness:Set the thickness of the limit line.
² LimitLineMaximum:Set the maximum value of the limit line.
² LimitLineMinimum:Set the minimum value of the limit line.
² UpperAndLowerDisplay:Set whether to display the limit line.
² UpperLimitLineColor:Set upper limit color.
² LowerLimitLineColor:Set lower limit color.
Toolbar
² Toolbar:Set Whether to display toolbar.
² ToolbarIcon:Set the toolbar icon type.
² ToolbarConfiguration:Set the contents of the toolbar.
Status Bar
² StatusDisplay:Set whether to display the status bar.
² NumericalFormat:Set the format of the status bar data display.
² Font:Set the font style for the status bar.
² BackgroundColor:Set the background color of the status bar.
² FontColor:Set the font color of the column name in the status bar.
² StatusGrid:Set whether the status bar displays grid lines.
² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.6.2 HistoryChart

Ø Open the window interface and click on “Toolbox” → “Extended
controls” → “HistoryChart” in the tools window to the left; the toolbar
is as shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of a history chart is complete, and a history chart will be
generated.
Ø Just repeat the steps above if another history chart needs to be
drawn.

Graphic introduction:

F The figure above is a selected history chart; click on the history
chart to enter selected status.
F There are two points on 1 in the figure above: the tensile point and
the center; 2-8 are the tensile points and 9 is the rotation point,10 is
the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.
F It is the statistics table on the bottom of the figure which is mainly
used to get the min , max, avg, sum and count of each curve.
F It is the toolbar on the top of figure which is used to operate chart.

Usage of the toolbar

² Query: ​query data according to the current configuration

² Set series: ​configure the curve style and associated variable in


the history chart


² Status column display: ​Set whether to display the column in the
status column

² Position line: ​whether to display the position line

² Save: ​history chart is saved as picture

² Print: ​print current history chart

² Set query time: ​when "set recent query time" is "custom",user


can set self-defined query range

² Set recent query time: ​Set the query time range: recent
one hour、recent one day、recent one week、recent one month、
recent three months、recent six months、recent one year、recent
three year、custom

² Time interval: ​when "set recent query


time" is not "custom",user can input time interval,its unit can be:
second、minute、hour、day、month、year、Default(preset time
interval)

² Import: ​Impoirt Excel to selected curve

² Export: ​Export curve to Excel


² First: ​set the scroll to the start time to see the chart

² Forward: ​move forward to see previous time quantum chart

² Backword: ​move backword to see

² Last: ​set the scroll to the end time to see the chart

² Fixed YAxis: ​Scroll the mouse to scale the horizontal axis ²

Fixed XAxis: ​Scroll the mouse to shrink the indulgence axis


HistoryChart properties
Appearence
² Title: The text contents of the title , it can be left empty,Support for
multilingual functionality.
² TitleFont: Set the font for the title
² TitleColor: Set the color of the title font
² StatusGrid:Whether display toolbar of a chart.
² StatusDisplay:Whether display the status bar.
² NumericalFormat:Set series numerical format.
² StatusbarBackgroundColor:Set status bar background color.
² StatusbarFontColor:Set status bar font color.
² FontColor:Set the font color for the chart.
² DisplayLegend: Whether display legend of a chart.
² MajorGrid: Set major grid.
² MinorGrid: Set minor grid.
² Background: Set control background.
Series
² DateTimeAxis:Set chart date axis.
² NumericalAxis:Set chart numerical axis.
² SeriesCollection:Set series of the category list.
² PositionLine: whether to display position line
² PositionLineColor: set the color of position line
² PositionLineFont: set the font type of position line
² VerticalAxisAutoChange:Set whether to automatically adjust the
maximum value of the vertical axis.
² Title:Set title of a chart,Support for multilingual functionality.
² Numeral axis

Property Description

Set whether the numberal axis is


AxisCenter
centered
AxisColor Set axis and text color
Set whether to transform the position
AxisPositionChange
of the axis
Set whether the scrollbar can be
CustomScrollBar
customized
Font Set the title font
LabelRotationAngle Set rotation angle of time axis
LargeScale Set big interval for the numeral axis
Maximum Set maximum for the numeral axis
Minimum Set minimum for the numeral axis
NumericalFormat Set numerical format
ScrollBar Set whether to display scrollbar
Set the ratio of scrollbar,the value
ScrollBarSizeRatio
range is 0.1~1
ShowAxis Set whether to display the axis
ShowGridline Set whether to display the gridline
SmallScale Set little interval for the numeral axis
Set the title of time axis,support for
Title
multilingual functionality.

² Datetime axis

Property Description

AxisCenter Set whether the time axis is centered


AxisColor Set axis and text color
Set whether to transform the position
AxisPositionChange
of the axis
Set whether the scrollbar can be
CustomScrollBar
customized
DateFormat Display date format
Font Set the title font
LabelRotationAngle Set rotation angle of time axis
ScrollBar Whether to display scrollbar
ScrollBarSizeRatio Set the ratio of scrollbar,the value
range is 0.1~1
ShowAxis Set whether to display the axis
ShowGridline Set whether to display the gridline
Set the title of time axis,support for
Title
multilingual functionality.

² SeriesCollection: Configures the curve style and connected


variables in the figure,for the configuration method as follows: Click“

​”bitton,pop up "History Series Editor" window,add one series as


follows:

The left part is add or delete members, each member is a


series(Series type include
Line,Column,Scatter,SplineLine,StepLine,SwitchLine); the middle part
can rank this series, the right part is the selected series properties, as
shown in the table below:
Property Description

SeriesName Set curve name


Display Set whether to display the curve
FrameColor Set the frame color
MultiAxisDisplay Set whether to display the multi axis
SeriesColor Set the series color
VariablePath Set variable path
Set the parameters of the vertical
VerticalAxis
axis displayed by multiple axis
Width Set the thickness of series

Series naming rules:Refer to the naming rules for curves in section


7.6.1 RealtimeChart.
Limit Line
² Thickness:Set the thickness of the limit line.
² LimitLineMaximum:Set the maximum value of the limit line.
² LimitLineMinimum:Set the minimum value of the limit line.
² UpperAndLowerDisplay:Set whether to display the limit line.
² UpperLimitLineColor:Set upper limit color.
² LowerLimitLineColor:Set lower limit color.
Toolbar
² Toolbar:Set Whether to display toolbar.
² ToolbarIcon:Set the toolbar icon type.
² ToolbarConfiguration:Set the contents of the toolbar.
Status Bar
² StatusDisplay:Set whether the status bar is displayed
² NumericalFormat:Set the format of the status bar data display.
² Font:Set the font style for the status bar.
² BackgroundColor:Set the background color of the status bar.
² FontColor:Set the font color of the column name in the status bar.
² StatusGrid:Set whether the status bar displays grid lines.

² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.6.3 XYChart

Ø Open the window interface and click on “Toolbox” → “Extended
controls” → “XYChart” in the tools window to the left; the toolbar is as
shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of a XY chart is complete, and a XY chart will be generated.
Ø Just repeat the steps above if another XY chart needs to be drawn.

Graphic introduction:


F The figure above is a selected XY curve; click on the XY curve to
enter selected status.
F There are two points on 1 in the figure above: the tensile point and
the center; 2-8 are the tensile points and 9 is the rotation point,10 is
the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.
Usage of the tool bar

² Configuration: ​Configure the realtime chart

² Position line: ​Whether to display the positIon line

² Start: ​Whether to start loading realtime chart

² Clear: ​Clear the realtime chart

² Save: ​Save the chart

² Print: ​Print the chart


² First: ​ ​XY chart first page data(When XY data is large, it will be
paged automatically)

² Last: ​ ​XY chart the last page data(When XY data is large, it will
be paged automatically)

² Forward: ​Page up

² Backward: ​Page down

² Fixed YAxis: ​Scroll the mouse to scale the horizontal axis ²

Fixed XAxis: ​Scroll the mouse to shrink the indulgence axis ²


Configuration: ​Configure the history chart

² Query: ​Query history data


² Query time setting: ​Set the start time and end time of history
chart

² Set nearest query time: ​Set the nearest query time


period,respectively are:Last hour, last day, last week, last month, last
three months, last six months, last year, last three years, custom

² TimeInterval: ​When "Set nearest query time" is the


most recent time outside of "Custom",user can input time interval,the
unit are:second,minute,hour,day,month,year,default(The default is the
interval set at development time)

² Display setting: ​Set the display of the status bar

² Import: ​Import Excel to the chart

² Export: ​Export the chart to the Excel


XYChart properties
Appearence
² Title: The text contents of the title , it can be left empty,Support for
multilingual functionality.
² TitleFont: Set the font for the title
² TitleColor: Set the color of the title font
² DisplayLegend: Set whether to display the legend
² MajorGrid:Set major grid
² MinorGrid:Set minor grid
² Background: Set the background of the chart
Series
² RefreshCount: Set the count per refreshment
² RefrshTime: Set the refresh time
² AxisAutoAdjust: set whether to adjust axis minmax value in the
runtime environment ² PositionLine: whether to display position line
² PositionLineColor: set the color of position line
² PositionLineFont: set the font type of position line
² RealTimeSeries: Configure real time series,the configuration
method is as follows:

Click“ ​”bitton,pop up real time series configure window,add one


series as follows:

The left part is add or delete members,each member is a


series(Series type include Line, Column, SplineLine, Scatter,
PiecewiseLine, FastLine);the middle part can rank this series,the
right part is the selected series properties,as shown in the table
below:
Property Description

Set updating data when values


ChangeUpdate
change
ColorMode Set color mode
SeriesName Set the name of the curve
Display Set whether to display the curve
Set the color of the curve frame(Pillar
FrameColor
style)
MultiAxisDisplay Set whether to display the multi axis
SeriesColor Set the color of the series
Symbol Set whether to display the symbol
SymbolColor Set the color of symbol
SymbolHeight Set the height of symbol
SymbolStyle Set the style of the dat symbol
SymbolWidth Set the width of symbol
Text Set whether to display the text
TextColor Set text color
TextFont Set text font
TextFormat Set text format
TextType Set text type
TextPosition Set text position
UpdateValue Set value changes to update data
VariablePathX Set variable path of X-axis
VariablePathY Set variable path of Y-axis
Set the parameters of the vertical
VerticalAxis
axis displayed by multiple axis
Width Set the thickness of series

Series naming rules:Refer to the naming rules for curves in section


7.6.1 RealtimeChart.
² HistorySeries: Configuration: Configure the history chart in the
diagtam,the configuration method is as follows:

Click“ ​”button,pup up the XY chart configuration window,the


default is none,add a series as follows:


The left part is add or delete members,each member is a
series(Series type include Line, Column, SplineLine, Scatter,
PiecewiseLine, SwitchLine);the middle part can rank this series,the
right part is the selected series properties,as shown in the table
below:

Property Description

Set updating data when values


ChangeUpdate
change
Set the numerical point coordinates
Collection
of the curve members
ColorMode Set the color mode
SeriesName Set curve name
Display Set whether to display the curve
FrameColor Set the frame color
MultiAxisDisplay Set whether to display the multi axis
SeriesColor Set the series color
Symbol Set whether to display the symbol
SymbolColor Set the color of symbol
SymbolHeight Set the height of symbol
SymbolStyle Set the style of the dat symbol
SymbolWidth Set the width of symbol
Text Set whether to display the text
TextColor Set whether to display the text
TextFont Set text font
TextFormat Set text format
TextType Set text type
TextPosition Set text position
UpdateValue Set value changes to update data
VariablePathX Set variable path of X-axis
VariablePathY Set variable path of Y-axis
Sets the parameters of the vertical
VerticalAxis
axis displayed by multiple axes
Width Set the thickness of series

Series naming rules:Refer to the naming rules for curves in section


7.7.1 RealtimeChart.
² Collection: Configure the fixed display series in the diagram as
follows:

Click“ ​”button,pup up the XY chart configuration window,the


default is none,add a series as follows:

² X axis

Property Description

AxisCenter Set whether the X axis is centered


AxisColor Set axis and text color
AxisColor Set axis and text color
Set whether to transform the position
AxisPositionChange
of the axis
Set whether the scrollbar can be
CustomScrollBar
customized
Font Set the numerical font style
LabelRotationAngle Set rotation angle of time axis
LargeScale Set the large scale of the axis
Maximum Set the maximum value
Minimum Set the minimum value
NumericalFormat Set the numerical format
ScrollBar Set whether to display the scrollbar
Set whether to resize the
ScrollBarSizeRatio
scrollbar,the value range is 0.1~1
ShowAxis Set whether to display the axis
ShowGridline Set whether to display the grid
Set the small scale between two
SmallScale
large scales
Title Set the title of the axis.

² Y axis

Property Description

AxisCenter Set whether the Y axis is centered


AxisColor Set axis and text color
Set whether to transform the position
AxisPositionChange
of the axis
Set whether the scrollbar can be
CustomScrollBar
customized
Font Set the numerical font style
LabelRotationAngle Set rotation angle of time axis
LargeScale Set the large scale of the axis
Maximum Set the maximum value
Minimum Set the minimum value
NumericalFormat Set the numerical format
ScrollBar Set whether to display the scrollbar
Set whether to resize the
ScrollBarSizeRatio
scrollbar,the value range is 0.1~1
ShowAxis Set whether to display the axis
ShowGridline Set whether to display the grid
ShowGridline Set whether to display the grid
Set the small scale between two
SmallScale
large scales
Set the title of the axis,Support for
Title
multilingual functionality.
Limit Line
² Thickness:Set the thickness of the limit line.
² LimitLineMaximum:Set the maximum value of the limit line.
² LimitLineMinimum:Set the minimum value of the limit line.
² UpperAndLowerDisplay:Set whether to display the limit line.
² UpperLimitLineColor:Set upper limit color.
² LowerLimitLineColor:Set lower limit color.
Toolbar
² Toolbar:Set Whether to display toolbar.
² ToolbarIcon:Set the toolbar icon type.
² ToolbarConfiguration:Set the contents of the toolbar.
Status Bar
² StatusDisplay:Set whether the status bar is displayed
² NumericalFormat:Set the format of the status bar data display.
² Font:Set the font style for the status bar.
² BackgroundColor:Set the background color of the status bar.
² FontColor:Set the font color of the column name in the status bar.
² StatusGrid:Set whether the status bar displays grid lines.
² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.6.4 CustomChart

Ø Open the window interface and click on “Toolbox” → “Extended
controls” → “CustomChart” in the tools window to the left; the toolbar
is as shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of a custom chart is complete, and a custom chart will be
generated.
Ø Just repeat the steps above if another custom chart needs to be
drawn.

Graphic introduction:


F The figure above is a selected custom chart; click on the custom
chart to enter selected status.
F There are two points on 1 in the figure above: the tensile point and
the center; 2-8 are the tensile points and 9 is the rotation point,10 is
the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.
CustomChart properties
Appearance
² Title: The text contents of the title , it can be left empty,Support for
multilingual functionality.
² TitleFont: Set the font for the title
² TitleColor: Set the color of the title font
² DisplayLegend: Set whether to display the legend
² Background: Set the background of the chart
Series
² ChartType: Set the type of chart
² PositionLine: whether to display position line
² PositionLineColor: set the color of position line
² PositionLineFont: set the font type of position line
² AxisTranspose:Horizontal axis and vertical axis conversion
position(only affective after adding a curve in the chart)
² SeriesCollection: Configures the curve style and connected
variables in the figure; the configuration method is as follows:

Click the “ ​” button and the custom curve editor window will appear;
add a curve, as shown in the figure below :


The left part is add or delete members,each member is a
series(Series type include Line, Scatter, Column, SplineLine,
StackColumn, StackColumn100);the middle part can rank this
series,the right part is the selected series properties,as shown in the
table below:

Property Description

Display Set whether to display the series


MultiAxisDisplay Set whether to display multi axis
SeriesStroke Set series stroke
SeriesStyle Set series style
SeriesName Set the name of the series
Width Set the thickness of series
SeriesColor Set the color of series color
Symbol Set whether to display symbol
SymbolColor Set the color of symbol
SymbolStyle Set the style of the dat symbol
SymbolWidth Set the width of symbol
SymbolHeight Set the height of symbol
Text Set whether to display the text
TextFont Set text font
TextFormat Set text format
TextType Set text type
TextPosition Set text position
VerticalAxis Set vertical axis
TextPosition Set text position
VerticalAxis Set vertical axis

Series naming rules:Refer to the naming rules for curves in section


7.6.1 RealtimeChart.
² Vertical axis

Property Description

AxisCenter Set whether the axis is centered


AxisColor Set axis and text color
AxisColor Set axis and text color
Set whether to transform the position
AxisPositionChange
of the axis
Font Set title and the text on axis
Set the rotation Angle of the
LabelRotationAngle
numerical axis
LargeScale Set big interval for the numeral axis
Maximum Set the maximum value
Minimum Set the minimum value
NumericalFormat Set the numrical format
NumericalFormat Set the numrical format
ScrollBar Set whether to display the scollbar
Set the size ratio of scrollbar,the
ScrollBarSizeRatio
value range is 0.1~1
ShowGridline Set whether to display the grid line
SmallSclale Set little interval for the numeral axis
Set the title of the axis,Support for
Title
multilingual functionality.

² Horizontal axis​​

Property Description

AxisCenter Set whether the time axis is centered


AxisColor Set axis and text color
Set whether to transform the position
AxisPositionChange
of the axis
DateFormat Set date format
Font Set title and the text on axis
Set the rotation Angle of the
LabelRotationAngle
numerical axis
ScrollBar Set whether to display the scollbar
Set the size ratio of scrollbar,the
ScrollBarSizeRatio
value range is 0.1~1
ShowGridline Set whether to display the gridline
Set the title of the axis,support for
Title
multilingual functionality.
Limit Line
² Thickness:Set the thickness of the limit line.
² LimitLineMaximum:Set the maximum value of the limit line.
² LimitLineMinimum:Set the minimum value of the limit line.
² UpperAndLowerDisplay:Set whether to display the limit line.
² UpperLimitLineColor:Set upper limit color.
² LowerLimitLineColor:Set lower limit color.
Status Bar
² StatusDisplay:Set whether the status bar is displayed
² NumericalFormat:Set the format of the status bar data display.
² Font:Set the font style for the status bar.
² BackgroundColor:Set the background color of the status bar.
² FontColor:Set the font color of the column name in the status bar.
² StatusGrid:Set whether the status bar displays grid lines.
² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.6.5 PieChart

Ø Open the window interface and click on “Toolbox” → “Extended
controls” → “PieChart” in the tools window to the left; the toolbar is
as shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of the pie chart is complete, and the pie chart will be
generated.
Ø Just repeat the steps above if another pie chart needs to be
drawn.

Graphic introduction:


F The figure above is a selected pie chart; click on the pie chart to
enter selected status.
F There are two points on 1 in the figure above: the tensile point and
the center; 2-8 are the tensile points and 9 is the rotation point,10 is
the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

PieChart properties
Appearance
² Title: Set the title of the chart,Support for multilingual functionality.
² TitleFont: Set the title font of the chart
² TitleColor: Set the title color of the chart
² LabelFont: Set label font
² LabelColor: Set label color
² LabelPosition: Set label position
² DisplayLegend: Set whether to display the legend
² LegendFont: Set legend font
² LegendColor: Set legend color
² LegendPosition: Set legend position
² Background: Set control background.
Chart
² RefreshTime:Set the refresh time
² ColorMode:Set the color mode(Metro,Custom)
² Collection:Configures the components and connected variables of
the pie chart; it configures each component’s color and value etc.
The configuration method is as follows: Click the“ ​”button and the
pie chart element editor window will appear; it has 4 elements
preset, as shown in the figure below:


The left part is add or delete members,each member is a series;
the middle part can rank this series,the right part is the selected
series properties,as shown in the table below:

Property Description

Name Sets the name of the element unit.


Sets the variable associated with the
VariablePath
element unit.
Color Sets the fill color of the element unit.
Value Sets the initial value of the element
unit.

Data Format
² LabelContent:Set the label content(YValue,XValue,Pencentage)
² LabelFormat:Set the label
format(Integer,Double1,Double2,Scientific,Percent)
² DisplayData:Set whether to display data
² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.6.6 PieChart3D

Ø Open the window interface and click on “Toolbox” → “Extended
controls” → “PieChart3D” in the tools window to the left; the toolbar
is as shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of a pie chart 3D is complete, and a pie chart 3D will be
generated.
Ø Just repeat the steps above if another XY chart needs to be
drawn.
Graphic introduction:
F The figure above is a selected pie chart 3D; click on the pie chart
3D to enter selected status.
F There are two points on 1 in the figure above: the tensile point and
the center; 2-8 are the tensile points and 9 is the rotation point,10 is
the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

PieChart3D properties
Appearance
² Title: Set the title of the chart,Support for multilingual functionality.
² TitleFont: Set the title font of the chart
² TitleColor: Set the title color of the chart
² LabelFont: Set label font
² LabelColor: Set label color
² LabelPosition: Set label position
² DisplayLegend: Set whether to display the legend
² LegendFont: Set legend font
² LegendColor: Set legend color
² LegendPosition: Set legend position
² Background: Set control background.
Chart
² 3DTiltAngle: Set 3D pie chart tilt angle
² 3DHeight: Set 3D pie chart height
² 3DRotation: Set whether you can rotate the 3D pie chart
² 3DRotationAngle: Set 3D pie chart rotation angle
² RefreshTime: Set refresh time.Default value is one second
² Collection: Configures the components and connected variables of
the pie chart 3D; it configures each component’s color and value etc.
The configuration method is as follows:

Click the“ ”button and the pie chart 3D element editor window will
appear; it has 6 default elements, as shown in the figure below:


The left part is add or delete members, each member is a series; the
middle part can rank this series, the right part is the selected series
properties, as shown in the table below:

Property Description

Name Sets the name of the element unit.


VariablePath Sets the variable associated with the
element unit.
Color Sets the fill color of the element unit.
Sets the initial value of the element
Value
unit.

Data Format
² DisplayData:Set whether to display data
² DisplayPoint:Set whether to display decimals in the data
² DisplayDataFormat:Set the data
format(XValue,YValue,Percentage,YofTot,XyPoint)
Toolbar
² Toolbar:Set Whether to display toolbar.
² ToolbarIcon:Set the toolbar icon type.
² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.6.7 ColumnChart

Ø Open the window interface and click on “Toolbox” →
“ExtendedControls” → “ColumnChart” in the tools window to the left;
the toolbar is as shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of the column chart is complete, and the column chart will
be generated.
Ø Just repeat the steps above if another column chart needs to be
drawn.

Graphic introduction:


F The figure above is a selected column chart; click on the column
chart to enter selected status.
F There are two points on 1 in the figure above: the tensile point and
the center; 2-8 are the tensile points and 9 is the rotation point,10 is
the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

ColumnChart properties:
Appearance
² Title: Set the title of the chart,Support for multilingual functionality.
² TitleFont: Set the title font
² TitleColor: Set the title color
² DisplayLegend: Set whether to display the legend
² LegendFont:Set the legend font
² LegendColor:Set the legend color
² LegendLocation:Set the legend location
² Background: Set control background.
Series
² RefreshTime: Set refresh time.Default value is one second
² AxisTranspose:Horizontal axis and vertical axis conversion
position(only affective after adding a curve in the chart)
² SeriesCollection: Configures the curve in the chart that is
associated with the variables to perform real-time display; the

configuration method is as follows: Click the“ ​”button and the


histogram curve editor window will appear; it has one curve preset,
as shown in the figure below:


Property Description

Collection Set the element of the column chart


ColorPalette Set the color palette
ColumnWidth Set the width of column
Display Set whether to display the element
Set the curve color below the lower
DownLine
limit line (column style)
MultiAxisDisplay Set whether to display the multi axis
SeriesColor Set series color
SeriesName Set the name of the series
SeriesStroke Set series stroke
Set whether to set the length of the
SetColumnWidth column. Check whether to set the
length of the column (column style).
Sets the display style of the
Style
histogram graphic elements
Symbol Set whether to display symbol
Set the symbol background color of
SymbolColor
numerical point
Set the symbol height of numerical
SymbolHeight
point
SymbolStyle Set the style of the dat symbol
Set the symbol width of numerical
SymbolWidth
point
Text Set whether to display the text
TextFont Set text font
TextFormat Set text format
TextType Set text type
TextPosition Set text position
Set the color of the curve when it is
UpLine greater than the upper limit line
(column style)
Sets the parameters of the vertical
VerticalAxis
axis displayed by multiple axes
Width Set the thickness of series
Series naming rules:Refer to the naming rules for curves in section
7.6.1 RealtimeChart.
l Column Chart Element Editor: click “Collection” configuration
button,open the editor to configure the element as follows:


The left part is add or delete members,each member is a series;
the middle part can rank this series,the right part is the selected
series properties,as shown in the table below:

Property Description

Category Sets the name of the element unit.


Sets the variable associated with the
VariablePath
element unit.
Color Sets the fill color of the element unit.
Sets the initial value of the element
Value
unit
² Vertical axis

Property Description

AxisCenter Set whether the axis is centered


AxisColor Set axis and text color
Set whether to transform the position
AxisPositionChange
of the axis
Font Set the text font style
Set the rotation Angle of the
LabelRotationAngle
numerical axis
LargeScale Set big interval for the numeral axis
Maximum Set the maximum value
Minimum Set the minimum value
NumericalFormat Set the numrical format
ScrollBar Set whether to display the scollbar
Set the size ratio of scrollbar,the
ScrollBarSizeRatio
value range is 0.1~1
ShowGridline Set whether to display the grid line
SmallScale Set little interval for the numeral axis
Set the title of the axis,Support for
Title
multilingual functionality.

² Horizontal axis

Property Description
AxisCenter Set whether the axis is centered
AxisColor Set axis and text color
Set whether to transform the position
AxisPositionChange
of the axis
Font Set the text font style
Set the rotation angle of the
LabelRotationAngle
horizontal axis
ScrollBar Set whether to display the scollbar
Set the size ratio of scrollbar,the
ScrollBarSizeRatio
value range is 0.1~1
ShowGridline Set whether to display the grid line
Set the title of the axis,support for
Title
multilingual functionality.
Limit Line
² Thickness:Set the thickness of the limit line.
² LimitLineMaximum:Set the maximum value of the limit line.
² LimitLineMinimum:Set the minimum value of the limit line.
² UpperAndLowerDisplay:Set whether to display the limit line.
² UpperLimitLineColor:Set upper limit color.
² LowerLimitLineColor:Set lower limit color.
² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.6.8 HistoryColumnChart
​​
Ø Open the window interface and click on “Toolbox” → “Extended
Controls” → “HistoryColumnChart” in the tools window to the left; the
toolbar is as shown in the figure above
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of a history column chart is complete, and a history column
chart will be generated
Ø Just repeat the steps above if another history column chart needs
to be drawn.

Graphic introduction:

F The figure above is a selected history column chart; click on the
history column chart to enter selected status.
F There are two points on 1 in the figure above: the tensile point and
the center; 2-8 are the tensile points and 9 is the rotation point,10 is
the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points
F It is the toolbar on the top of figure which is used to operate chart.

Usage of the toolbar

² Time setting: ​Set the start and end time of the query

² Set nearest query time: ​Set the nearest query time


period,respectively are:Last hour, last day, last week, last month, last
three months, last six months, last year, last three years, custom;

² TimeInterval: ​when "set recent query time"


is not "custom",user can input time interval,its unit can be: second、
minute、hour、day、month、year、Default(preset time interval)

² Query: ​query data according to the current configuration

² Display positioning line: ​whether to display the position line

² Save: ​history chart is saved as picture

² Print: ​print current history chart


HistoryColumnChart properties
Appearance
² Title: Set the title of a chart,Support for multilingual functionality.
² TitleFont: Set the font style for the chart.
² FontColor: Set the font color for the chart.
² DisplayLegend: Whether display legend of a chart.
² MajorGrid: Set major grid.
² MinorGrid: Set minor grid.
² Background: Set control background.
Series
² VerticalAxisAutoChange:Set whether to automatically adjust the
maximum value of the vertical axis.
² PositionLine: whether to display position line
² PositionLineColor: set the color of position line
² PositionLineFont: set the font type of position line
² CategoryList: Configure the variable path of the series,the
configuration method is as follows:
The left part is add or delete members,each member is a series;the
middle part can rank this series,the right part is the selected series
properties,as shown in the table below:

Click“ ​” button,pup up the History Column Series Editor window,


the default members are three elements as follows:

Property Description

Name Set the name of the element


Set the associated history varialbe of
VariablePath
the chart

² DateConditionList: configure the the curve style in the diagram, the


configuration is as follows:
The left part is add or delete members,each member is a series;the
middle part can rank this series,the right part is the selected series
properties,as shown in the table below:

Click“ ​” button,pup up the "Time Format Editor" window,the default


members are three conditions as follows:

The left part is add or delete members,each member is a series;the
middle part can rank this series,the right part is the selected series
properties,as shown in the table below:

Property Description

SeriesName Set curve name


Display Set whether to display the curve
FrameColor Set frame color
MultiAxisDisplay Set whether to display the multi axis
SeriesColor Set series color
SeriesStyle Set series style
StatisticValue Sets the statistical value type of
series(Min,Avg,Max)
Symbol Set whether to display symbol
Set the symbol height of numerical
SymbolHeight
point
Set the symbol width of numerical
SymbolWidth
point
Set the symbol background color of
SymbolColor
numerical point
SymbolStyle Set the style of the dat symbol
SymbolWidth Set symbol width
Text Set whether to display the text
TextColor Set text color
TextFont Set text font
TextFormat Set text format
TextType Set text type
TextPosition Set text position
Sets the parameters of the vertical
VerticalAxis
axis displayed by multiple axes
Width Set the thickness of series

Series naming rules:Refer to the naming rules for curves in section


7.6.1 RealtimeChart.
² NumericalAxis

Property Description

AxisCenter Set whether the axis is centered


AxisColor Set axis and text color
Set whether to change the position of
AxisPositionChange
axis
Set whether the scrollbar is
CustomScrollBar
customized
Font Set the numerical font style
Set the rotation angle of the
LabelRotationAngle
numerical axis
LargeScale Set big interval for the numerical axis
Maximum Set the maximum value
Minimum Set the minimum value
NumericalFormat Set the numrical format
ScrollBar Set whether to display the scoll bar
Set the size ratio of scroll bar,the
ScrollBarSizeRatio
value range is 0.1~1
ShowAxis Set whether to show axis
ShowGridline Set whether to display the grid line
Set little interval for the numerical
SmallScale
axis
Set the title of the axis,Support for
Title
multilingual functionality.

² CategoryAxis

Property Description

AxisCenter Set whether the axis is centered


AxisColor Set axis and text color
Set whether to change the position of
AxisPositionChange
axis
Set whether the scrollbar is
CustomScrollBar
customized
Font Set the numerical font style
Set the rotation angle of the
LabelRotationAngle
numerical axis
ScrollBar Set whether to display the scollbar
Set the size ratio of scrollbar,the
ScrollBarSizeRatio
value range is 0.1~1
ShowAxis Set whether to show axis
ShowGridline Set whether to display the grid line
Title Set the title of the axis
Limit Line
² Thickness:Set the thickness of the limit line.
² LimitLineMaximum:Set the maximum value of the limit line.
² LimitLineMinimum:Set the minimum value of the limit line.
² UpperAndLowerDisplay:Set whether to display the limit line.
² UpperLimitLineColor:Set upper limit color.
² LowerLimitLineColor:Set lower limit color.
Status Bar
² StatusDisplay:Set whether the status bar is displayed
² NumericalFormat:Set the format of the status bar data display.
² Font:Set the font style for the status bar.
² BackgroundColor:Set the background color of the status bar.
² FontColor:Set the font color of the column name in the status bar.
² StatusGrid:Set whether the status bar displays grid lines.
Toolbar
² Toolbar:Set Whether to display toolbar.
² ToolbarIcon:Set the toolbar icon type.
² ToolbarConfiguration:Set the contents of the toolbar.
² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.6.9 RecordBox

Ø Open the window interface and click on “Toolbox” → “Extended


controls” → “RecordBox” in the tools window to the left; the toolbar is
as shown in the figure above
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of a record box is complete, and a record box will be
generated.
Ø Just repeat the steps above if another history chart needs to be
drawn.
Graphic introduction:

F The figure above is a selected record box; click on the record box
to enter selected status
F There are two points on 1 in the figure above: the tensile point and
the center; 2-8 are the tensile points and 9 is the rotation point,10 is
the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.
F It is the toolbar on the top of figure which is used to operate record
box.

Usage of the toolbar

² Query: query data according to the current configuration

² Set the status column format: set whether to display the specific
column in the status column

² Query object: select the query object

² Set recent query time: set the query time range: recent
one hour、recent one day、recent one week、recent one month、
recent three months、recent six months、recent one year、recent
three year、custom

² Set query time: when "set recent query time" is "custom",user


can set self-defined query range

² Save: ​history chart is saved as picture

² Print: ​print current history chart

² Export current data: export the current page data

² Export all data: export all the data


RecordBox properties
Appearance
² Font: Set font
² FontColor: Set font color
² StatusBar: Set whether to display the status bar.
² StatusbarFontColor:Set the color of the status bar font.
² Background: Set control background.
² ShowGridline: Set whether to display grid.
² NewRecordPosition: Set the location of the latest records.
Toolbar
² Toolbar:Set Whether to display toolbar.
² ToolbarIcon:Set the toolbar icon type.
² ToolbarConfiguration:Set the contents of the toolbar.
² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.6.10 AlarmWindow

Ø Open the window interface and click on “Toolbox” → “Extended
controls” → “AlarmWindow” in the tools window to the left; the toolbar
is as shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of an alarm window is complete, and an alarm window will be
generated.
Ø Just repeat the steps above if another alarm window needs to be
drawn.

Graphic introduction:


F The figure above is a selected alarm window; click on the alarm
window to enter selected status F There are two points on 1 in the
figure above: the tensile point and the center; 2-8 are the tensile
points and 9 is the rotation point,10 is the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

Usage of the toolbar


Ø History Alarm

² Set recent alarm query time: ​set the query time range:
recent one hour,recent one day,recent one week,recent one
month,recent three months,recent six months,recent one
year,recent three year,custom

² Set recent alarm query time: ​when "set recent alarm query
time" is "all alarm",user can set self-defined query range
² Set query filter condition: ​set query filter condition

² Alarm group filter: ​set filter alarm according to alarm group

² Set the column need to display: ​select the column need to


display, if the column is checked , display it.

² Query history alarm: ​query history alarm according to the


current configuration

² Export current data: ​export current page data

² Export all the data: ​export all the data

² Save: ​history alarm is saved as picture

² Print: ​print current history alarm

² Previous: ​Go to previous page

² Next: ​Go to next page

² Go to specific page: ​go to uer selected page


Ø Realtime Alarm

² Start loading realtime alarm data: ​start to query realtime


alarm data

² Stop loading realtime alarm data: ​stop to query realtime


alarm data

² Ack the selected alarm: ​ack the selected alarm

² Jump to the window: ​ ​the selected alarm jumps to the window


(only when the alarm is configured with a window in the alarm
switch property, this button is effective)

² Set query filter condition: ​set the query filter condition

² Alarm group filter: ​set filter according to alarm group

² Set the column need to display: ​elect the column need to


display, if the column is checked , display it

² Exprot data: ​export current data

² Save: ​realtime alarm is saved as picture

² Print: ​print current realtime alarm


AlarmWindow properties
Appearence

² DefaultPage:Select the alarm window displayed by default(Reatime


alarm window,History alarm window)
² RealTimeUpdate:Set to load real-time alarm automatically at runtime
² AlarmGroupBackground:Set the background color for the alarm.
² HistoryAlarmFont:Set the font type of history alarm window.
² RealTimeAlarmFont:Set the font type of real-time alarm window.
² HistoryAlarmColumnDisplay:Set history alarm window column
display.
² RealTimeAlarmColumnDisplay:Set real time alarm window display.
² HistoryAlarmHeaderDisplay:Set whether to display the history alarm
header.
² RealTimeAlarmHeaderDisplay:Set whether to display the real-time
alarm header.
² Background:Set control background.
² AlarmSwitch:Set the window that this alarm can jump to at runtime

Click“ ​” button,pup up the following window,users can choose


according to their own needs:

Toolbar


² Toolbar:Set the alarm window toolbar wheather to show or not.
² ToolbarIcon:Set alarm box toolbar icon type.
Alarm Text Color

² DoubleLowAlarm:Set DoubleLow alarm text color.
² LowAlarm:Set LowAlarm text color.
² DoubleHighAlarm:Set DoubleHigh alarm text color.
² HighAlarm:Set HighAlarm text color.
² LowDeviationAlarm:Set LowDeviation alarm text color.
² UpperDeviationAlarm:Set UpperDeviation alarm text color.
² RateOfChangeAlarm:Set RateOfChange alarm text color.
² OnAlarm:Set OnAlarm text color.
² OffAlarm:Set OffAlarm text color.
² OnOrOffAlarm:Set OnOrOff alarm text color.
² ExpressionAlarm:Set Expression alarm text color.
Condition Filter


² HistoryAlarmFilter:Set history alarm filter condition.
² RealtimeAlarmFilter:Set real time alarm filter condition.
Click“ ​” button,pup up the "Set Filter Condition" window,users can
choose according to their own needs:


² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.6.11 ScrollAlarm

Ø Open the window interface and click on “Toolbox” → “Extended
controls” → “ScrollAlarm” in the tools window to the left; the toolbar
is as shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of a ScrollAlarm is complete, and a scroll alarm will be
generated.
Ø Just repeat the steps above if another scroll alarm needs to be
drawn.

Graphic introduction:


F The figure above is a selected scroll alarm; click on the scroll alarm
to enter selected status
F There are two points on 1 in the figure above: the tensile point and
the center; 2-8 are the tensile points and 9 is the rotation point,10 is
the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

ScrollAlarm properties
Appearence


² RealTimeUpdate:Set whether to load real-time alarm automatically
at runtime.
² ScrollSpeed:Set the scroll speed of the scroll alarm content
² AlarmColor:Set the font color of the scroll alarm.
² FontSize:Set the font size of the scroll alarm.
² Background:Set the background of scroll alarm.

² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.6.13 RecipeBrowser

Ø Open the window interface and click on “Toolbox” → “Extended


controls” → “RecipeBrowser” in the tools window to the left; the
toolbar is as shown in the figure above.

Ø Move the mouse to the working area of the window, select a


starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of a recipe browser is complete, and a recipe browser will
be generated.

Ø Just repeat the steps above if another recipe browser needs to be


drawn.

Graphic introduction

F The figure above is a selected recipe browser; click on the recipe
browser to enter selected status.
F There are two points on 1 in the figure above: the tensile point and
the center; 2-8 are the tensile points and 9 is the rotation point,10 is
the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

Usage of the toolbar


² All|Detail: ​display all the detail of recipe

² Change: ​recipe item and recipe element row-column transform

² Add new recipe item: ​add new recipe item


² Edit: ​edit select recipe item

² Delete: ​delete select recipe item

² Save: ​record box is saved as picture

² Print: ​print current record box

² The first recipe item: ​move to the first item

² Previous: The previous recipe item

² Last: ​The last recipe item

² Next: ​Next recipe item

² Write in: ​write in recipe item from variable value

² Write out: ​write out recipe item to variable value

² Import: ​import to recipe from file

² Export: ​export recipe to file

² Save: ​save recipe


² Filter input box:filter condition

² Filter: ​query recipe according to the content in the filter box

Appearence

² Font:set recipe browser font
² FontColor:set recipe browser font color
² StatusBar:set StatusBar is show
² Background:set control background
² RecipeColumnWidth:set recipe column width(Auto,Star,Custom)


Toolbar

² Toolbar:Set Whether to display toolbar.


² ToolbarIcon:Set the toolbar icon type.
² ToolbarConfiguration:Set the contents of the toolbar.

² All Detail: Set whether to display "all detail" button


² Add: Add new recipe item
² Edit: Edit select recipe item
² Delete: Delete select recipe item
² First: The first recipe item
² Previous: The previous recipe item
² Last: The last recipe item
² Next: The next recipe item
² Write in: Write in recipe item from variable value
² Write out: Write out recipe item to variable value
² Import: Import to recipe from file
² Export: Export recipe to file
² For other property settings please refer to the section “7.3 Graphic
universal properties”
7.6.14 Ruler

Ø Open the window interface and click on “Toolbox” → “Extended
controls” → “Ruler” in the tools window to the left; the toolbar is as
shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of a ruler is complete, and a ruler will be generated.
Ø Just repeat the steps above if another ruler needs to be drawn.

Graphic introduction

F The figure above is a selected ruler; click on the ruler to enter


selected status.
F There are two points on 1 in the figure above: the tensile point and
the center; 2-8 are the tensile points and 9 is the rotation point,10 is
the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

Ruler properties
Appearance
² Title: The text contents of the title , it can be left empty,Support for
multilingual functionality.
² TitleFont: Set the font for the title
² TitleColor: Set the color of the title font
² Background: Set control background.
Instrument
² PointerValue: set pointer value
² ValueUnit: set the value of the unit
² VariablePath: Set the VariablePath
² Pointer

Property Description

PointerColor Set the color of the bar pointer


PointerHeight Set the height of the symbol pointer
PointerWidth Set the width of the symbol pointer
DisplayPointer Set whether to display a pointer
PointerPosition Set the position of the symbol pointer

² Ruler
Property Description

FontColor Set the font color


ScalePosition Set the scale position
BackgroundColor Set the background color of the ruler
Maximum Set the maximum value of the ruler
FontSize Set font size
Set the large scale of the instrument
MaxScale
ruler
MinScale Set the small scale of the ruler
Set the color of the small scale to the
MinScaleColor
ruler
Set the color of the large scale to the
MaxScaleColor
ruler

² Bottomline

Property Description

BottomlineEndValue Set end value to the bottom line


BottomlineOffset Set offset to the bottom line
BottomlineColor Set color to the bottom line

Toolbar
² Toolbar:Set the alarm window toolbar wheather to show or not.
² ToolbarIcon:Set alarm box toolbar icon type.
Status Bar
² StatusBar:Set whether to display the status bar
² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.6.15 CircleGauge

Ø Open the window interface and click on “Toolbox” → “Extended
controls” → “CircleGauge” in the tools window to the left; the toolbar
is as shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of a circle gauge is complete, and a circle gauge will be
generated.
Ø Just repeat the steps above if another circle gauge needs to be
drawn.

Graphic introduction


F The figure above is a selected circle gauge; click on the circle
gauge to enter selected status.
F There are two points on 1 in the figure above: the tensile point and
the center; 2-8 are the tensile points and 9 is the rotation point,10 is
the center.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points.

CircleGauge properties
Appearance
² Title: The text contents of the title , it can be left empty,Support for
multilingual functionality.
² TitleFont: Set the font for the title
² TitleColor: Set the color of the title font
² Background: Set control background.
Instrument
² PointerValue: set pointer value
² ValueUnit: set the value of the unit
² VariablePath: Set the VariablePath
² Pointer

Property Description

PointerColor Set the color of the needle pointer


Set the origin size of the needle
PointerOriginSize
pointer
PointerOriginColor Set the origin color of the needle
pointer
Set the origin color of the needle
PointerOriginColor
pointer
Length Set the length of the needle pointer
Width Set the width of the needle pointer
PointerStyle Set the style of the pointer
SymbolPonterStyle Set the style of the symbol pointer

² InstrumentPanel

Property Description

Set the background color of the


BorderBackground
instrument dial border
FontColor Set font color
ScalePosition Set the scale of the instrument panel
Set the width of the border of the
BorderWidth
instrument dial border
Set the maximum value of the
Maximum
instrument panel
TitleFont Set the font of the dashboard
Set the large scale of the instrument
MaxScale
panel
Set the small scale of the instrument
MinScale
panel
Set the minimum value of circle
MinimumValue
gauge
Display Set the dashboard display
MinScaleColor Set the color of the instrument panel
Set the starting angle of the
StartAngle
instrument panel
Set the scanning angle of the
ScanningAngle
instrument panel
Set the scanning angle of the
ScanningAngle
instrument panel
MaxScaleColor Set the color of the instrument panel
Set the numeric position on the
ValuePosition
instrument panel

Toolbar
² Toolbar:Set the alarm window toolbar wheather to show or not.
² ToolbarIcon:Set alarm box toolbar icon type.
Status Bar
² StatusBar:Set whether to display the status bar

² For other property settings please refer to the section “7.3 Graphic
universal properties”.
7.6.16 VideoMonitor

Ø Open the window interface and click on “Toolbox” → “Extended
controls” → “VideoMonitor” in the tools window to the left; the toolbar
is as shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of a Video Monitor is complete, and a Web browser will be
generated.
Ø Just repeat the steps above if another Video Monitor needs to be
drawn.

Graphic introduction


F The figure above is a selected Video Monitor; click on the Video
Monitor to enter selected status.
F There are two points on 1 in the figure above: the tensile point and
the center; 2-8 are the tensile points and 9 is the rotation point.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points,10 is the center.
F It is the toolbar on the top of figure which is used to operate Video
Monitor.

Usage of menu
² Sign in: Sign in the user.
² Start Preview: Show video realtime.
² Capture Images: Capture frame one by one, save in folder set by
development.
² Start Recording: Record video and save in MP4 format.
² Playback: Play the saved video.
² Remote Setting: fetch or set video’s properties.
VideoMonitor properties
² AutomaticPreview: Get or set whether or not preview the video.
² PictureSavePath:get or set the save path of the picture captured.
² VideoPlaybackPath:get or set video playback path.
² DeviceConfiguration:Deivce IP, Devide port, and UserName,
password.

² For other property settings please refer to the section “7.3 Graphic
universal properties”
7.6.17 WebBrowser

Ø Open the window interface and click on “Toolbox” → “Extended
controls” → “WebBrowser” in the tools window to the left; the toolbar
is as shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of a Web browser is complete, and a Web browser will be
generated.
Ø Just repeat the steps above if another Web browser needs to be
drawn.

Graphic introduction


F The figure above is a selected Web browser; click on the Web
browser to enter selected status.
F There are two points on 1 in the figure above: the tensile point and
the center; 2-8 are the tensile points and 9 is the rotation point.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points,10 is the center.
F It is the toolbar on the top of figure which is used to operate web
browser.
F It is the status bar on the bottom of figure which is used to display
the current progress.

Usage of the toolbar


² HomePage: click the button to open the default homepage in the
runtime environment
² GoBack:backward to previous webpage
² GoForward:forward to next webpagge address
² Address: user can input an address to display
² Refresh: refresh current webpage
WebBrowser properties
² StatusBar: set whether to display status bar
² Toolbar: set whether to display toolbar
² Home: set the home address of Web browser
² Address: set the address of Web browser
² For other property settings please refer to the section “7.3 Graphic
universal properties”
7.6.18 RTSPVideoMonitor

Ø Open the window interface and click on “Toolbox” → “Extended
controls” → “RTSPVideoMonitor” in the tools window to the left; the
toolbar is as shown in the figure above.
Ø Move the mouse to the working area of the window, select a
starting point and press the left mouse button and drag the mouse
towards the bottom-right; after releasing the left mouse button, the
drawing of a RTSP Video Monitor is complete, and a Web browser
will be generated.
Ø Just repeat the steps above if another RTSP Video Monitor needs
to be drawn.

Graphic introduction

F The figure above is a selected RTSP Video Monitor; click on the
RTSP Video Monitor to enter selected status.
F There are two points on 1 in the figure above: the tensile point and
the center; 2-8 are the tensile points and 9 is the rotation point.
F Above point 2 and below point 6 in the figure are the horizontal
distortion points. The right of point 4 and the left of point 8 are the
vertical distortion points,10 is the center.
F The RTSP Video Monitor don't support rotation and distortion.
F The lower part of the figure is the toolbar, which is used to perform
various operations on the RTSP Video Monitor.

Usage of menu
² Select Video: used to select the video source displayed in the
screen.
² Start : Display the picture of the video source.
² Start Recording: Record video and save in webm format.
² Playback: Search by creation time and select one from the list to
play.
² Refersh: when the video playback is abnormal,click refresh to reset
the video playback.
RTSPVideoMonitor properties
² VideoSet: Edit video source.

² EditVideoSource:Set the video source of the player and support


multiple selections.

² For other property settings please refer to the section “7.3 Graphic
universal properties”
7.7.1 Overview
Thegallery includes the DIAView software’s built-in frequently used
graphic model collection and the user’s customized graphics
collection. Graphics include indicating instruments, button switches,
valve and containers and motor pump fans etc.; users can also
create their own frequently used graphic models and add them into
thegallery.
Models in thegallery are grouped graphics; users can easily add
them into the sketchpad and use them directly. It is in the “Gallery”
tool window in the toolbox, as shown in the figure below:

7.7.2 Using the gallery
The graphics in the gallery of the DIAView software includes the
system’s built-in graphic models and also allows users to define their
own graphic models and add them into the gallery.
The graphics from the gallery needs to be used in the sketchpad,
the method to use them is similar to the normal graphics.
Ø Enter the window interface → open the “Gallery” window in toolbar
→ select the category of the graphics→ click the model in the gallery
with the mouse → move the mouse cursor on the working area of
the sketchpad and press the mouse button; then graphics will appear
on the sketchpad and its properties such as position and size can be
adjusted.
Adding gallery category:
Users can add their frequently used graphic models into the
gallery; usually customized gallery categories are created for easy
usage and management.
Open the “Gallery” tool window, right-click on the gallery and then
select“Category” -- “Add Category”, as shown in the figure below:

After clicking “Add Category”, a gallery category with the default
name “New Category” will be added in the gallery, as shown in the
figure below:


The category name added here can be edited and renamed;
Select a category and perform operations such as “Rename” and
“Delete” by right-clicking the mouse.
Name: The system will choose a name(New Category) by default
and the user can also change it. The name of the graphic category
cannot be repeated as other created graphic category.
7.7.3 Expanding the gallery
The models in the gallery are the grouped graphics in the sketchpad;
models can be drawn by the following three steps:
1. Draw the sub-graphics that forms the model.
2. Adjust the size, position and stacking levels of the sub-graphics
and then group them into a graphic.
3. Add the new grouped graphic into the gallery.

Adding the customized model into the gallery:


Open the category inside the “Gallery” to add the new model, select
the grouped graphics in the sketchpad, press and hold the left mouse
button and drag the grouped graphics into the category area of the
“Gallery”; the steps are as shown in the figure below:

At this time the model name is automatically generated by the
system; users can select the model and press the right mouse button
to perform operations such as “Rename” and “Delete” etc.
The naming rules of group graphics are consistent with the naming
rules of general graphics, referring to "7.3 Graphic universal
properties".
7.7.4 Export as picture
In this panel,the steps below can export the model in gallery as
picture:

1.Right-click the graphic model that needs to export

2.Select "Export as picture" item in the right-click buttton

3.Select the flie path to save,confirm exporting


7.8.1 Overview
Graphic operations refer to perform operations to graphics
including stretching, rotating,distorting, sorting, aligning and grouping
etc., modifying the properties of the graphic to achieve the functions
and effects that we need.
In a project development environment, we not only can acquire and
modify the properties of graphics directly from the properties frame of
the graphic, we can also use the mouse, right-clicking the mouse,
shortcut keys and the shortcut buttons on the toolbar to edit the
properties. For example, when we are drawing, we can adjust the
graphic’s rotation point to rotate it, or stretch the tensile points around
the graphic to adjust the size of the graphic etc., as shown in the
figure below:


In order to achieve “all-mouse” operations, the DIAView software
has the convenient right-click menu (please refer to “4.5 DIAView
Right-click menu introduction” for the specific functions), as shown in
the figure below:

In order to increase development efficiency and the convenience


for operating, the DIAView also provides shortcut buttons for
frequently used operations (please refer to “4.4.2 Start menu” for the
specific functions), as shown in the figure below:


7.8.2 Rotation
When the graphic drawn needs to be rotated, place the mouse on
the “rotation point” and the mouse cursor will change to ,now you
can press and hold the left mouse button and drag the rotation point
to rotate the graphic.

Graphic rotation uses the center point as the center for rotating. It
can be rotated using the default center point location (the center of
the graphic), or the center point can also be changed and then
rotated, as shown in the figure below:

Rotating by the default location of the center point:

Rotating after changing the location of the center point:


In addition, specific values (unit: degrees) can be entered
directly in the “Rotation angle” properties frame of the graphic
properties window to specify the rotating angle of the graphic.
7.8.3 Stretch
When the graphic drawn needs to be stretched (which means
adjusting the size of the graphic), place the mouse on the “stretching
point (when a graphic is selected, a dotted frame will appear around
the graphic, and 8 rounded rectangle points filled with blue will
appear on the rectangular dotted frame. These are the stretching
points. For example 1 in the figure below is the first stretching point),
and the mouse cursor will change to bidirectional arrows such as 或
. Now you can press and hold the left mouse button to drag the
stretching point to change the size of the graphic.

As shown in the figure below:


In addition, specific values can be entered directly in the “Size”
properties frame of the graphic properties window to specify
the width and height of the graphic.
7.8.4 Arrangement
When there are multiple graphics, sometimes they need to be
aligned or adjusted their spaces according to a specific direction or
by referring to one of the graphics. The DIAView software provides 7
types of alignment operations and 2 types of distribution
operations(shortcut buttons under the “Format” menu), which most of
the alignment methods can only be used when two or more graphics
are selected.
Alignment reference graphic rules when multiple graphics are
selected: (please refer to the highlighted blue stretching points of the
graphics).
1. When multiple graphics are framed with the mouse, the graphic
that is first drawn in the sketchpad is the reference graphic;
2. When multiple graphics are selected by clicking with the
mouse, the first graphic clicked and selected with the mouse
will be used as the reference graphic.
Ø Align Left
Use the reference graphic as the basis and make the left edge of
the other selected graphics align with the left edge of the
reference graphic;
The shortcut button in the “Start” menu is ​.
For example: 3 graphics are framed in which the rectangular
highlighted blue stretch points of graphic 1 is brighter, so it is the
reference graphic; when the align left button in the toolbar is
pressed, the other graphics will align to the left edge of graphic 1.

Framed graphics:

Aligned effect:


Ø Align Right
Use the reference graphic as the basis and make the right edge
of the other selected graphics align with the right edge of the
reference graphic;
The shortcut button in the “Start” menu is ​
Ø Align Top
Use the reference graphic as the basis and make the top edge of
the other selected graphics align with the top edge of the
reference graphic;
The shortcut button in the “Start” menu is ​
Ø Align Bottom
Use the reference graphic as the basis and make the bottom
edge of the other selected graphics align with the bottom edge of
the reference graphic;
The shortcut button in the “Start” menu is ​
Ø Align Center
Use the reference graphic as the basis and make the X-axis of
geometric center of the other selected graphics the same as the
X-axis of the geometric center of the reference graphic;
The shortcut button in the “Start” menu is ​
Ø Align Middle
Use the reference graphic as the basis and make the Y-axis of
geometric center of the other selected graphics the same as the
Y-axis of the geometric center of the reference graphic;
The shortcut button in the “Start” menu is ​
Ø Same center
Use the reference graphic as the basis and make the X and Y-
axis of geometric center of the other selected graphics the same
as the X and Y-axis of the geometric center of the reference
graphic;
The shortcut button in the “Start” menu is ​

Ø Distribute Vertical
Distribute the geometric center of three or more selected graphic
objects in the sketchpad evenly in the vertical direction,The
shortcut button in the “Start” menu is: ​; as shown in the figure
below:

Ø Distribute Horizontal
Distribute the geometric center of three or more selected graphic
objects in the sketchpad evenly in the horizontal direction.

The shortcut button in the “Start” menu is: ​; as shown in the figure
below:

7.8.5 Layer
Layer refers to the display order of graphics in the sketchpad; the
graphic first drawn in the sketchpad of the DIAView is at the inner
layer (bottom layer) and the graphics later drawn is at the outer layer
(top layer).

When multiple graphics are stacked in the sketchpad, sometimes


their stacking order needs to be adjusted; for example placing a
certain graphic on the top-most layer for display etc.

The DIAView has 4 types of graphic layer operation functions (please


refer to the shortcut buttons under the “Start” menu):

Ø Place at top layer

Move the selected graphic to the top-most layer of all graphics on


the sketchboard for display;
The shortcut button in the “Start” menu is

An example is as follows:
Ø Place at bottom layer

Move the selected graphic to the bottom-most layer of all


graphics on the sketchboard for display;
The shortcut button in the “Start” menu is

Ø Move up a layer

Move the selected graphic up a layer for display;


The shortcut button in the “Start” menu is
An example is as follows:

Ø Move down a layer

Move the selected graphic down a layer for display;


The shortcut button in the “Start” menu is
7.8.6 Size
When there are multiple graphics in a sketchpad, sometimes their
size needs to be adjusted; the DIAView provides 3 types of graphic
size adjustment operations (please refer to the shortcut buttons
under the “Start” menu). They can only be used when two or more
graphics are selected.

Alignment reference graphic rules when multiple graphics are


selected:

1. When multiple graphics are framed with the mouse, the graphic
that is first drawn in the sketchpad is the reference graphic;

2. When multiple graphics are selected by clicking with the


mouse, the first graphic clicked and selected with the mouse
will be used as the reference graphic.

Ø Same Width Use the reference graphic as the basis and make the
width of the other selected graphics the same as the width of the
reference graphic.
The shortcut button in the “Start” menu is ;as shown in the
figure below:
Ø Same Height
Use the reference graphic as the basis and make the height of
the other selected graphics the same as the height of the
reference graphic.
The shortcut button in the “Start” menu is .

Ø Same Size

Use the reference graphic as the basis and make the size of the
other selected graphics the same as the size of the reference
graphic.
The shortcut button in the “Start” menu is 。
7.8.7 Grouping
Grouping refers to forming two or more graphics into a whole,
forming a new graphic making it easier for user to use. For example:
we can group graphics such as fans, motors and water tanks and
place it in the graphic library, so we can easily access them from the
image library when we need to use it again.

Operations such as rotation and size adjustment etc. can be


performed to the grouped graphic as a new graphic.

Grouped graphics can be ungrouped at any time.

Ø Grouping

The shortcut button in the “Start” menu is

First we draw the various sub-graphics that we want to group into


a new graphic; for example, we can draw a pump by first drawing
the various parts that forms it:
We adjust the sizes, positions and stacking orders of these sub-
graphics and then group them together:

Ø Ungroup

The shortcut button in the “Start” menu is

Select the grouped graphic and then click the “Ungroup” shortcut
button in the “Start” menu, and the various sub-graphics in the
group will exist independently in the sketchpad.
7.8.8 Distortion
1、Distortion: Making the graphic tilt; distorting is divided into
horizontal distortion and vertical distortion.

2、Using a rectangle as an example, it has two horizontal distortion


points, when the mouse cursor is placed on the distortion points, the
mouse cursor style will change to ;It also has to vertical distortion
points, and when the mouse cursor is placed on top of the vertical
distortion points, the mouse cursor style will change to

3、When the graphic drawn needs to be distorted, place the


mouse on the “distortion point” and the mouse status will change.
Now you can press and hold the left mouse button and drag the
distortion point to change the shape of the graphic.

As shown in the figure below (taking horizontal distortion as an


example):

a、Place the mouse on the horizontal distortion point, and the


mouse cursor style changes:
b、Press and hold the left mouse button and move it to the right
horizontally:

c、Distorted graphic:

In addition, specific values can be entered directly in the


“Horizontal distortion” or “Vertical distortion” property frames
in the graphic property field to distort the graphic. Both of their
value ranges from -89 to 89 up to two decimal places.
7.8.9 Zooming
Zooming: Zoom in or zoom out the graphic; zooming is divided into
horizontal zooming and vertical zooming: horizontal zooming uses
the center point of the graphic as the origin and zooms to both the
left and right sides. Vertical zooming uses the center point of the
graphic as the origin and zooms to both the top and bottom sides.
Shifting the center point of the graphic affects the zooming effects.

As shown in the figure below:

1. Horizontal zooming: Draw two rectangles with identical sizes


and use the default value as the center point; set the horizontal
zooming property value of the bottom rectangle to 2.
2. Vertical zooming: Draw two rectangles with identical sizes and
use the default value as the center point; set the vertical zooming
property value of the right rectangle to 2.
7.8.10 Offset
Offset: Making the position of the graphic offset: Offset is divided into
horizontal offset and vertical offset. Horizontal offset uses the
coordinates of the graphic as the origin and moves to both the left
and right sides; vertical offset uses the coordinates of the graphic as
the origin and moves to both the top and bottom sides.
As shown in the figure below:
1、Horizontal offset:Draw two rectangles with identical sizes, set
the horizontal offset property value of the bottom rectangle to 50.


2、Vertical offset: Draw two rectangles with identical sizes, set the
vertical offset property value of the bottom rectangle to 50.


after shifting
7.9 Group graphic extended properties
Click“ ​” to add property for grouping graphic in the extended
property window and configure the added extended property in the
pop-up window.

Extended property basic configuration:


Property name: set the name of extended name
Property name rules:
(1) Composed of English letters, numbers, Chinese characters and
underscore,and the name must start with English letters or Chinese
characters.
(2) Not case sensitive.
(3) Spaces,periods,exclamation marks and special characters such
as @$#&*? etc. cannot be used in the name.
(4) The length cannot exceed 200 English letters and cannot exceed
25 Chinese characters.
(5) Cannot be the same as the name of the other extend properties
in the same group Graphic.
(6) The name language can only be simplified Chinese, traditional
Chinese and English.
Property type: set the type of extended type
Default: set the default of extended property,the value will take
effect in real time during development
Description: set the property description information to explain the
property effect or what to do when value changes

Add associated item for extended property:


Extended property have two type association:
1.Dierect correlation: property will be listed in the right part of the
window, click checking, extended property can be associcated with
the sub graphic property directly


2.Script correlation: Click ​button
to write script in the pop up window,the script will be triggered during
development. In the script, "value" can be used instead of the value
of the extension attribute being configured, for example:
Rectangle0.width = value; You can also set the attribute value
directly, for example: Rectangle0.width = 200.

7.10.1 Find
In the development environment, open the project and press Ctrl + F
to open the “find and replace” window. The find window is displayed
by default, as shown in the following figure:


Find Content: Enter the content to search in this edit box.The find
types include string, variable, control and security, as shown in the
following figure:
When the search type is "variable" and "safe area", click the ​button
to select the search content quickly.as shown in the following figure:


Find Condition:
² Match whole word: Select this item and only examples that
matches all words in the “Find target” string will be displayed. For
example, find “aaa” and the result will return “aaa” instead of
“baaa” or “aaac”.
² Match case: If this item is selected, it will only display examples
that have exactly the same cases as the string content in “Find
content”.
² Find Range:Contains two options--“project” and “window ”.When
the “project ” is selected, it means to find content in the whole
project; when the “window” is selected, it means to find content
only in all windows.
² Find Type:Contains four types-
-“string”,“variable”,“control”,“security”.
Shortcut menu:
Right click any node in the result tree to call out the position function,
as shown in the following figure:

Click "position" to jump to the corresponding position (only can jump
to window currently ), as shown in the figure above.Click "position"
button then open "window0", and select "text0" automatically.
7.10.2 Replace
In the development environment, open the project and press Ctrl + F
to open the “find and replace” window. Click the label "Replace"to
open replace window, as shown in the following figure:


Find Content: Enter the content to search in this edit box.
Replace Content: Enter the replacement content in this edit box,
select the node to be replaced in the search result tree, and then click
"Replace" to batch replace the specified items. For example, as
shown in the following figure:
Find Condition:
Refer to section "7.10.1 Find".
Shortcut menu:
Refer to section "7.10.1 Find".
8.1 Overview
Animation refers to the correspondence between the created
window element and the internal variables; it makes the properties of
the window element change dynamically according to the field
acquired data, and truly displays the dynamic scene of the industrial
field. For example, simulation of fluid flow in the pipeline in the
window, real-time changes of instrument data, rotation of electrical
machineries and the flashing of alarm etc.

To configure an animation that makes the related properties of the


graphics object in the window change in real-time, corresponding
variables must be connected and related properties must be
configured according to the variable data acquired in real-time,
therefore animations are driven by data.

The animation configuration function of the DIAView is very


powerful; it includes animations such as rotating, appearance, filling,
zooming, moving, visibility, flowing and value display etc. The
corresponding animation can only be configured once for the same
graphic object.

DIAView animation refresh rate defaults to 60 frames per second,


depending on the use environment.
8.2 Rotating animation
Rotating animation refers to allow graphics to perform rotating
around the center point of the graphic and changing the “rotation
angle” property of the graphic.
Rotating animations are divided into four kinds: “RotationControl”,
“RotationSpeed”, “RotationAngle” and “DiscreteRotate”;
“RotationAngle” animation refers to an animation where the
rotation angle of the graphic object make linear relationship changes
according to the variables or the value of the expression;
“RotationControl” refers to an animation where whether the
graphic object will rotate around the center point of the graphic is
controlled by the variable or when the value of the expression is true
or false.
“DiscreteRotate” refers to the rotation angle of the graphic object
being discretely related to the variable;
“RotationSpeed” refers to the rotation speed of the graphic object
being bound with the variable.

1.Steps to configure rotation speed are as follows:


Step 1: Open the project window where the animation needs to be
configured under the DIAView software development environment →
select the graphic object to configure animation in the sketchpad →
open the “Animation” window → select “RotationSpeed”→ click the
button in the “RotationSpeed” field, as shown in the figure below:
Step 2: The rotation speed animation configuration window will
appear, as shown in the figure below:
The meanings of each setting in the configuration window are as
follows:
Expression: Enter the variable name or expression; you can also
click the ​button to open the variable browser to select a
variable; the “Clear” button can clear the contents in the input frame.
MinimumValue:
Ø Value: Set a minimun value for expression
Ø SpeedPercent: Set a minimun value for speed percent
MaximumValue:
Ø Value: Set a maximum value for expression
Ø SpeedPercent: Set a maximum value for speed percent
Property:
Ø Step(Degree): Set the angle at which the object rotates one
step(Unit:Degree)
Ø Speed(ms): Set the time required for each rotation step of the
object(Unit:ms)
Example:Configure the window as shown in the figure below:When
the expression value is 10,the object rotates clockwise at 9 degrees
per second ;when the expression value is 100,the object rotates
clockwise at 90 degrees per second.

Step 3: When configuration is complete, press the “OK” button to


complete the configuration of the “RotationSpeed” animation; the
animation configuration of this graphics will be displayed in the
“Animation” window, as shown in the figure below:
To delete the animation, simply select the animation in the animation
list and then right click the mouse and select “Delete”, as shown in
the figure below:
2. Steps to configure rotation angle are as follows:
Step 1: Open the project window where the animation needs to be
configured under the DIAView development environment → select
the graphic object to configure animation in the sketchpad → open
the “Animation” window → select “RotationAngle” → click the button
in the “RotationAngle” bar , as shown in the figure below:
Step 2: The rotation angle animation configuration window will
appear, as shown in the figure below:

The meanings of each setting in the configuration window are as
follows:
Expression: Enter the variable name or expression; you can also
click the ​button to open the variable browser to select a
variable, the “Clear” button can clear the contents in the input box.
MinimumValue:
Ø Value: Set a minimun value for expression
Ø RotationAngle: Set a minimun value for rotation angle
MaximumValue:
Ø Value: Set a maximum value for expression
Ø RotationAngle: Set a maximum value for rotation angle
Step 3: When configuration is complete, press the “OK” button to
complete the configuration of the “RotationAngle” animation; the
animation configuration of this graphics will be displayed in the
“Animation” window, as shown in the figure below:
To delete the animation, simply select the animation in the animation
list and then right-click the mouse and select “Delete”, as shown in
the figure below:
3. Steps to configure rotation control animation are as follows:
Step 1: Open the project window where the animation needs to be
configured under the DIAView development environment → select
the graphic object to configure animation in the sketchpad → open
the “Animation” window → select “RotationControl” → click the
button in the “RotationControl” bar , as shown in the figure below:
Step 2: The rotation control window will appear, as shown in the
figure below:

The meanings of each setting in the configuration window are as
follows:
Expression: Enter the variable name or expression; you can also
click the ​button to open the variable browser to select a
variable, the “Clear” button can clear the contents in the input box.
Expression Is True:Set starting or stopping rotation when the
expression is true
Ø Begin to Rotate : Start rotating when expression is true
Ø Stop to Rotate: Stop rotating when expression is true
Property:
Ø Step(Degree): Set the angle at which the object rotates one
step(Unit:Degree)
Ø Speed(ms): Set the time required for each rotation step of the
object(Unit:ms)
Step 3: When configuration is complete, press the “OK” button to
complete the configuration of the “RotationControl” animation; the
animation configuration of this graphics will be displayed in the
“Animation” window, as shown in the figure below:

To delete the animation, simply select the animation in the animation


list and then right-click the mouse and select “Delete”, as shown in
the figure below:
4. Steps to configure discrete rotation animation are as follows:
Step 1: Open the project window where the animation needs to be
configured under the DIAView software development environment →
select the graphic object to configure animation in the sketchpad →
open the “Animation” window → select “DiscreteRotation”→ click the
button in the “DiscreteRotation” bar, as shown in the figure below:
Step 2: The discrete rotation animation configuration window will
appear, as shown in the figure below:

The meanings of each setting in the configuration window are as
follows:
Expression: Enter the variable name or expression; you can also
click the ​按button to open the variable browser to select a
variable, the “Clear” button can clear the contents in the input box.
Filling configuration:​
Ø Comparison operators:: Sets the comparison operator symbol
between the “Expression” and “Expression value”; it is a drop-down
menu that includes 6 options:
l <: Less than
l <=: Less than or equal to
l =: Equal to (preset)
l !=: Not equal to
l >=: Greater than or equal to
l >: Greater than
Ø Value: Sets the reference value for the “Expression” to compare
to; it can be an integer or decimal .
Ø Angle: Sets the corresponding rotation angle.
Ø “Add” button: Press this button to add configuration items, as
shown in the figure below:


Ø “Delete” button: Pressing this button after selecting a certain
configuration item will delete that configuration item.
Step 3: When configuration is complete, press the “OK” button to
complete the configuration of the “DiscreteRotation” animation; the
animation configuration of this graphics will be displayed in the
“Animation” window, as shown in the figure below:
To delete the animation, simply select the animation in the animation
list and then right-click the mouse and select “Delete”.
8.3 Appearance animation
Appearance animation refers to changing the brush color of the
graphic, and also changing the properties of the graphic including
the “background color/fill color” and “line color/border color”.

Appearance animations include two property animations “Brush”


and “Stroke”; the following is the configuration steps of the “Brush”
property animation.

Configuring steps are as follows:

Step 1: Open the project window where the animation needs to be


configured under the DIAView software development environment →
select the graphic object to configure animation in the sketchpad →
open the “Animation” window → select “Brush”→ click the button in
the “Brush” field, as shown in the figure below:
Step 2: The brush animation configuration window will appear, as
shown in the figure below:
The meanings of each setting in the configuration window are as
follows:

Expression: Enter the variable name or expression; you can also


click the button to open the variable browser to select a
variable, the “Clear” button can clear the contents in the input box.

Filling configuration:

Ø Comparison Operators: Sets the comparison operator symbol


between the “Expression” and “Value”; it is a drop-down menu that
includes 6 options:

l <: Less than

l <=: Less than or equal to

l =: Equal to (preset)
l !=: Not equal to

l >=: Greater than or equal to

l >: Greater than

Ø Value: Sets the reference value for the “Expression” to compare


to; it can be an integer or decimal

Ø Effect: Sets the color effects.

Ø “Add” button: Click this button to add a fill configuration item, as


shown in the figure below:

Ø “Delete” button: Pressing this button after selecting a certain fill


configuration item will delete that fill configuration item.

Step 3:When configuration is complete, press the “OK” button to


complete the configuration of the “Brush” animation; the animation
configuration of this graphics will be displayed in the “Animation”
window, as shown in the figure below:

To delete the animation, simply select the animation in the


animation list and then right-click the mouse and select “Delete”.
8.4 Fill animation
Fill animation refers to controlling the fill effect of the graphic object
through variables or expression values and changing the “fill ratio”
and “fill direction” properties of the graphic object.
Depending on the fill direction, the fill animation is divided into four
types: “HorizontalFill”, “HorizontalDiscreteFill”, “VerticalFill” and
“VerticalDiscrete Fill”. The configuration steps for the horizontal and
vertical directions are the same. The following are the configuration
steps.
1. Steps to configure “HorizontalFill” animations are as follows:
Step 1: Open the project window where the animation needs to be
configured under the DIAView development environment → select
the graphic object to configure animation in the sketchpad → open
the “Animation” window → select “Fill”→ click the button in the
“HorizontalFill” field, as shown in the figure below:

Step 2: The horizontal fill animation configuration window will
appear, as shown in the figure below:

The meanings of each setting in the configuration window are as
follows:
Expression: Enter the variable name or expression; you can also
click the ​button to open the variable browser to select a
variable, the “Clear” button can clear the contents in the input box.
MinimumValue:
Ø Value: Sets the minimum value of the “Expression”
Ø Percentage: Sets the minimum value for the fill percentage
MaximumValue:
Ø Value: Sets the maximum value of the “Expression”
Ø Percentage: Sets the maximum value for the fill percentage
Fill Attributes:
Ø HorizontalFillDirection: Sets the fill direction; it is a drop-down
menu that includes 3 options:
l Left to Right
l Right to Left
l Center to Sides
Step3: When configuration is complete, press the “OK” button to
complete the configuration of the “HorizontalFill ” animation; the
animation configuration of this graphics will be displayed in the
“Animation” window, as shown in the figure below:


To delete the animation, simply select the animation in the animation
list and then right-click the mouse and select “Delete”.
※ What’s different when configuring “VerticalFill” animations:
Fill Attributes:
Ø VerticalDiscreteFill: Sets the fill direction; it is a drop-down menu
that includes 3 options:
l Top to Bottom
l Bottom to Up
l Center to Sides
2. Steps to configure “HorizontalDiscreteFill” animation are as
follows:
Step 1: Open the project window where the animation needs to be
configured under the DIAView software development environment →
select the graphic object to configure animation in the sketchpad →
open the “Animation” window → select “Fill”→ click the button in the
“HorizontalDiscreteFill” field, as shown in the figure below:

Step 2: The horizontal discrete fill animation configuration window
will appear, as shown in the figure below:

The meanings of each setting in the configuration window are as
follows:
Expression: Enter the variable name or expression; you can also
click the ​button to open the variable browser to select a
variable; the “Clear” button can clear the contents in the input box.
Filling configuration:
Ø Comparison Operators: Sets the comparison operator symbol
between the “Expression” and “Value”, it is a drop-down menu that
includes 6 options:
l <: Less than
l <=: Less than or equal to
l =: Equal to (preset)
l !=: Not equal to
l >=: Greater than or equal to
l >: Greater than
Ø Value: Sets the reference value for the “Expression” to compare to;
it can be an integer or decimal .
Ø Percentage: Sets the corresponding fill percentage.
Ø “Add” button: Press this button to add configuration items, as
shown in the figure below:


Ø “Delete” button: Pressing this button after selecting a certain
configuration item will delete that configuration item.
Fill Attributes:
Ø HorizontalFillDirection: Sets the fill direction; it is a drop-down
menu that includes 3 options:
l Left to Right
l Right to Left
l Center to Sides
Step 3:When configuration is complete, press the “OK” button to
complete the configuration of the “HorizontalDiscreteFill” animation;
the animation configuration of this graphics will be displayed in the
“Animation” window, as shown in the figure below:

To delete the animation, simply select the animation in the animation


list and then right-click the mouse and select “Delete”.
※ What’s different when configuring “VerticalDiscreteFill” animations:
Fill Attributes:
Ø Vertical discrete fill direction: Sets the fill direction; it is a drop-
down menu that includes 3 options:
l Top to Bottom
l Bottom to Up
l Center to Sides
8.5 Zoom animation
Zoom animation refers to controlling the size of the graphic object
through variables or expression values and changing the “size”
property of the graphic object.
Depending on the zoom direction, the zoom animation is divided
into four types: “HorizontalZoom”, “HorizontalDiscreteZoom”,
“VerticalZoom” and “VerticalDiscreteZoom”. The configuration steps
for the horizontal and vertical directions are the same. The following
are the configuration steps.
1.Steps to configure “HorizontalZoom” animations are as follows:
Step 1: Open the project window where the animation needs to be
configured under the DIAView software development environment →
select the graphic object to configure animation in the sketchpad →
open the “Animation” window → select “HorizontalZoom”→ click the
button in the “HorizontalZoom” bar, as shown in the figure below:
Step 2: The horizontal zoom animation configuration window will
appear, as shown in the figure below:

The meanings of each setting in the configuration window are as
follows::
Expression: Input the variable name or expression; you can also
click the ​button to open the variable browser to select a
variable, the “Clear” button can clear the contents in the input box.
MinimumValue:
Ø Value: Sets the minimum value of the “Expression”
Ø Percentage: Sets the minimum value for the horizontal zoom
percentage
MaximumValue:
Ø Value: Sets the maximum value of the “Expression”
Ø Percentage: Sets the maximum value for the horizontal zoom
percentage
Zoom Attributes:
Ø HorizontalZoomDirection: Sets the zoom direction; it is a drop-
down menu that includes 3 options:
l Left to Right
l Right to Left
l Center to Sides
Step 3: When configuration is complete, press the “OK” button to
complete the configuration of the “HorizontalZoom” animation; the
animation configuration of this graphics will be displayed in the
“Animation” window, as shown in the figure below:

To delete the animation, simply select the animation in the animation


list and then right-click the mouse and select “Delete”.
※ What’s different when configure “Vertical zoom” animations:
Zoom Attributes:
Ø VerticalZoomDirection: Sets the zoom direction; it is a drop-
down menu that includes 3 options:
​l Top to Bottom
​l Bottom to Up
​l Center to Sides

2.Steps to configure “HorizontalDiscreteZoom” animations are as


follows:
Step 1: Open the project window where the animation needs to be
configured under the DIAView software development environment →
select the graphic object to configure animation in the sketchpad →
open the “Animation” window → select “HorizontalDiscreteZoom” →
click the button in the “HorizontalDiscreteZoom” bar, as shown in the
figure below:
Step 2: The horizontal discrete zoom animation configuration
window will appear, as shown in the figure below:

The meanings of each setting in the configuration window are as
follows:
Expression: Enter the variable name or expression; you can also
click the ​button to open the variable browser to select a
variable; the “Clear” button can clear the contents in the input box.
Zoom configuration:
​Ø Comparison operators: Sets the comparison operator symbol
between the “Expression” and “Value”, it is a drop-down menu that
includes 6 options:
​l <: Less than
​l <=: Less than or equal to
​l =: Equal to (preset)
​l !=: Not equal to
​l >=: Greater than or equal to
​l >: Greater than
​Ø Value: Sets the reference value for the “Expression” to compare to;
it can be an integer or decimal.
​Ø Percentage: Sets the corresponding zoom percentage.
​Ø “Add” button: Press this button to add configuration items, as
shown in the figure below:


​Ø “Delete” button: Pressing this button after selecting a certain
configuration item will delete that configuration item.
Zoom Attributes:
​Ø HorizontalZoomDirection: Sets the zoom direction; it is a drop-
down menu that includes 3 options
​l Left to Right
​l Right to Left
​l Center to Sides
Step 3: 3:When configuration is complete, press the “OK” button to
complete the configuration of the “Horizontal discrete zoom”
animation; the animation configuration of this graphics will be
displayed in the “Animation” window, as shown in the figure below:


To delete the animation, simply select the animation in the animation
list and then right-click the mouse and select “Delete”.
※ What’s different when configuring “Vertical discrete zoom”
animations:
Zoom Attributes
​Ø VerticalZoomDirection: Sets the zoom direction; it is a drop-down
menu that includes 3 options
​l Top to Bottom
​l Bottom to Up
​l Center to Sides
8.6 Move animation
Move animation refers to controlling the position of the graphic
object through variables or expression values and changing the
“coordinates” property of the graphic object.
Move animation is divided into three types: “HorizontalMove”,
“VerticalMove” and “DiscreteMove”, in which the configuration steps
of horizontal and vertical movement are the same. The following are
the configuration steps:
1.Steps to configure “HorizontalMove” animations are as follows:
Step 1:Open the project window where the animation needs to be
configured under the DIAView software development environment →
select the graphic object to configure animation in the sketchpad →
open the “Animation” window → select “HorizontalMove”→ click the
button in the “HorizontalMove” bar, as shown in the figure below:
Step 2: The horizontal move animation configuration window will
appear, as shown in the figure below:

The meanings of each setting in the configuration window are as
follows:
Expression: Enter the variable name or expression; you can also
click the ​button to open the variable browser to select a
variable, the “Clear” button can clear the contents in the input box.
Left:
Ø Value: Sets the minimum value of the “Expression”
Ø Location: Sets the coordinates of the left-most position that can be
reached for horizontal movement
Right:
Ø Value: Sets the maximum value of the “Expression”
Ø Location: Sets the coordinates of the right-most position that can be
reached for horizontal movement
Step 3:When configuration is complete, press the “OK” button to
complete the configuration of the “HorizontalMove” animation; the
animation configuration of this graphics will be displayed in the
“Animation” window, as shown in the figure below:
To delete the animation, simply select the animation in the animation
list and then right-click the mouse and select “Delete”.
2. Steps to configure “DiscreteMove” animations are as follows:
Step 1:Open the project window where the animation needs to be
configured under the DIAView software development environment →
select the graphic object to configure animation in the sketchpad →
open the “Animation” window → select “DiscreteMove”→ click the
button in the “DiscreteMove” field, as shown in the figure below:
Step 2: The discrete move animation configuration window will
appear, as shown in the figure below:

The meanings of each setting in the configuration window are as
follows:
Expression: Enter the variable name or expression; you can also
click the ​button to open the variable browser to select a
variable; the “Clear” button can clear the contents in the input box.
Move configurations:
Ø Comparison Operators: Sets the comparison operator symbol
between the “Expression” and “Value”, it is a drop-down menu that
includes 6 options:
l <: Less than
l <=: Less than or equal to
l =: Equal to (preset)
​l !=: Not equal to
​l >=: Greater than or equal to
​l >: Greater than
​Ø Value: Sets the reference value for the “Expression” to compare to;
it can be an integer or decimal.
​Ø Coordinate: Sets the correspondingposition coordinates.
​Ø “Add” button: Press this button to add configuration items, as
shown in the figure below:


​Ø “Delete” button: Pressing this button after selecting a certain
configuration item will delete that configuration item.
Step 3:When configuration is complete, press the “OK” button to
complete the configuration of the “DiscreteMove” animation; the
animation configuration of this graphics will be displayed in the
“Animation” window, as shown in the figure below:

To delete the animation, simply select the animation in the
animation list and then right-click the mouse and select “Delete”.
8.7 Visibility animation
Visibility animation refers to controlling the visibility of the graphic
object through variables or expression values and changing the
“Visibility” property of the graphic object.
According to the visibility effect, visibility animations are divided
into two types: “Visibility” and “Blink”; the difference between them
are: Blinking makes the graphic switch between display and hide
according to a fixed frequency in order to achieve blinking effects;
visibility changes the graphic from display to hide or from hide to
display according to the conditions; it is only a single action.
1. Steps to configure blinking animation are as follows:
Step 1:Open the project window where the animation needs to be
configured under the DIAView software development environment →
select the graphic object to configure animation in the sketchpad →
open the “Animation” window → select “Blink” → click the button in
the “Blink” bar, as shown in the figure below:
Step 2: The blink animation configuration window will appear, as
shown in the figure below:


The meanings of each setting in the configuration window are as
follows:
Expression: Enter the variable name or expression; you can also
click the ​button to open the variable browser to select a
variable, the “Clear” button can clear the contents in the input box.
BlinkSpeed: Sets the Blink frequency; it is a drop-down menu with
3 options:
l Slow
l Medium
l Fast
Step 3: When configuration is complete, press the “OK” button to
complete the configuration of the “Blink” animation; the animation
configuration of this graphics will be displayed in the “Animation”
window, as shown in the figure below:
To delete the animation, simply select the animation in the animation
list and then right-click the mouse and select “Delete”.
2. Steps to configure visibility animation are as follows:
Step 1:Open the project window where the animation needs to be
configured under the DIAView software development environment →
select the graphic object to configure animation in the sketchpad →
open the “Animation” window → select “Visibility”→ click the button
in the “Visibility” bar, as shown in the figure below:
Step 2: The visibility animation configuration window will appear, as
shown in the figure below:


The meanings of each setting in the configuration window are as
follows:
Expression: Enter the variable name or expression; you can also
click the ​button to open the variable browser to select a
variable; the “Clear” button can clear the contents in the input box.
Step 3: When configuration is complete, press the “OK” button to
complete the configuration of the “Visibility” animation; the animation
configuration of this graphics will be displayed in the “Animation”
window, as shown in the figure below

To delete the animation, simply select the animation in the


animation list and then right-click the mouse and select “Delete”.
8.8 Flowing animation
Flowing animation can only be configured for the “Pipe” graphic
object, which is changing the “Liquid” flow property of the pipe.
Flowing animation are divided into two types: “LineFlow” and
“FlowControl”; they cannot be configured at the same time .
“LineFlow” refers to setting a variable or expression and
comparing them with the default value.When it matches the
comparison conditions , the liquid in the pipe will flow according
configured flowing speed ;
“FlowControl” refers to using whether expressions or discrete
variable values are true or false to control whether the liquid in the
pipe will flow; the flow speed can also be set at the same time .
1. Steps to configure line flow animation are as follows:
Step 1: Open the project window where the animation needs to be
configured under the DIAView software development environment →
select the graphic object to configure animation in the sketchpad →
open the “Animation” window → select “LineFlow”→ click the button
in the “LineFlow” bar, as shown in the figure below:

Step 2: The line flow animation configuration window will appear, as


shown in the figure below:

The meanings of each setting in the configuration window are as
follows:
Expression: Enter the variable name or expression; you can also
click the ​button to open the variable browser to select a
variable; the “Clear” button can clear the contents in the input box.
Filling configuration:
Ø Comparison Operators: Sets the comparison operator symbol
between the “Expression” and “Value”; it is a drop-down menu that
includes 6 options:
l <: Less than
l <=: Less than or equal to
l =: Equal to (preset)
l !=: Not equal to
l >=: Greater than or equal to
l >: Greater than
Ø Value: Sets the reference value for the “Expression” to compare to;
it can be an integer or decimal .
Ø Current Speed: Sets the flowing speed of the liquid; it is a drop-
down menu that includes 6 options
l Static
l Slow
l Medium Speed
l Fast
Ø “Add” button: Press this button to add configuration items, as
shown in the figure below:


Ø “Delete” button: Pressing this button after selecting a certain
configuration item will delete that configuration item.
Step 3:When configuration is complete, press the “OK” button to
complete the configuration of the “LineFlow” animation. The
animation configuration of this graphics will be displayed in the
“Animation” window, as shown in the figure below:

To delete the animation, simply select the animation in the animation
list and then right-click the mouse and select “Delete”.
2. Steps to configure flow control animation are as follows:
Step 1:Open the project window where the animation needs to be
configured under the DIAView software development environment →
select the graphic object to configure animation in the sketchpad →
open the “Animation” window → select “FlowControl”→ click the
button in the “FlowControl” bar, as shown in the figure below:

Step 2: The flow control animation configuration window will appear,


as shown in the figure below:
The meanings of each setting in the configuration window are as
follows:
Expression: Enter the variable name or expression; you can also
click the ​button to open the variable browser to select a
variable; the “Clear” button can clear the contents in the input box.
Flow Attributes: Sets the flowing speed of the liquid; it is a drop-
down menu thatincludes 6 options:
l Static
l Slow
l Medium Speed
l Fast
Step 3: When configuration is complete, press the “OK” button to
complete the configuration of the “FlowControl” animation. The
animation configuration of this graphics will be displayed in the
“Animation” window, as shown in the figure below:

To delete the animation, simply select the animation in the


animation list and then right-click the mouse and select “Delete”.
8.9 Value display animation
Value display animations can only be configured for “Text”,
“TextBox” and “Label” ; changing their “Content” property will allow
the text display to change according to the changes in the
associated variable value and conditions set.
Value display animations are divided into four types:
“TextDisplay”,“AnalogValueDisplay”, “AnalogValueStringDisplay”,
“DiscreteValueDisplay” and ; they cannot be configured
simultaneously.
“TextDisplay” animation associates a variable directly or by setting
strings. It allows the displayed content of the graphic object to be the
associated variable value or the setting string.
“AnalogValueDisplay” animation associates an analog (integer or
real) variable and sets the display format of the value so that the
variable value is displayed in the graphic object according to the
setting format.
“AnalogValueStringDisplay” animation associates an analog
(integer or real) variable and compares the variable value with the
setting value . When it matches the comparison conditions, the
content displayed in the graphic object is the string value set.
“DiscreteValueDisplay” animation associates a digital (bool)
variable; different display contents are set according to the variable
value.

1. Steps to configure analog value string display animation are as


follows:
Step 1:Open the project window where the animation needs to be
configured under the DIAView software development environment →
select the graphic object to configure animation in the sketchpad →
open the “Animation” window → select “AnalogValueStringDisplay”→
click the button in the “AnalogValueStringDisplay” bar, as shown in
the figure below:

Step 2: The analog value string display animation configuration


window will appear, as shown in the figure below:

The meanings of each setting in the configuration window are as
follows:
Expression: Input the variable name or expression; you can also
click the ​button to open the variable browser to select a
variable; the “Clear” button can clear the contents in the input box.
Analog value string configuration:
Ø Comparison Operators: Sets the comparison operator symbol
between the “Expression” and “Value”; it is a drop-down menu that
includes 6 options:
l <: Less than
l <=: Less than or equal to
l =: Equal to (default)
l !=: Not equal to
l >=: Greater than or equal to
l >: Greater than
Ø Value: Sets the reference value for the “Expression” to compare to;
it can be an integer or decimal.
Ø Current Value: Sets the text or resource or expression of the
string; which the comparison conditions set are met, this value will
be displayed in the content of the graphic object.
Ø “Add” button: Press this button to add a configuration item, as
shown in the figure below:

Ø “Delete” button: Pressing this button after selecting a certain


configuration item will delete that configuration item.

Step 3:When configuration is complete, press the “OK” button to


complete the configuration of the “AnalogValueStringDisplay”
animation; the animation configuration of this graphics will be
displayed in the “Animation” window, as shown in the figure below:
To delete the animation, simply select the animation in the animation
list and then right-click the mouse and select “Delete”.
2. Steps to configure analog value display animation are as follows:
Step 1:Open the project window where the animation needs to be
configured under the DIAView software development environment →
select the graphic object to configure animation in the sketchpad →
open the “Animation” window → select “AnalogValueDisplay”→ click
the button in the “AnalogValueDisplay” bar, as shown in the figure
below:
Step 2: The analog value display animation configuration window
will appear, as shown in the figure below:

The meanings of each setting in the configuration window are as
follows:
Expression: Input the associated variable name; you can also
click the ​button to open the variable browser to select a
variable; the “Clear” button can clear the contents in the input box.
IntegerDigits:Set the number of digits for the integer; the default
value is 1. If the number of integer digits of the outputted value is
less than the value set here, a zero will be added to the highest digit.
If it is greater than the value set here, it will output according to the
actual number of digits there are Setting it to 0 means not adding a
zero to the displayed output value. For example: Of the number of
digits of the integer is set as 3 and the output value is 10, it will
display 010; and if the output value is 165, it will display 165.
DecimalDigits: Sets the number of decimal numbers; the default
value is 2. If the number of decimal places of the outputted value is
less than the value set here, a zero will be added behind the lowest
digit. If it is greater than the value set here, it will be rounded off to
the setting number of decimal places. Moreover, 1 will be added if
greater than 5 and eliminated if less than 5. Setting it to 0 means do
not display decimal places. Decimal places are set for all associated
engineering variables; they will not affect the settings here. For
example: When the number of decimal places is set to 2 and the
output value is 2.3, it will display 2.30; if the output value is 0.125, it
will display 0.12; if the output value is 0.126, it will display 0.13.

Scientific Notation: Sets whether to use scientific notation to


display the variable value.
Thousand Separator: Sets whether to use the thousand
seperator.

Step 3: When configuration is complete, press the “OK” button to


complete the configuration of the “AnalogValueDisplay” animation;
the animation configuration of this graphics will be displayed in the
“Animation” window, as shown in the figure below:
To delete the animation, simply select the animation in the animation
list and then right-click the mouse and select “Delete”.
3. Steps to configure discrete value display animation are as follows:
Step 1:Open the project window where the animation needs to be
configured under the DIAView software development environment →
select the graphic object to configure animation in the sketchpad →
open the “Animation” window → select “DiscreteValueDisplay”→
click the button in the “DiscreteValueDisplay” bar , as shown in the
figure below:

Step 2: The discrete value display animation configuration window


will appear, as shown in the figure below:
The meanings of each setting in the configuration window are as
follows:
Expression: Input the associated variable name or expression;
you can also click the ​button to open the variable browser to
select a variable; the “Clear” button can clear the contents in the
input box.
WhenTrue,DisplayString: Sets the display content of the graphic
object when the expression is true,support for multilingual
functionality.
WhenFalse,DisplayString: Sets the display content of the graphic
object when the expression is false,support for multilingual
functionality.
Step 3:When the configuration is complete, press the “OK” button to
complete the configuration of the “DiscreteValueDisplay” animation.
The animation configuration of these graphics will be displayed in the
“Animation” window, as shown in the figure below:
To delete the animation, simply select the animation in the
animation list and then right-click the mouse and select “Delete”.

4. Steps to configure text display animation are as follows:


Step 1:Open the project window where the animation needs to be
configured under the DIAView software development environment →
select the graphic object to configure animation in the sketchpad →
open the “Animation” window → select “TextDisplay”→ click the
button in the “TextDisplay” bar , as shown in the figure below:
Step 2: The text display animation configuration window will appear,
as shown in the figure below:


The meanings of each setting in the configuration window are as
follows:
Expression: Input the associated variable name or string value;
you can also click the ​button to open the variable browser to
select a variable; the “Clear” button can clear the contents in the
input box.
Step 3:When configuration is complete, press the “OK” button to
complete the configuration of the “TextDisplay” animation. The
animation configuration of this graphics will be displayed in the
“Animation” window, as shown in the figure below:

l Text display animation can not only display single variable value but
also can recycle displaying all the alarm information of associated
alarm group.
l To delete the animation, simply select the animation in the
animation list and then right-click the mouse and select “Delete”.
8.10 Skew animation
Skew animation refers to controlling the slope level of the graphic
object through variables or expression values and changing the
“Skew” property of the graphic object.
Slope animation is divided into four types: “HorizontalSkew”,
“VerticalSkew” ,“HorizontalDiscreteSkew” and
“VerticalDiscreteSkew”.
“HorizontalSkew” animation refers to the slope level of the graphic
object in the horizontal direction.
“VerticalSkew” animation refers to the slope level of the graphic
object in the vertical direction.
“HorizontalDiscreteSkew” means that the horizontal slope angle of
the graphic object is related to the discrete variable.
“VerticalDiscreteSkew” means that the vertical slope angle of the
graphic object is related to the discrete variable.
1. The configuration process is as follows,take the animation of
"horizontal Skew" and "horizontal discrete Skew" as examples:
Step 1:Open the project window where the animation needs to be
configured under the DIAView software development environment →
select the graphic object to configure animation in the sketchpad →
open the “Animation” window → select “HorizontalSkew”→ click the
button in the “HorizontalSkew” bar, as shown in the figure below:
Step 2: The horizontal skew animation configuration window will
appear, as shown in the figure below:
The meanings of each setting in the configuration window are as
follows:
Expression: Input the variable name or expression; you can also
click the ​button to open the variable browser to select a
variable; the “Clear” button can clear the contents in the input box.
MinimumValue:
Ø Value: Sets the minimum value of the “Expression”
Ø HorizontalSkew: Sets the minimum value for the Horizontal slope
MaximumValue:
Ø Value: Sets the maximum value of the “Expression”
Ø HorizontalSkew: Sets the maximum value for the Horizontal slope
Step 3: When configuration is complete, press the “OK” button to
complete the configuration of the “HorizontalSkew” animation; the
animation configuration of this graphics will be displayed in the
“Animation” window, as shown in the figure below:
To delete the animation, simply select the animation in the animation
list and then right-click the mouse and select “Delete”.

2. Steps to configure the Horizontal discrete slope animation are as


follows:
Step 1:Open the project window where the animation needs to be
configured under the DIAView software development environment →
select the graphic object to configure animation in the sketchpad →
open the “Animation” window → select “HorizontalDiscreteSkew”→
click the button in the “HorizontalDiscreteSkew” fbar, as shown in the
figure below:
Step 2: The horizontal discrete skew animation configuration window
will appear, as shown in the figure below:
The meanings of each setting in the configuration window are as
follows:
Expression: Input the variable name or expression; you can also
click the ​button to open the variable browser to select a
variable; the “Clear” button can clear the contents in the input box.
Filling configuration:
Ø Comparison Operators: Sets the comparison operator symbol
between the “Expression” and “Value”; it is a drop-down menu that
includes 6 options:
l <: Less than
l <=: Less than or equal to
l =: Equal to (preset)
l !=: Not equal to
l >=: Greater than or equal to
l >: Greater than
Ø Value: Sets the reference value for the “Expression” to compare to;
it can be an integer or decimal.
Ø Skew: Sets the corresponding slope level.
Ø “Add”button: Press this button to add configuration items, as
shown in the figure below:

Ø “Delete” button: Pressing this button after selecting a certain


configuration item will delete that configuration item.
Step 3:When configuration is complete, press the “OK” button to
complete the configuration of the “HorizontalDiscreteSkew”
animation. The animation configuration of this graphics will be
displayed in the “Animation” window, as shown in the figure below:
To delete the animation, simply select the animation in the
animation list and then right-click the mouse band select “Delete”.
8.11 Text animation
Text animation is to control the forecolor of object by variable or
expression value to make the text color blink alternately.

1.Steps to configure“TextColor”animation are as follows:

Step 1:

Open the project window where the animation needs to be


configured under the DIAView software development environment →
select the graphic object to configure animation in the sketchpad →
open the “Animation” window → select “TextColor”→ click the button
in the “TextColor” bar, as shown in the figure below:
Step 2: The text color animation configuration window will appear, as
shown in the figure below:
The meanings of each setting in the configuration window are as
follows:

Expression: Input the variable name or expression; you can also


click the button to open the variable browser to select a variable; the
“Clear” button can clear the contents in the input box.

Ø Comparison Operators: Sets the comparison operator symbol


between the “Expression” and “Value”; it is a drop-down menu that
includes 6 options:

l <: Less than

l <=: Less than or equal to

l =: Equal to (preset)

l !=: Not equal to


l >=: Greater than or equal to

l >: Greater than

Ø Value: Sets the reference value for the “Expression” to compare to;
it can be an integer or decimal.

Ø Effect: set color effect.

Ø “Add” button: Press this button to add configuration items, as


shown in the figure below:

Ø “Delete” button: Pressing this button after selecting a certain


configuration item will delete that configuration item.

Step 3:When configuration is complete, press the “OK” button to


complete the configuration of the “TextColor” animation. The
animation configuration of this graphics will be displayed in the
“Animation” window, as shown in the figure below:
To delete the animation, simply select the animation in the
animation list and then right-click the mouse and select “Delete”.
9.1 Overview
Events are operations that can be identified and responded by
graphic objects; they are divided into system events and user
events. Events in the DIAView software are usually user
events,which are operations that users performed to various graphic
objects in the window, which further drives the graphic control to
execute certain functions.

Events in the DIAView software refers to the related script handler


that are triggered when the user performs operations to the graphic
object with the mouse and keyboard etc.; therefore, event
configuration is mainly using script editors to configure script
programs, or use packaged programs: the script editor of DIAView
includes many written commands and system functions that users
can use directly in the script program

The DIAView software has comprehensive event operating


functions; events include mouse and form operations and value input
etc. Each kind of event can only be configured once to the same
corresponding graphic object.
9.2 Left button event
Left Button Event is an event triggered by performing operations
with clicking the left mouse button, which will further use related script
handlers to complete related functions.
There are two types of Left Button Events: LeftButtonDown and
LeftButtonUp.
The configuration is as follows, taking “LeftButtonDown” event as
an example:
Step 1:Open project window where the animation needs to be
configured under the DIAView software development environment →
select graphic object to configure event in the sketchpad → open
“Event” window → select “LeftButtonDown”→ click the button in
“LeftButtonDown” bar, as shown in the figure below:

Step 2: The event script editor window will appear, as shown in the
figure below:
Step 3: Write the script (The DIAView software uses the Visual Basic
Script; the script editor will check for basic syntax errors), as shown in
the figure below:
Step 4: Once the script is written and checked with no errors, click
“Save and exit button” ​to complete event configuration; information
on the configured event will be displayed in the event window, as

shown in the figure below: ​


To delete an event, simply select the event in the event list and
then right-click the mouse and select “Delete”.
9.3 Right button event
Right Button Event is an event triggered by performing operations
with clicking the right mouse button, which will further use related
script handlers to complete related functions.
There are two types of Right Button Events: RightButtonDown
and RightButtonUp.
The configuration process is as follows, taking the “RightButtonDown”
event as an example:
Step 1: Open project window where the animation needs to be
configured under the DIAView software development environment →
select graphic object to configure event in the sketchpad → open
“Event” window → select “RightButtonDown”→ click the button in
“RightButtonDown” bar, as shown in the figure below:
Step 2: The event script editor window will appear, as shown in the
figure below:
Step 3: Write the script (The DIAView software uses the Visual Basic
Script; the script editor will check for basic syntax errors), as shown in
the figure below:
Step 4: Once the script is written and checked with no errors, click
“Save and exit button” to complete event configuration; information
on the configured event will be displayed in the event window, as
shown in the figure below:
To delete an event, simply select the event in the event list and
then right-click the mouse and select “Delete”.
9.4 Mouse event
Mouse event is an event triggered by performing moving and clicking
operations with the mouse on the graphic object, which will further
use related script handlers to complete related functions.

There are six types of Mouse events: MouseEnter, MouseLeave,


MouseWheel, MouseMove, MouseDown and MouseUp.

The configuration is as follows, taking “MouseEnter” event as an


example:

Step 1:Open project window where the animation needs to be


configured under the DIAView software development environment →
select graphic object to configure event in the sketchpad → open
“Event” window → select “MouseEnter”→ click the button in the
“MouseEnter” bar, as shown in the figure below:
Step 2: The event script editor window will appear, as shown in the
figure below:
Step 3: Write the script (The DIAView software uses the Visual Basic
Script; the script editor will check for basic syntax errors), as shown in
the figure below:
Step 4: Once the script is written and checked with no errors, click
“Save and exit button” to complete event configuration; information
on the configured event will be displayed in the event window, as
shown in the figure below:
To delete an event, simply select the event in the event list and
then right-click the mouse and select “Delete”.
9.5 Window operation event
Window Operation Event is to open and close windows.
There are three types of Window Operation Events:
OpenWindow, CloseWindow, OpenWindowCloseothers.
OpenWindow means opening the setting Window, CloseWindow
means closing the setting Window and
OpenWindowCloseothers means opening the setting Window
and closing all other opened Windows besides the setting
Windows.
The configuration process is as follows, taking “OpenWindow” event
as an example:
Step 1: Open the project window where the animation needs to be
configured under the DIAView software development environment →
select graphic object to configure event in the sketchpad → open
“Event” window → select “OpenWindow”→ click the button in
“OpenWindow” bar, as shown in the figure below:

Step 2: The window configuration window will appear, as shown in
the figure below:
Step 3: Select the window to open from the “Window List” to the left,
and then click the “>” button to add it to the “Select Window” :

Ø Button functions:
l “>” : Add a window to selected window
l “>>”: Add all windows to the selected window
l “↓” : Move the window down
l “↓↓”: Move the window to the bottom
l “↑↑”: Move the window to the top
l “↑” : Move the window up
l “<” : Remove a window from selected window
l “<<”: Remove all windows from selected window

Step 4:When configuration is complete, press the “OK” button;


information of the configured event will be displayed in the “Event”
window, as shown in the figure below:
To delete an event, simply select the event in the event list and
then right-click themouse and select “Delete”.
9.6 Sliding input event
Sliding input event is an event triggered by moving the position of
graphic objects in the window to change the value of associated
variables.
There are two types of sliding input events: HorizontalSlide and
VerticalSlide.
The configuration is as follows, taking“Horizontalslide” event as an
example:
Step 1: Open the project window where the animation needs to be
configured under the DIAView software development environment →
select graphic object to configure event in the sketchpad → open
“Event” window → select “HorizontalSlide”→ click the button in
“HorizontalSlide” bar, as shown in the figure below:

Step 2: The Horizontal Slide configuration window will appear, as


shown in the figure below:

The meanings of each setting in the configuration window are as
follows:
Ø Variable:
l The associated variable name. You can also click the ​button to
open the variable browser to select a variable; the “Clear” button can
clear the contents in the input box
Ø Left Position:
l Location: Sets the value of the left-most position when the graphic
object slides horizontally
l VariableValue: Sets the variable value when the graphic object
slides horizontally and reaches the left-most position
Ø Right Position:
l Location: Sets the value of the right-most position when the graphic
object slides horizontally
l VariableValue: Sets the variable value when the graphic object
slides horizontally and reaches the right-most position
Ø Operation modes:
l SequentialWrite: The input value changes in real-time with the
moving position
l OnceWrite: The input value changes when the moving stops
Step 3:When configuration is complete, press the “OK” button to
complete the configuration of the “HorizontalSlide” event; the event
configuration of this graphic will be displayed in the “Event” window,
as shown in the figure below:


To delete an event, simply select the event in the event list and
then right-click the mouse and select “Delete”.
9.7 Value input event
Value Input event is when clicking a graphic object in the window
triggers the value input window of the DIAView software for value
input operations.
There are four types of value input events: AnalogValueInput,
DiscreteValueInput, StringInput and ButtonInput.
1.AnalogValueInput:
When this event is set for a graphic object, a analog value input
dialog will appear when this graphic object is clicked by the mouse in
the DIAView software runtime environment, including digital buttons;
users can click the digital buttons to input numbers to change the
value of the associated analog variable. Configuring steps are as
follows:
Step 1: Open the project window where the event needs to be
configured under the DIAView software development environment →
select graphic object to configure event in the sketchpad → open
“Event” window → select “AnalogValueInput”→ click the button in
“AnalogValueInput” bar, as shown in the figure below:

Step 2: The Analog Value Input configuration window will appear, as
shown in the figure below:
The meanings of each setting in the configuration window are as
follows:
Ø Variable:
l The associated variable name, the variable type is analog value;
you can also click the ​button to open the variable browser to
select a variable. The “Clear” button can clear the contents in the
input box
Ø Value range:
l MinimumValue: Sets the minimum value that can be input
l MaximumValue: Sets the maximum value that can be input
Ø Input Panel Size:
l Set the size of pop-up analog input keyboard
Ø Auto create animation:
l Set whether to automatically create the corresponding value
display animation(text, textbox, and label support this function)
Step 3:When configuration is complete, press the “OK” button to
complete the configuration of the “AnalogValueInput” event. The
event configuration of this graphic will be displayed in the “Event”
window, as shown in the figure below:


To delete an event, simply select the and then right-click the
mouse and select “Delete”.
2.DiscreteValueInput:
When this event is set for a graphic object, a discrete value input
dialog will appear when this graphic object is clicked by the mouse in
the DIAView software runtime environment.Users can set the
button’s text according to associated discrete variable value is True
or False. Configuring steps are as follows:
Step 1: Open the project window where the event needs to be
configured under the DIAView software development environment →
select the graphic object to configure event in the sketchpad → click
the “Value Input ” in the “Event” window → select
“DiscreteValueInput” from the options→ click the button in the
“DiscreteValueInput”bar, as shown in the figure below:

Step 2: The Discrete Value Input configuration window will appear,
as shown in the figure below:
The meanings of each setting in the configuration window are as
follows:
Ø Variable:Variable:
l The associated variable name, the variable type is digital value; you
can also click the ​button to open the variable browser to select
a variable; the “Clear” button can clear the contents in the input box
Ø Button text:
l SetTrue: Text content displayed by the button when the value is
True
l SetFalse: Text content displayed by the button when the value is
False
Ø Auto create animation:
l Set whether to automatically create the corresponding value
display animation(text, textbox, and label support this function)
Step 3:When configuration is complete, press the “OK” button to
complete the configuration of the “DiscreteValueInput” event. The
event configuration of this graphic will be displayed in the “Event”
window, as shown in the figure below:

To delete an event, simply select the event and then right-click
the mouse and select “Delete”.
3.StringInput:
When this event is set for a graphic object, a string input dialog will
appear when this graphic object is clicked by the mouse in the
DIAView software runtime environment; it includes letters and
number input keyboard and users can click the keys to enter strings
to change the value of the associated string variable.
Step 1:Open the project window where the event needs to be
configured under the DIAView software development environment →
select the graphic object to configure event in the sketchpad → click
the “Value Input” in the “Event” window → select “StringInput” from
the options→ click the button in the “StringInput” bar, as shown in the
figure below:


Step 2: The String Input configuration window will appear, as shown
in the figure below:
The meanings of each setting in the configuration window are as
follows:
Ø Variable:
l The associated variable name, the variable type is text amount; you
can also click the ​button to open the variable browser to select
a variable. The “Clear” button can clear the contents in the input box
Ø Display password:
l If this checkbox is selected, the input value will be displayed in a
password form
Ø Keyboard size:
l Set the size of pop-up string input keyboard under the runtime
environment
Ø Auto create animation:
l Set whether to automatically create the corresponding value
display animation(text, textbox, and label support this function)
Step 3:When configuration is complete, press the “OK” button to
complete the configuration of the “StringInput” event. The event
configuration of this graphic will be displayed in the “Event” window,
as shown in the figure below:


To delete an event, simply select the event and then right-click
the mouse and select “Delete”.
4.ButtonInput:
When this event is set for a graphic object, if this graphic object is
clicked with the mouse under the DIAView software runtime
environment, the value of the associated variable will change
according to the setting method ; for example, reset the value ,
addition or subtraction between the variable value and the setting
value etc. Configuring steps are as follows:
Step 1:Open the project window where the event needs to be
configured under the DIAView software development environment →
select the graphic object to configure event in the sketchpad → click
the “Value Input ” in the “Event” window → select “ButtonInput” from
the options→ click the button in the “ButtonInput” bar , as shown in
the figure below:


Step 2: The Button Input configuration window will appear, as shown
in the figure below:

The meanings of each setting in the configuration window are as


follows:
Ø Variable:
l The associated variable name, the variable type is analog value or
digital value; you can also click the ​button to open variable
browser to select a variable; the “Clear” button can clear the
contents in the input bax
Ø Input value:
l Input the setting value
Ø Nemerical type:
l Changes the variable value when the graphic object is pressed;
there are 6 types of changing methods:
² Set Value: Give the “InputValue” directly to the associated
variable; valid for analog values
² Increase: Adds the setting value to the associated variable value
and then give it to the associated variable; valid for analog values
² Decrease: Subtracts the setting value from the associated
variable value and then give it to the associated variable;valid for
analog values
² Multiply: Multiples the setting value to the associated variable
value and then give it to the associated variable; valid for analog
values
² Divide: Divides the variable value by the set value and then give
it to the associated variable; valid for analog values
² Toggle: The analog value switches between the two values 0
and 1, and the digital value switches between true and false
Ø Auto create animation:
l Set whether to automatically create the corresponding value
display animation(text, textbox, and label support this function)
Step 3:When configuration is complete, press the “OK” button to
complete the configuration of the “ButtonInput” event; the event
configuration of this graphic will be displayed in the “Event” window,
as shown in the figure below:

To delete an event, simply select the event in the event list and
then right-click the mouse and select “Delete”.
9.8 Rotation input event
Rotating input event is events triggered by rotating the angle of
graphic objects in the window which changes the value of associated
variables.
There is only one type of rotary input event: RotationInput.
Configuration steps are as follows:
Step 1:Open the project window where the event needs to be
configured under the DIAView software development environment →
select graphic object to configure event in the sketchpad → open
“Event” window → select “RotationInput”→ click the button in
“RotationInput” bar, as shown in the figure below:

Step 2: The Rotation Input configuration window will appear, as
shown in the figure below:

The meanings of each setting in the configuration window are as
follows:
Ø Variable:
l The associated variable name. You can also click the ​button
to open the variable browser to select a variable; the “Clear” button
can clear the contents in the input box
Ø Anti-clockwise:
l Angle: Sets the counter-clockwise rotation angle of the graphic
object (Unit: degrees)
l VariableValue: Sets the variable value for the counter-clockwise
rotation angle of the graphic object
Ø Clockwise:
l Angle: Sets the clockwise rotation angle of the graphic object
(Unit: degrees)
l VariableValue: Sets the variable value for the clockwise rotation
angle of the graphic object
Ø OperateMode:
l OnceWrite: The input value changes continuously
l SequentialWrite: The input value changes after a period of time
Step 3:When configuration is complete, press the “OK” button to
complete the configuration of the “RotatingInput” event. The event
configuration of this graphic will be displayed in the “Event” window,
as shown in the figure below:


To delete an event, simply select the event in the event list and
then right-click the mouse and select “Delete”.
9.9 Control event
Control event is an unique event to a form control. Different controls
have different events.
For example, the text box has a "TextChanged" event, and the
check box has "checked" and "unchecked" events. All events can be
implemented through editing script.
The followingt through the "TextChanged" event of the text box as
an example to illustrate the configuration process of the event.
The configuration process is as follows:
Step 1:Open the project window where the animation needs to be
configured under the DIAView software development environment →
select graphic object to configure event in the sketchpad → open
“Event” window → select “Control”→ click the button in
“TextChanged” bar, as shown in the figure below:

Step 2: The Script Editor window will appear, as shown in the figure
below:
Step 3: Write the script (The DIAView software uses the Visual Basic
Script; the script editor will check for basic syntax errors), as shown in
the figure below:
Step 4: Once the script is written and checked with no errors, click
“Save and exit button” ​to complete event configuration; information
on the configured event will be displayed in the event window, as
shown in the figure below:

To delete an event, simply select the event in the event list and
then right-click the mouse and select "Delete".
The Configuration process of other controls is the same as
above.
Ø Control events include:
l CheckedBox: Checked event、Unchecked event
l ComboBox: SelectionChanged event
l TextBox: TextChanged event
l PasswordBox: PasswordChanged event
l DateTimePicker: ValueChanged event
l DatePicker: SelectedDateChanged event
l Calendar: SelectedDateChanged event
l RecipeBrowser: SelectionChanged event
l AlarmWindow: SelectionChanged event
9.10 Window program event
Window program event is to set the custom time interval program
executed in the runtime environment.
Window program event has only one type: Window Program.
Configuration steps are as follows:
Step 1: 1:Open the project window where the event needs to be
configured under the DIAView software development environment →
select window to configure event in the sketchpad → open “Event”
window → select “Window Program ”→ click the button in “Window
Program” bar , as shown in the figure below:


​Step 2: The Window Program configuration window will appear, click
"Add" button ,as shown in the figure below:

​The meanings of each setting in the configuration window are as
follows:

Name: set the function needs to be executed


Program name rules:
(1) Composed of English letters, numbers, Chinese characters and
underscore,and the name must start with English letters.
(2) Not case sensitive.
(3) Spaces,periods,exclamation marks and special characters such
as @$#&*? etc. cannot be used in the name.
(4) The length cannot less than 6 English letters and cannot exceed
32 English letters.
(5) Cannot be the same as the name of the other window programs in
the same window.
(6) The name language can only be simplified Chinese, traditional
Chinese and English.
Excution Mode: execute the specified program including
Loaded,TimerTicked and Closed
Program: Set the program to be executed
Interval Time(ms): set the time interval of specified program(ms)
IsEnabled: set whether to execute the specified program
Description: related information of the specified program
Step 3: Click the drop-down box below the Excution Mode to choose
the Excute Mode, as shown in the figure below:


Step 4: Click the button below “Program”,pop up the script editor
window ,Script can be written in it ,as shown in the figure below:
​Step 5: Once the script is written and checked with no errors, click
“Save and exit button” ​to complete event configuration; information
on the configured event will be displayed in the Program, as shown in
the figure below:

​Step 6: Click “OK” button after the configuration is done, information
on the configured event will be displayed in the event window, as
shown in the figure below:



9.11 Shortcut program event
The shortcut key program event is the operation of pressing the
keyboard combination to execute a custom script.
There are two types of shortcut key program events: window
shortcut key events and global shortcut key events.

1. Window shortcut program


The window shortcut program is a script program executed by
pressing the keyboard shortcut during the window openning. Multiple
shortcut key scripts can be set for each window, and each window
shortcut key program does not affect each other.
Configuration steps are as follows:
Step 1: Open the project window where the event needs to be
configured under the DIAView software development environment →
select window to configure event in the sketchpad → open “Event”
window → select “ShortcutProgram ”→ click the "..." button in
“ShortcutProgram” bar , as shown in the figure below:


Step 2: The window shortcut program configuration window will
appear, click "Add" button ,as shown in the figure below:

The items in the window are as follows:
Name:Shortcut key name, cannot be empty, and cannot be repeated
with others, the maximum can only be 50 characters
Shortcut key:Keyboard key combination, not repeatable
Program:Shortcut key script content.When checkbox in the same
row is selected, the program content cannot be empty.Click the "..."
button in the column to open the script editor.
For the usage of the script editor, please refer to the chapter: "20.
Script".
IsEnabled:Set whether to enable, the shortcut key can trigger the
script execution when selected
Description:Content description, the maximum input is 200
characters
Add:Add a new record
Delete:Delete the selected record
Clear:Clear all records in the list. Before clearing, a confirmation
dialog box will pop up. After agreeing, the list content will be cleared.
OK:Save and close the editing window
Cancel:Close the editing window

2. Global Shortcut Program


The global shortcut program is the script program executed by
pressing the keyboard shortcut during HMI running.
Configuration steps are as follows:
Step 1: Right-click on the “Window” node in the project window tree
index and then click the “Glolbal Shortcut Program” item in the right-
click menu, as shown in the figure below:


Step 2: The global shortcut program configuration window will
appear, click "Add" button ,as shown in the figure below:

For the meaning of each setting in the window, please refer to
"Window Shortcut Program".

3. Additional information
During HMI operation, when multiple windows with the same
shortcut keys are opened at the same time, pressing the shortcut
key will execute the shortcut key program matched in each window.
The priority of the global shortcut key program is higher than that of
the window shortcut key program, that is, when the window shortcut
key conflicts with the global shortcut key, only the global shortcut key
program is executed.
10. Report overview
Report tool that offerintg "Semblable excel" operation is used to
make common production report(daily report,monthly report, yearly
report),which is also used to make various complicated format report
flexibly to achive querying,displaying,printing and output to
realtime,history and statistic data.

Report can not only display the data of realtime and history database
but also can query and access to the typical database like Mysql,
SQL Server, Oracel, Access etc.
10.1 Report template design
Ø Open the project window under the DIAView software development
environment → open the “Report” node in the project index tree →
click the "New Report"option in the right-click menu, as shown in the
figure below
Ø Just repeat the steps above if another recipe browser needs to be
drawn.

Right-click the mouse on the new created report sub-node and


operations including “Copy”, “Delete” and “Rename” operation can be
operated for the current report, as shown in the figure below:
² Report naming rules are the same as window naming rules.

Report menu introducution:


F The figure above is report template menu which can be used to
design for report
Usage of the toolbar
² Import: Import report templates or excel tables
² Export As: Expor as Excel, PDF, CSV file
² Print: Set report template printing parameter and print

Preview:
Preview: preview current report
Save template: save current template
Up Page: Preview previous page
Down Page:Preview next page
Printing Range Page: Printing selected range page
Print Current Page: Print current page
Print All: Print all the page

Page:
Orientation: Landscape or portrait
Scaling: print accrording to ratio
1 page width 1 page height : adjust table to one page
1 page width 0 page height : adjust all column to one page
0 page width 1 page height : adjust all row to one page
0 page width 0 page height : no zoom
Margin : Set print margins
Row Column Headers : Set whether to display the row number and
column headers.
Show Gridline:Set whether to display gridline.

Page Setting:
PageNum: Insert page number in header and footer
PageCount: Insert page count in header and footer
Date: Insert date in header and footer
Time: Insert time in header and footer
UserName : Insert user name in header and footer
Header : Set the content of the header
Footer : Set the content of the footer
First page is different : Set whether the header and footer of the first
page are different from other pages
² Font setting: set font style, size, bold,slope,underline,cell border
style, cell fill color, font color and font alignment
² Word wrap: set wtether to word wrap if the content is more the
length of cell
² Merge and center: merge the selected cell or cancel merging
² Insert Sheet: insert sheet
² Insert Image: insert image
² Insert SubReport: insert a subreport in the specified area of the
current worksheet
² Delete Sheet: delete sheet
² Delete SubReport: delete the subreport
² Row Count: set row count
² Row Height: set row height
² Column Count: set column count
² Column Width: set column width
² Freeze Panes: freeze the selected row and column
² Freeze First Column: freeze first column
² Freeze Top Row: freeze the first row
² Cancel Freeze: cancel freeze
² Protect Sheet: set whether to project sheet
² Realtime Variable: design realtime variable report template,the
configuration is as follows:

Click“ ​”button,pop up window to associate realtime variable as


shown in the figure below:

² History Data: design history variable report template,the
configuration is as follows:

Click“ ​”button,pop up the window,as shown in the figure below:



Search:Filter and search the historical variables
Check TriggerTime for time record,check Value for Value record

² Database: design report for external data source, the configuration


is as follows:

Click“ ​”button, pop up window to select “database access


name”and “column name”, as shown in the figure below:

² Report guide: For detailed configuration, see section 10.2
² Print Setting

Print Region: set report print region


Cancel Print Region: cancel report print region

² PDF Setting

PDF Region

Cancel PDF Region

Report template properties


² ShowFormula: whether show formula bar
² RowCount: Report current row counts
² ColumnCount: Report current column counts
² ShowHeader: Whether show row and column header
10.2 Report guide


Ø Open or add a report template.
Ø Open “Report guide” by click report guide

Report guide setting needs to go through 4 steps:


1. Select the chart type:


Description:
(1)Chart type,include Class Day Week Month Quarter and Year.
(2)Value type, include Spurt Average Max Min and Basic.
(3)DateTime,use to set query’s starttime ,time duration.
(4)LeftTop,It is sheet’s left and top location.
(5)Row/Column statistics,include Average,Sum,Max and Min.

2. Select the point:


Description:
(1)Search,It is used to find and mark history group variable.
(2)Samples, It list “History var record”and“History group record”.
(3)Selected samples, it is a listbox,used to display selected
samples.
(4) Button functions:
l “>” : Select(alone)
l “>>”: Group select
l “↓” : Move down
l “↓↓”: Move to bottom
l “↑↑”: Move to top
l “↑” : Move up
l “<” : Remove(alone)
l “<<”: Group remove

3. Select the generate chart type:


Description:
(1)Chart type, include column bar line pie area and scatter.
(2)Chart, every type include many types. Such as column includes
common column, stack column and percent 100 stack column.
4. Generate chart preview:


Description:
(1)Header, edit chart’s header content in development.
(2)X-Axis, use it to edit chart’s x-axis’s content in development.
(3)Y-Axis, use it to edit chart’s y-axis’s content in development.
After 4 steps:

Description(row num):
No1. Report type is Class. value type is Average. Chart style
Column. LeftTop location (1,3). Picture’s size 500*350.Query time
:8,2010/10/25 8:00:00,Hour
No2. Title
No3. Binding’s query variables.
No11. Average(B4:B10), and so on.
No12. Sum(B4:B10), and so on.
Column ’E’. Max(B3:D3), and so on.
Column ‘F’. Min(B3:D3), and so on.
10.3 SubReport template design
Ø Create a report template as a sub-template and design it, as shown
in the figure below:


Ø Select the insertion location in the main report template and click "
Insert Subreport" button to insert the subreport template into the main
report template, as shown in the figure below:


Ø Select the subreport template to be inserted, and set the name of
the subreport, as shown in the figure below:

Ø The effect after insertion, as shown in the figure below:


Ø Select the subreport cell and click the "Delete SubReport"to delete
the subreport, as shown in the figure below:

Ø SubReport real-time data display and historical data query can be
realized through sub-report script.
10.4.1 How to create a real-time report
This section takes the wind turbine output real-time data report as an
example to introduce how to create real-time reports and monitor
real-time data. It is assumed that the preconditions are as follows:
Ø Project: Wind turbine output data report
Ø Window: real-time monitoring of wind turbine output
Ø Variables: Variable,Variable1 and Variable2
Variables type
Variable Analog
Variable1 Analog
Variable2 Analog
Ø IO Devices:Address、Address1、Address2
IO Address Variables
Address Variable
Address1 Variable1
Address2 Variable2
After the preconditions are completed, you can perform report-related
operations, the steps are as follows:
Step 1:Right-click the "Report" node in the project window tree, and
click "New Report" in the pop-up menu. The system will create a new
report template with the default name and rename it to "Real-time
Output Monitoring", as shown in the figure below:
Step 2:Edit in the "real-time output monitoring" template, manually
modify the cell format and size of the report, as shown in the figure:
Step 3:Bind real-time variable data, bind the system time in the first
column, as shown in the figure:
Step 4:Bind the real-time variable data, bind the variable, variable1,
and variable2 in the second, third, and fourth columns respectively,
as shown in the figure:
Step 5:The report template interface after binding is as shown in the
figure:
Step 6:Double-click the "wind turbine output real-time monitoring"
window, drag and drop a report from the toolbox extension control,
and set the "data template" to the "real-time output monitoring" report
in the properties window:
Step 7:Drag a button from the toolbox window control, set the "display
text" in the properties window to "real-time output monitoring start",
configure the left-click event for it, and the script content is shown in
the figure:
Step 8:After the configuration is complete, click the "Run" button in the
menu bar at the top of the window interface to enter the running
environment, and the running screen is as shown in the figure:
Step 9:Click the "Real-time production monitoring start" button, you
can see that a new data is refreshed every second.Such a report for
monitoring real-time data is ready.


10.4.2 How to create a historical report
This section takes the wind turbine output history report as an
example to introduce how to create history reports and monitor data.
It is assumed that the preconditions are as follows:
Ø Project: Wind turbine output data report
Ø Window: historical query of wind turbine output
Ø Variables: variable,variable1,variable2
Variables type
Variable Analog
Variable1 Analog
Variable2 Analog
Ø IO Devices:Address、Address1、Address2
IO Address Variables
Address Variable
Address1 Variable1
Address2 Variable2
Ø Historical record: RecordVariable,RecordVariable1,RecordVariable2
Storage
History record Variables Timer
mode
RecordVariable Variable Timing s1,s30,h1
RecordVariable1 Variable1 Timing s1,s30,h1
RecordVariable2 Variable2 Timing s1,s30,h1
After the preconditions are completed, report-related operations can
be performed, and the steps are as follows:
Step 1:Bind historical variable data, bind the time in the system in the
first row, as shown in the figure below:
Step 2:Bind historical variable data, bind the associated variables in
the second, third, and fourth columns respectively, RecordVariable,
RecordVariable1, and RecordVariable2.As shown in the figure
below:
Step 3:Double-click the "wind turbine output real-time monitoring"
window, drag a report from the toolbox extended control, and set the
"data template" to the "historical output query" report in the properties
window:
Step 4:Click the run button to run the window, you can select the time
range, sorting, etc. to be queried from the toolbar, as shown in the
figure below:
Step 5:The query result is the historical data record as shown in the
figure below:
Step 6:To export data, click the "Export" button on the toolbar, select
the location and name to export to EXCEL:
10.4.3 How to create a daily report

This section takes the wind turbine output daily report as an example
to introduce how to create and query daily report data. It is assumed
that the preconditions are as follows:
Ø Project: Wind turbine output data report
Ø Window: historical query of wind turbine output
Ø Variables: Variable, Variable1, wind Variable2
Variables type
Variable Analog
Variable1 Analog
Variable2 Analog
Ø IO Devices:Address、Address1、Address2
IO Address Variables
Address Variable
Address1 Variable1
Address2 Variable2
Ø Historical record: RecordVariable,RecordVariable1,RecordVariable2
Storage
History record Variables Timer
mode
RecordVariable Variable Timing s1,m1,h1
RecordVariable1 Variable1 Timing s1,m1,h1
RecordVariable2 Variable2 Timing s1,m1,h1
After the preconditions are completed, you can perform report-related
operations, the steps are as follows:
Step 1:Right-click the "Report" node in the project window tree, and
click "New Report" in the pop-up menu. The system will create a new
report template with the default name and rename it to "Wind Turbine
Production Daily Report" as shown in the figure below:

​Step 2:Select "Report Wizard" in the menu bar, and the "Report
Wizard Navigation Bar" pops up as shown in the figure below:
​ tep 3:Configure the required type in the "Report Guide", and select
S
"day" in the "Chart Type", as shown in the figure below:

Value type, to get the amount of data at the time, so select "Spurt", as
shown in the figure below:

​Start time, the time to start the calculation of the daily report, as
shown in the figure below after selection:

​ he benchmark rank is the default, add statistical data as needed,
T
add "average" and "sum" to row statistics, add "maxi" and "min" to
column statistics, as shown in the figure below:

Find the established variables, use keywords to search, and add the
outbound volume of wind wheel ABC group in the variable record to
the point, as shown in the figure below:

​ elect the type of chart to be generated, and select "Curve Chart", as
S
shown in the figure below:

​ enerate a preview image, change the label of the generated chart to
G
a wind turbine output daily report, as shown in the figure:

​ tep 4:After clicking "OK", the report template interface generated by
S
the report guide is as shown in the figure:

​ tep 5:After the configuration is complete, click the "Run" button in the
S
menu bar at the top of the window interface to enter the running
environment, and the running screen is as shown in the figure:


11.1 Overview
An alarm is a kind of reminder when the data acquired by the
system exceeds the warning value ,in order to prevent early
warnings for dangers that might occur during the production process
or equipment failures. Alarms have irreplacable function on system
security control in industrial automation and control systems.

During the process of using the DIAView software, when the data
of the field environment(Temperature, humidity, etc)or instruments
equipment monitored and acquired by the system exceeds the
system’s preset range, the system will use setting methods to send
alarm information and display them in the alarm window, such as
sending E-mails or alarm sounds ,so that users can know the
running status of the fied and instruments equipment immediately
and operate corresponding strategies to the alarm in order to prevent
accidents .

The DIAView software has perfect alarm functions to ensure safe


and reliable of the industry system.
11.2 Alarm group
“Alarm variable” is when alarm conditions are configured for
associated system variables so that the alarms can be generated
when the variable value changes.
Alarm groups can achieve classification management for alarms.
Related alarms can be classify into the same alarm group making it
easier for the system to perform unified management and operations
for alarm groups. The alarm variables of the DIAView software usually
belong to an alarm group. The alarm group is first created and then
alarm variables are created in the alarm group.
Alarm group naming rules:
Refer to the naming rules for IO variable in section “5.5.1 Create IO
variable ”,and If there are alarm variables and alarm groups under
similar class
nodes within the same project, the alarm variable and alarm group
names cannot be repeated.
Add alarm group:
Step 1:Open the project window under the DIAView software
development environment → open the “Alarm” node in the project
index tree → right-click on the “AlarmVariable” node → click the "New
Alarm Group"option in the right-click menu, as shown in the figure
below:
Step 2: After clicking the “New Alarm Group” button, the system will
create an new alarm group sub-node with a default name; double
click that alarm group sub-node to open the alarm variable
configuration window (please refer to the next chapter for creating
alarm variables), as shown in the figure below:


Other operations for alarm group:
Right-click the mouse on the new created alarm group sub-node and
operations including “New Alarm Group”, “Delete” and “Rename”
operation can be operated for the current alarm group, as shown in
the figure below:

Right-click"Alarm" and select the multi-language button to extract the


alarm text in the alarm configuration into a string for customized
editing, as shown in the figure below:
11.3 Alarm variable
1. Creating alarm variables
After opening the alarm group variable configuration window, click
the “Add” button in the window to add alarm variables; the system will
give a default name, as shown in the figure below:


² The meanings of each setting in the configuration window are as
follows:
Name: Alarm variable name.
Alarm variable naming rules:Refer to the naming rules for IO
variable in section “5.5.1 Create IO variable ”,and If there are alarm
variables and alarm groups under similar class nodes within the same
project, the alarm variable and alarm group names cannot be
repeated.
Associated Variables:Associate the variables created in the
project, which are the corresponding variables of the data acquired by
the system; they are the basic data source for alarms. Alarm
variables can only be configured for analog value or digital value
variables.
Alarm Level:The alarm are divided into 5 levels: Slight, Lighter,
General, Serious, Heavier.
Alarm Configuration:Sets alarm information including alarm type
,the alarm value limit and alarm text that corresponds to the alarm
levels etc.
Description: Other information for the alarm variable.
² Function button :
“Add” button:Create new alarm variable.
“Insert” button: Inserts new alarm variable on the selected row.
“Delete” button: The “Delete” button is used to delete the selected
alarm variable.
“Import” button: Imports the alarm variables from Excel to the
system.
“Export” button: Exports the alarm variables from system to
Excel.
2.Configuring alarm variable
1. Associate variable: Click the button in associated variables cell
and select the system variable to associate (only analog value and
digital value type variables can be used to set alarms), as shown in
the figure below:


2.Alarm level: Click the button and a drop-down menu will appear,
select a level, as shown in the figure below:

3. Alarm configuration: Click the button in the alarm configuration
cell and the alarm configuration window will appear; the system will
perform related configurations according to the variable type, as
shown in the figure below:
Ø Analog variable (Analog type variable) alarm configuration
Analog variables are mainly integer and real type variables; click
the button in the alarm configuration cell and the analog variable
alarm configuration window will appear, as shown in the figure below:

Analog variable alarms are divided into 4 types: Limit value alarm,
Deviation alarm,Rate of change alarm and Customer expression
alarm.Alarm Text supports multilingual configuration.
(1) Limit value alarm
The alarm will be generated when the analog value exceeds the
threshold of the alarm . There are 4 alarm thresholds for Limit value
alarms: Lowlow, low, high, higher; their alarm thresholds should be
set between the maximum value and minimum value of the variable;
its alarm threshold and principles are as shown in the figure below:

When the variable value changes, if it exceeds a certain threshold
value, over-limit alarms will occur immediately. Also, only one over-
limit alarm will occur for one variable. For example: If the variable
value exceeds the “higher alarm threshold value”, the higher alarm
will occur and not the high alarm. If it went over-limit two times, the
system will determine whether they are the same type of alarm first ;
if they are, no new alarms will occur, or else the original alarm will be
reset and then a new alarm will occur.

Limit value alarm occurrence and recovery rules:


F Higher alarms will occur when greater than or equal to the
higher threshold and recover when less than the higher
threshold.
F High alarms will occur when greater than or equal to the high
threshold and less than the higher threshold, and recover when
less than the high threshold.
F Low alarms will occur when less than or equal to the low
threshold and greater than the lowlow threshold, and recover
when greater than the low threshold.
F Lowlow alarms will occur when less than or equal to the lowlow
threshold, and recover when greater than the lowlow threshold.

The Limit value alarm threshold is not selected under default


conditions, one or multiple of the checkboxes in front of the alarm
threshold can be selected when needed. Then the editing box will
become editable and “Alarm value” and “Alarm text” settings can be
performed in it. The meaning of its properties are as follows:
Alarm value: Sets the threshold value of the alarm and defines the
rules that should be followed when the threshold value is reached:
minimum value<=Lowlow<low<high<Higher<=maximum value.
Alarm text: Sets the descriptive text of the alarm information. Dead
band: The effect of the dead band is to prevent unrealistic alarms
from being generated when the variable value changes frequently
between the original maximum and minimum alarm threshold by
adding a threshold value for the maximum and minimum alarm
threshold, changing the original alarm threshold from a single line to
an alarm threshold band. When the value of the variable changes
within the alarm threshold band , alarms will not occur or reset; alarm
information will only occur when it exceeds the alarm threshold band .
It is important for eliminating invalid alarms of fluctuating signals. The
dead band value must between 0 and the value of the maximum
value minus the minimum value; the dead band should also be in
between the difference of any two threshold values. The principles of
the alarm dead band are as shown in the figure below:

(2) Deviation alarm


This is the alarm that occurs when the ratio of the analog value to
the deviation target value fluctuation exceeds the changing range .
Deviation alarms are divided into two types: Large deviation
(Major)and Small deviation(Minor). When the fluctuating value
exceeds the Large/Small deviation range Large deviation alarms and
Small deviation alarms will occur respectively. Also, only one
deviation alarm will occur for each variable; its calculation method
and principle are as follows:
F Small deviation alarm threshold value=deviation target value ±
Small deviation alarm value.
F Large deviation alarm threshold value=deviation target value ±
Large deviation alarm value.
² When greater than or equal Small deviation alarm threshold value,
Small deviation alarm will occur.
² When greater than or equal to the Large deviation alarm threshold
value, Large deviation alarm will occur.
² When less than or equal to the Small deviation alarm threshold
value, Small deviation alarm will occur.
² When less than or equal to the Large deviation alarm threshold
value, Large deviation alarm will occur.


The deviation alarm is not selected under preset conditions, one
or two of the check boxes in front of the types can be selected
when needed. After which, the editing block behind will become
editable and “Alarm value” and “Alarm text” settings can be
performed for it:
Small deviation: Sets the Small deviation value;
Large deviation: Sets the Large deviation value;
Target value: Sets the deviation target value for when the
deviation alarm occurs; it is used together with the Large and
Small deviations. Please refer to the calculation method of the
Large and Small deviations Please refer to the “Over-limit alarm”
settings for other items.
Deadband : Sets the deviation band of the alarm threshold value,
which means that when deviation alarm occurs, if the variable
value is within the alarm threshold value ± dead band value range,
no new alarms will occur; or else the alarm will first be reset and
then a new alarm will occur.
(3) Rate of change alarm
This is the alarm that occurs when the change rate of the analog
value exceeds the value set for a period, which means that the alarm
that will occur when the variable value changes too quickly. During
software running, the changing speed of the variable value will be
calculated each time to determine whether an alarm will occur. It is
mainly used to monitor the change rate of the variable.
The rate of change alarm uses time as the unit and is divided
into 3 types: hour, minute and second. Its calculation method is
as follows:
Change rate = ((current variable value — previous variable
value) * 100) / ((time the current value was generated —
previous time the value was generated) *(maximum value of the
variable — minimum value of the variable) * value that
corresponds to the alarm type unit).
※Definition of the “the value that corresponds to the alarm type
unit” is:
If alarm type is second, the value is 1;
If alarm type is minute, the value is 60;
If alarm type is hour, the value is 3600
The change rate alarm is not selected under default conditions,
check boxes in front of the rate of change can be selected when
needed. After which, the editing block behind will become editable
and “Alarm value” and “Alarm text” settings can be performed for it:
Change rate: Sets the change rate value.
Type: Sets rate of change alarm type unit; the rate of change alarm
uses time as the unit and is divided into 3 types: hour, minute and
second.
(4) Customer expression alarm
The alarm condition of the analog quantity is set by the content of the
custom expression, and the alarm will occur when the alarm condition
is triggered.
For example, var. variable>60 Or var. variable<40;Indicates that an
alarm will be generated when the variable value is greater than 60 or
less than 40.
Limit value or deviation alarm delay: Sets a delay time (unit:
second) so that when an alarm occurs the system will not display it
immediately and instead perform a delay; if the alarm was reset or
disappeared within the delay time, that alarm might be a false alarm
and the system will clear it automatically. If the alarm still exists after
the delay time, then that alarm is a real alarm and the system will
display and record it. If a new alarm occurred within the delay time,
the delay timer will restart.

Ø Digital variable (Digital type variable) alarm configuration


Digital variables are Boolean type variables; Click the button in the
alarm configuration cell and the alarm configuration window will
appear, as shown in the figure below:


There are 4 types of digital variable alarms: On alarm, Off
alarm,displacement alarm and Customer expression alarm.
² “On”: Alarm will occur when the variable value changes from
off to on (changes from 0 to 1)
² “Off”: Alarm will occur when the variable value changes from
on to off (changes from 1 to 0)
² “Displacement”: Alarm will occur when the variable value
changes no matter whether from off to on or on to off
² “Customer expression alarm”: Alarm will occur when the
variable value reaches the alarm condition set by the
custom expression script.
11.4 Alarm window
Alarm window is used to display alarms information; once an alarm
is configured, its information must be viewed only by the alarm
window, therefore they must be used together. Once an alarm
window is drawn, it will associate with all configured alarm
information automatically without other configurations. Only the
alarm type color effect and the properties of the alarm windows need
to be configured to display, such as alarm levels. etc. When the
system runs, it will display alarm information in runtime and allows
query historic data of alarm.

Please refer to chapter “7.6.10 AlarmWindow” on how to draw alarm


windows and configure properties of alarm windows.
11.5 Alarm configuration
Configure E-mail, sound ,mobile phone SMS,Wechat and IFTTT
alarm functions for alarm and alarm groups.
Alarm configuration:
Step 1:Open the project window under the DIAView software
development environment → open the “Alarm” node in the project
tree → double-click the “AlarmConfig” , as shown in the figure below:


Step 2: After double-clicking the “AlarmConfig”, the configuration
window will appear, as shown in the figure below:

11.5.1 Email
Configure E-mail, sound ,mobile phone SMS,Wechat and IFTTT
alarm functions for alarm and alarm groups.
E-mail:
Sends alarm information to related personnel through E-mail.
Open the “E-mail” option and the configuration steps are as
follows:
Step 1:Selected the “Send e-mail” check box; it means that the send
e-mail function is enabled when selected and the next steps of the
configuration can be performed:
Step 2: Input the E-mail address to send the alarm information in the
“Send server” field:
Step 3: Click the “Settings” button ,and the “E-mail account settings”
window will appear , as shown in the figure below (taking the 163 E-
mail server as an example):


The meanings of each configuration in the window are as follows:
l TimeInterval: Sets the time interval to send E-mails; the alarm
information will be sent once a new alarm occurs within the time
interval.
l SendServer: Configures the address and port information of the
E-mail to send .
l UserName: The login user name of the E-mail account used to
send the alarm information (which is the user name of the E-mail
set in Step 2).
l Password: The password used to login the E-mail account used
to send the alarm information (which is the password of the E-
mail set in Step 2).
l Send: Test whether the E-mail server settings are correct and
whether the E-mail can be sent; the rest result is as shown in the
figure below:


Step 4: When the E-mail account setting is complete, press the “New
” button to add the information of the user to receive alarm
information:

The meanings of each field in the configuration window are as
follows:
l User Name: User name of the recipient.
User Name naming rules:Refer to the naming rules for IO variable in
section “5.5.1 Create IO variable ”,The user names under “Email” ,
“SMS”,"Wechat" and "IFTTT" nodes cannot be repeated.
l Address: E-mail address of the recipient.
l Alarm Group: Select the alarm group in which the desired alarm
information is located.
l Alarm Type: Select the alarm type to send alarm information.
l Alarm Level: Select the alarm level to send alarm information.
l Record Type: There are 4 types: Alarm, confirm, reset and
remove; the information of the selected types will be sent and
information of the unselected types will not be sent.
l Information Format: Sets the content, order, date and time
format of the alarm information sent.
11.5.2 Sound
Configure E-mail, sound ,mobile phone SMS,Wechat and IFTTT
alarm functions for alarm and alarm groups.
​Sound:
Configure the sounds to play for different alarm groups, alarm levels,
alarm types and alarm variables when alarms occur.
Its priority is: All alarms < alarm group < alarm level < alarm type <
alarm variable.
Open the “Sound” option and the configuring steps are as
follows:
Step 1: Check the “Enable sound alarm” check box. It means that the
sound alarm function is enabled and the next steps of the
configuration can be performed, as shown in the figure below:

Step 2: Configure the various contents in the “Sound Alarm Config”:
Ø All Alarm:
Sound will be used for All alarms generated by the system ;
methods that can be selected include: no sound, buzzer sound,
system sound, audio file and play audio etc.
l Silent: No sounds are played.
l Buzz: Buzzer sounds are played from the buzzer of the
computer when the system generates an alarm. When multiple
alarms are generated, the buzzer sound will sound in turns.
l SysSound: Uses the sound from the Windows system, which
include the following five sounds: “Asterisk (preset)”, “Beep”,
“Exclamation”, “Hand“,”Question”.
l SoundFile: Users can customize sound file sources so that the
selected sound file will be played when an alarm is generated.
Press the ​button and the sound source selection window
will appear, as shown in the figure below:


The “Add” button used to import external sound files, and press the
“Play” button allows you to listen to the file.
l PlaySound: Plays the customized sound content. Pressed the
​button and the sound configuration window will appear, as
shown in the figure below:

It allows customized sound contents and it supports Chinese and
English. Select the alarm related configuration information and adjust
the sound playback order; when an alarm is generated, the system
will play sound contents in order.
Ø Alarm Group:
Configure the alarm group that need sound alarm. The “New” and
“Delete” buttons can be used to select the alarm group, and use the
button in the “Alarm group” field to select the alarm group that needs
to configure sound alarms; click the button in the “Alarm sound” field
to configure alarm sounds, as shown in the figure below:

² Select alarm group, as shown in the figure below:

² Configure the alarm occurrence sound, as shown in the figure
below:


Ø Alarm level:
Set the sound alarm when different levels of alarms occur; use the
button in the “Alarm Sound” field to configure alarm sounds, as
shown in the figure below:

Ø Alarm type:
Set the sound alarm when different types of alarms occur; use the
button in the “Alarm sound” field to configure alarm sounds, as shown
in the figure below:

Ø Alarm variables:
Configurations can be performed here for alarm variables in the
DIAView software that require additional sound alarms after an alarm
occurs, as shown in the figure below:

Configuration process for each row: First use the “New” button to add
a new alarm sound configuration row
² Alarm variable: Click the button in the row to open the alarm
variable browser and select variables to associate to alarm
viriables, as shown in the figure below:

² Alarm type: Selects the alarm type that needs sound alarm; it is
a drop-down menu.
² Alarm sound: Click the button in the row to configure the sound
to play when an alarm occurs.
² Alarm recovery sound: Click the button in the row to configure
the sound to play when an alarm recovers.
11.5.3 SMS
Configure E-mail, sound ,mobile phone SMS,Wechat and IFTTT
alarm functions for alarm and alarm groups.
SMS:
Sends the alarm information to related personnel through mobile
phone SMS.
Open the “SMS” option and the configuration steps are as
follows:
Step 1: Check the “Send messages” check box; it means that the
send SMS function is enabled and the next steps of the configuration
can be performed ,as shown in the figure below:

Step 2: Click the “Configuration” button to configure the information
to sending SMS; the “Configuration” window will appear ,as shown in
the figure below (the serial port is preset to COM3, change it to
COM1: serial transmission rate is 115200):

Step 3: Click the “Connect” button and the “Test” window will appear;
click the “Send” button to display the current status, as shown in the
figure below:


Step 4: Configure the “TargetPhoneNumber” and related information
for sending SMS; click the “Send” button to display the current status,
as shown in the figure below:


Step 5:When the mobile phone account configuration is complete,
press the “New” button to add the information for the user to receive
alarm information:
The meanings of each field in the configuration window are as
follows:
l User Name: User name of the recipient.
User Name naming rules:Refer to the naming rules for IO variable in
section “5.5.1 Create IO variable ”,The user names under “Email” ,
“SMS”,"Wechat" and "IFTTT" nodes cannot be repeated.
l Phone Number: The phone number of the recipient.
l Alarm Group: Select the alarm group in which the desired alarm
information is located.
l Alarm Type: Select the alarm type to send alarm information.
l Alarm Level: Select the alarm level to send alarm information.
l Record Type: There are 4 types: Alarm, confirm, reset and
remove; the information of the selected types will be sent and
information of the unselected types will not be sent.
l Information Format: Set the content, order, date and time format
of the alarm information to send.
11.5.4 Wechat
Configure E-mail, sound ,mobile phone SMS,Wechat and IFTTT
alarm functions for alarm and alarm groups.
Wechat:
Send the alarm information to relevant personnel through enterprise
wechat.
Open the "wechat notification" tab, and the configuration steps
are as follows:
​Step 1: Check the "Enable Enterprise Wechat Notification" check box
and enter "Company ID", "Application ID" and "Application Secret" in
sequence, as shown in the figure below:

Step 2: Click the "New" button to add the user information receiving
wechat notification. The user name is "UserName" by default,as
shown in the figure below:

Step 3: Configure "User ID", as shown in the figure below:

Step 4: Configure "Alarm Group" and select the grouping of required
alarm information, as shown in the figure below:

Step 5: Other configurations remain the default, and the configuration
is completed. When an alarm is generated in "Alarm.AlarmGroup 1",
wechat notification will be triggered,as shown in the figure below:

The meanings of each field in the configuration window are as
follows:
l Company ID: Enterprise wechat number, find the path "my
enterprise" - "enterprise information" - "enterprise ID".
l Application ID: ID number displayed after successfully creating
alarm application in enterprise wechat.
l Application Secret: The key displayed after the alarm application
is successfully created in the enterprise wechat.
l User Name:Name of the user receiving wechat notification.
User Name naming rules:Refer to the naming rules for IO variable in
section “5.5.1 Create IO variable ”,The user names under “Email” ,
“SMS”,"Wechat" and "IFTTT" nodes cannot be repeated.
l User ID: The account number of the user receiving the alarm
wechat notification in the enterprise wechat address book.
l Alarm Group: Select the alarm group in which the desired
alarm information is located.
l Alarm Type: Select the alarm type to send alarm information.
l Alarm Level: Select the alarm level to send alarm information.
l Record Type: There are three types: Alarm, Responses and
Restore; The selected type information will be sent, and the
unselected type information will not be sent.
l Information Format: Set the content, order, date and time
format of the alarm information to send.
11.5.5 IFTTT
Configure E-mail, sound ,mobile phone SMS,Wechat and IFTTT
alarm functions for alarm and alarm groups.
IFTTT:
Forward the alarm message to LINE/WhatsApp/Telegram through
IFTTT.
Open the "IFTTT" tab, and the configuration steps are as
follows:
Step 1: Check the "Enable IFTTT Notification" checkbox,enable
IFTTT function,as shown in the figure below:


Step 2: Click the "New" button to add users information who
receiving IFTTT notification. The user name is "UserName" by
default, as shown in the following figure:


Step 3: Configure "Event Name" and "Key",as shown in the following
figure:

Step 4: Configure "Alarm Group". In this example, select "Alarm
Group0", as shown in the following figure:

Step 5: Other configurations remain the default and the configuration
is completed,IFTTT event notification is triggered when an alarm is
generated in "Alarm Group0":

The meanings of each field in the configuration window are as
follows:
l User Name: User name of the recipient.
User Name naming rules:Refer to the naming rules for IO variable in
section “5.5.1 Create IO variable ”,The user names under “Email” ,
“SMS”,"Wechat" and "IFTTT" nodes cannot be repeated.
l Event Name: IFTTT Event Name,it is consistent with the
Event Name configured on the IFTTT official website。
l Key: The verification code for communication with the ifttt
official website,it is obtained from the ifttt official website.
l Alarm Group: Select the alarm group in which the desired
alarm information is located.
l Alarm Type: Select the alarm type to send alarm information.
l Alarm Level: Select the alarm level to send alarm information.
l Record Type: There are 3 types: Alarm, Responses and
Restore; the information of the selected types will be sent and
information of the unselected types will not be sent.
l Information Format: Set the content, order, date and time
format of the alarm information to send.
12.1 Overview
Users authority refers to the operating and control authority that a
user has when using the DIAView ; it includes “Security zone” and
“User”. User authority management can be used to guarantee safe
and reliable operations and stable executions in order to prevent
problems such as making wrong operations, unauthorized
operations, or tampering with the project settings illegally.

Security zone is a strategy to protect the security of system


operations; setting security zones in the DIAView development
environment allows partition protection for the access operating
authority of graphic objects. Security zone is usually used together
with user; a user can have one or multiple security zone operating
authorities, and each graphic object can belong to 1 or multiple
security zone. During the system execution process, users can only
access and operating graphic objects within the security zone the
user has in order to prevent users from performing wrong operations
and unauthorized operations, ensuring the usage security for system
executions and operations.

Users are operators and administrators with related operating


authorities set for project development and execution; users in the
DIAView software are divided into: “System administrator”,
“Operator” and “Manager”. “System administrator” is default in the
project; it has all operating authorities and the highest level. Each
project only has one system administrator, and it cannot be deleted.
“Operator” is the ordinary project operator; its operating authority can
be set by setting the security zones. “Manager” not only has the
operating authority to set security zones, it can also manage
“Operator”; it can add, modify and delete “Operator” information.
12.2 Security zone
Security zone is a logical partition to the security control for
accessing graphic objects in the project; it should be divided
according to the security control when setting. The DIAView software
has no preset security zone; under preset conditions, all users have
the same access operating authority.
Ø Setting steps
Step 1: In the DIAView development environment, open the project
window tree index → open the “Authority” node in the tree index:

Step 2: Double-click the “Security” node to open the security zone


configuration window, as shown in the figure below:

The meanings of each setting in the window are as follows:
Name: Name of the security zone.
Security zone naming rules:Refer to the naming rules for IO
variable in section “5.5.1 Create IO variable ”
Description: Related description information of the security zone.
Step 3: Click the “Add” button to create the security zone and the
system will automatically provide a default name, as shown in the
figure below:

The name and description information of the security zone can be


edited and the setting of the security zone will be completed,At
the same time ,the “Delete” button can be used to delete the
selected security zone.
Ø Usage
Graphic objects in the DIAView all have the “Security” property;
select the graphic object to configure access operating authority
in the sketchpad window, and then press the button to the right of
the “Security” property in the property window, as shown in the
figure below:

The “Security” selection box will appear; press the checkbox in


front of a security zone to select it, as shown in the figure below:

The “Maintenance Security” here can also be used to perform add
or delete operations to the security zone; it will be synchronized with
the operations performed in the previous “Security” window.
12.3 User
Users are the users of the DIAView who require related access and
operating authority in the project; users are granted user rights by
setting security zones so that users can access and operate the
rights set for them, ensuring the security and reliability of the system.

Ø Setting steps

Step 1: In the DIAView development environment, open the project


window tree index → open the “User authority ” node in the tree
index:

Step 2: Double-click the “User” node to open the user configuration


window, as shown in the figure below:
There will be a default system administrator in the user information
——“SystemAdmin”, it cannot be added or deleted. The meanings of
each setting in the window are as follows:

Name: User name

User name naming rules:Refer to the naming rules for IO variable


in section “5.5.1 Create IO variable ”

Password: User account password, used for user login

Security: Sets the security zone authority for user operations

Automatic Log off Time: Time limits can be set for user authority
so that they automatically logout when the time has reached; ‘0”
means always valid

User type: Sets the user type; there areThree types of users:
SystemAdmin, Administrators and operators.

User type permission level:


SystemAdmin>Administrators>operators.

Expire Date Time:There is a time limit for setting a user or


password. If the time limit is reached, the user or password will
automatically become invalid

Level:Set the level difference of the same user type, the level range
is 0~9, the higher the number is, the higher the level is
Description: User related information description

Step 3: Click the “Add” button to create the user and the system will
automatically generate a default user name, as shown in the figure
below:

Step 4: Click the "Password Rule"button,appear Password rules


configuration dialog box, as shown in the figure below:

Change Password Cycle Days: The default extension of the


password expiration time by days

Number of Password Errors: When the number of password


errors during login reaches the set value, the user will be locked
automatically

User Lock-in Time(Minute): The length of time for the user to


automatically unlock a password after it has been locked for a
specified number of times

Keep Password History: The user will not be allowed to change


the password when it is the same as the previous password

Using User Password Rules: If password strength is enabled,


select True to enable password strength verification

Rules: Contains four rules, check one or all of them, then password
characters can only be set in accordance with the rules, if the
strength verification is turned on

Step 5: Click the button in the “Password” cell and the user password
modification window will appear to allow changing of user password,
as shown in the figure below:
Step 6: Click the button in the “Security” cell and the security zone
selection window will appear for setting the security zone rights of
user operations, as shown in the figure below:

Step 7: Click the button in the “User Type” cell and select a user type
from the drop-down menu; the system’s default user type is operator,
as shown in the figure below:
Step 8:Click the button in the "Expire DateTime" cell to pop up the
expiration time configuration dialog box, select whether to enable this
function, and set the expiration time of the user's expired password
after enabled, as shown in the figure below:

UserAccount expired:When the system time reaches the set


Expire DateTime of the user, the user is locked and unable to log in.

Password expired:When the system time reaches the set Expire


DateTime of the password, the password is disable.

Step 9:Click the button in the "User Level" cell to set the user level,
as shown in the figure below:

User Level:
l The user level is used to distinguish the level differences of the
same user type.

l Users can set the level range to 0-9. The higher the number, the
higher the level, except SystemAdmin.

l High-level users have view and edit permissions for users below
this level.

l System administrators are not subject to any restrictions.

Step 10:Click"Description" to add user description information, as


shown in the figure below:

User description information can be added in the “Description” field;


this will conclude user settings; the “Delete” button can be used to
delete the selected user.

Ø Runtime user and password setting methods

l Reset user expiration time

The script usercmd.usermanagerbox () is used to call out the user


management window to set user password security zone and other
parameters, as shown in the figure below:
When the expiration time of the user and password is reset, the
expiration time is updated and the following principles are
followed:

² Reset user expiration time: User expiration time = Current system


time + SetDays

(Clear the RemainingDays to zero and start the timing again


according to the set number of days)

² Reset password expiration time: Password expiration time =


Current system time + SetDays

(Clear the RemainingDays to zero and start the timing again


according to the set number of days)

l Reset user Password


The script usercmd.usermanagerbox () is used to call out the user
management window to set user password, as shown in the figure
below:

When the remaining days of password expiration time >


password valid days, reset the password, the expiration time will
not be updated, on the contrary, user password reset, the
password expiration time will be updated, and follow the
following principles:

² Reset user password: Password expiration time = Current system


time + Change Password Cycle Days

(Clear the RemainingDays to zero and start the timing again


according to the Change Password Cycle Days)
12.4 User type
In the user type, the user can define the type name and level. After
the definition is completed, the user can configure the user-defined
user type.
Ø Setting steps
Step 1: Open the project project window tree directory in the DIAView
configuration software development environment → open the
"Authority" node in the tree index:


Step 2: Double click the “user type” node to open the user type
configuration interface, as shown in the figure below:


The meanings of the settings in the window are as follows:
Name: the name of the user type.
Security zone naming rules:Refer to the naming rules for IO variable
in section “5.5.1 Create IO variable ”
User type level: the level of user type, the range is 0-9, 0 is the
minimum permission, and 9 is the maximum permission.
Name text: the content displayed by user type at development time
and runtime, which supports multi language display.
Description: related description information of user type.
Step 3: Click the "Add" button to create a user type, and the system
will give the default name, as shown in the figure below:

The user type name, user type level, name text and description
information can be modified. At same time, a user type is set, the
selected user type can be deleted through the "delete" button.
Ø Usage
After setting the user type configuration interface, open the user
interface and click the "Add" button to create a new user, as shown in
the figure below:

Click the drop-down button of the user type of the new user and
select the newly created user type,as shown in the figure below:
After selection, click “Save” to complete the configuration.
13 Operation variable
Operation variables are variables used to save and record the
project variables information which operated by the user.; it is related
to events and used to record and track system variables which
operated by the users. Record information includes: variable name,
change time, value of variable before and after changes and user
information etc.
Ø Configuring steps tfor operation variables are as follows:
Step 1: In the DIAView software development environment, open the
project tree window → double click the “OperationVariable” in the
project tree to open the operation variable configuration window, as
shown in the figure below:


The meanings of each field in the window are as follows:
Name: Name of the operation variable
Operation variable naming rules:Refer to the naming rules for IO
variable in section “5.5.1 Create IO variable ”,and if there
are operation variables and operation variable groups under similar
class nodes within the same node, the operation variable and
operation variable group names cannot be repeated.
Associated Variables: The associated variable
Description:Other information for the operation variable
Step 2: Click the “Add” button to create the operation variables and
the system will automatically generate a default name, as shown in
the figure below:

Step 3: Click the button in the “Associated Variables” cell and
selected the variable to associate in the variable browser, as shown
in the figure below:


※ Each variable can only be associated to one operation variable.
After configuring the description information, the configuration of an
operation variable is complete; the “Delete” button can be used to
delete the selected operation variable and the “Import” and “Export”
buttons can be used to import and export the operation variables from
and into Excel.
Viewing operation variables: To view the information of the
operation variables, user can call the report object scripts
QueryVariableOperations(sheetIndex,opVariablePaths)
For example: Draw a report in the window: report 0 and a button:
button 0;
Configure the event for “Button 0”: Left-click and call the operation
variable query function of report 0:
Report0.QueryVariableOperations(0,"Operation")
14.1 Overview
In order to display and mintor the field site running status of
production, the DIAView software will create many variables that
associates with field site equipment to perform data interaction, and
these variables are constantly updating and changing. In order to
save important data and analy the field data to mintor productive
status and system running information .In order to increase
productive efficiency and quality and optimize the system, the data of
variables during system runnning need to be recorded; the variables
that have this function are called history variables.

History variables are divided into 2 types: record variable and


variables group record.

The record variables in the DIAView software are divided into two
types recording methods: Timing record and changed record. Timing
record records the data of the variables in the system according to
the time interval cofigured; Changed record records the data of the
variables in the system when the variable data changes.

Variable group record can record history group variable ,each


group can conclude 128 variables at most.Users can manage and
query data conveniently by variable record group.
14.2 Setting history record variable
The record variable configuring steps are as follows:
Step 1: Open the project tree window in the DIAView software
development environment → Right_click the “RecordVariable” in the
project tree index → Click "Database Configuration" to open
database configuration window, as shown in the figure below:

The meanings of each configuration in the window are as follows:


ServerName: Enter the server name or IP address of the database
which needs to be connected to; click the pull-down button to search
automatically for servers within the network.
DatabaseName: Enter the database name to use (length: 2
thousand words).
Authentication: There are two methods to authorize when logging
in the server:Windows ID authentication and SQL ID authentication; if
the database is configured on a local host, select “Windows ID
authentication”; if the database is configured on a remote computer,
select “SQL ID authentication”.
UserName: Sets the user name for SQL ID authentication.
Password: Sets the user password for SQL ID authentication.
ConnectTimeout: Sets the time for the database to switch
connection or reconnect after connection failed, and report an error if
it is the timeout; unit: seconds.
ConnectionTest:Tests whether it can connect to the database
server.
DaysOfDataRetention: The times of date saved, default: 30 days.

Step 2: Open the project tree window in the DIAView software


development environment → double click the “RecordVariable” in the
project tree index to open the history record variable configuration
window, as shown in the figure below:


The meanings of each configuration in the window are as follows:
Name: Name of the record variable.
Naming rules:Refer to the naming rules for IO variable in section
“5.5.1 Create IO variable ”.
Associated Variable: Associated project variable, which are the
project variables need to be saved.
Mode: Set the recording method of data; there are 2 types:
Changed record and timing record.
Timer: Set the time interval of the recording method is “Timing
record”.
Deadband: When the associated project variable is a analog value,
set a value to form a deadband with the value of the variable to
perform data filtering.
Description: Other information for the record variable.

Step 3: Click the “Add” button to create the history record variables
and the system will automatically generate a default name, as shown
in the figure below:


Step 4: Click the button in the “Associated Variables” cell and
selected the variable need to record in the variable browser, as
shown in the figure below:

※ Each variable can only be associated to one history record
variable.

Step 5: Click the drop-down button in the “Mode” cell and select the
recording method, as shown in the figure below:


Timing: Set timer;During the operation of the system, the data of
variables in the system will be recorded according to the set timer.
Changed: The system is recorded whenever variable data changes
during operation.

Step 6: Timer:If the recording mode is "Timing", the timer needs to be


set.Click the button ​in the timer cell and the timer browser pops
up,as shown in the figure below:


The meanings of timer browser are as follows:
IsEnable: Check the checkbox to enable this timer,allow to use
multiple timer, and enable timers decide the query intervar time(if
user check "s1" and "m1",the interval time is 1 second or 1 minute).
Name: Timer name, use English alphabets, numbers, or
underscores, beginning with an English letter, with a word length of
no more than 12.
Timer Unit: the base unit of timer, now has "Second", "minute",
"hour" and "day".
Timer Coefficient:Trigger time is timer unit * timer coeffcicent(ex:
timer unit is second, timer coefficient is 1, the trigger tiem is 1
second).
Relative Time: Click the button in the “Relative Time” cell , has two
select: "Project start time" and "User_defined time", it determine the
real time of timer triggered(ex: user set a timer, trigger time is 1 day, if
select "Project start time", assume project start at "2018-1-1
12:12:12", then the real trigger time of timer is 12:12:12 every day; if
user select "User_defined time", assume the defined time is "2018-1-
1 00:00:00", then the real trigger time of timer is 00:00:00 every day).
Description: Description to this timer.
Add: Add a timer in the end of datagrid.
Insert: Insert a timer.
Delete: Delete selected timer.
OK: Save modification.
Cancel: Cancel modification.
Step 7: Deadband: If the associated variable is an analog value type,
and the record method is “Changed record”, set a value as the
deadband value to form a deadband with the value of the variable:
(current value of variable - deadband value) <= deadband <= (current
value of variable + deadband value);
Effect: Data filtering.
Principle: When the next variable value is within the deadband
range, no new values will be record and the original value will remain
the same. If it is not in the deadband range, then the record variable
value will acquire a new variable value and record it into the
database, and the deadband will also change accordingly. It will keep
looping in this way.
The “Delete” button can be used to delete the history variables
selected and the “Import” and “Export” buttons can be used to import
and export the history record variables from and into Excel.
14.3 Viewing history record variable
Once the history record variables data were saved, it requires related
display tools to view the history record variables data and analy and
operate the data. The DIAView software provides history charts and
reports to query and analy the history record variables.
Ø History chart
The history charts can draw the history record variable data within a
period into a curve and display it ; it is a graphic object. One history
record variable corresponds to one curve; multiple history record
variable curves can be configured and can be used for data
comparison and analysis. For drawing of history charts, please refer
to the chapter “7.6.2 History chart”; steps to associate history record
variables are as follows:
Step 1: After the history chart is drawn, open its property window and
click “Series” → click the button in the “SeriesCollection” bar, as
shown in the figure below:


Step 2: The “History series editor”window will appear, and then click
the “Add” button to add curves, as shown in the figure below:
The system will generate a curve with a default name; the left side
of the window is the list of curve members and the right side is the
corresponding curve property window.
Step 3: Click the button in the right of “VariablePath” bar in property
window , and the history variable collection window will appear, it will
allow you to select a history record variable to associate with the
curve, as shown in the figure below:

Press the “OK” button after selecting a history record variable to


return to the “History Series Editor” window; press the “OK” button
after setting the color of the curve and other properties to complete
the configuration for a history curve. The steps mentioned above can
be repeated to configure multiple history curves.

Ø Report
The historical data of history record variable can be presented in the
form of report.A report can present the historical data of multiple
history record variables in multiple columns. For drawing of report,
please refer to the chapter “7.6.12 Report”; steps to associate history
record variables are as follows:
Step 1: Create new report template,associate with history record
variable.

Step 2: Draw a report in window,associate with the created report


template in step1.


Step 3: Create two DateTimePicker in
window(DateTimePicker0,DateTimePicker1) and one button,
configure the button script as follows:


DateTimePicker0.Value=Sys.StartTime
DateTimePicker1.Value=Sys.Now
Call Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.SetVarRecordRulerName(0,"s1")
Call Report0.QueryHistoryData()
※ "s1" is the Timer Name。
Step 4: Run the project,click "QueryHistoryData" button,can view
historical data in the report,as shown in the figure below:


14.4 Setting historical group

Historical group record operational principles are as follows:


When triggering condition is triggered,history record variable data will
be saved to the configured database.
Variable group record needs to configure trigger condition、database
and history record variable.The configuration steps are as follows:
Step1: Add New Historical Group:
Right-click the “Historical Group” node in the project window tree
index and then click the “New History Variable Group” from the right-
click menu. The system will create a new history variable group with
the default name, as shown in the figure below:


Several history variable groups can be created under a historical
group
History variable group naming rules:Refer to the naming rules for IO
variable in section “5.5.1 Create IO variable ”.
Double-click the created “HistoryGroup” sub-node and open the
history variable group operation window:


Step2: Configure variable record:


Parameter:

Name: variable record name.


Variable record name naming rules:Refer to the naming rules for
IO;variable;in section “5.5.1 Create IO variable".
Column Name: the column name of variable record
corresponding datatable.
Expression: the realtime data of variable record that need to be
recorded is generated by associated expression.
Variable Type: the data type generated by variable record ,the
corresponding column type in the datatable.
Storage Type: it is divided into general storage and subtract
storage.General storage: Every time the condition is triggered,
the real data generated by expression are recorded;subtract
storage: the difference between the current data and last data
generated by expression.

Step3: Configure the database:


Parameter:

DatabaseType: Configure database connection


information.Current support: SQL Server Compact,SQL
Server,Oracle,My SQL.
TableName: The name of variable record group corresponding
datatable.
Remove Expire Datas Regularly: User can choose the storage
time of the data recorded by group record,if the data are
overdue, they will be cleared regularly.
StorageTime: User choose the storage time of the data
recorded by group record.
Create Datatable in Database: Click the button and DIAView
will create a new datatable in the database according to variable
record configuration and database configuration.
Step4: Trigger Condition:


Configuration conditions are divided into two type according to the
trigger style:TimeScript(start,stop,one
time,continue,weekly,monthly)and ContidionScript(value
change,while true,while false,on true and on false). The configuration
is the same as the user script.please refer to chapter "16 User script
".
15.1 Overview
In industrial production, recipe is used to provides the method and
material ratio for the elements of the product; in the DIAView
software, recipe is the collection of parameter values that
corresponds to the variables during the producing. For example, the
recipe of producting cakes lists the elements to produce the cake (for
example flour, eggs, sugar and water etc.) and the amount needed
for each element. Since different types of cakes need to be
produced, their elements won’t be the same completely ; therefore
this recipe lists all the elements that are used by these cakes, but the
amount of elements used for different cakes are different. The
following table is the cake recipe of a certain cake factory:
Chocolate Cranberry
Recipe Matcha cake
cake cake
Flour 130g 100g 150g
Cocoa
30g 0g 0g
powder
Egg 4eggs 3eggs 3eggs
White
110g 60g 50g
sugar
Salad oil 45ml 0ml 0ml
Olive oil 0ml 0ml 50ml
Raisin 25g 0g 0g
Cream 50g 0g 0g
Butter 0ml 40ml 0ml
Water 300ml 200ml 100ml
Salt 0g 1g 0g
Matcha 0g 3g 0g
Cranberry 0g 0g 100g
Recipe is the collection of various elements, and each element has
its own parameter item. In the DIAView software,the recipe are the
recipe “elements” that corresponds to the project variables ; the
parameter of each recipe item is composed by variable values.
Recipes can be the preset tables of elements value and the various
recipe items, or it can be maintained during the running of the
DIAView software.
The control “Recipe browser” in the DIAView software can be used to
view and maintain recipes; it is easy to operate and highly efficient.
15.2 Recipe configuration
Configuring recipe means defining the elements of the recipe, the
specific project and the value of the dosage; configuration steps are
as follows:
Step 1:Open the project tree index window under the DIAView
software development environment →Right-click the “Recipe” in the
project tree index and click on “New Recipe” ; the system will create a
recipe table with the default name “Recipe 0”, as shown in the figure
below:

Recipe name naming rules:


Refer to the naming rules for IO variable in section “5.5.1 Create IO
variable ”
Step 2: Right-click on the added “Recipe 0” node and rename it to
“Cake recipe”; double-click it to open the recipe table and click the
“Add element” button to add an element, as shown in the figure
below:
The meanings of each configuration in the window are as follows:
Name: Name of the recipe element.
Recipe element naming rules:Refer to the naming rules for IO
variable in section “5.5.1 Create IO variable ”
Recipe Type: Recipe element type; there are 3 types: analog
value, digital value and string value.
Associated Variables: Project variable associated to the recipe
element.
Description: Other information for the recipe element.
The functions of each button in the toolbar in the recipe window are
as follows:
Add Element: Adds an element at the bottom of the recipe table
with a default name. Each element is a row in the recipe table.
Insert Element: Inserts an element on top of the row selected in
the recipe table with incremented naming of the selected row.
Delete Element: Deletes the selected recipe element.
Add Item: Adds recipe items, which means adding column in the
recipe table; double-click the title of the column to rename of the
column. The column names of “Name”, “Recipe type”, “Associated
variable” and “Description” cannot be changed.
Recipe item naming rules:Refer to the naming rules for IO variable in
section “5.5.1 Create IO variable ”
Insert Item: item: Inserts a recipe item at the left of the selected
column; the column name uses incremented naming of the selected
column.
Delete Item: Deletes the selected recipe item.
Import: Imports recipe data from Excel to the recipe table.
Export: Exports the data from the recipe table to Excel.
Step 3: Change the element name, select the recipe type,associate
project variables etc.Then complete the configuration of a recipe
table, as shown in the figure below:
15.3 Recipe browser
In the DIAView software,the recipe browser is used to browse and
operate recipe; it can automatically identify all the recipe created in
the system;Only by matching recipe names in the property of recipe
browser under developing environment,user can view and maintain
recipes under running environment. It is very easy and highly efficient
to use.
Ø Usage of recipe browser:
open the extended controls group in the toolbox in the DIAView
software development environment and click on “RecipeBrowser”:
Ø Composition of recipe browser:


The toolbar includes some buttons to operate the recipe table,
including “Add recipe item”, “Edit recipe item”, “Write variable value to
recipe item” and “Import recipe” etc.;
The display area of the recipe table will display the recipe data that
are already configured in the project;
The StatusBar displays related nformation of the recipe.
Ø Functions of recipe browser toolbar buttons:
Functions of recipe browser toolbar buttons please refer to the
chapter “7.6.13 RecipeBrowser”
Ø Recipe browser properties:
Recipe browser properties please refer to the chapter “7.6.13
RecipeBrowser”
Ø Recipe command:
Recipe commands can be used in event scripts to operate to the
recipe, as shown in the figure below:

Please refer to the "20.4 Programming model"for the specific


command scripts.
16.1 Overview
User scripts are programs with special functions written by users; it
can complete and expand the functions of the DIAView. When a user
writes programs in the project, it can flexibly use and control the
various resources of the DIAView such as graphic objects and
commands etc., and it is able to improve and optimize system
workflow and increase the efficiency of execution.

The DIAView software has a built-in script editor provided for users
to write customized programs; it uses the VB Script language. VBS
is a lightweight interpreted scripting language that is easy to learn
and has powerful functions; the script editor has flexible and
intelligent reminder function that allows users to write programs more
easily, conveniently and highly efficiently.

The DIAView has two types of user programs: ConditionScript and


TimeScript.
16.2 Condition script
Condition Script are customized programs that the system will
execute when items in the project satisfies the setting conditions;
configuration steps are as follows:
Step 1: Open the project window tree index in the DIAView
development environment→ open the “Script” node, as shown in the
figure below:

Step 2: Double-click the “ConditionScript” sub-node to open the


ConditionScript window; click the “Add” button to add a program
configuration row, as shown in the figure below:
The meanings of each field in the ConditionScript are as follows:
Name: Name of the ConditionScript.
Naming rules:Refer to the naming rules for IO variable in
section “5.5.1 Create IO variable ”,and this name cannot be
the same name as in the “TimeScript”.
IsEnable: Selecting the checkbox means enabling this
ConditionScript, or else it means not enabled (default is enabled).
Expression: Sets the condition expression.
Trigger Mode:There are 5 types: “Value change”, “While true”,
“While false”, “One true” and“One false”. Only when the condition is
satisfied will the system be triggered to execute the ConditionScript.
Time Interval:Sets the time interval for the system to execute the
configured program; this can only be set when the trigger mode is
“One true” and “One false”.
Script Content:Writes the script program.
Description: Explanation information of the ConditionScript.

Step 3: Click the button in the “Expression” field to open the condition
expression configuration window and set the expression, as shown in
the figure below:

Step 4: Select the trigger mode; when the setting is “One true” or
“One false”, the Time Interval must also be set (unit: milliseconds);
Step 5: Click the button in the “Script Content” field to open the script
editor and write the script program, as shown in the figure below:

16.3 Time script
Time Script is a user-defined program that is executed by the system
at startup, during operation, or when the project stops. The
configuration steps are as follows:

Step 1: Open the project window tree index in the DIAView


development environment,→ open the “Script” node, as shown in the
figure below:

Step 2: Double-click the “TimeScript” sub-node to open the


TimeScript window; click the “Add” button to add a program
configuration row, as shown in the figure below:

The meanings of each field in the TimeScript are as follows:

Name: Name of the TimeScript.

Naming rules:Refer to the naming rules for IO variable in


section “5.5.1 Create IO variable ”,and this name cannot be
the same name as in the “ConditionScript”.

IsEnable: Selecting the checkbox means enabling this TimeScript,


or else it means not enabled (default is enabled).

Trigger Mode: There are 6 types: "Start", "Stop", "One-time",


"Continue", "Weekly" and "Monthly". Which is the time for triggering
the system to execute the configuration program.

Configuration: Sets the time condition for the system to execute


the configuration program; this can only be set when the trigger mode
is “One-time”, “Continual”, “Weekly” and “Monthly”.

Script Content: Writes the script program.

Description: Explanation information of the TimeScript.

Step 3: Select the Trigger Mode; TimeScript must also be set when
the trigger mode is set as “Onetime”, “Continue”, “Weekly” and
“Monthly”. The figure below is the configuration window that appears
when the Trigger Mode is set as “One-time” and the button in the
“Configuration” field is pressed,as is shown in:

The following figure is the configuration window that appears when


the Trigger Mode is set as "Continue" and the button in the
"Configuration" field is pressed,as is shown in:
The following figure is the configuration window that appears when
the Trigger Mode is set as “Weekly” and the button in the
“Configuration” field is pressed,as is shown in:
The following figure is the configuration window that appears when
the Trigger Mode is set as "Monthly" and the button in the
"Configuration" field is pressed,as is shown in:

The meanings of each configuration in the window are as follows:

Weekly: Selects the weekly triggering time.

Monthly: Selects the monthly triggering time.

Start: Sets the start time.


End: Sets the end time (if the set start time > end time, the trigger
period will be: starts from the start time set and ends at the end time
set on the following day. If the setting start time < end time, the trigger
period will be starts from the setting start time and ends at the setting
end time).

Interval: Sets the interval time, unit: milliseconds (ms).

Step 4: Click the button in the “Script Content” field to open the script
editor and write the script program, as shown in the figure below:
16.4.1 Overview
DIAView Globle Function is to package the reusable script
code, avoid code dispersion, reduce maintenance costs and
debugging difficulties.
16.4.2 Module configuration
In global function, a module consists of a series of methods,
equivalent to a list
1. Add new module:
Step 1: Right-click on the “Script” node child node "Globle Function"
in the project window tree index and then click the “New Module” item
in the right-click menu, as shown in the figure below:


Step 2: After clicking “New Module”, the system will generate a
window sub-node under the “Global Function” node using a default
name, and the new window will be opened in the sketchpad work
area, as shown in the figure below:

2. Delete Module:
Select the module node to delete from the project window tree index
and right-click on it, then select the “Delete” item from the right-click
menu to delete the window, as shown in the figure below:

3. Rename Module:
Select the module node to rename in the project window tree index
and right-click on it, and the select the “Rename” item from the right-
click menu. The module name will become an editable status and just
input the new module name, as shown in the example in the figure
below:

² Module naming rules:Refer to the naming rules for IO variable in
section “5.5.1 Create IO variable ”
4. Encrypt Module:
Select the module node to encrypt from the project window tree index
and right-click on it, then select the “Password” item from the right-
click menu to encrypt the module, as shown in the figure below:
² Note: If module has encrypted, click "Password" is to modify
password, if new password is null, will cancel password.
5. Module Property:
Select the module node to modify property from the project window
tree index and right-click on it, then select the “Property” item from
the right-click menu to modify the module property, as shown in the
figure below:
² Note: The description of module will be displayed in script
editor, as shown in the figure below:
16.4.3 Add and use method
1. Open module view
Open module window, as shown in the figure below:

Property:
Name: Method name
Method naming rules:Naming rules:Refer to the naming rules for IO
variable in section"5.5.1 Create IO variable"
Method Type: Type of method function
Sub : Not return value.
Function: Has return vaule.
Script Content: The body of method, edit in script editor.
Description: The description of method, include function, parameter,
and return vaule.
2. Add method
Step 1: Click "Add", add new method, modify name and method type,
as shown in the figure below:

Step 2: Click button of the script content, into the script editor and
compile script, as shown in the figure below:


Step 3: Click button of the description, into the description window
and modify method description, as shown in the figure below:


Step 4: The description of method will be displayed in script editor, as
shown in the figure below:

Step 5: method of global function can be used in other script, as


shown in the figure below:
16.4.4 Reference and import export
1. Module reference browser

Right-click on the “Global Function” node in the project window tree


index and then click the “Module Reference Browser” item in the
right-click menu, as shown in the figure below:
2. Module import and export

The file type to import and export is ".modules".

Step 1: Right-click on the “Global Function” node in the project


window tree index and then click the “Export Module” item in the
right-click menu to export module, as shown in the figure below:
Step 2: Right-click on the “Global Function” node in the project
window tree index and then click the “Import Module” item in the right-
click menu ,as shown in the figure below:
17.1 Overview
DatabaseAccess in DIAView allows users to access external
database, query and modify the data in the database.

As long as users configure database connection in the


DatabaseAccess, users can operate data in the database in the
runtime.

The supporting database types: SQLServer\SQLServer


Compact\Oracle\MySQL.
17.2 Database access configuration
DatabaseAccess configuration figure is as shown in the figure
below:


Ø Configure the database connection name:
Name:The database connection name.
Naming rules:Refer to the naming rules for IO variable in section
“5.5.1 Create IO variable ”.
Ø Configure the database connection information:
² Oracle database configuration is as shown in the figure below:
ServerName: Enter the server name or IP address of the database
that needs to connect.
ServiceName: The service name of Oracle database.
UserName: Sets the user name for Oracle ID authentication login.
Password: Sets the user password used for Oracle ID
authentication login.
ConnectionTimeout: Sets the time for the database to switch
connection or reconnect after connection failed, and reports an error
if exceeded this time; unit: seconds.
PortNumber: Port number used by Oracle database.
TableSpace: The table space to access,if it is null,Oracle will select
the default table space.
TableName: The table name to access.
² SQLServer database configuration is as shown below:
ServerName: Enter the server name or IP address of the database
that needs to connect; click the pull-down button to search for servers
automatically within the network.When accessing a remote database,
you need to enter the PC name or IP address where the database
server is located.
Authentication: There are two methods to authentication when
logging in the server:Windows ID authentication and SQL ID
authentication;if the database is configured on a local host;When
selecting "Windows authentication", no user name and password
need to be entered. When selecting SQL authentication, you need to
enter the corresponding username and password configured in the
SQL server.
UserName: Sets the user name for SQL ID authentication login.
Password: Sets the user password used for SQL ID authentication
login.
ConnectionTimeout: Sets the time for the database to switch
connection or reconnect after connection failed, and reports an error
if exceeded this time; unit: seconds.
Connect: Tests whether it can connect to the database server.
DatabaseName: Enter the database name that need to access.
TableName: The table name to access.
² SQLServer Compact database configuration is as shown in the
figure below:

DatabaseFile: Enter the database file path and file; the button on
the right can be clicked to select the directory.
Password: Database password; left empty if the password is not
required.
Connect: Tests whether it can connect to the database.
TableName: The table name to access.
² MySQL database configuration is as shown in the figure below:
ServerName: MySQL server name or IP address.
Username: Sets the user name for My SQL ID authentication login.
Password: Sets the user password used for My SQL ID
authentication login.
ConnectionTimeout: Sets the time for the database to switch
connection or reconnect after connection failed, and reports an error
if exceeded this time; unit: seconds.
Connect:Tests whether it can connect to the database server.
DatabaseName:Enter the database name that need to access.
TableName: The table name to access.

Ø Paging : If selecting the paging, the DIAView will paging the data
into a lot of pages according to the setting paging when DIAView
reads data, only one page data is read at one time;If not, all the data
is read.Due to the large amount of data in the database , reading all
data once will take up a lot of memory,it will cause the program
lagging.
17.3 Accessing database
DIAView provides many methods to access external database, one of
the most basic method is to call the database access command to
access the database. Database access provides a rich script
commands to help user query, modify the database data.

The command provided by database access which has been


configured is as shown in the figure below:
Database access function also provides public commands to be
convenient for the user to operate more flexibly.
17.4.1 How to create a database
This section takes the material management system as an example to
create a database table to realize the warehousing and requisitioning
management of materials and update the material inventory in real time. It is
assumed that the preconditions are as follows:
Ø Project:MaterialManagementSystem
Ø Window:Create_database_tables
Ø Report:Report0
Ø Database:SQL Server
Ø After the precondition is completed, you can create a database table:
Step 1:Configure database access:Double click the "Database Access" node
in the project tree view to open the "Database Access" window,click "Add"
to add a database access table. The default name of the system is
"DatabaseAccess",click the button on the right side of the "Configuration"
column,select the data source type "SQL Server" in the pop-up "Database
Configuration" window,configure the correct server name,select "Windows
Authentication",configure "DatabaseName","TableName" remains
empty,click the "Connect" button to prompt "Test connection succeeded!", as
shown in the figure:
Step 2:Create Database Table:Drag a button from the Toolbox window
control,set "Content" to "CreateDatabaseTable" in the property
window,configure the LeftButtonDown event, and the script content is as
shown in the figure:
Click the "Run" button in the menu bar above the window interface to
enter the running environment,click "CreateDatabaseTable" button。
17.4.2 How to add, delete, change and query
database
This section takes the material management system as an example to
introduce how to create and delete database tables and insert, delete, modify
and query data tables. It is assumed that the preconditions are as follows:
Ø Project:MaterialManagementSystem
Ø Window:Database_addition_deletion_modification_query
Ø Database:SQL Server
Ø Database Table:Database table "material" exists in database tempdb
Ø After the precondition is completed, you can configure database access:
Step 1:Configure "TableName" of the database access, as shown in the
figure:
Step 2:Double click the "Database_addition_deletion_modification_query"
window,drag three Labels from the Window Controls. Default names are
"Label0", "Label1" and "Label2",set the content to“Id”“Name”“Count”
respectively in the property window,drag three TextBoxes from the Window
Controls,the default names are “TextBox0”“TextBox1”“TextBox2”,to enter
material information,as shown in the figure:

Step 3:In "Database_addition_deletion_modification_query" window,drag


one Report control from the Extended Controls. The default name is
"Report0",as shown in the figure:
Ø Insert data to database table
Step 4:Drag one Button from the Window Controls,set the content to
"InsertData" in the property window,configure the LeftButtonDown event,
and the script content is as shown in the figure:
Click the "Run" button in the menu bar above the window interface to enter
the running environment,input Id,Name,Count,click "InsertData" button,
insert data success, displayed in the report, as shown in the following figure:
Ø Delete data from database table
Step 5:Delete data:Drag one Button from the Window Controls,set the
content to "DeleteData" in the property window,configure the
LeftButtonDown event, and the script content is as shown in the figure:
Click the "Run" button in the menu bar above the window interface to enter
the running environment, input ID,click “DeleteData” button,delete data
success,displayed in the report, as shown in the following figure:
Ø Update data:
Step 6:Update data:Drag one Button from the Window Controls,set the
content to "UpdateData" in the property window,configure the
LeftButtonDown event, and the script content is as shown in the figure:
Click the "Run" button in the menu bar above the window interface to enter
the running environment, input ID,NAME,COUNT,click "UpdateData"
button, update data success,displayed in the report, as shown in the
following figure:
Ø Query the data and display it in a report:
Step 7:Drag one Button from the Window Controls,set the content to
"InsertData" in the property window,configure the LeftButtonDown event,
and the script content is as shown in the figure:
Click the "Run" button in the menu bar above the window interface to enter
the running environment,click “QueryData” button,as shown in the
following figure:
17.4.3 How to store, query and export history
through database
This section takes the WaterLevelMonitoringSystem as an example to
introduce how to store, query and export history records through the
database, mainly including storing history records and querying and
exporting history records with the database. It is assumed that the
preconditions are as follows::
Ø Project:WaterLevelMonitoringSystem
Ø Window:Store_Query_Export
Ø Variable:WaterLevel
Variable Variable
Name Type
WaterLevel Analog
Ø IO Device:Address0
IO Address Associated
Name Variables
地址 WaterLevel
Ø Database:SQL Server
Ø After the precondition is completed, you can store history records,steps as
follows:

Step 1:Add Record Variable:Double click "History Variable"→"Record


Variable" in the tree view of the project window to open the "Record
Variable" window,click "Add" button,the system will add a historical record
with the default name and rename it to "WaterLevelMonitoring", as shown
in the figure:
Step 2:Record Variable Associated Variables:Click the button on the right
side of the "Associated Variables" column,select the variable "WaterLevel"
in the pop-up "Variable Browser" window, as shown in the figure:
Step 3:Select Storage Mode:Click the drop-down button on the right side
of the "Mode" column and select"Timing", as shown in the figure:
Step 4:Select Timer:Click the button on the right side of the "Timer"
column, and check the timer "s1" in the pop-up "Timer Browser" window, as
shown in the figure:
Step 5:Configure Record Variable Database:Right click the "Record
Variable" node in the tree of the project window and click "Database
Configuration",in the pop-up Database Configuration window, select the
DatabaseType as SQL server,input ServerName
“CNWJ6RDNB197\SQLEXPRESS”,select "Windows Authentication",use
the default DatabaseName "HistoryDB",click "connect",prompt "Test
connection successful",as shown in the figure:

Ø Query historical record,steps as follows:


Step 6:Configure database access:Double click the "Database Access"
node in the tree of the project window,open "Database Access" window,click
"Add" button,to add one database access,the default name is
"DatabaseAccess",click the button on the right side of the "configuration"
column,in the pop-up Database Configuration window, select the
DatabaseType as SQL server,input correct ServerName,select "Windows
Authentication",configure the DatabaseName and the TableName,click
"connect",prompt "Test connection successful",as shown in the figure:
Step 7:Double click "Store_Query_Exort" window,drag one Report control
from the Extended Controls. The default name is "Report0",as shown in the
figure:
Step 8:Configure "QueryData" script:Drag one Button from the Window
Controls,set the content to "QueryData" in the property window,configure
the LeftButtonDown event, and the script content is as shown in the figure:
Step 9:QueryData:After configuration,click the "Run" button in the menu
bar above the window interface to enter the running environment,after
running the project for a period of time,click "QueryData" to display the
query results in the report, as shown in the figure:
Ø Export historical records,steps as follows:
Step 10:Configure "ExportData" script:Double click the
"Store_Query_Export" window,drag one Button from the Window
Controls,set the content to "ExportData" in the property window,configure
the LeftButtonDown event, and the script content is as shown in the figure:
Step 11:Export data:After configuration,click the "Run" button in the menu
bar above the window interface to enter the running environment,after
running the project for a period of time,click "ExportData" button, display
the database records in the window report, and then exported to the specified
path, as shown in the figure:

18.1 Overview
Globalization provides users with the ability to convert the contents
of functional modules into the list of multi-language resources at
development time and edit the extracted resources, so as to realize
the function of multi-language free switching in the runtime screen.

Currently supported multilingual resource types are: string image


sound
18.2 Language configuration
Step 1: Right-click on the“Global”node in the project window tree
index and then click the “Configuration” item in the right-click menu,
as shown in the figure below:

Step 2: Open configuration window, as shown in the figure below:


l Add: Add selected language in the left list.

l Remove: Remove selected language in the right list, if select


language is set to "Develop Environment Language","Runtime
Environment Language" or "Default Project Language", can not be
removed.

l Set Develop Environment: Set selected language in the right list to


"Develop Environment Language", "Develop Environment Language"
is the dispaly language of string, picture and soud in windows at
develop environment.

l Set Runtime Environment: Set selected language in the right list to


"Runtime Environment Language", "Runtime Environment Language"
is the dispaly language of string, picture and soud in windows at
runtime environment.

l Set Default Project Language: Select language from combobox to


"Default Project Language", "Default Project Language" support
simple Chinese, traditional Chinese and English. Window will display
default project language if current language not translate. All resource
should be translated if set langguage to "Default Project Language".
When project default language not compares with software language,
suggest switch project default language.

Note: it is recommended to switch the default language to be


consistent with the software language when the software language is
inconsistent with the default language of the project (for example, the
software language is English and the default language of the project
is Chinese)
18.3 Language reference
Language referener is a window to view all string images and sound
references in globalization to see if a resource is referenced and path
information is referenced

Step 1: Right-click on the “Global” node in the project window tree


index and then click the “Browser” item in the right-click menu, as
shown in the figure below:

Step 2: Open borwser window, as shown in the figure below:


Description

l The left side of the language resource usage browser is the tree
index of the "Global", and the right side is the display window of
language resource references.

l In the tree index to the left, if the round symbol in front of the
language resource displays as “yellow”,it means that this language
resource is referenced. If it is “gray”, it means that it is not yet
referenced.

l Select the language resource to view from the tree index to the left,
and the language resource reference display window on the right will
display all objects in the project that uses that language resource.
They are displayed using an expanded tree index in order for users to
pinpoint the objects that actually uses this language resource.
18.4 String
String is the global function of this type of repository, the user can
customize the editing steps below:
Step 1: Select the“String” node in the project window tree index, as
shown in the figure below:

Step 2: Double click "String" node and open editor window, as shown
in the figure below:

Note: In string window, row represents resource display in different
language, column represents a kind of language, if cell content is null,
will display default language content.
Functional modules that can be converted into string resources
in DIAView include:
l All tooltip property of controls in "Window".
l Content property of text control, button control, label control,
checkBox control, comboBox control and textBox control.
l Collection property of comboBox.
l Title and x, y title of chart controls.
l Alarm content in alarm variable.
Ø The text property selects the resource
At development time, the text property can directly select an existing
string resource, as follows:
Step 1: Add a new button control in window, click button in the
content property, as shown in the figure below:

Step 2: Open content editor, as shown in the figure below:

Note: If user has create a resource in string window, cilck
"Resources" and select it, if has not create, user can click"To
Resource", system will generate a new resource in string window.
Step 3: Click "Resources", select a resource user want relation, and
click "OK", this property has globalized, as shown in the figure below:

Ø Text properties are converted to resources


At development time, text properties can be converted to string
resources, as follows
Step 1: Add a new button control in window, click button in the
content property, as shown in the figure below:

Step 2: Open content editor, as shown in the figure below:

Step 3: Click "To Resource", select current content to generate
resource, as shown in the figure below:

Step 4: Click "Editor",open resources editor and editor resource, as
shown in the figure below:

Step 5: Close resources editor, click "OK", this property has
globalized.
18.5 Image
Picture is the resource library of picture path in the globalization
function. Users can customize it as follows
Step 1: Select the "Image" node in the project window tree index, as
shown in the figure below:

Step 2: Double click "Image" node and open editor window, as shown
in the figure below:

Note: In image window, row represents resource display in different
language, column represents a kind of language, if cell content is null,
will display default language content.
Ø Image preview:
User can preview image when mouse move into cell, as shown in the
figure below:


User can close preview image at right menu, as shown in the figure
below:


Globalization control of image in DIAView:
l Image control
l GIFImage control
Ø Use image Resource
At development time, the image path can directly select the existing
image resources, the specific operation is as follows:
Step 1: Add a new image control in window, click button in the
imagePath property, as shown in the figure below:

Step 2: Open image window, as shown in the figure below:
Step 3: Click "Resource List", select resource to relate, as shown in
the figure below:
Ø Image properties are converted to resources
At development time, the image path can be converted to image path
resources, as follows:
Step 1: Add a new image control in window, click button in the
imagePath property, as shown in the figure below:

Step 2: Open image window, as shown in the figure below:

Step 3: Click "To Resource", select resource to relate, as shown in
the figure below:

Step 4: Click "Editor",open image resources editor and editor
resource, as shown in the figure below:

Step 5: Close image resources editor, click "OK", this image control
has globalized.
18.6 Sound
Sound is the sound resource library in the globalization function.
Users can customize it as follows

Step 1: Select the“Sound”node in the project window tree index, as


shown in the figure below:

Step 2: Double click "Sound" node and open editor window, as


shown in the figure below:
Note: In sound window, row represents resource display in different
language, column represents a kind of language, if cell content is null,
will display default language content.

Sound preview:

User can preview sound when mouse move into cell and user can
also close preview image at right menu, as shown in the figure below:
18.7 System
System more language refers to the window in the system, according
to the text in the specified language system multilingual including
advanced control menu bar and a drop-down box content, runtime
menu bar etc. For example: system multilingual edit box has three
languages: English and Chinese traditional, is the project in the
development time and runtime can switch between the three
languages

Step 1: Select the "System" node in the project window tree index, as
shown in the figure below:
Step 2: Double click "System" node and open editor window, as
shown in the figure below:

Description

l A line in a system's multilingual interface represents what a resource


displays in different languages, and a column represents a language

l Users of traditional Chinese and English are not allowed to modify it,
even if they export Excel changes and then import them

l Users can not customize the multi-language resources of the


system, and can only translate the corresponding national language
for the existing resources
18.8 Switch language at runtime
When the system is running, users can switch between multiple
languages in the following ways:

Ø By runtime meun:

At run time, use the shortcut key F11 to exit the full screen, and click
the language button in the menu bar to switch languages, as shown
in the figure below:

Ø By script:

Switch language by "SwitchLanguageTo" script at global script, as


shown in the figure below:
19.1 Introduction
WebAPI is a network application program interface, which contains
a wide range of functions.Through API interfaces, network
applications can realize the capabilities of storage services,
message services, computing services, etc. by using these
capabilities, web applications with powerful functions can be
developed.

Diaview follows the rest architecture and establishes the WebAPI.


The data is uniformly in JSON format. The authorization verification
method is JWT (JSON web token).JWT is generally used to transfer
authenticated user identity information between identity providers
and service providers, so as to obtain resources from the resource
server.
19.2 WebAPI implementation
The realization of DIAView WebAPI function is completed through
the "WebAPI" sub option of the "Project Configuration" node in the
tree directory of the project window.In the process of enabling
WebAPI, you need to start three configuration tasks: WebAPI, Server
Address and Port Number.


² WebAPI:Check to start WebAPI;
² Server Address:WebAPI server address,the default is
localhost,this refers to the IP address of the computer where
DIAView is located;
² Port Number:The default is 9010,the range is 0-65535;
² WebAPI function needs dongle support。
² The WebAPI function requires DIAView to be run as an
administrator.。
19.3 Login
Use postman to simulate the client, send the request data to the
server and obtain the corresponding response results.
Ø Login with user name and password:
Interface address:http://{ip}:{port}/RTDB/WebAPI/Login
Username and PasswordPut in Postman's Body(x-www-form-
urlencoded),the server judges whether the username and
password are correct and decides whether to return a token.
Request mode: HttpPost
Return format:Json
Ø Example:
Step 1: Check to start WebAPI service,modify the server
address to the IP of the computer where DIAView is located, and
the port number remains the default, as shown in the following
figure:


Explain:The examples in this chapter enable the webapi
function by default.
Step 2: Set username and password in the "Authority" node in
the tree directory of the project window


Step 3:Use postman to simulate post request of client,put
username and password in the Body(x-www-form-urlencoded) of
postman,send request data to the server.

Return message:
result:OK:Indicates that the result is correct;
message:" ":Message is the requested data,token returned this
time;
errorMsg:" ":When the returned result is false, you need to
check the contents of errorMsg。
19.4 Verify the validity of token
The valid duration of a token is half an hour. After it fails, it is
necessary to obtain a valid token again.

The client needs a valid token to obtain data and operation data
from the server, so first verify the validity of the token.

Ø Verify the validity of token:

Interface address:http://{ip}:
{port}/RTDB/WebAPI/ValidateToken

Request mode: HttpGet

Return format:Json

Ø Example:

Step 1: Use postman to simulate get request of client, put token in


authorization, and send request data to server, as shown in the following
figure:
Return message:

result:OK:Indicates that the result is correct;

message:" ":Message is the requested data,return null this


time;

errorMsg:" ":When the returned result is false, you need to


check the contents of errorMsg。
19.5 Get username
There are two ways to obtain usernames: one is to obtain all
usernames without permission, and the other is to obtain usernames
under permission according to user permission.

Ø Get username under permission:

Interface address:http://{ip}:
{port}/RTDB/WebAPI/UserNames/{userTypeName}

Request mode: HttpGet

Return format:Json

Ø Example1 Get all usernames:

Step 1: "User Type" and "User Manage" have been configured, as


shown below:
Step 2: Use postman to simulate get request of client, get all
usernames, and send request data to server, as shown in the
following figure:
Return message:

result:OK:Indicates that the result is correct;

message:" ":Message is the requested data, where


"systemadmin", "user", "user1", "user2", "user3" are returned;;
errorMsg:" ":When the returned result is false, you need to
check the contents of errorMsg.

Ø Example2 Get usernames of the specified SystemAdmin


type:

Step 1: Use postman to simulate get request of client, get usernames


of the specified SystemAdmin type, and send request data to server, as
shown in the following figure:
Return message:

result:OK:Indicates that the result is correct;

message:" ":Message is the requested data, where


"systemadmin" is returned;;

errorMsg:" ":When the returned result is false, you need to


check the contents of errorMsg.

Ø Example3 Get usernames of the specified Admin type:

Step 1: Use postman to simulate get request of client, get usernames


of the specified Admin type, and send request data to server, as shown
in the following figure:
Return message:

result:OK:Indicates that the result is correct;

message:" ":Message is the requested data, where "user",


"user1" are returned;;

errorMsg:" ":When the returned result is false, you need to


check the contents of errorMsg.
Ø Example4 Get usernames of the specified Operator type:

Step 1: Use postman to simulate get request of client, get usernames


of the specified Operator type, and send request data to server, as
shown in the following figure:

Return message:

result:OK:Indicates that the result is correct;


message:" ":Message is the requested data, where "user2",
"user3" are returned;;

errorMsg:" ":When the returned result is false, you need to


check the contents of errorMsg.
19.6 Get device names
Get all IO device names in the project.

Interface address:http://{ip}:
{port}/RTDB/WebAPI/DeviceNames

Request mode: HttpGet

Return format:Json

Ø Example Get all IO device names in the project:

Several IO devices already exist in project, as shown in the


following figure:
Use postman to simulate get request of client, obtain all IO devices
names, and send request data to server, as shown in the following
figure:
Return message:

result:OK:Indicates that the result is correct;


message:Message is the requested data, all IO device names
existing in the project are returned here,as
"ModubsTCP","OmronFINSASCII","DeltaASRTU",etc;

errorMsg:" ":When the returned result is false, you need to


check the contents of errorMsg.
19.7 Get device parameters
Gets parameters of the specified IO device in project.

Interface address:http://{ip}:
{port}/RTDB/WebAPI/GetDeviceConfig/{devicename}

Request mode: HttpGet

Return format:Json

Ø Example Gets parameters of the specified IO device in project:

Step 1:Several IO devices already exist in project, as shown in


the following figure:
Step 2: Use postman to simulate get request of client, get parameters
of DVP12SETCP device,, and send request data to server, as shown in
the following figure:
Return message:

Return the list of specified equipment parameters, including


device type, device name, device station number, whether to
start the scanning device initially, etc.
19.8 Get device address list
Get the address list of IO device in the project. The address list
refers to the address name, address and binding variables under the
device.

There are two ways to obtain the address list of device: one is to
get the address list under a specified single device, and the other is
to get the address list of all device in the project.

Ø Example1 Get address list of the specified IO device in project:

Interface address:http://{ip}:
{port}/RTDB/WebAPI/GetDeviceAddress/{devicename}

Request mode: HttpGet

Return format:Json

Step 1:The address configuration of IO device DVP12SETCP in


project is shown in the figure below:
Step 2:Use postman to simulate get request of the client, get
address list of DVP12SETCP device, and send request data to
the server, as shown in the following figure:
Return message:

result:OK:Indicates that the result is correct;

message:Message is the requested data, return the address list


under DVP12SETCP of the device, such as address name,
register address, associated variable, etc;

errorMsg:When the returned result is false, you need to check


the contents of errorMsg.

Ø Example2 Get the address list of all IO devices in project:

Interface address: http://{ip}:{port}/RTDB/WebAPI/AllIOAddress

Request mode: HttpGet

Return format:Json

Step 1:The address configuration of IO devices DVP12SETCP


and ModbusTCP in project is shown in the figure below, and
there are no addresses under other IO devices:
Step 2: Use postman to simulate get request of client, get
address list of all devices, and send request data to server, as
shown in the following figure:
Return message: The content of the returned message is too long. It
is shown in three figures;

result:OK:Indicates that the result is correct;

message:Message is the requested data,the address list of all


devices is returned here,only DVP12SETCP and ModbusTCP
have address configuration, and other IO devices have no
address configuration, so the iodataitems of other devices in the
returned message are empty;

errorMsg:" ":When the returned result is false, you need to


check the contents of errorMsg.
19.9 Get list of all variables
Get all variable information in the project.

Interface address:http://{ip}:{port}/RTDB/WebAPI/AllTagsList

Request mode: HttpGet

Return format:Json

Ø Example1 Get all variable information in the project:

Step 1: The variables and variable groups existing in project are


shown in the following figure:
Step 2: Use postman to simulate get request of client, get list of
all variables, and send request data to server, as shown in the
following figure:
Return message:

result:OK:Indicates that the result is correct;

message:Message is the requested data, here return the list of all


variables;;

errorMsg:" ":When the returned result is false, you need to check the
contents of errorMsg.
19.10 Get variable value
Get value of the specified variable.

Interface address:http://{ip}:{port}/RTDB/WebAPI/GetTags 或
http://{ip}:{port}/RTDB/WebAPI/GetAsyncTags

Request mode: HttpGet

Return format:Json

Ø Example Get value of the specified variable:

Step 1: The variables and variable groups existing in project are


shown in the following figure:
Step 2: Fill the variable to be read into raw under the body
option of postman, and then use postman to simulate get request
of client to get value of specified variable, as shown in the
following figure:
Return message:

result:OK:Indicates that the result is correct;

message:Message is the requested data, here returns the requested


variables and values;

errorMsg:" ":When the returned result is false, you need to check the
contents of errorMsg.
19.11 Write variable value
Updates the value of specified variable.

Interface address:http://{ip}:{port}/RTDB/WebAPI/WriteTags 或
http://{ip}:{port}/RTDB/WebAPI/WriteAsyncTags

Request mode: HttpPost

Return format:Json

Ø Example Updates the valud of specified variable:

Step 1: Get value of the specified variable,as shown in the following


figure:
Step 2:Fill variables and values to be updated into raw under the
body option of postman according to the specified format, and
then use postman to simulate post request of client to update
values of the specified variables, as shown in the following
figure:
Return message:

result:OK:Indicates that the result is correct;

message:Message is the requested data, here returns blank;

errorMsg:" ":When the returned result is false, you need to check the
contents of errorMsg.

Step 3: Obtain value of the specified variable again and confirm


that the variable value is written successfully, as shown in the
following figure:
19.12 Get real time alarm
Get real-time alarm.

Interface address:http://{ip}:{port}/RTDB/WebAPI/AllAlarms

Request mode: HttpGet

Return format:Json

Ø Example Get Real-Time Alarm:

Step 1: There are triggered alarms in the project, as shown in the


following figure
Step 2:Use postman to simulate get request of client and obtain
the real-time alarm, as shown in the following figure::
Return message:

The content of the returned message is too long. It is shown


in two figures;

result:OK:Indicates that the result is correct;

message:Message is the requested data,real time alarm


information is returned here, including alarm source, record
type, alarm content, alarm level, trigger time, alarm value, etc;

errorMsg:" ":When the returned result is false, you need to check


the contents of errorMsg.
19.13 Get history alarms
Two parameters "Starttime" and "Endtime" are required to obtain
the history alarm, indicating the start time and end time of obtaining
the history alarm.

Interface address:http://{ip}:
{port}/RTDB/WebAPI/HistoryAlarms/{startTime}/{endTime}

Request mode: HttpGet

Return format:Json

Ø Example Get History Alarm:

Step 1: There are history alarms in the project, as shown in the


following figure:
Step 2:Use postman to simulate get request of client and obtain
the history alarm, as shown in the following figure:
Return message:

The content of the returned message is too long. It is shown in two


figures;

result:OK:Indicates that the result is correct;


message:Message is the requested data, two history alarm
messages between start time and end time are returned here;

errorMsg:" ":When the returned result is false, you need to check the
contents of errorMsg.
20.1 Overview
The DIAView is composed of two parts,the development environment
and runtime environment.The project IO communications created in
the development environment,the graphic interfaces drawn and
scripts edited etc,can only br fully operated in the runtime
environment,including display pictures dynamically and achieve real-
time monitoring.The runtime environment of the DIAView software
can dynamically display the graphic objects,the animations and
events configured for graphic objects or window controls,achieving
information interaction and real-time controlling between the picture
and the field equipment.
20.2 Project configuration
In the DIAView, the main function of project configuration is to
configure the shortcut keys of the runtime environment, the project
runtime picture and the network configuration.
Shortcut key configuration is mainly to set keys that can be used in
the project runtime environment.
Picture configuration is to set the window to open and the display
order of the window in the project runtime environment.
Network configuration,set the communication information and display
mde of server and client.
Ø Runtime
Sets the shortcut keys in the runtime environment, as shown in the
figure below:

² Auto Fit Screen: The runtime window size will adapt
automatically to the full screen.
² Auto Run: The default project is automatically run when the
computer is started.
² Start OPC UA Server: Sets whether to start OPC UA Server at run
time.
² Configuration: Configure the OPC UA Server port number.
² Cursor: Sets the running mouse style.
² Select All: Once selected, all checkbox in the group box will be
selected.
² Prohibit key F11: In the runtime environment , prohibit F11 key to
switch to full screen mode.
² Prohibit Alt + F4: In the runtime environment , prohibit “Alt + F4”
keys to close the engineering.
² Prohibit Window Switching: In the runtime environment , prohibit
“Alt + Tab”/“ Windows key + Tab” keys to switch windows.
² Prohibit Start Menu: In the runtime environment , prohibit
“Windows” key to open the start menu.
² Disable the maximize button: In the runtime environment , the
maximize button is not available.
² Resizeable: In the runtime environment ,the interface size is
allowed to change.
² Disable Main Menu: In the runtime environment ,the system menu
will not be visible.
² Full Screen: In the runtime environment ,the screen is full screen
display.
² KeyboardSize: Sets the style of the keyboard that pops up at run
time.
² Loading Image: Sets the Image to load at startup runtime.
² Runtime Icon: Sets the Image displayed at runtime.
² Clear: Clear the selected Image.
Put the License under the C:\Program Files (x86)\DIAView\License
path,Users can customize loading pictures at startup and the icon at
runtime
Ø Window
Sets the windows to be opened and the display order of the windows
in the runtime environment, as shown in the figure below:

Select the windows that need to be opened in the project runtime
environment from the “Screen list” field, and then click the ​
button to add the selected windows into the “Selected windows” field;
press the ​button to add all windows into the “Selected window”
field. The initial windows can be one or multiple windows, the newly
added window is located at the bottom; if there are multiple windows,
the ​button can be used to move the screen up and the ​
button can be used to move the screen down.
Window display order: The windows in the “Selected windows” list
will be opened in the order from top to bottom; the window opened
last (which is the bottom-most window in the list) will be displayed at
the front-most.

Ø Web Window
Sets the web windows to be opened and the display order of the web
windows in the runtime environment, as shown in the figure below:

Select the web windows that need to be opened in the project
runtime environment from the “Window list” field, and then click the
​button to add the selected web windows into the “Start
Windows” field; press the ​button to add all web windows into the
“Start Window” field. The initial web windows can be one or multiple
web windows, the newly added web window is located at the bottom;
if there are multiple web windows, the ​button can be used to
move the window up and the ​button can be used to move the
window down.
Web window display order: The web windows in the “Start window”
list will be opened in the order from top to bottom; the web window
opened last (which is the bottom-most web window in the list) will be
displayed at the front-most.
Ø Network
Set the IP address or computer name, port number and other related
information of the server in the Network architecture,as shown in the
figure below:

² Server Address: Enter the name or IP address of the server.
² Port Number: The recommended range is 9002,9101-9200.Use
the port number of the recommended range to facilitate unified
setting of the port number range allowed by the firewall.
² Communication Password: The password that the client needs
to use to log in to the service.
² Sync Service Time: Whether the client is allowed to set the
system time of the local machine based on the service time.
² Run Server only: By default,clicking run at development time will
start both client and service,When you check run only services,only
services are strarted.
When choosing to start the web service, the web service option is
applicable.
² Port Number: The recommended range is 80,8101-8200.
² Address IP: Select the IP address that the developer started.
² Support Https: Check to start Https publishing.
² RTSP Port Number: The recommended range is 8083-8099.
Ø WebAPI
WebAPI is a network application program interface, which contains a
wide range of functions. Through API interface, network application
can realize the capabilities of storage service, message service and
computing service, and then develop web application with powerful
functions.


² WebAPI: Check enable WebAPI.
² Server Address: Provide the server address of the WebAPI.
² Port Number: The default is 9010 and the range is 0-65535.
20.3 Introduction to the runtime environment
To execute a project,the project configuration must be performed in
advance(refer to chapter 18);once the runtime picture configuration is
finished,the runtime environment can be enabled.Steps are as
follows:
1.C/S Introduction to the runtime environment
Ø Click the main interface of the DIAView software development
environment → “Start” menu →“Run” button to enter the runtime
environment, as shown in the figure below:
​​
Ø System prompts that a dongle is not detected, the DIAView
software runtime environment requires authorization to use:

Ø Click “Ignore” to enter the 2 hour demos (this reminder will not
appear when a dongle was purchased and used):

※ The F11 button can be used to switch to full screen mode.
Includes two menus “File” “View”“Config” and “Language”:
1.File menu items and functions:
Exit: Exits the runtime environment.
It can also be achieved by calling the window command
“HMICmd.ExitApplication()” to exit.
2.View menu items and functions:
Full screen:Full screen will display in the runtime environment.
3.Config menu items and functions:
Cancel Auto Login .
4.Language menu items and functions:
If multiple languages are configured, the language menu is displayed
in the runtime environment. Click this button to switch the runtime
language.

2.B/S Introduction to the runtime environment


Ø Click the main interface of the DIAView software development
environment → “Start” menu →“Run” button to enter the runtime
environment, as shown in the figure below:

21.1 Overview
The DIAView functions are comprehensive and powerful, but
customers' requirements are various; some functions are additional
customization according to user needs.The DIAView can write
ralated programs with the script editor to complete certain special
tasks and functions.

Event configuration and user program etc. in the DIAView software


all need the script editor to write scripts. The DIAView uses the
VBScript language; User can write logic control programs according
to VBScript language specifications to complete special functions
and enhance the availability of the system.
21.2 Script editor function introduction
Scripts writing is achieved in the script editor; in order to make it
easier for users to write scripts correctly, the script editor not only
provides functions such as intellisense, highlighting, one-key
typesetting and precise positioning but also provides the syntax
check function.
The script editor of the DIAView has basically the same interfaces,
structures and functions that the common editors have. The following
methods can be used to open the script editor.
Select “Window” in the directory tree of the project window in DIAView
development environment→ right-click “Add window”→ draw a
graphic in the window sketchpad → select the graphic and click a
button of the event configuration field in the “Event” window, the script
editor will popup, as shown in the figure:

Script editor components:
² Menu bar: Provides menus of basic functions of various
operations.
² Toolbar:Operation function shortcut buttons.
² Script editing area:The area where the script program is written.
² Project/system/operator/key words/directory tree:Directory
windows of various operations.
² Message bar:Displays the editing status and operation
information etc.
1.Menu bar
The menu bar of the script editor includes the following menu and
menu items:
(1)File menu
Command button Function
​Import Imports external script file.
Saves the current script content as an
​Export external script file.
​Save Saves the current script content.
Saves the current script content and exits
​Save and exit
the script editor.
Perform syntax check for the contents of
​Check the current script; the check results will be
displayed in the “Output window”.
Discards the edited script content,exits the
​Exit
script editor.

(2)Edit menu
Command button Function
Press this command to cancel previously
​Undo executed commands and start from the last
operation.
Click this command to recover the previous
​Restore undo command and start from the last
operation.
Select the text within the script editing area
​Cut and click this command to delete the text
and copy it into the clipboard.

​Copy Select the text within the script editing area


and click this command to save the text and
copy it into the clipboard.
Pastes the content in the current clipboard
​Paste into the script editing area.
Select the text within the script editing area
​Delete and click this command to delete the text.
Click this command and all text in the script
​Select All
editing interface will be selected.
Click this command and a secondary menu
will popup.It includes three commands:
​Find and Replace Find, replace and replace all. Please refer
to below for details.
Achieves quick positioning function; enter
the row number in the popup dialog block,
​Scroll to line click “OK”, the system cursor will move to
the end of the row and select that line of
script.
Click this command and the text in the
​Type Setting script editing area will automatically perform
format arrangement.

(3) Find and replace:Click this command and the dialog block will
popup as shown in the follow figure:

² Find: Enter the text to search in this edit box.
² Match case: If this item is selected, it will only display examples
that have exactly the same cases as the string content in “Find
target”.
² Search up: Select this item and it will start searching upwards
from the current location of the cursor.
² Match whole word: Select this item and only examples that
matches all words in the “Find target” string will be displayed. For
example, find “aaa” and the result will return “aaa”; it will not return
“baaa” or “aaac”.
² Replace:First enter the search content and then enter the
replace content, and then simply press the“Replace” button.
² Replace all:Enter the search content and replace content, and
then simply press the “Replace all” button.
The options of “Replace” and “Replace all” have the save
effects as the “Find” option.
(4) View menu
Command Function

​Font setting Click this command, a secondary


menu will appear to set the font style
and font size,when saved,it will be
applied to the current project.

​Show/Hide Output Click this command ,the output


Window window will be displayed or hided.

2.Project/system/operator/key word directory tree


window
(1) Project tree: Includes most information of development project,
including variable information, alarm information, communication
information and user information etc.


(2) System tree: There are 7 groups including date and time,
conversion, format etc.; each group includes several functions.

(3) Operator tree: There are three groups including arithmetic
operator, comparison operator and logical operator. There are several
operators under every group; double-click the operator and the
operator will be entered into the script editor interface.​​

(4) Key words tree: Includes all keywords of the script syntax.
Double-click the keyword and it will automatically be entered into the
script editor interface.

3.Syntax highlighting
In order to allow users to edit scripts more conveniently and clearly,
the script editor will use different colors to distinguish different syntax
parts. As shown in the table below:
Content Color
Default Black
Number Purple
String Dark brown
Mathematical symbol Red
Note Green
Keyword Blue
4. Intelligent reminder function
(1) Tip reminder
When the user enters a system function and enters “(“, the automatic
reminder frame will remind the function name and parameters of that
function and also the description of the function. In the Tip reminder
frame, the bold, black parameters represents the number of the
parameter that is currently being entered.
As shown in the figure below:


(2) List box prompt
When users enter a letter, the reminder frame will automatically
display. This reminder frame lists the results of fuzzy matching letters,
including objects, properties and methods etc. As shown in the figure
below:

When the user enters “.”, the system will display the reminder frame
according to the content before the “.”; the remind frame may include
property and variable group etc. As shown in the figure below:

5.Shortcut keys
Available shortcut keys in the script editor are as follows:
Command Shortcut keys
Copy Ctrl+C
Cut Ctrl+X
Paste Ctrl+V
Select all Ctrl+A
Undo Ctrl+Z
Recover Ctrl+Y
Switch to row Ctrl+G
Find and replace Ctrl+F
One-key typesetting Alt+F8
Syntax check Alt+C
Exit Alt+F4
Font Alt+S
Display/hide output
Ctrl+O
window

Switch to definition F12


Visual Basic Scripting Edition
VBScript Fundamentals
VBScript Data Types
VBScript Variables
VBScript Constants
VBScript Operators
Using Conditional Statements
Looping Through Code
VBScript Procedures
VBScript Coding Conventions

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
VBScript Data Types
VBScript has only one data type called a Variant. A Variant is a
special kind of data type that can contain different kinds of
information, depending on how it is used. Because Variant is the
only data type in VBScript, it is also the data type returned by all
functions in VBScript.
At its simplest, a Variant can contain either numeric or string
information. A Variant behaves as a number when you use it in a
numeric context and as a string when you use it in a string context.
That is, if you are working with data that looks like numbers,
VBScript assumes that it is numbers and does what is most
appropriate for numbers. Similarly, if you're working with data that
can only be string data, VBScript treats it as string data. You can
always make numbers behave as strings by enclosing them in
quotation marks (" ").
Variant Subtypes
Beyond the simple numeric or string classifications, a Variant can
make further distinctions about the specific nature of numeric
information. For example, you can have numeric information that
represents a date or a time. When used with other date or time data,
the result is always expressed as a date or a time. You can also
have a rich variety of numeric information ranging in size from
Boolean values to huge floating-point numbers. These different
categories of information that can be contained in a Variant are
called subtypes. Most of the time, you can just put the kind of data
you want in a Variant, and the Variant behaves in a way that is most
appropriate for the data it contains.
The following table shows subtypes of data that a Variant can
contain.

Subtype Description
Variant is uninitialized. Value is 0 for numeric
Empty variables or a zero-length string ("") for string
variables.
Null Variant intentionally contains no valid data.
Boolean Contains either True or False.
Byte Contains integer in the range 0 to 255.
Integer Contains integer in the range -32,768 to 32,767.
-922,337,203,685,477.5808 to
Currency
922,337,203,685,477.5807.
Contains integer in the range -2,147,483,648 to
Long
2,147,483,647.
Contains a single-precision, floating-point number in
the range -3.402823E38 to -1.401298E-45 for
Single
negative values; 1.401298E-45 to 3.402823E38 for
positive values.
Double Contains a double-precision, floating-point number
in the range -1.79769313486232E308 to
-4.94065645841247E-324 for negative values;
4.94065645841247E-324 to
1.79769313486232E308 for positive values.
Contains a number that represents a date between
Date (Time)
January 1, 100 to December 31, 9999.
Contains a variable-length string that can be up to
String
approximately 2 billion characters in length.
Object Contains an object.
Error Contains an error number.

You can use conversion functions to convert data from one subtype
to another. In addition, the VarType function returns information
about how your data is stored within a Variant.

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
VBScript Variables
A variable is a convenient placeholder that refers to a computer
memory location where you can store program information that may
change during the time your script is running. For example, you
might create a variable called ClickCount to store the number of
times a user clicks an object on a particular Web page. Where the
variable is stored in computer memory is unimportant. What is
important is that you only have to refer to a variable by name to see
or change its value. In VBScript, variables are always of one
fundamental data type, Variant.
Declaring Variables
You declare variables explicitly in your script using the Dim
statement, the Public statement, and the Private statement. For
example:
Dim DegreesFahrenheit

You declare multiple variables by separating each variable name


with a comma. For example:
Dim Top, Bottom, Left, Right

You can also declare a variable implicitly by simply using its name in
your script. That is not generally a good practice because you could
misspell the variable name in one or more places, causing
unexpected results when your script is run. For that reason, the
Option Explicit statement is available to require explicit declaration of
all variables. The Option Explicit statement should be the first
statement in your script.
Naming Restrictions
Variable names follow the standard rules for naming anything in
VBScript. A variable name:

Must begin with an alphabetic character.


Cannot contain an embedded period.
Must not exceed 255 characters.
Must be unique in the scope in which it is declared.
Scope and Lifetime of Variables
A variable's scope is determined by where you declare it. When you
declare a variable within a procedure, only code within that
procedure can access or change the value of that variable. It has
local scope and is a procedure-level variable. If you declare a
variable outside a procedure, you make it recognizable to all the
procedures in your script. This is a script-level variable, and it has
script-level scope.
The lifetime of a variable depends on how long it exists. The lifetime
of a script-level variable extends from the time it is declared until the
time the script is finished running. At procedure level, a variable
exists only as long as you are in the procedure. When the procedure
exits, the variable is destroyed. Local variables are ideal as
temporary storage space when a procedure is executing. You can
have local variables of the same name in several different
procedures because each is recognized only by the procedure in
which it is declared.
Assigning Values to Variables
Values are assigned to variables creating an expression as follows:
the variable is on the left side of the expression and the value you
want to assign to the variable is on the right. For example:
B = 200
Scalar Variables and Array Variables
Much of the time, you only want to assign a single value to a variable
you have declared. A variable containing a single value is a scalar
variable. Other times, it is convenient to assign more than one
related value to a single variable. Then you can create a variable
that can contain a series of values. This is called an array variable.
Array variables and scalar variables are declared in the same way,
except that the declaration of an array variable uses parentheses ( )
following the variable name. In the following example, a single-
dimension array containing 11 elements is declared:
Dim A(10)

Although the number shown in the parentheses is 10, all arrays in


VBScript are zero-based, so this array actually contains 11 elements.
In a zero-based array, the number of array elements is always the
number shown in parentheses plus one. This kind of array is called a
fixed-size array.
You assign data to each of the elements of the array using an index
into the array. Beginning at zero and ending at 10, data can be
assigned to the elements of an array as follows:
A(0) = 256
A(1) = 324
A(2) = 100
. . .
A(10) = 55

Similarly, the data can be retrieved from any element using an index
into the particular array element you want. For example:
. . .
SomeVariable = A(8)
. . .

Arrays aren't limited to a single dimension. You can have as many as


60 dimensions, although most people can't comprehend more than
three or four dimensions. You can declare multiple dimensions by
separating an array's size numbers in the parentheses with commas.
In the following example, the MyTable variable is a two-dimensional
array consisting of 6 rows and 11 columns:
Dim MyTable(5, 10)

In a two-dimensional array, the first number is always the number of


rows; the second number is the number of columns.
You can also declare an array whose size changes during the time
your script is running. This is called a dynamic array. The array is
initially declared within a procedure using either the Dim statement
or using the ReDim statement. However, for a dynamic array, no size
or number of dimensions is placed inside the parentheses. For
example:
Dim MyArray()
ReDim AnotherArray()

To use a dynamic array, you must subsequently use ReDim to


determine the number of dimensions and the size of each
dimension. In the following example, ReDim sets the initial size of
the dynamic array to 25. A subsequent ReDim statement resizes the
array to 30, but uses the Preserve keyword to preserve the contents
of the array as the resizing takes place.
ReDim MyArray(25)
. . .
ReDim Preserve MyArray(30)

There is no limit to the number of times you can resize a dynamic


array, although if you make an array smaller, you lose the data in the
eliminated elements.

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
VBScript Constants
A constant is a meaningful name that takes the place of a number or
string and never changes. VBScript defines a number of intrinsic
constants . You can get information about these intrinsic constants
from the VBScript Langauge Reference.
Creating Constants
You create user-defined constants in VBScript using the Const
statement. Using the Const statement, you can create string or
numeric constants with meaningful names and assign them literal
values. For example: Const MyString = "This is my string." Const
MyAge = 49
Note that the string literal is enclosed in quotation marks (" ").
Quotation marks are the most obvious way to differentiate string
values from numeric values. You represent Date literals and time
literals by enclosing them in number signs (#). For example: Const
CutoffDate = #6-1-97#
You may want to adopt a naming scheme to differentiate constants
from variables. This will prevent you from trying to reassign constant
values while your script is running. For example, you might want to
use a "vb" or "con" prefix on your constant names, or you might
name your constants in all capital letters. Differentiating constants
from variables eliminates confusion as you develop more complex
scripts.

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
VBScript Operators
VBScript has a full range of operators, including arithmetic operators,
comparison operators, concatenation operators, and logical
operators.
Operator Precedence
When several operations occur in an expression, each part is
evaluated and resolved in a predetermined order called operator
precedence. You can use parentheses to override the order of
precedence and force some parts of an expression to be evaluated
before others. Operations within parentheses are always performed
before those outside. Within parentheses, however, standard
operator precedence is maintained.
When expressions contain operators from more than one category,
arithmetic operators are evaluated first, comparison operators are
evaluated next, and logical operators are evaluated last. Comparison
operators all have equal precedence; that is, they are evaluated in
the left-to-right order in which they appear. Arithmetic and logical
operators are evaluated in the following order of precedence.

Arithmetic

Description Symbol
Exponentiation ^
Unary negation -
Multiplication *
Division /
Integer division \
Modulus arithmetic Mod
Addition +
Subtraction -
String concatenation &

Comparison
Description Symbol
Equality =
Inequality <>
Less than <
Greater than >
Less than or equal to <=
Greater than or equal to >=
Object equivalence Is

Logical

Description Symbol
Logical negation Not
Logical conjunction And
Logical disjunction Or
Logical exclusion Xor
Logical equivalence Eqv
Logical implication Imp

When multiplication and division occur together in an expression,


each operation is evaluated as it occurs from left to right. Likewise,
when addition and subtraction occur together in an expression, each
operation is evaluated in order of appearance from left to right.
The string concatenation (&) operator is not an arithmetic operator,
but in precedence it falls after all arithmetic operators and before all
comparison operators. The Is operator is an object reference
comparison operator. It does not compare objects or their values; it
checks only to determine if two object references refer to the same
object.
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Using Conditional Statements
Controlling Program Execution

You can control the flow of your script with conditional statements
and looping statements. Using conditional statements, you can write
VBScript code that makes decisions and repeats actions. The
following conditional statements are available in VBScript:

If...Then...Else statement
Select Case statement
Making Decisions Using If...Then...Else
The If...Then...Else statement is used to evaluate whether a
condition is True or False and, depending on the result, to specify
one or more statements to run. Usually the condition is an
expression that uses a comparison operator to compare one value or
variable with another. For information about comparison operators,
see Comparison Operators. If...Then...Else statements can be
nested to as many levels as you need.

Running Statements if a Condition is True

To run only one statement when a condition is True, use the single-
line syntax for the If...Then...Else statement. The following example
shows the single-line syntax. Notice that this example omits the Else
keyword.
Sub FixDate()
Dim myDate
myDate = #2/13/95#
If myDate < Now Then myDate = Now
End Sub

To run more than one line of code, you must use the multiple-line (or
block) syntax. This syntax includes the End If statement, as shown
in the following example:
Sub AlertUser(value)
If value = 0 Then
AlertLabel.ForeColor = vbRed
AlertLabel.Font.Bold = True
AlertLabel.Font.Italic = True
End If
End Sub

Running Certain Statements if a Condition is True and Running


Others if a Condition is False
You can use an If...Then...Else statement to define two blocks of
executable statements: one block to run if the condition is True, the
other block to run if the condition is False.
Sub AlertUser(value)
If value = 0 Then
AlertLabel.ForeColor = vbRed
AlertLabel.Font.Bold = True
AlertLabel.Font.Italic = True
Else
AlertLabel.Forecolor = vbBlack
AlertLabel.Font.Bold = False
AlertLabel.Font.Italic = False
End If
End Sub

Deciding Between Several Alternatives

A variation on the If...Then...Else statement allows you to choose


from several alternatives. Adding ElseIf clauses expands the
functionality of the If...Then...Else statement so you can control
program flow based on different possibilities. For example:
Sub ReportValue(value)
If value = 0 Then
MsgBox value
ElseIf value = 1 Then
MsgBox value
ElseIf value = 2 then
Msgbox value
Else
Msgbox "Value out of range!"
End If

You can add as many ElseIf clauses as you need to provide


alternative choices. Extensive use of the ElseIf clauses often
becomes cumbersome. A better way to choose between several
alternatives is the Select Case statement.
Making Decisions with Select Case
The Select Case structure provides an alternative to
If...Then...ElseIf for selectively executing one block of statements
from among multiple blocks of statements. A Select Case statement
provides capability similar to the If...Then...Else statement, but it
makes code more efficient and readable.
A Select Case structure works with a single test expression that is
evaluated once, at the top of the structure. The result of the
expression is then compared with the values for each Case in the
structure. If there is a match, the block of statements associated with
that Case is executed, as in the following example.
Select Case Document.Form1.CardType.Options(SelectedIndex).Text
Case "MasterCard"
DisplayMCLogo
ValidateMCAccount
Case "Visa"
DisplayVisaLogo
ValidateVisaAccount
Case "American Express"
DisplayAMEXCOLogo
ValidateAMEXCOAccount
Case Else
DisplayUnknownImage
PromptAgain
End Select

Notice that the Select Case structure evaluates an expression once


at the top of the structure. In contrast, the If...Then...ElseIf structure
can evaluate a different expression for each ElseIf statement. You
can replace an If...Then...ElseIf structure with a Select Case
structure only if each ElseIf statement evaluates the same
expression.

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Looping Through Code
Looping allows you to run a group of statements repeatedly. Some
loops repeat statements until a condition is False; others repeat
statements until a condition is True. There are also loops that repeat
statements a specific number of times.
The following looping statements are available in VBScript:

Do...Loop: Loops while or until a condition is True.


While...Wend: Loops while a condition is True.
For...Next: Uses a counter to run statements a specified number
of times.
For Each...Next: Repeats a group of statements for each item in
a collection or each element of an array.
Using Do Loops
You can use Do...Loop statements to run a block of statements an
indefinite number of times. The statements are repeated either while
a condition is True or until a condition becomes True.

Repeating Statements While a Condition is True

Use the While keyword to check a condition in a Do...Loop


statement. You can check the condition before you enter the loop (as
shown in the following ChkFirstWhile example), or you can check it
after the loop has run at least once (as shown in the ChkLastWhile
example). In the ChkFirstWhile procedure, if myNum is set to 9 instead
of 20, the statements inside the loop will never run. In the
ChkLastWhile procedure, the statements inside the loop run only
once because the condition is already False.
Sub ChkFirstWhile()
Dim counter, myNum
counter = 0
myNum = 20
Do While myNum > 10
myNum = myNum - 1
counter = counter + 1
Loop
MsgBox "The loop made " & counter & " repetitions."
End Sub

Sub ChkLastWhile()
Dim counter, myNum
counter = 0
myNum = 9
Do
myNum = myNum - 1
counter = counter + 1
Loop While myNum > 10
MsgBox "The loop made " & counter & " repetitions."
End Sub

Repeating a Statement Until a Condition Becomes True


There are two ways to use the Until keyword to check a condition in
a Do...Loop statement. You can check the condition before you
enter the loop (as shown in the following ChkFirstUntil example), or
you can check it after the loop has run at least once (as shown in the
ChkLastUntil example). As long as the condition is False, the looping
occurs.
Sub ChkFirstUntil()
Dim counter, myNum
counter = 0
myNum = 20
Do Until myNum = 10
myNum = myNum - 1
counter = counter + 1
Loop
MsgBox "The loop made " & counter & " repetitions."
End Sub

Sub ChkLastUntil()
Dim counter, myNum
counter = 0
myNum = 1
Do
myNum = myNum + 1
counter = counter + 1
Loop Until myNum = 10
MsgBox "The loop made " & counter & " repetitions."
End Sub

Exiting a Do...Loop Statement from Inside the Loop

You can exit a Do...Loop by using the Exit Do statement. Because


you usually want to exit only in certain situations, such as to avoid an
endless loop, you should use the Exit Do statement in the True
statement block of an If...Then...Else statement. If the condition is
False, the loop runs as usual.
In the following example, myNum is assigned a value that creates an
endless loop. The If...Then...Else statement checks for this
condition, preventing the endless repetition.
Sub ExitExample()
Dim counter, myNum
counter = 0
myNum = 9
Do Until myNum = 10
myNum = myNum - 1
counter = counter + 1
If myNum < 10 Then Exit Do
Loop
MsgBox "The loop made " & counter & " repetitions."
End Sub
Using While...Wend
The While...Wend statement is provided in VBScript for those who
are familiar with its usage. However, because of the lack of flexibility
in While...Wend, it is recommended that you use Do...Loop instead.
Using For...Next
You can use For...Next statements to run a block of statements a
specific number of times. For loops, use a counter variable whose
value increases or decreases with each repetition of the loop.
The following example causes a procedure called MyProc to execute
50 times. The For statement specifies the counter variable x and its
start and end values. The Next statement increments the counter
variable by 1.
Sub DoMyProc50Times()
Dim x
For x = 1 To 50
MyProc
Next
End Sub

Using the Step keyword, you can increase or decrease the counter
variable by the value you specify. In the following example, the
counter variable j is incremented by 2 each time the loop repeats.
When the loop is finished, the total is the sum of 2, 4, 6, 8, and 10.
Sub TwosTotal()
Dim j, total
For j = 2 To 10 Step 2
total = total + j
Next
MsgBox "The total is " & total
End Sub

To decrease the counter variable, use a negative Step value. You


must specify an end value that is less than the start value. In the
following example, the counter variable myNum is decreased by 2 each
time the loop repeats. When the loop is finished, total is the sum of
16, 14, 12, 10, 8, 6, 4, and 2.
Sub NewTotal()
Dim myNum, total
For myNum = 16 To 2 Step -2
total = total + myNum
Next
MsgBox "The total is " & total
End Sub

You can exit any For...Next statement before the counter reaches its
end value by using the Exit For statement. Because you usually
want to exit only in certain situations, such as when an error occurs,
you should use the Exit For statement in the True statement block
of an If...Then...Else statement. If the condition is False, the loop
runs as usual.
Using For Each...Next
A For Each...Next loop is similar to a For...Next loop. Instead of
repeating the statements a specified number of times, a For
Each...Next loop repeats a group of statements for each item in a
collection of objects or for each element of an array. This is
especially helpful if you don't know how many elements are in a
collection.
In the following HTML code example, the contents of a Dictionary
object is used to place text in several text boxes.
<HTML>
<HEAD><TITLE>Forms and Elements</TITLE></HEAD>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub cmdChange_OnClick
Dim d 'Create a variable
Set d = CreateObject("Scripting.Dictionary")
d.Add "0", "Athens" 'Add some keys and items
d.Add "1", "Belgrade"
d.Add "2", "Cairo"

For Each I in d
Document.frmForm.Elements(I).Value = D.Item(I)
Next
End Sub
-->
</SCRIPT>
<BODY>
<CENTER>
<FORM NAME="frmForm"

<Input Type = "Text"><p>


<Input Type = "Text"><p>
<Input Type = "Text"><p>
<Input Type = "Text"><p>
<Input Type = "Button" NAME="cmdChange" VALUE="Click Here"><p>
</FORM>
</CENTER>
</BODY>
</HTML>
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
VBScript Procedures
In VBScript, there are two kinds of procedures; the Sub procedure
and the Function procedure.
Sub Procedures
A Sub procedure is a series of VBScript statements (enclosed by
Sub and End Sub statements) that perform actions but don't return
a value. A Sub procedure can take arguments (constants, variables,
or expressions that are passed by a calling procedure). If a Sub
procedure has no arguments, its Sub statement must include an
empty set of parentheses ().
The following Sub procedure uses two intrinsic, or built-in, VBScript
functions, MsgBox and InputBox, to prompt a user for information. It
then displays the results of a calculation based on that information.
The calculation is performed in a Function procedure created using
VBScript. The Function procedure is shown after the following
discussion.
Sub ConvertTemp()
temp = InputBox("Please enter the temperature in degrees
F.", 1)
MsgBox "The temperature is " & Celsius(temp) & " degrees C."
End Sub
Function Procedures
A Function procedure is a series of VBScript statements enclosed
by the Function and End Function statements. A Function
procedure is similar to a Sub procedure, but can also return a value.
A Function procedure can take arguments (constants, variables, or
expressions that are passed to it by a calling procedure). If a
Function procedure has no arguments, its Function statement must
include an empty set of parentheses. A Function returns a value by
assigning a value to its name in one or more statements of the
procedure. The return type of a Function is always a Variant.
In the following example, the Celsius function calculates degrees
Celsius from degrees Fahrenheit. When the function is called from
the ConvertTemp Sub procedure, a variable containing the argument
value is passed to the function. The result of the calculation is
returned to the calling procedure and displayed in a message box.
Sub ConvertTemp()
temp = InputBox("Please enter the temperature in degrees
F.", 1)
MsgBox "The temperature is " & Celsius(temp) & " degrees C."
End Sub

Function Celsius(fDegrees)
Celsius = (fDegrees - 32) * 5 / 9
End Function
Getting Data into and out of Procedures
Each piece of data is passed into your procedures using an
argument . Arguments serve as placeholders for the data you want
to pass into your procedure. You can name your arguments any valid
variable name. When you create a procedure using either the Sub
statement or the Function statement, parentheses must be included
after the name of the procedure. Any arguments are placed inside
these parentheses, separated by commas. For example, in the
following example, fDegrees is a placeholder for the value being
passed into the Celsius function for conversion.
Function Celsius(fDegrees)
Celsius = (fDegrees - 32) * 5 / 9
End Function

To get data out of a procedure, you must use a Function.


Remember, a Function procedure can return a value; a Sub
procedure can't.
Using Sub and Function Procedures in Code
A Function in your code must always be used on the right side of a
variable assignment or in an expression. For example:
Temp = Celsius(fDegrees)

-or-
MsgBox "The Celsius temperature is " & Celsius(fDegrees) & "
degrees."

To call a Sub procedure from another procedure, type the name of


the procedure along with values for any required arguments, each
separated by a comma. The Call statement is not required, but if you
do use it, you must enclose any arguments in parentheses.
The following example shows two calls to the MyProc procedure. One
uses the Call statement in the code; the other doesn't. Both do
exactly the same thing.
Call MyProc(firstarg, secondarg)
MyProc firstarg, secondarg

Notice that the parentheses are omitted in the call when the Call
statement isn't used.

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
VBScript Coding Conventions
Coding conventions are suggestions are designed to help you write
code using Microsoft Visual Basic Scripting Edition. Coding
conventions can include the following:

Naming conventions for objects, variables, and procedures


Commenting conventions
Text formatting and indenting guidelines

The main reason for using a consistent set of coding conventions is


to standardize the structure and coding style of a script or set of
scripts so that you and others can easily read and understand the
code. Using good coding conventions results in clear, precise, and
readable source code that is consistent with other language
conventions and is intuitive.
Constant Naming Conventions
Earlier versions of VBScript had no mechanism for creating user-
defined constants. Constants, if used, were implemented as
variables and distinguished from other variables using all uppercase
characters. Multiple words were separated using the underscore (_)
character. For example: USER_LIST_MAX
NEW_LINE
While this is still an acceptable way to identify your constants, you
may want to use an alternative naming scheme, now that you can
create true constants using the Const statement. This convention
uses a mixed-case format in which constant names have a "con"
prefix. For example: conYourOwnConstant
Variable Naming Conventions
To enhance readability and consistency, use the following prefixes
with descriptive names for variables in your VBScript code.
Subtype Prefix Example
Boolean bln blnFound
Byte byt bytRasterData
Date (Time) dtm dtmStart
Double dbl dblTolerance
Error err errOrderNum
Integer int intQuantity
Long lng lngDistance
Object obj objCurrent
Single sng sngAverage
String str strFirstName
Variable Scope
Variables should always be defined with the smallest scope possible.
VBScript variables can have the following scope.

Where Variable Is
Scope Visibility
Declared
Procedure- Event, Function, or Sub Visible in the procedure in
level procedure. which it is declared.
HEAD section of an
Visible in every procedure
Script-level HTML page, outside any
in the script.
procedure.
Variable Scope Prefixes
As script size grows, so does the value of being able to quickly
differentiate the scope of variables. A one-letter scope prefix
preceding the type prefix provides this, without unduly increasing the
size of variable names.

Scope Prefix Example


Procedure-level None dblVelocity
Script-level s sblnCalcInProgress
Descriptive Variable and Procedure Names
The body of a variable or procedure name should use mixed case
and should be as descriptive as necessary. In addition, procedure
names should begin with a verb, such as InitNameArray or
CloseDialog.
For frequently used or long terms, standard abbreviations are
recommended to help keep name length reasonable. In general,
variable names greater than 32 characters can be difficult to read.
When using abbreviations, make sure they are consistent throughout
the entire script. For example, randomly switching between Cnt and
Count within a script or set of scripts may lead to confusion.
Object Naming Conventions
The following table lists recommended conventions for objects you
may encounter while programming VBScript.

Object type Prefix Example


3D Panel pnl pnlGroup
Animated button ani aniMailBox
Check box chk chkReadOnly
Combo box, drop-down
cbo cboEnglish
list box
Command button cmd cmdExit
Common dialog dlg dlgFileOpen
Frame fra fraLanguage
Horizontal scroll bar hsb hsbVolume
Image img imgIcon
Label lbl lblHelpMessage
Line lin linVertical
List Box lst lstPolicyCodes
Spin spn spnPages
Text box txt txtLastName
Vertical scroll bar vsb vsbRate
Slider sld sldScale
Code Commenting Conventions
All procedures should begin with a brief comment describing what
they do. This description should not describe the implementation
details (how it does it) because these often change over time,
resulting in unnecessary comment maintenance work, or worse,
erroneous comments. The code itself and any necessary inline
comments describe the implementation.
Arguments passed to a procedure should be described when their
purpose is not obvious and when the procedure expects the
arguments to be in a specific range. Return values for functions and
variables that are changed by a procedure, especially through
reference arguments, should also be described at the beginning of
each procedure.
Procedure header comments should include the following section
headings. For examples, see the "Formatting Your Code" section
that follows.
Section
Comment Contents
Heading
Purpose What the procedure does (not how).
List of any external variable, control, or other
Assumptions
element whose state affects this procedure.
List of the procedure's effect on each external
Effects
variable, control, or other element.
Explanation of each argument that is not obvious.
Inputs Each argument should be on a separate line with
inline comments.
Return Values Explanation of the value returned.

Remember the following points:


Every important variable declaration should include an inline
comment describing the use of the variable being declared.
Variables, controls, and procedures should be named clearly to
ensure that inline comments are only needed for complex
implementation details.
At the beginning of your script, you should include an overview
that describes the script, enumerating objects, procedures,
algorithms, dialog boxes, and other system dependencies.
Sometimes a piece of pseudocode describing the algorithm can
be helpful.
Formatting Your Code
Screen space should be conserved as much as possible, while still
allowing code formatting to reflect logic structure and nesting. Here
are a few suggestions:

Indent standard nested blocks four spaces.


Indent the overview comments of a procedure one space.
Indent the highest level statements that follow the overview
comments four spaces, with each nested block indented an
additional four spaces.
The following code adheres to VBScript coding conventions.
'*********************************************************

' Purpose: Locates the first occurrence of a specified user '


in the UserList array.

' Inputs: strUserList(): the list of users to be searched.

' strTargetUser: the name of the user to search for.

' Returns: The index of the first occurrence of the


strTargetUser ' in the strUserList array.

' If the target user is not found, return -1.

'*********************************************************
Function intFindUser (strUserList(), strTargetUser) Dim i '
Loop counter.

Dim blnFound ' Target found flag

intFindUser = -1

i = 0 ' Initialize loop counter

Do While i <= Ubound(strUserList) and Not blnFound If


strUserList(i) = strTargetUser Then blnFound = True ' Set
flag to True intFindUser = i ' Set return value to loop count
End If

i = i + 1 ' Increment loop counter Loop

End Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
VBScript Language Reference
VBScript Constants
VBScript Errors
VBScript Events
VBScript Functions
VBScript Keywords
VBScript Methods
VBScript Miscellaneous
VBScript Objects
VBScript​​ Operators
VBScript​​ Properties
VBScript​​​Statements

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Version Information
The following table lists the version of Microsoft Visual Basic
Scripting Edition implemented by host applications.

Host Application 1.0 2.0 3.0 4.0 5.0 5.5 5.6


Microsoft Internet Explorer 3.0 x
Microsoft Internet Information
x
Server 3.0
Microsoft Internet Explorer 4.0 x
Microsoft Internet Information
x
Server 4.0
Microsoft Windows Scripting
x
Host 1.0
Microsoft Outlook 98 x
Microsoft Visual Studio 6.0 x
Microsoft Internet Explorer 5.0 x
Microsoft Internet Information
x
Services 5.0
Microsoft Internet Explorer 5.5 x
Microsoft Visual Studio .NET x

The following table lists VBScript language features and the version
when first introduced.

Language Element 1.0 2.0 3.0 4.0 5.0 5.5 5.6


Abs Function x
Addition Operator (+) x
And Operator x
Array Function x
Asc Function x
Assignment Operator (=) x
Atn Function x
Call Statement x
CBool Function x
CByte Function x
CCur Function x
CDate Function x
CDbl Function x
Chr Function x
CInt Function x
Class Object x
Class Statement x
Clear Method x
CLng Function x
Color Constants x
Comparison Constants x
Concatenation Operator (&) x
Const Statement x
Cos Function x
CreateObject Function x
CSng Function x
CStr Function x
Date and Time Constants x
Date Format Constants x
Date Function x
DateAdd Function x
DateDiff Function x
DatePart Function x
DateSerial Function x
DateValue Function x
Day Function x
Description Property x
Dim Statement x
Division Operator (/) x
Do...Loop Statement x
Empty x
Eqv Operator x
Erase Statement x
Err Object x
Eval Function x
Execute Method x
Execute Statement x
ExecuteGlobal Statement x
Exit Statement x
Exp Function x
Exponentiation Operator (^) x
False x
Filter Function x
FirstIndex Property x
Fix Function x
For...Next Statement x
For Each...Next Statement x
FormatCurrency Function x
FormatDateTime Function x
FormatNumber Function x
FormatPercent Function x
Function Statement x
GetLocale Function x
GetObject Function x
GetRef Function x
Global Property x
Hex Function x
HelpContext Property x
HelpFile Property x
Hour Function x
If...Then...Else Statement x
IgnoreCase Property x
Imp Operator x
Initialize Event x
InputBox Function x
InStr Function x
InStrRev Function x
Int Function x
Integer Division Operator (\) x
Is Operator x
IsArray Function x
IsDate Function x
IsEmpty Function x
IsNull Function x
IsNumeric Function x
IsObject Function x
Join Function x
LBound Function x
LCase Function x
Left Function x
Len Function x
Length Property x
LoadPicture Function x
Log Function x
LTrim Function x
Match Object x
Matches Collection x
Mid Function x
Minute Function x
Miscellaneous Constants x
Mod Operator x
Month Function x
MonthName Function x
MsgBox Constants x
MsgBox Function x
Multiplication Operator (*) x
Negation Operator (-) x
Not Operator x
Now Function x
Nothing x
Null x
Number Property x
Oct Function x
On Error Statement x
Option Explicit Statement x
Or Operator x
Pattern Property x
Private Statement x
PropertyGet Statement x
PropertyLet Statement x
PropertySet Statement x
Public Statement x
Raise Method x
Randomize Statement x
ReDim Statement x
RegExp Object x
Rem Statement x
Replace Function x
Replace Method x
RGB Function x
Right Function x
Rnd Function x
Round Function x
RTrim Function x
ScriptEngine Function x
ScriptEngineBuildVersion
x
Function
ScriptEngineMajorVersion
x
Function
ScriptEngineMinorVersion
x
Function
Second Function x
Select Case Statement x
Set Statement x
SetLocale Function x
Sgn Function x
Sin Function x
Source Property x
Space Function x
Split Function x
Sqr Function x
StrComp Function x
String Constants x
String Function x
StrReverse Function x
Sub Statement x
Subtraction Operator (-) x
Tan Function x
Terminate Event x
Test Method x
Time Function x
Timer Function x
TimeSerial Function x
TimeValue Function x
Trim Function x
Tristate Constants x
True x
TypeName Function x
UBound Function x
UCase Function x
Value Property x
VarType Constants x
VarType Function x
VBScript Constants x
Weekday Function x
WeekdayName Function x
While...Wend Statement x
With Statement x
Xor Operator x
Year Function x
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
VBScript Features
The following table is a list of VBScript features.

Category Keywords
Array Dim, Private, Public, ReDim
IsArray
Array handling
Erase
LBound, UBound
Assignments Set
Comments Comments using ' or Rem
Empty
Nothing
Constants/Literals
Null
True, False
Do...Loop
For...Next
For Each...Next
Control flow If...Then...Else
Select Case
While...Wend
With
Conversions Abs
Asc, AscB, AscW
Chr, ChrB, ChrW
CBool, CByte
CCur, CDate
CDbl, CInt
CLng, CSng, CStr
DateSerial, DateValue
Hex, Oct
Fix, Int
Sgn
TimeSerial, TimeValue
Date, Time
DateAdd, DateDiff, DatePart
DateSerial, DateValue
Day, Month, MonthName
Dates/Times
Weekday, WeekdayName, Year
Hour, Minute, Second
Now
TimeSerial, TimeValue
Class
Const
Declarations Dim, Private, Public, ReDim
Function, Sub
Property Get, Property Let, Property Set
On Error
Error Handling
Err
Eval
Execute
Expressions RegExp
Replace
Test
FormatCurrency
FormatDateTime
Formatting Strings
FormatNumber
FormatPercent
InputBox
Input/Output LoadPicture
MsgBox
Empty
False
Literals Nothing
Null
True
Math Atn, Cos, Sin, Tan
Exp, Log, Sqr
Randomize, Rnd
Eval Function
Miscellaneous Execute Statement
RGB Function
CreateObject
Err Object
Objects
GetObject
RegExp
Addition (+), Subtraction (-)
Exponentiation (^)
Modulus arithmetic (Mod)
Multiplication (*), Division (/)
Integer Division (\)
Negation (-)
String concatenation (&)
Operators Equality (=), Inequality (<>)
Less Than (<), Less Than or Equal To
(<=)
Greater Than (>)
Greater Than or Equal To (>=)
Is
And, Or, Xor
Eqv, Imp
Options Option Explicit
Call
Procedures Function, Sub
Property Get, Property Let, Property Set
Abs
Rounding Int, Fix, Round
Sgn
ScriptEngine
ScriptEngineBuildVersion
Script Engine ID
ScriptEngineMajorVersion
ScriptEngineMinorVersion
Strings Asc, AscB, AscW
Chr, ChrB, ChrW
Filter, InStr, InStrB
InStrRev
Join
Len, LenB
LCase, UCase
Left, LeftB
Mid, MidB
Right, RightB
Replace
Space
Split
StrComp
String
StrReverse
LTrim, RTrim, Trim
IsArray
IsDate
IsEmpty
IsNull
Variants
IsNumeric
IsObject
TypeName
VarType

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
VBScript Features not in Visual Basic
for Applications
The following table lists VBScript features not in Visual Basic for
Applications.

Category Feature/Keyword
Declarations Class
Miscellaneous Eval Execute
Objects RegExp
ScriptEngine
ScriptEngineBuildVersion
Script Engine Identification
ScriptEngineMajorVersion
ScriptEngineMinorVersion

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Visual Basic for Applications
Features Not In VBScript
The following table lists Visual Basic for Applications Features not in
VBScript.

Category Omitted Feature/Keyword


Option Base
Array Handling
Declaring arrays with lower bound <> 0
Add, Count, Item, Remove
Collection
Access to collections using ! character
Conditional #Const
Compilation #If...Then...#Else
DoEvents
GoSub...Return, GoTo
Control Flow On Error GoTo
On...GoSub, On...GoTo
Line numbers, Line labels
CVar, CVDate
Conversion
Str, Val
All intrinsic data types except Variant
Data Types
Type...End Type
Date/Time Date statement, Time statement
DDE LinkExecute, LinkPoke, LinkRequest, LinkSend
Debug.Print
Debugging
End, Stop
Declare (for declaring DLLs)
Optional
Declaration
ParamArray
Static
Category Omitted Feature/Keyword
Erl
Error Handling Error
Resume, Resume Next
File Input/Output All traditional Basic file I/O
Financial All financial functions
Object
TypeOf
Manipulation
Clipboard
Objects
Collection
Operators Like
Deftype
Option Base
Options
Option Compare
Option Private Module
Expressions containing Is keyword or any
comparison operators
Select Case
Expressions containing a range of values using
the To keyword.
Fixed-length strings
LSet, RSet
Strings
Mid Statement
StrConv
Using Objects Collection access using "!"

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
VBScript Constants
A number of useful constants you can use in your code are built into
VBScript. Constants provide a convenient way to use specific values
without actually having to remember the value itself. Using constants
also makes your code more maintainable should the value of any
constant ever change. Because these constants are already defined
in VBScript, you don't need to explicitly declare them in your code.
Simply use them in place of the values they represent.
Here are the various categories of constants provided in VBScript
and a brief description of each:

Color Constants Defines eight basic colors that can be used in


scripting.
Date and Time Constants Defines date and time constants used
by various date and time functions.
Date Format Constants Defines constants used to format dates
and times.
Miscellaneous Constants Defines constants that don't
conveniently fit into any other category.
MsgBox Constants Defines constants used in the MsgBox
function to describe button visibility, labeling, behavior, and
return values.
String Constants Defines a variety of non-printable characters
used in string manipulation.
Tristate Constants Defines constants used with functions that
format numbers.
VarType Constants Defines the various Variant subtypes.

Requirements
Version 2

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Color Constants

Since these constants are built into VBScript, you don't have to
define them before using them. Use them anywhere in your code to
represent the values shown for each.

Constant Value Description


vbBlack &h00 Black
vbRed &hFF Red
vbGreen &hFF00 Green
vbYellow &hFFFF Yellow
vbBlue &hFF0000 Blue
vbMagenta &hFF00FF Magenta
vbCyan &hFFFF00 Cyan
vbWhite &hFFFFFF White

Requirements

Version 2

See Also

Comparison Constants | Date and Time Constants | Date Format


Constants | Miscellaneous Constants | MsgBox Constants | String
Constants | Tristate Constants | VarType Constants

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Comparison Constants
Since these constants are built into VBScript, you don't have to
define them before using them. Use them anywhere in your code to
represent the values shown for each.

Constant Value Description


vbBinaryCompare 0 Perform a binary comparison.
vbTextCompare 1 Perform a textual comparison.

Requirements

Version 2

See Also

Color Constants | Date and Time Constants | Date Format Constants


| Miscellaneous Constants | MsgBox Constants | String Constants |
Tristate Constants | VarType Constants

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Date and Time Constants
Since these constants are built into VBScript, you don't have to
define them before using them. Use them anywhere in your code to
represent the values shown for each.

Constant Value Description


vbSunday 1 Sunday
vbMonday 2 Monday
vbTuesday 3 Tuesday
vbWednesday 4 Wednesday
vbThursday 5 Thursday
vbFriday 6 Friday
vbSaturday 7 Saturday
Use the day of the week
vbUseSystemDayOfWeek 0 specified in your system settings
for the first day of the week.
Use the week in which January
vbFirstJan1 1
1 occurs (default).
Use the first week that has at
vbFirstFourDays 2
least four days in the new year.
Use the first full week of the
vbFirstFullWeek 3
year.

Requirements

Version 2

See Also
Color Constants | Comparison Constants | Date Format Constants |
Miscellaneous Constants | MsgBox Constants | String Constants |
Tristate Constants | VarType Constants

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Date Format Constants
Since these constants are built into VBScript, you don't have to
define them before using them. Use them anywhere in your code to
represent the values shown for each.

Constant Value Description


Display a date and/or time. For real
numbers, display a date and time. If there
is no fractional part, display only a date. If
vbGeneralDate 0
there is no integer part, display time only.
Date and time display is determined by
your system settings.
Display a date using the long date format
vbLongDate 1 specified in your computer's regional
settings.
Display a date using the short date format
vbShortDate 2 specified in your computer's regional
settings.
Display a time using the long time format
vbLongTime 3 specified in your computer's regional
settings.
Display a time using the short time format
vbShortTime 4 specified in your computer's regional
settings.

Requirements

Version 2

See Also
Color Constants | Comparison Constants | Date and Time Constants
| Miscellaneous Constants | MsgBox Constants | String Constants |
Tristate Constants | VarType Constants

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Miscellaneous Constants
Since this constant is built into VBScript, you don't have to define it
before using it. Use it anywhere in your code to represent the values
shown.

Constant Value Description


User-defined error numbers should
be greater than this value, for
example,
vbObjectError -2147221504
Err.Raise Number = vbObjectError
+ 1000

Requirements

Version 2

See Also

Color Constants | Comparison Constants | Date and Time Constants


| Date Format Constants | MsgBox Constants | String Constants |
Tristate Constants | VarType Constants

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
MsgBox Constants
The following constants are used with the MsgBox function to
identify what buttons and icons appear on a message box and which
button is the default. In addition, the modality of the MsgBox can be
specified. Since these constants are built into VBScript, you don't
have to define them before using them. Use them anywhere in your
code to represent the values shown for each.

Constant Value Description


vbOKOnly 0 Display OK button only.
vbOKCancel 1 Display OK and Cancel buttons.
Display Abort, Retry, and Ignore
vbAbortRetryIgnore 2
buttons.
Display Yes, No, and Cancel
vbYesNoCancel 3
buttons.
vbYesNo 4 Display Yes and No buttons.
vbRetryCancel 5 Display Retry and Cancel buttons.
vbCritical 16 Display Critical Message icon.
vbQuestion 32 Display Warning Query icon.
vbExclamation 48 Display Warning Message icon.
vbInformation 64 Display Information Message icon.
vbDefaultButton1 0 First button is the default.
vbDefaultButton2 256 Second button is the default.
vbDefaultButton3 512 Third button is the default.
vbDefaultButton4 768 Fourth button is the default.
Application modal. The user must
respond to the message box before
vbApplicationModal 0
continuing work in the current
application.
Constant Value Description
System modal. On Win16 systems,
all applications are suspended until
the user responds to the message
box. On Win32 systems, this
vbSystemModal 4096
constant provides an application
modal message box that always
remains on top of any other
programs you may have running.

The following constants are used with the MsgBox function to


identify which button a user has selected. These constants are only
available when your project has an explicit reference to the
appropriate type library containing these constant definitions. For
VBScript, you must explicitly declare these constants in your code.

Constant Value Description


vbOK 1 OK button was clicked.
vbCancel 2 Cancel button was clicked.
vbAbort 3 Abort button was clicked.
vbRetry 4 Retry button was clicked.
vbIgnore 5 Ignore button was clicked.
vbYes 6 Yes button was clicked.
vbNo 7 No button was clicked.

Requirements

Version 2

See Also
Color Constants | Comparison Constants | Date and Time Constants
| Date Format Constants | Miscellaneous Constants | String
Constants | Tristate Constants | VarType Constants

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
String Constants
Since these constants are built into VBScript, you don't have to
define them before using them. Use them anywhere in your code to
represent the values shown for each.

Constant Value Description


vbCr Chr(13) Carriage return.
Chr(13) &
VbCrLf Carriage return–linefeed combination.
Chr(10)
Form feed; not useful in Microsoft
vbFormFeed Chr(12)
Windows.
vbLf Chr(10) Line feed.
Chr(13) & Platform-specific newline character;
vbNewLine Chr(10) or whatever is appropriate for the
Chr(10) platform.
vbNullChar Chr(0) Character having the value 0.
String Not the same as a zero-length string
vbNullString having (""); used for calling external
value 0 procedures.
vbTab Chr(9) Horizontal tab.
Vertical tab; not useful in Microsoft
vbVerticalTab Chr(11)
Windows.

Requirements

Version 2

See Also
Color Constants | Comparison Constants | Date and Time Constants
| Date Format Constants | Miscellaneous Constants | MsgBox
Constants | Tristate Constants | VarType Constants

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Tristate Constants
Since these constants are built into VBScript, you don't have to
define them before using them. Use them anywhere in your code to
represent the values shown for each.

Constant Value Description


Use default from computer's regional
vbUseDefault -2
settings.
vbTrue -1 True
vbFalse 0 False

Requirements

Version 2

See Also

Color Constants | Comparison Constants | Date and Time Constants


| Date Format Constants | Miscellaneous Constants | MsgBox
Constants | String Constants | VarType Constants

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
VarType Constants
These constants are only available when your project has an explicit
reference to the appropriate type library containing these constant
definitions. For VBScript, you must explicitly declare these constants
in your code.

Constant Value Description


vbEmpty 0 Uninitialized (default)
vbNull 1 Contains no valid data
vbInteger 2 Integer subtype
vbLong 3 Long subtype
vbSingle 4 Single subtype
vbSingle 5 Double subtype
vbCurrency 6 Currency subtype
vbDate 7 Date subtype
vbString 8 String subtype
vbObject 9 Object
vbError 10 Error subtype
vbBoolean 11 Boolean subtype
vbVariant 12 Variant (used only for arrays of variants)
vbDataObject 13 Data access object
vbDecimal 14 Decimal subtype
vbByte 17 Byte subtype
vbArray 8192 Array

Requirements

Version 2
See Also

Color Constants | Comparison Constants | Date and Time Constants


| Date Format Constants | Miscellaneous Constants | MsgBox
Constants | String Constants | Tristate Constants

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Errors
In This Section

VBScript Run-time Errors


VBScript Syntax Errors

Related Sections

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
VBScript Run-time Errors
VBScript run-time errors are errors that result when your VBScript
script attempts to perform an action that the system cannot execute.
VBScript run-time errors occur while your script is being executed;
when variable expressions are being evaluated, and memory is
being dynamic allocated.

Error
Description
Number
429 ActiveX component can't create object
507 An exception occurred
449 Argument not optional
17 Can't perform requested operation
430 Class doesn't support Automation
506 Class not defined
11 Division by zero
48 Error in loading DLL
5020 Expected ')' in regular expression
5019 Expected ']' in regular expression
File name or class name not found during
432
Automation operation
92 For loop not initialized
5008 Illegal assignment
51 Internal error
505 Invalid or unqualified reference
481 Invalid picture
5 Invalid procedure call or argument
5021 Invalid range in character set
94 Invalid use of Null
Error
Description
Number
448 Named argument not found
447 Object doesn't support current locale setting
445 Object doesn't support this action
438 Object doesn't support this property or method
451 Object not a collection
504 Object not safe for creating
503 Object not safe for initializing
502 Object not safe for scripting
424 Object required
91 Object variable not set
7 Out of Memory
28 Out of stack space
14 Out of string space
6 Overflow
35 Sub or function not defined
9 Subscript out of range
5017 Syntax error in regular expression
The remote server machine does not exist or is
462
unavailable
10 This array is fixed or temporarily locked
13 Type mismatch
5018 Unexpected quantifier
500 Variable is undefined
Variable uses an Automation type not supported in
458
VBScript
Wrong number of arguments or invalid property
450
assignment
See Also

VBScript Syntax Errors

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
VBScript Syntax Errors
VBScript syntax errors are errors that result when the structure of
one of your VBScript statements violates one or more of the
grammatical rules of the VBScript scripting language. VBScript
syntax errors occur during the program compilation stage, before the
program has begun to be executed.

Error
Description
Number
Cannot have multiple default property/method in a
1052
Class
1044 Cannot use parentheses when calling a Sub
1053 Class initialize or terminate do not have arguments
1058 'Default' specification can only be on Property Get
1057 'Default' specification must also specify 'Public'
1005 Expected '('
1006 Expected ')'
1011 Expected '='
1021 Expected 'Case'
1047 Expected 'Class'
1025 Expected end of statement
1014 Expected 'End'
1023 Expected expression
1015 Expected 'Function'
1010 Expected identifier
1012 Expected 'If'
1046 Expected 'In'
1026 Expected integer constant
1049 Expected Let or Set or Get in property declaration
Error
Description
Number
1045 Expected literal constant
1019 Expected 'Loop'
1020 Expected 'Next'
1050 Expected 'Property'
1022 Expected 'Select'
1024 Expected statement
1016 Expected 'Sub'
1017 Expected 'Then'
1013 Expected 'To'
1018 Expected 'Wend'
1027 Expected 'While' or 'Until'
1028 Expected 'While,' 'Until,' or end of statement
1029 Expected 'With'
1030 Identifier too long
1014 Invalid character
1039 Invalid 'exit' statement
1040 Invalid 'for' loop control variable
1013 Invalid number
1037 Invalid use of 'Me' keyword
1038 'loop' without 'do'
1048 Must be defined inside a Class
1042 Must be first statement on the line
1041 Name redefined
Number of arguments must be consistent across
1051
properties specification
1001 Out of Memory
1054 Property Set or Let must have at least one argument
1002 Syntax error
Error
Description
Number
1055 Unexpected 'Next'
1015 Unterminated string constant

See Also

VBScript Run-time Errors

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Events
In This Section

Initialize Event
Terminate Event

Related Sections

VBScript Langauge Reference

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Initialize Event
Occurs when an instance of the associated class is created.
Private Sub Class_Initialize()
statements
End Sub

The statements part consists of zero or more code statements to be


run when the class is initialized.

Remarks

The following example illustrates the use of the Initialize event.


Class TestClass
Private Sub Class_Initialize ' Setup Initialize event.
MsgBox("TestClass started")
End Sub
Private Sub Class_Terminate ' Setup Terminate event.
MsgBox("TestClass terminated")
End Sub
End Class

Set X = New TestClass ' Create an instance of TestClass.


Set X = Nothing ' Destroy the instance.

Requirements

Version 5

See Also

Class Object | Class Statement | Terminate Event


Applies To: Class Object

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Terminate Event
Occurs when an instance of the associated class is terminated.
Private Sub Class_Terminate()
statements
End Sub

The statements part consists of zero or more code statements to be


run when the class is initialized.

Remarks

The following example illustrates the use of the Terminate event.


Class TestClass
Private Sub Class_Initialize ' Setup Initialize event.
MsgBox("TestClass started")
End Sub
Private Sub Class_Terminate ' Setup Terminate event.
MsgBox("TestClass terminated")
End Sub
End Class
Set X = New TestClass ' Create an instance of TestClass.
Set X = Nothing ' Destroy the instance.

Requirements

Version 5

See Also

Class Object | Class Statement | Initialize Event


Applies To: Class Object

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Functions
The following table contains the VBScript functions.

Abs Array Asc Atn


CBool CByte CCur CDate
CDbl Chr CInt CLng
Conversions Cos CreateObject CSng
Date DateAdd DateDiff DatePart
DateSerial DateValue Day Derived Maths
Eval Exp Filter FormatCurrency
FormatDateTime FormatNumber FormatPercent GetLocale
GetObject GetRef Hex Hour
InputBox InStr InStrRev Int, Fixs
IsArray IsDate IsEmpty IsNull
IsNumeric IsObject Join LBound
LCase Left Len LoadPicture
Log LTrim; RTrim; and Trims Maths Mid
Minute Month MonthName MsgBox
Now Oct Replace RGB
Right Rnd Round ScriptEngine
ScriptEngineBuildVersion ScriptEngineMajorVersion ScriptEngineMinorVersion Second
SetLocale Sgn Sin Space
Split Sqr StrComp String
Tan Time Timer TimeSerial
TimeValue TypeName UBound UCase
VarType Weekday WeekdayName Year

Related Sections

VBScript Langauge Reference

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Abs Function
Returns the absolute value of a number.
Abs(number)

The number argument can be any valid numeric expression. If


number contains Null, Null is returned; if it is an uninitialized
variable, zero is returned.

Remarks

The absolute value of a number is its unsigned magnitude. For


example, Abs(-1) and Abs(1) both return 1.
The following example uses the Abs function to compute the
absolute value of a number: Dim MyNumber MyNumber = Abs(50.3)
' Returns 50.3. MyNumber = Abs(-50.3) ' Returns 50.3.

Requirements

Version 1

See Also

Sgn Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Array Function
Returns a Variant containing an array.
Array(arglist)

The required arglist argument is a comma-delimited list of values


that are assigned to the elements of an array contained with the
Variant. If no arguments are specified, an array of zero length is
created.

Remarks

The notation used to refer to an element of an array consists of the


variable name followed by parentheses containing an index number
indicating the desired element. In the following example, the first
statement creates a variable named A. The second statement
assigns an array to variable A. The last statement assigns the value
contained in the second array element to another variable.
Dim A
A = Array(10,20,30)
B = A(2) ' B is now 30.

Note A variable that is not declared as an array can still contain


an array. Although a Variant variable containing an array is
conceptually different from an array variable containing Variant
elements, the array elements are accessed in the same way.

Requirements

Version 2

See Also

Dim Statement
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Asc Function
Returns the ANSI character code corresponding to the first letter in a
string.
Asc(string)

The string argument is any valid string expression. If the string


contains no characters, a run-time error occurs.

Remarks

In the following example, Asc returns the ANSI character code of the
first letter of each string: Dim MyNumber MyNumber = Asc("A") '
Returns 65. MyNumber = Asc("a") ' Returns 97. MyNumber =
Asc("Apple") ' Returns 65.

Note The AscB function is used with byte data contained in a


string. Instead of returning the character code for the first
character, AscB returns the first byte. AscW is provided for 32-
bit platforms that use Unicode characters. It returns the Unicode
(wide) character code, thereby avoiding the conversion from
Unicode to ANSI.

Requirements

Version 1

See Also

Chr Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Atn Function
Returns the arctangent of a number.
Atn(number)

The number argument can be any valid numeric expression.

Remarks

The Atn function takes the ratio of two sides of a right triangle
(number) and returns the corresponding angle in radians. The ratio is
the length of the side opposite the angle divided by the length of the
side adjacent to the angle. The range of the result is -pi /2 to pi/2
radians.
To convert degrees to radians, multiply degrees by pi/180. To convert
radians to degrees, multiply radians by 180/pi.
The following example uses Atn to calculate the value of pi:
Dim pi
pi = 4 * Atn(1) ' Calculate the value of pi.

Note Atn is the inverse trigonometric function of Tan, which


takes an angle as its argument and returns the ratio of two sides
of a right triangle. Do not confuse Atn with the cotangent, which
is the simple inverse of a tangent (1/tangent).

Requirements

Version 1

See Also

Cos Function | Derived Math Functions | Sin Function | Tan Function


© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
CBool Function
Returns an expression that has been converted to a Variant of
subtype Boolean.
CBool(expression)

The expression argument is any valid expression.

Remarks

If expression is zero, False is returned; otherwise, True is returned.


If expression can't be interpreted as a numeric value, a run-time
error occurs.
The following example uses the CBool function to convert an
expression to a Boolean. If the expression evaluates to a nonzero
value, CBool returns True; otherwise, it returns False.
Dim A, B, Check
A = 5: B = 5 ' Initialize variables.
Check = CBool(A = B) ' Check contains True.
A = 0 ' Define variable.
Check = CBool(A) ' Check contains False.

Requirements

Version 1

See Also

CByte Function | CCur Function | CDate Function | CDbl Function |


CInt Function | CLng Function | CSng Function | CStr Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
CByte Function
Returns an expression that has been converted to a Variant of
subtype Byte.
CByte(expression)

The expression argument is any valid expression.

Remarks

In general, you can document your code using the subtype


conversion functions to show that the result of some operation
should be expressed as a particular data type rather than the default
data type. For example, use CByte to force byte arithmetic in cases
where currency, single-precision, double-precision, or integer
arithmetic normally would occur.
Use the CByte function to provide internationally aware conversions
from any other data type to a Byte subtype. For example, different
decimal separators are properly recognized depending on the locale
setting of your system, as are different thousand separators.
If expression lies outside the acceptable range for the byte subtype,
an error occurs. The following example uses the CByte function to
convert an expression to a byte:
Dim MyDouble, MyByte
MyDouble = 125.5678 ' MyDouble is a Double.
MyByte = CByte(MyDouble) ' MyByte contains 126.

Requirements

Version 1

See Also
CBool Function | CCur Function | CDate Function | CDbl Function |
CInt Function | CLng Function | CSng Function | CStr Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
CCur Function
Returns an expression that has been converted to a Variant of
subtype Currency.
CCur(expression)

The expression argument is any valid expression.

Remarks

In general, you can document your code using the subtype


conversion functions to show that the result of some operation
should be expressed as a particular data type rather than the default
data type. For example, use CCur to force currency arithmetic in
cases where integer arithmetic normally would occur.
You should use the CCur function to provide internationally aware
conversions from any other data type to a Currency subtype. For
example, different decimal separators and thousands separators are
properly recognized depending on the locale setting of your system.
The following example uses the CCur function to convert an
expression to a Currency: Dim MyDouble, MyCurr MyDouble =
543.214588 ' MyDouble is a Double. MyCurr = CCur(MyDouble * 2) '
Convert result of MyDouble * 2 (1086.429176) to a Currency
(1086.4292).

Requirements

Version 1

See Also

CBool Function |CByte Function | CDate Function | CDbl Function |


CInt Function | CLng Function | CSng Function | CStr Function
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
CDate Function
Returns an expression that has been converted to a Variant of
subtype Date.
CDate(date)

The date argument is any valid date expression.

Remarks

Use the IsDate function to determine if date can be converted to a


date or time. CDate recognizes date literals and time literals as well
as some numbers that fall within the range of acceptable dates.
When converting a number to a date, the whole number portion is
converted to a date. Any fractional part of the number is converted to
a time of day, starting at midnight.
CDate recognizes date formats according to the locale setting of
your system. The correct order of day, month, and year may not be
determined if it is provided in a format other than one of the
recognized date settings. In addition, a long date format is not
recognized if it also contains the day-of-the-week string.
The following example uses the CDate function to convert a string to
a date. In general, hard coding dates and times as strings (as shown
in this example) is not recommended. Use date and time literals
(such as #10/19/1962#, #4:45:23 PM#) instead.
MyDate = "October 19, 1962" ' Define date.
MyShortDate = CDate(MyDate) ' Convert to Date data type.
MyTime = "4:35:47 PM" ' Define time.
MyShortTime = CDate(MyTime) ' Convert to Date data type.

Requirements

Version 1
See Also

IsDate Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
CDbl Function
Returns an expression that has been converted to a Variant of
subtype Double.
CDbl(expression)

The expression argument is any valid expression.

Remarks

In general, you can document your code using the subtype


conversion functions to show that the result of some operation
should be expressed as a particular data type rather than the default
data type. For example, use CDbl or CSng to force double-precision
or single-precision arithmetic in cases where currency or integer
arithmetic normally would occur.
Use the CDbl function to provide internationally aware conversions
from any other data type to a Double subtype. For example, different
decimal separators and thousands separators are properly
recognized depending on the locale setting of your system.
This example uses the CDbl function to convert an expression to a
Double.
Dim MyCurr, MyDouble
MyCurr = CCur(234.456784) ' MyCurr is a Currency
(234.4567).
MyDouble = CDbl(MyCurr * 8.2 * 0.01) ' Convert result to a
Double (19.2254576).

Requirements

Version 1

See Also
CBool Function |CByte Function | CCur Function | CDate Function |
CInt Function | CLng Function | CSng Function | CStr Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Chr Function
Returns the character associated with the specified ANSI character
code.
Chr(charcode)

The charcode argument is a number that identifies a character.

Remarks

Numbers from 0 to 31 are the same as standard, nonprintable ASCII


codes. For example, Chr(10) returns a linefeed character.
The following example uses the Chr function to return the character
associated with the specified character code: Dim MyChar MyChar =
Chr(65) ' Returns A. MyChar = Chr(97) ' Returns a. MyChar =
Chr(62) ' Returns >. MyChar = Chr(37) ' Returns %.

Note The ChrB function is used with byte data contained in a


string. Instead of returning a character, which may be one or two
bytes, ChrB always returns a single byte. ChrW is provided for
32-bit platforms that use Unicode characters. Its argument is a
Unicode (wide) character code, thereby avoiding the conversion
from ANSI to Unicode.

Requirements

Version 1

See Also

Asc Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
CInt Function
Returns an expression that has been converted to a Variant of
subtype Integer.
CInt(expression)

The expression argument is any valid expression.

Remarks

In general, you can document your code using the subtype


conversion functions to show that the result of some operation
should be expressed as a particular data type rather than the default
data type. For example, use CInt or CLng to force integer arithmetic
in cases where currency, single-precision, or double-precision
arithmetic normally would occur.
Use the CInt function to provide internationally aware conversions
from any other data type to an Integer subtype. For example,
different decimal separators are properly recognized depending on
the locale setting of your system, as are different thousand
separators.
If expression lies outside the acceptable range for the Integer
subtype, an error occurs.
The following example uses the CInt function to convert a value to
an Integer: Dim MyDouble, MyInt MyDouble = 2345.5678 ' MyDouble
is a Double. MyInt = CInt(MyDouble) ' MyInt contains 2346.

Note CInt differs from the Fix and Int functions, which truncate,
rather than round, the fractional part of a number. When the
fractional part is exactly 0.5, the CInt function always rounds it
to the nearest even number. For example, 0.5 rounds to 0, and
1.5 rounds to 2.

Requirements
Version 1

See Also

CBool Function |CByte Function | CCur Function | CDate Function |


CDbl Function CLng Function | CSng Function | CStr Function | Int,
Fix Functions

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
CLng Function
Returns an expression that has been converted to a Variant of
subtype Long.
CLng(expression)

The expression argument is any valid expression.

Remarks

In general, you can document your code using the subtype


conversion functions to show that the result of some operation
should be expressed as a particular data type rather than the default
data type. For example, use CInt or CLng to force integer arithmetic
in cases where currency, single-precision, or double-precision
arithmetic normally would occur.
Use the CLng function to provide internationally aware conversions
from any other data type to a Long subtype. For example, different
decimal separators are properly recognized depending on the locale
setting of your system, as are different thousand separators.
If expression lies outside the acceptable range for the Long subtype,
an error occurs.
The following example uses the CLng function to convert a value to
a Long: Dim MyVal1, MyVal2, MyLong1, MyLong2 MyVal1 =
25427.45: MyVal2 = 25427.55 ' MyVal1, MyVal2 are Doubles.
MyLong1 = CLng(MyVal1) ' MyLong1 contains 25427. MyLong2 =
CLng(MyVal2) ' MyLong2 contains 25428.

Note CLng differs from the Fix and Int functions, which
truncate, rather than round, the fractional part of a number.
When the fractional part is exactly 0.5, the CLng function
always rounds it to the nearest even number. For example, 0.5
rounds to 0, and 1.5 rounds to 2.
Requirements

Version 1

See Also

CBool Function |CByte Function | CCur Function | CDate Function |


CDbl Function | CInt Function | CSng Function | CStr Function | Int,
Fix Functions

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Conversion Functions
Asc Function
CBool Function
CByte Function
CCur Function
CDate Function
CDbl Function
Chr Function
CInt Function
CLng Function
CSng Function
CStr Function
Hex Function
Oct Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Cos Function
Returns the cosine of an angle.
Cos(number)

The number argument can be any valid numeric expression that


expresses an angle in radians.

Remarks

The Cos function takes an angle and returns the ratio of two sides of
a right triangle. The ratio is the length of the side adjacent to the
angle divided by the length of the hypotenuse. The result lies in the
range -1 to 1.
To convert degrees to radians, multiply degrees by pi /180. To
convert radians to degrees, multiply radians by 180/pi.
The following example uses the Cos function to return the cosine of
an angle:
Dim MyAngle, MySecant
MyAngle = 1.3 ' Define angle in radians.
MySecant = 1 / Cos(MyAngle) ' Calculate secant.

Requirements

Version 1

See Also

Atn Function | Derived Math Functions | Sin Function | Tan Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
CreateObject Function
Creates and returns a reference to an Automation object.
CreateObject(servername.typename,[location])

Arguments

servername
Required. The name of the application providing the object.
typename
Required. The type or class of the object to create.
location
Optional. The name of the network server where the object is to be
created.

Remarks

Automation servers provide at least one type of object. For example,


a word-processing application may provide an application object, a
document object, and a toolbar object.
To create an Automation object, assign the object returned by
CreateObject to an object variable:
Dim fso, MyFile
Set fso =CreateObject("Scripting.FileSystemObject")
Set MyFile =fso.CreateTextFile("d:\testfile.txt", True)
MyFile.WriteLine("SSSS")
msgbox "Done"

This code starts the application that creates the object (in this case,
a Microsoft Excel spreadsheet). Once an object is created, refer to it
in code using the object variable you defined. As shown in the
following example, you can access properties and methods of the
new object using the object variable, ExcelSheet, and other Excel
objects, including the Application object and the ActiveSheet.Cells
collection:
' Make Excel visible through the Application object.
ExcelSheet.Application.Visible = True
' Place some text in the first cell of the sheet.
ExcelSheet.ActiveSheet.Cells(1,1).Value = "This is column A,
row 1"
' Save the sheet.
ExcelSheet.SaveAs "C:\DOCS\TEST.XLS"
' Close Excel with the Quit method on the Application object.
ExcelSheet.Application.Quit
' Release the object variable.
Set ExcelSheet = Nothing

Creating an object on a remote server can only be accomplished


when Internet security is turned off. You can create an object on a
remote networked computer by passing the name of the computer to
the servername argument of CreateObject. That name is the same
as the machine name portion of a share name. For a network share
named "\\myserver\public", the servername is "myserver". In
addition, you can specify servername using DNS format or an IP
address.
The following code returns the version number of an instance of
Excel running on a remote network computer named "myserver":
Function GetVersion
Dim XLApp
Set XLApp = CreateObject("Excel.Application", "MyServer")
GetVersion = XLApp.Version
End Function

An error occurs if the specified remote server does not exist or


cannot be found.

Requirements

Version 2

See Also

GetObject Function
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
CSng Function
Returns an expression that has been converted to a Variant of
subtype Single.
CSng(expression)

The expression argument is any valid expression.

Remarks

In general, you can document your code using the data type
conversion functions to show that the result of some operation
should be expressed as a particular data type rather than the default
data type. For example, use CDbl or CSng to force double-precision
or single-precision arithmetic in cases where currency or integer
arithmetic normally would occur.
Use the CSng function to provide internationally aware conversions
from any other data type to a Single subtype. For example, different
decimal separators are properly recognized depending on the locale
setting of your system, as are different thousand separators.
If expression lies outside the acceptable range for the Single
subtype, an error occurs.
The following example uses the CSng function to convert a value to
a Single: Dim MyDouble1, MyDouble2, MySingle1, MySingle2 '
MyDouble1, MyDouble2 are Doubles. MyDouble1 = 75.3421115:
MyDouble2 = 75.3421555 MySingle1 = CSng(MyDouble1) '
MySingle1 contains 75.34211. MySingle2 = CSng(MyDouble2) '
MySingle2 contains 75.34216.

Requirements

Version 1

See Also
CBool Function | CByte Function | CCur Function | CDate Function |
CDbl Function | CInt Function | CLng Function | CStr Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
CStr Function
Returns an expression that has been converted to a Variant of
subtype String.
CStr(expression)

The expression argument is any valid expression.

Remarks

In general, you can document your code using the data type
conversion functions to show that the result of some operation
should be expressed as a particular data type rather than the default
data type. For example, use CStr to force the result to be expressed
as a String.
You should use the CStr function instead of Str to provide
internationally aware conversions from any other data type to a
String subtype. For example, different decimal separators are
properly recognized depending on the locale setting of your system.
The data in expression determines what is returned according to the
following table:

If expression is CStr returns


Boolean A String containing True or False.
A String containing a date in the short-date
Date
format of your system.
Null A run-time error.
Empty A zero-length String ("").
A String containing the word Error followed by
Error
the error number.
Other numeric A String containing the number.

The following example uses the CStr function to convert a numeric


value to a String: Dim MyDouble, MyString MyDouble = 437.324 '
MyDouble is a Double. MyString = CStr(MyDouble) ' MyString
contains "437.324".

Requirements

Version 1

See Also

CBool Function | CByte Function | CCur Function | CDate Function |


CDbl Function | CInt Function | CLng Function | CSng Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Date Function
Returns the current system date.
Date

Remarks

The following example uses the Date function to return the current
system date: Dim MyDate MyDate = Date ' MyDate contains the
current system date.

Requirements

Version 1

See Also

CDate Function | Now Function | Time Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
DateAdd Function
Returns a date to which a specified time interval has been added.
DateAdd(interval, number, date)

Arguments

interval
Required. String expression that is the interval you want to add.
See Settings section for values.
number
Required. Numeric expression that is the number of interval you
want to add. The numeric expression can either be positive, for
dates in the future, or negative, for dates in the past.
date
Required. Variant or literal representing the date to which interval
is added.

Settings

The interval argument can have the following values:

Setting Description
yyyy Year
q Quarter
m Month
y Day of year
d Day
w Weekday
ww Week of year
h Hour
n Minute
s Second
Remarks

You can use the DateAdd function to add or subtract a specified


time interval from a date. For example, you can use DateAdd to
calculate a date 30 days from today or a time 45 minutes from now.
To add days to date, you can use Day of Year ("y"), Day ("d"), or
Weekday ("w").
The DateAdd function won't return an invalid date. The following
example adds one month to January 31:
NewDate = DateAdd("m", 1, "31-Jan-95")

In this case, DateAdd returns 28-Feb-95, not 31-Feb-95. If date is


31-Jan-96, it returns 29-Feb-96 because 1996 is a leap year.
If the calculated date would precede the year 100, an error occurs.
If number isn't a Long value, it is rounded to the nearest whole
number before being evaluated.

Requirements

Version 2

See Also

DateDiff Function | DatePart Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
DateDiff Function
Returns the number of intervals between two dates.
DateDiff(interval, date1, date2 [,firstdayofweek[,
firstweekofyear]])

The DateDiff function syntax has these parts:

Arguments

interval
Required. String expression that is the interval you want to use to
calculate the differences between date1 and date2. See Settings
section for values.
date1, date2
Required. Date expressions. Two dates you want to use in the
calculation.
firstdayofweek
Optional. Constant that specifies the day of the week. If not
specified, Sunday is assumed. See Settings section for values.
firstweekofyear
Optional. Constant that specifies the first week of the year. If not
specified, the first week is assumed to be the week in which
January 1 occurs. See Settings section for values.

Settings

The interval argument can have the following values:

Setting Description
yyyy Year
q Quarter
m Month
y Day of year
d Day
w Weekday
ww Week of year
h Hour
n Minute
s Second
The firstdayofweek argument can have the following values:

Constant Value Description


Use National Language Support
vbUseSystemDayOfWeek 0
(NLS) API setting.
vbSunday 1 Sunday (default)
vbMonday 2 Monday
vbTuesday 3 Tuesday
vbWednesday 4 Wednesday
vbThursday 5 Thursday
vbFriday 6 Friday
vbSaturday 7 Saturday

The firstweekofyear argument can have the following values:

Constant Value Description


Use National Language Support (NLS)
vbUseSystem 0
API setting.
Start with the week in which January 1
vbFirstJan1 1
occurs (default).
Start with the week that has at least four
vbFirstFourDays 2
days in the new year.
Start with the first full week of the new
vbFirstFullWeek 3
year.

Remarks
You can use the DateDiff function to determine how many specified
time intervals exist between two dates. For example, you might use
DateDiff to calculate the number of days between two dates, or the
number of weeks between today and the end of the year.
To calculate the number of days between date1 and date2, you can
use either Day of year ("y") or Day ("d"). When interval is Weekday
("w"), DateDiff returns the number of weeks between the two dates.
If date1 falls on a Monday, DateDiff counts the number of Mondays
until date2. It counts date2 but not date1. If interval is Week ("ww"),
however, the DateDiff function returns the number of calendar
weeks between the two dates. It counts the number of Sundays
between date1 and date2. DateDiff counts date2 if it falls on a
Sunday; but it doesn't count date1, even if it does fall on a Sunday.
If date1 refers to a later point in time than date2, the DateDiff
function returns a negative number.
The firstdayofweek argument affects calculations that use the "w"
and "ww" interval symbols.
If date1 or date2 is a date literal, the specified year becomes a
permanent part of that date. However, if date1 or date2 is enclosed
in quotation marks (" ") and you omit the year, the current year is
inserted in your code each time the date1 or date2 expression is
evaluated. This makes it possible to write code that can be used in
different years.
When comparing December 31 to January 1 of the immediately
succeeding year, DateDiff for Year ("yyyy") returns 1 even though
only a day has elapsed.
The following example uses the DateDiff function to display the
number of days between a given date and today:
Function DiffADate(theDate)
DiffADate = "Days from today: " & DateDiff("d", Now,
theDate)
End Function

Requirements
Version 2

See Also

DateAdd Function | DatePart Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
<b>DatePart(</b><a href=""
onclick="showTip(this)">interval</a><b>,</b> <a href=""
onclick="showTip(this)">date</a>[<b>,</b> firstdayofweek[<b>,
</b> <a href="" onclick="showTip(this)">firstweekofyear</a>]]
<b>)</b>

Function GetQuarter(TheDate) GetQuarter = <code>


<b>DatePart(</b></code>"q"<code><b>,</b></code>
TheDate<code><b>)</b></code> End Function

Requirements

Version 2

See Also

DateAdd Function | DateDiff Function

© 2001 Microsoft Corporation. All rights reserved.

Build: Topic Version 5.6.9309.1546


Visual Basic Scripting Edition
DateSerial Function
Returns a Variant of subtype Date for a specified year, month, and
day.
DateSerial(year, month, day)

Arguments

year
Number between 100 and 9999, inclusive, or a numeric
expression.
month
Any numeric expression.
day
Any numeric expression.

Remarks

To specify a date, such as December 31, 1991, the range of


numbers for each DateSerial argument should be in the accepted
range for the unit; that is, 1–31 for days and 1–12 for months.
However, you can also specify relative dates for each argument
using any numeric expression that represents some number of days,
months, or years before or after a certain date.
The following example uses numeric expressions instead of absolute
date numbers. Here the DateSerial function returns a date that is the
day before the first day (1 – 1) of two months before August (8 – 2)
of 10 years before 1990 (1990 – 10); in other words, May 31, 1980.
Dim MyDate1, MyDate2
MyDate1 = DateSerial(1970, 1, 1) ' Returns January 1, 1970.
MyDate2 = DateSerial(1990 - 10, 8 - 2, 1 - 1) ' Returns May
31, 1980.

For the year argument, values between 0 and 99, inclusive, are
interpreted as the years 1900–1999. For all other year arguments,
use a complete four-digit year (for example, 1800).
When any argument exceeds the accepted range for that argument,
it increments to the next larger unit as appropriate. For example, if
you specify 35 days, it is evaluated as one month and some number
of days, depending on where in the year it is applied. However, if any
single argument is outside the range -32,768 to 32,767, or if the date
specified by the three arguments, either directly or by expression,
falls outside the acceptable range of dates, an error occurs.

Requirements

Version 1

See Also

Date Function | DateValue Function | Day Function | Month Function


| Now Function | TimeSerial Function | TimeValue Function |
Weekday Function | Year Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
DateValue Function
Returns a Variant of subtype Date.
DateValue(date)

The date argument is normally a string expression representing a


date from January 1, 100 through December 31, 9999. However,
date can also be any expression that can represent a date, a time, or
both a date and time, in that range.

Remarks

If the date argument includes time information, DateValue doesn't


return it. However, if date includes invalid time information (such as
"89:98"), an error occurs.
If date is a string that includes only numbers separated by valid date
separators, DateValue recognizes the order for month, day, and year
according to the short date format you specified for your system.
DateValue also recognizes unambiguous dates that contain month
names, either in long or abbreviated form. For example, in addition
to recognizing 12/30/1991 and 12/30/91, DateValue also recognizes
December 30, 1991 and Dec 30, 1991.
If the year part of date is omitted, DateValue uses the current year
from your computer's system date.
The following example uses the DateValue function to convert a
string to a date. You can also use date literals to directly assign a
date to a Variant variable, for example, MyDate = #9/11/63#.
Dim MyDate
MyDate = DateValue("September 11, 1963") ' Return a date.

Requirements

Version 1
See Also

CDate Function | DateSerial Function | Day Function | Month


Function | Now Function | TimeSerial Function | TimeValue Function
| Weekday Function | Year Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Day Function
Returns a whole number between 1 and 31, inclusive, representing
the day of the month.
Day(date)

The date argument is any expression that can represent a date. If


date contains Null, Null is returned.
The following example uses the Day function to obtain the day of the
month from a specified date:
Dim MyDay
MyDay = Day("October 19, 1962") ' MyDay contains 19.

Requirements

Version 1

See Also

Date Function | Hour Function | Minute Function | Month Function |


Now Function | Second Function | Weekday Function | Year Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Derived Math Functions
The following non-intrinsic math functions can be derived from the
intrinsic math functions:

Function Derived equivalents


Secant Sec(X) = 1 / Cos(X)
Cosecant Cosec(X) = 1 / Sin(X)
Cotangent Cotan(X) = 1 / Tan(X)
Inverse Sine Arcsin(X) = Atn(X / Sqr(-X * X + 1))
Arccos(X) = Atn(-X / Sqr(-X * X + 1)) + 2 *
Inverse Cosine
Atn(1)
Arcsec(X) = Atn(X / Sqr(X * X - 1)) + Sgn((X)
Inverse Secant
-1) * (2 * Atn(1))
Arccosec(X) = Atn(X / Sqr(X * X - 1)) +
Inverse Cosecant
(Sgn(X) - 1) * (2 * Atn(1))
Inverse Cotangent Arccotan(X) = Atn(X) + 2 * Atn(1)
Hyperbolic Sine HSin(X) = (Exp(X) - Exp(-X)) / 2
Hyperbolic Cosine HCos(X) = (Exp(X) + Exp(-X)) / 2
HTan(X) = (Exp(X) - Exp(-X)) / (Exp(X) +
Hyperbolic Tangent
Exp(-X))
Hyperbolic Secant HSec(X) = 2 / (Exp(X) + Exp(-X))
Hyperbolic Cosecant HCosec(X) = 2 / (Exp(X) - Exp(-X))
Hyperbolic HCotan(X) = (Exp(X) + Exp(-X)) / (Exp(X) -
Cotangent Exp(-X))
Inverse Hyperbolic
HArcsin(X) = Log(X + Sqr(X * X + 1))
Sine
Inverse Hyperbolic
HArccos(X) = Log(X + Sqr(X * X - 1))
Cosine
Inverse Hyperbolic HArctan(X) = Log((1 + X) / (1 - X)) / 2
Tangent
Inverse Hyperbolic
HArcsec(X) = Log((Sqr(-X * X + 1) + 1) / X)
Secant
Inverse Hyperbolic HArccosec(X) = Log((Sgn(X) * Sqr(X * X + 1)
Cosecant +1) / X)
Inverse Hyperbolic
HArccotan(X) = Log((X + 1) / (X - 1)) / 2
Cotangent
Logarithm to base N LogN(X) = Log(X) / Log(N)

See Also

Atn Function | Cos Function | Exp Function | Log Function | Sin


Function | Sqr Function | Tan Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Eval
Evaluates an expression and returns the result.
[result = ]Eval(expression)

Arguments

result
Optional. Variable to which return value assignment is made. If
result is not specified, consider using the Execute statement
instead.
expression
Required. String containing any legal VBScript expression.

Remarks

In VBScript, x = y can be interpreted two ways. The first is as an


assignment statement, where the value of y is assigned to x. The
second interpretation is as an expression that tests if x and y have
the same value. If they do, result is True; if they are not, result is
False. The Eval method always uses the second interpretation,
whereas the Execute statement always uses the first.

Note In Microsoft® JScript™, no confusion exists between


assignment and comparison, because the assignment operator
(=) is different from the comparison operator (==).

The following example illustrates the use of the Eval function: Sub
GuessANumber Dim Guess, RndNum RndNum = Int((100) * Rnd(1)
+ 1) Guess = CInt(InputBox("Enter your guess:",,0)) Do If
Eval("Guess = RndNum") Then MsgBox "Congratulations! You
guessed it!" Exit Sub Else Guess = CInt(InputBox("Sorry! Try
again.",,0)) End If Loop Until Guess = 0 End Sub

Requirements
Version 5

See Also

Execute Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Exp Function
Returns e (the base of natural logarithms) raised to a power.
Exp(number)

The number argument can be any valid numeric expression.

Remarks

If the value of number exceeds 709.782712893, an error occurs. The


constant e is approximately 2.718282.

Note The Exp function complements the action of the Log


function and is sometimes referred to as the antilogarithm.

The following example uses the Exp function to return e raised to a


power: Dim MyAngle, MyHSin ' Define angle in radians. MyAngle =
1.3 ' Calculate hyperbolic sine. MyHSin = (Exp(MyAngle) - Exp(-1 *
MyAngle)) / 2

Requirements

Version 1

See Also

Derived Math Functions | Log Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Filter Function
Returns a zero-based array containing a subset of a string array
based on a specified filter criteria.
Filter(InputStrings, Value[, Include[, Compare]])

Arguments

InputStrings
Required. One-dimensional array of strings to be searched.
Value
Required. String to search for.
Include
Optional. Boolean value indicating whether to return substrings that
include or exclude Value. If Include is True, Filter returns the
subset of the array that contains Value as a substring. If Include is
False, Filter returns the subset of the array that does not contain
Value as a substring.
Compare
Optional. Numeric value indicating the kind of string comparison to
use. See Settings section for values.

Settings

The Compare argument can have the following values:

Constant Value Description


vbBinaryCompare 0 Perform a binary comparison.
vbTextCompare 1 Perform a textual comparison.

Remarks

If no matches of Value are found within InputStrings, Filter returns


an empty array. An error occurs if InputStrings is Null or is not a one-
dimensional array.
The array returned by the Filter function contains only enough
elements to contain the number of matched items.
The following example uses the Filter function to return the array
containing the search criteria "Mon":
Dim MyIndex
Dim MyArray (3)
MyArray(0) = "Sunday"
MyArray(1) = "Monday"
MyArray(2) = "Tuesday"
MyIndex = Filter(MyArray, "Mon") ' MyIndex(0) contains
"Monday".

Requirements

Version 2

See Also

Replace Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
FormatCurrency Function
Returns an expression formatted as a currency value using the
currency symbol defined in the system control panel.
FormatCurrency(Expression[,NumDigitsAfterDecimal
[,IncludeLeadingDigit [,UseParensForNegativeNumbers
[,GroupDigits]]]])

Arguments

Expression
Required. Expression to be formatted.
NumDigitsAfterDecimal
Optional. Numeric value indicating how many places to the right of
the decimal are displayed. Default value is -1, which indicates that
the computer's regional settings are used.
IncludeLeadingDigit
Optional. Tristate constant that indicates whether or not a leading
zero is displayed for fractional values. See Settings section for
values.
UseParensForNegativeNumbers
Optional. Tristate constant that indicates whether or not to place
negative values within parentheses. See Settings section for
values.
GroupDigits
Optional. Tristate constant that indicates whether or not numbers
are grouped using the group delimiter specified in the computer's
regional settings. See Settings section for values.

Settings

The IncludeLeadingDigit, UseParensForNegativeNumbers, and


GroupDigits arguments have the following settings:

Constant Value Description


TristateTrue -1 True
TristateFalse 0 False
Use the setting from the computer's
TristateUseDefault -2
regional settings.

Remarks

When one or more optional arguments are omitted, values for


omitted arguments are provided by the computer's regional settings.
The position of the currency symbol relative to the currency value is
determined by the system's regional settings.

Note All settings information comes from the Regional Settings


Currency tab, except leading zero, which comes from the
Number tab.

The following example uses the FormatCurrency function to format


the expression as a currency and assign it to MyCurrency:
Dim MyCurrency
MyCurrency = FormatCurrency(1000) ' MyCurrency contains
$1000.00.

Requirements

Version 2

See Also

FormatDateTime Function | FormatNumber Function |


FormatPercent Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
<b>FormatDateTime(</b><i><a href=""
onclick="showTip(this)">Date</a></i>[<b>,</b> <i><a href=""
onclick="showTip(this)">NamedFormat</a></i>]<b>)</b>

Function GetCurrentDate ' FormatDateTime formats Date in long


date.

GetCurrentDate = <code><b>FormatDateTime(</b>
</code>Date<code><b>,</b></code> 1<code><b>)</b></code>
End Function

Requirements

Version 2

See Also

FormatCurrency Function | FormatNumber Function |


FormatPercent Function

© 2001 Microsoft Corporation. All rights reserved.

Build: Topic Version 5.6.9309.1546


<b>FormatNumber(</b><a href=""
onclick="showTip(this)">Expression</a> [<b>,</b><a href=""
onclick="showTip(this)">NumDigitsAfterDecimal</a> [<b>,</b>
<a href="" onclick="showTip(this)">IncludeLeadingDigit</a>
[<b>,</b><a href=""
onclick="showTip(this)">UseParensForNegativeNumbers</a>
[<b>,</b><a href=""
onclick="showTip(this)">GroupDigits</a>]]]]<b>)</b>
Function FormatNumberDemo

Dim MyAngle, MySecant, MyNumber MyAngle = 1.3 ' Define


angle in radians.

MySecant = 1 / Cos(MyAngle) ' Calculate secant.

FormatNumberDemo = <code><b>FormatNumber(</b>
</code>MySecant<code><b>,</b></code>4<code><b>)</b>
</code> ' Format MySecant to four decimal places.
End Function

Requirements

Version 2

See Also

FormatCurrency Function |FormatDateTime Function |


FormatPercent Function

© 2001 Microsoft Corporation. All rights reserved.

Build: Topic Version 5.6.9309.1546


Visual Basic Scripting Edition
FormatPercent Function
Returns an expression formatted as a percentage (multiplied by 100)
with a trailing % character.
FormatPercent(Expression[,NumDigitsAfterDecimal
[,IncludeLeadingDigit [,UseParensForNegativeNumbers
[,GroupDigits]]]])

The FormatPercent function syntax has these parts:

Arguments

Expression
Required. Expression to be formatted.
NumDigitsAfterDecimal
Optional. Numeric value indicating how many places to the right of
the decimal are displayed. Default value is -1, which indicates that
the computer's regional settings are used.
IncludeLeadingDigit
Optional. Tristate constant that indicates whether or not a leading
zero is displayed for fractional values. See Settings section for
values.
UseParensForNegativeNumbers
Optional. Tristate constant that indicates whether or not to place
negative values within parentheses. See Settings section for
values.
GroupDigits
Optional. Tristate constant that indicates whether or not numbers
are grouped using the group delimiter specified in the control
panel. See Settings section for values.

Settings

The IncludeLeadingDigit, UseParensForNegativeNumbers, and


GroupDigits arguments have the following settings:
Constant Value Description
TristateTrue -1 True
TristateFalse 0 False
Use the setting from the computer's
TristateUseDefault -2
regional settings.

Remarks

When one or more optional arguments are omitted, the values for
the omitted arguments are provided by the computer's regional
settings.

Note All settings information comes from the Regional Settings


Number tab.

The following example uses the FormatPercent function to format


an expression as a percent:
Dim MyPercent
MyPercent = FormatPercent(2/32) ' MyPercent contains 6.25%.

Requirements

Version 2

See Also

FormatCurrency Function |FormatDateTime Function |


FormatNumber Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
GetLocale Function
Returns the current locale ID value.
GetLocale()

Remarks

A locale is a set of user preference information related to the user's


language, country/region, and cultural conventions. The locale
determines such things as keyboard layout, alphabetic sort order, as
well as date, time, number, and currency formats.
The return value can be any of the 32-bit values shown in the Locale
ID chart:
The following example illustrates the use of the GetLocale function.
To use this code, paste the entire example between the <BODY>
tags of a standard HTML page.
Enter Date in UK format: <input type="text" id="UKDate"
size="20"><p>
Here's the US equivalent: <input type="text" id="USdate"
size="20"><p>
<input type="button" value="Convert" id="button1"><p>
Enter a price in German: &nbsp; <input type="text"
id="GermanNumber" size="20">
<p>
Here's the UK equivalent: <input type="text" id="USNumber"
size="20"><p>
<input type="button" value="Convert" id="button2"><p>

<script language="vbscript">
Dim currentLocale
' Get the current locale
currentLocale = GetLocale

Sub Button1_onclick
Dim original
original = SetLocale("en-gb")
mydate = CDate(UKDate.value)
' IE always sets the locale to US English so use the
' currentLocale variable to set the locale to US English
original = SetLocale(currentLocale)
USDate.value = FormatDateTime(mydate,vbShortDate)
End Sub

Sub button2_onclick
Dim original
original = SetLocale("de")
myvalue = CCur(GermanNumber.value)
original = SetLocale("en-gb")
USNumber.value = FormatCurrency(myvalue)
End Sub

</script>

See Also

SetLocale Function | Locale ID (LCID) Chart

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
GetObject Function
Returns a reference to an Automation object from a file.
GetObject([pathname] [, class])

Arguments

pathname
Optional; String. Full path and name of the file containing the object
to retrieve. If pathname is omitted, class is required.
class
Optional; String. Class of the object.
The class argument uses the syntax appname.objectype and has
these parts:

Arguments

appname
Required; String. Name of the application providing the object.
objectype
Required; String. Type or class of object to create.

Remarks

Use the GetObject function to access an Automation object from a


file and assign the object to an object variable. Use the Set
statement to assign the object returned by GetObject to the object
variable. For example:
Dim CADObject
Set CADObject = GetObject("C:\CAD\SCHEMA.CAD")

When this code is executed, the application associated with the


specified pathname is started and the object in the specified file is
activated. If pathname is a zero-length string (""), GetObject returns
a new object instance of the specified type. If the pathname
argument is omitted, GetObject returns a currently active object of
the specified type. If no object of the specified type exists, an error
occurs.
Some applications allow you to activate part of a file. Add an
exclamation point (!) to the end of the file name and follow it with a
string that identifies the part of the file you want to activate. For
information on how to create this string, see the documentation for
the application that created the object.
For example, in a drawing application you might have multiple layers
to a drawing stored in a file. You could use the following code to
activate a layer within a drawing called SCHEMA.CAD:
Set LayerObject = GetObject("C:\CAD\SCHEMA.CAD!Layer3")

If you don't specify the object's class, Automation determines the


application to start and the object to activate, based on the file name
you provide. Some files, however, may support more than one class
of object. For example, a drawing might support three different types
of objects: an Application object, a Drawing object, and a Toolbar
object, all of which are part of the same file. To specify which object
in a file you want to activate, use the optional class argument. For
example:
Dim MyObject
Set MyObject = GetObject("C:\DRAWINGS\SAMPLE.DRW",
"FIGMENT.DRAWING")

In the preceding example, FIGMENT is the name of a drawing


application and DRAWING is one of the object types it supports. Once
an object is activated, you reference it in code using the object
variable you defined. In the preceding example, you access
properties and methods of the new object using the object variable
MyObject. For example:

MyObject.Line 9, 90
MyObject.InsertText 9, 100, "Hello, world."
MyObject.SaveAs "C:\DRAWINGS\SAMPLE.DRW"
Note Use the GetObject function when there is a current
instance of the object or if you want to create the object with a
file already loaded. If there is no current instance, and you don't
want the object started with a file loaded, use the CreateObject
function.

If an object has registered itself as a single-instance object, only one


instance of the object is created, no matter how many times
CreateObject is executed. With a single-instance object, GetObject
always returns the same instance when called with the zero-length
string ("") syntax, and it causes an error if the pathname argument is
omitted.

Requirements

Version 5

See Also

CreateObject Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
GetRef Function
Returns a reference to a procedure that can be bound to an event.
Set object.eventname = GetRef(procname)

Arguments

object
Required. Name of the object with which event is associated.
event
Required. Name of the event to which the function is to be bound.
procname
Required. String containing the name of the Sub or Function
procedure being associated with the event.

Remarks

The GetRef function allows you to connect a VBScript procedure


(Function or Sub) to any available event on your DHTML (Dynamic
HTML) pages. The DHTML object model provides information about
what events are available for its various objects.
In other scripting and programming languages, the functionality
provided by GetRef is referred to as a function pointer, that is, it
points to the address of a procedure to be executed when the
specified event occurs.
The following example illustrates the use of the GetRef function.
<SCRIPT LANGUAGE="VBScript">

Function GetRefTest()
Dim Splash
Splash = "GetRefTest Version 1.0" & vbCrLf
Splash = Splash & Chr(169) & " YourCompany 1999 "
MsgBox Splash
End Function
Set Window.Onload = GetRef("GetRefTest")
</SCRIPT>

Requirements

Version 5

See Also

Function Statement | Set Statement | Sub Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Hex Function
Returns a string representing the hexadecimal value of a number.
Hex(number)

The number argument is any valid expression.

Remarks

If number is not already a whole number, it is rounded to the nearest


whole number before being evaluated.
If number is Hex returns
Null Null.
Empty Zero (0).
Up to eight hexadecimal
Any other number
characters.

You can represent hexadecimal numbers directly by preceding


numbers in the proper range with &H. For example, &H10 represents
decimal 16 in hexadecimal notation.
The following example uses the Hex function to return the
hexadecimal value of a number: Dim MyHex MyHex = Hex(5) '
Returns 5. MyHex = Hex(10) ' Returns A. MyHex = Hex(459) '
Returns 1CB.

Requirements

Version 1

See Also

Oct Function
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Hour Function
Returns a whole number between 0 and 23, inclusive, representing
the hour of the day.
Hour(time)

The time argument is any expression that can represent a time. If


time contains Null, Null is returned.
The following example uses the Hour function to obtain the hour
from the current time: Dim MyTime, MyHour MyTime = Now MyHour
= Hour(MyTime) ' MyHour contains the number representing ' the
current hour.

Requirements

Version 1

See Also

Day Function | Minute Function | Now Function | Second Function |


Time Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
InputBox Function
Displays a prompt in a dialog box, waits for the user to input text or
click a button, and returns the contents of the text box.
InputBox(prompt[, title][, default][, xpos][, ypos][, helpfile,
context])

Arguments

prompt
String expression displayed as the message in the dialog box. The
maximum length of prompt is approximately 1024 characters,
depending on the width of the characters used. If prompt consists
of more than one line, you can separate the lines using a carriage
return character (Chr(13)), a linefeed character (Chr(10)), or
carriage return–linefeed character combination (Chr(13) &
Chr(10)) between each line.
title
String expression displayed in the title bar of the dialog box. If you
omit title, the application name is placed in the title bar.
default
String expression displayed in the text box as the default response
if no other input is provided. If you omit default, the text box is
displayed empty.
xpos
Numeric expression that specifies, in twips, the horizontal distance
of the left edge of the dialog box from the left edge of the screen. If
xpos is omitted, the dialog box is horizontally centered.
ypos
Numeric expression that specifies, in twips, the vertical distance of
the upper edge of the dialog box from the top of the screen. If ypos
is omitted, the dialog box is vertically positioned approximately
one-third of the way down the screen.
helpfile
String expression that identifies the Help file to use to provide
context-sensitive Help for the dialog box. If helpfile is provided,
context must also be provided.
context
Numeric expression that identifies the Help context number
assigned by the Help author to the appropriate Help topic. If
context is provided, helpfile must also be provided.

Remarks

When both helpfile and context are supplied, a Help button is


automatically added to the dialog box.
If the user clicks OK or presses ENTER, the InputBox function
returns whatever is in the text box. If the user clicks Cancel, the
function returns a zero-length string ("").
The following example uses the InputBox function to display an
input box and assign the string to the variable Input:
Dim Input
Input = InputBox("Enter your name")
MsgBox ("You entered: " & Input)

Requirements

Version 1

See Also

MsgBox Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
<b>InStr(</b>[<a href="" onclick="showTip(this)">start</a><b>,
</b>]<a href="" onclick="showTip(this)">string1</a><b>, </b><a
href="" onclick="showTip(this)">string2</a>[<b>, </b><a href=""
onclick="showTip(this)">compare</a>]<b>)</b>

Dim SearchString, SearchChar, MyPos

SearchString ="XXpXXpXXPXXP" ' String to search in.

SearchChar = "P" ' Search for "P".

MyPos = <code><b>Instr(</b></code>4<code><b>,</b></code>
SearchString<code><b>,</b></code> SearchChar<code><b>,</b>
</code> 1<code><b>)</b></code> ' A textual comparison starting
at position 4. Returns 6.

MyPos = <code><b>Instr(</b></code>1<code><b>,</b></code>
SearchString<code><b>,</b></code> SearchChar<code><b>,</b>
</code> 0<code><b>)</b></code> ' A binary comparison starting
at position 1. Returns 9.

MyPos = <code><b>Instr(</b></code>SearchString<code><b>,
</b></code> SearchChar<code><b>)</b></code> ' Comparison is
binary by default (last argument is omitted). Returns 9.

MyPos = <code><b>Instr(</b></code>1<code><b>,</b></code>
SearchString<code><b>,</b></code> "W"<code><b>)</b>
</code> ' A binary comparison starting at position 1. Returns 0
("W" is not found).

Note The InStrB function is used with byte data contained in


a string. Instead of returning the character position of the first
occurrence of one string within another, InStrB returns the
byte position.

Requirements

Version 1

See Also

InStrRev Function

© 2001 Microsoft Corporation. All rights reserved.

Build: Topic Version 5.6.9309.1546


<b>InStrRev(</b><a href="" onclick="showTip(this)">string1</a>
<b>,</b> <a href="" onclick="showTip(this)">string2</a>[<b>,
</b> <a href="" onclick="showTip(this)">start</a>[<b>,</b> <a
href="" onclick="showTip(this)">compare</a>]]<b>)</b>

Dim SearchString, SearchChar, MyPos SearchString


="XXpXXpXXPXXP" ' String to search in.

SearchChar = "P" ' Search for "P".

MyPos = <code><b>InstrRev(</b></code>SearchString<code>
<b>,</b></code> SearchChar<code><b>,</b></code> 10<code>
<b>,</b></code> 0<code><b>)</b></code> ' A binary comparison
starting at position 10. Returns 9.

MyPos = <code><b>InstrRev(</b></code>SearchString<code>
<b>,</b></code> SearchChar<code><b>,</b></code> -1<code>
<b>,</b></code> 1<code><b>)</b></code> ' A textual
comparison starting at the last position. Returns 12.

MyPos = <code><b>InstrRev(</b></code>SearchString<code>
<b>,</b></code> SearchChar<code><b>,</b></code> 8<code>
<b>)</b></code> ' Comparison is binary by default (last argument
is omitted). Returns 0.

Note The syntax for the InStrRev function is not the same as
the syntax for the InStr function.

Requirements

Version 2
See Also

InStr Function

© 2001 Microsoft Corporation. All rights reserved.

Build: Topic Version 5.6.9309.1546


Visual Basic Scripting Edition
Int, Fix Functions
Returns the integer portion of a number.
Int(number)
Fix(number)

The number argument can be any valid numeric expression. If


number contains Null, Null is returned.

Remarks

Both Int and Fix remove the fractional part of number and return the
resulting integer value.
The difference between Int and Fix is that if number is negative, Int
returns the first negative integer less than or equal to number,
whereas Fix returns the first negative integer greater than or equal to
number. For example, Int converts -8.4 to -9, and Fix converts -8.4
to -8.
Fix(number) is equivalent to:
Sgn(number) * Int(Abs(number))

The following examples illustrate how the Int and Fix functions
return integer portions of numbers:
MyNumber = Int(99.8) ' Returns 99.
MyNumber = Fix(99.2) ' Returns 99.
MyNumber = Int(-99.8) ' Returns -100.
MyNumber = Fix(-99.8) ' Returns -99.
MyNumber = Int(-99.2) ' Returns -100.
MyNumber = Fix(-99.2) ' Returns -99.

Requirements

Version 1

See Also
CInt Function | Round Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
IsArray Function
Returns a Boolean value indicating whether a variable is an array.
IsArray(varname)

The varname argument can be any variable.

Remarks

IsArray returns True if the variable is an array; otherwise, it returns


False. IsArray is especially useful with variants containing arrays.
The following example uses the IsArray function to test whether
MyVariable is an array: Dim MyVariable Dim MyArray(3) MyArray(0)
= "Sunday" MyArray(1) = "Monday" MyArray(2) = "Tuesday"
MyVariable = IsArray(MyArray) ' MyVariable contains "True".

Requirements

Version 1

See Also

IsDate Function | IsEmpty Function | IsNull Function | IsNumeric


Function | IsObject Function | VarType Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
IsDate Function
Returns a Boolean value indicating whether an expression can be
converted to a date.
IsDate(expression)

The expression argument can be any date expression or string


expression recognizable as a date or time.

Remarks

IsDate returns True if the expression is a date or can be converted


to a valid date; otherwise, it returns False. In Microsoft Windows, the
range of valid dates is January 1, 100 A.D. through December 31,
9999 A.D.; the ranges vary among operating systems.
The following example uses the IsDate function to determine
whether an expression can be converted to a date:
Dim MyDate, YourDate, NoDate, MyCheck
MyDate = "October 19, 1962": YourDate = #10/19/62#: NoDate =
"Hello"
MyCheck = IsDate(MyDate) ' Returns True.
MyCheck = IsDate(YourDate) ' Returns True.
MyCheck = IsDate(NoDate) ' Returns False.

Requirements

Version 1

See Also

CDate Function | IsArray Function | IsEmpty Function | IsNull


Function | IsNumeric Function | IsObject Function | VarType Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
IsEmpty Function
Returns a Boolean value indicating whether a variable has been
initialized.
IsEmpty(expression)

The expression argument can be any expression. However, because


IsEmpty is used to determine if individual variables are initialized,
the expression argument is most often a single variable name.

Remarks

IsEmpty returns True if the variable is uninitialized, or is explicitly set


to Empty; otherwise, it returns False. False is always returned if
expression contains more than one variable.
The following example uses the IsEmpty function to determine
whether a variable has been initialized:
Dim MyVar, MyCheck
MyCheck = IsEmpty(MyVar) ' Returns True.
MyVar = Null ' Assign Null.
MyCheck = IsEmpty(MyVar) ' Returns False.
MyVar = Empty ' Assign Empty.
MyCheck = IsEmpty(MyVar) ' Returns True.

Requirements

Version 1

See Also

IsArray Function | IsDate Function | IsNull Function | IsNumeric


Function | IsObject Function | VarType Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
IsNull Function
Returns a Boolean value that indicates whether an expression
contains no valid data (Null).
IsNull(expression)

The expression argument can be any expression.

Remarks

IsNull returns True if expression is Null, that is, it contains no valid


data; otherwise, IsNull returns False. If expression consists of more
than one variable, Null in any constituent variable causes True to be
returned for the entire expression.
The Null value indicates that the variable contains no valid data.
Null is not the same as Empty, which indicates that a variable has
not yet been initialized. It is also not the same as a zero-length string
(""), which is sometimes referred to as a null string.

Caution Use the IsNull function to determine whether an


expression contains a Null value. Expressions that you might
expect to evaluate to True under some circumstances, such as
If Var = Null and If Var <> Null, are always False. This is
because any expression containing a Null is itself Null, and
therefore, False.

The following example uses the IsNull function to determine whether


a variable contains a Null:
Dim MyVar, MyCheck
MyCheck = IsNull(MyVar) ' Returns False.
MyVar = Null ' Assign Null.
MyCheck = IsNull(MyVar) ' Returns True.
MyVar = Empty ' Assign Empty.
MyCheck = IsNull(MyVar) ' Returns False.

Requirements
Version 1

See Also

IsArray Function | IsDate Function | IsEmpty Function | IsNumeric


Function | IsObject Function | VarType Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
IsNumeric Function
Returns a Boolean value indicating whether an expression can be
evaluated as a number.
IsNumeric(expression)

The expression argument can be any expression.

Remarks

IsNumeric returns True if the entire expression is recognized as a


number; otherwise, it returns False. IsNumeric returns False if
expression is a date expression.
The following example uses the IsNumeric function to determine
whether a variable can be evaluated as a number: Dim MyVar,
MyCheck MyVar = 53 ' Assign a value. MyCheck =
IsNumeric(MyVar) ' Returns True. MyVar = "459.95" ' Assign a value.
MyCheck = IsNumeric(MyVar) ' Returns True. MyVar = "45 Help" '
Assign a value. MyCheck = IsNumeric(MyVar) ' Returns False.

Requirements

Version 1

See Also

IsArray Function | IsDate Function | IsEmpty Function | IsNull


Function | IsObject Function | VarType Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
IsObject Function
Returns a Boolean value indicating whether an expression
references a valid Automation object.
IsObject(expression)

The expression argument can be any expression.

Remarks

IsObject returns True if expression is a variable of Object subtype


or a user-defined object; otherwise, it returns False.
The following example uses the IsObject function to determine if an
identifier represents an object variable:
Dim MyInt, MyCheck, MyObject
Set MyObject = Me
MyCheck = IsObject(MyObject) ' Returns True.
MyCheck = IsObject(MyInt) ' Returns False.

Requirements

Version 1

See Also

IsArray Function | IsDate Function | IsEmpty Function | IsNull


Function | IsNumeric Function | Set Statement | VarType Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Join Function
Returns a string created by joining a number of substrings contained
in an array.
Join(list[, delimiter])

Arguments

list
Required. One-dimensional array containing substrings to be
joined.
delimiter
Optional. String character used to separate the substrings in the
returned string. If omitted, the space character (" ") is used. If
delimiter is a zero-length string, all items in the list are
concatenated with no delimiters.

Remarks

The following example uses the Join function to join the substrings
of MyArray: Dim MyString Dim MyArray(3) MyArray(0) = "Mr."
MyArray(1) = "John " MyArray(2) = "Doe " MyArray(3) = "III"
MyString = Join(MyArray) ' MyString contains "Mr. John Doe III".

Requirements

Version 2

See Also

Split Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
LBound Function
Returns the smallest available subscript for the indicated dimension
of an array.
LBound(arrayname[, dimension])

Arguments

arrayname
Name of the array variable; follows standard variable naming
conventions.
dimension
Whole number indicating which dimension's lower bound is
returned. Use 1 for the first dimension, 2 for the second, and so on.
If dimension is omitted, 1 is assumed.

Remarks

The LBound function is used with the UBound function to determine


the size of an array. Use the UBound function to find the upper limit
of an array dimension.
The lower bound for any dimension is always 0.

Requirements

Version 1

See Also

Dim Statement | ReDim Statement | UBound Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
LCase Function
Returns a string that has been converted to lowercase.
LCase(string)

The string argument is any valid string expression. If string contains


Null, Null is returned.

Remarks

Only uppercase letters are converted to lowercase; all lowercase


letters and non-letter characters remain unchanged.

The following example uses the LCase function to convert


uppercase letters to lowercase: Dim MyString Dim LCaseString
MyString = "VBSCript" LCaseString = LCase(MyString) ' LCaseString
contains "vbscript".

Requirements

Version 1

See Also

UCase Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Left Function
Returns a specified number of characters from the left side of a
string.
Left(string, length)

Arguments

string
String expression from which the leftmost characters are returned.
If string contains Null, Null is returned.
length
Numeric expression indicating how many characters to return. If 0,
a zero-length string("") is returned. If greater than or equal to the
number of characters in string, the entire string is returned.

Remarks

To determine the number of characters in string, use the Len


function.
The following example uses the Left function to return the first three
characters of MyString:
Dim MyString, LeftString
MyString = "VBSCript"
LeftString = Left(MyString, 3) ' LeftString contains "VBS".

Note The LeftB function is used with byte data contained in a


string. Instead of specifying the number of characters to return,
length specifies the number of bytes.

Requirements

Version 1
See Also

Len Function | Mid Function | Right Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Len Function
Returns the number of characters in a string or the number of bytes
required to store a variable.
Len(string | varname)

Arguments

string
Any valid string expression. If string contains Null, Null is returned.
varname
Any valid variable name. If varname contains Null, Null is returned.

Remarks

The following example uses the Len function to return the number of
characters in a string: Dim MyString MyString = Len("VBSCRIPT") '
MyString contains 8.

Note The LenB function is used with byte data contained in a


string. Instead of returning the number of characters in a string,
LenB returns the number of bytes used to represent that string.

Requirements

Version 1

See Also

InStr Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
LoadPicture Function
Returns a picture object. Available only on 32-bit platforms.
LoadPicture(picturename)

The picturename argument is a string expression that indicates the


name of the picture file to be loaded.

Remarks

Graphics formats recognized by LoadPicture include bitmap (.bmp)


files, icon (.ico) files, run-length encoded (.rle) files, metafile (.wmf)
files, enhanced metafiles (.emf), GIF (.gif) files, and JPEG (.jpg) files.

Requirements

Version 2

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Log Function
Returns the natural logarithm of a number.
Log(number)

The number argument can be any valid numeric expression greater


than 0.

Remarks

The natural logarithm is the logarithm to the base e. The constant e


is approximately 2.718282.
You can calculate base-n logarithms for any number x by dividing the
natural logarithm of x by the natural logarithm of n as follows:
Logn(x) = Log(x) / Log(n)
The following example illustrates a custom Function that calculates
base-10 logarithms: Function Log10(X) Log10 = Log(X) / Log(10)
End Function

Requirements

Version 1

See Also

Derived Math Functions | Exp Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
LTrim; RTrim; and Trim Functions
Returns a copy of a string without leading spaces (LTrim), trailing
spaces (RTrim), or both leading and trailing spaces (Trim).
LTrim(string)
RTrim(string)
Trim(string)

The string argument is any valid string expression. If string contains


Null, Null is returned.

Remarks

The following example uses the LTrim, RTrim, and Trim functions to
trim leading spaces, trailing spaces, and both leading and trailing
spaces, respectively:
Dim MyVar
MyVar = LTrim(" vbscript ") ' MyVar contains "vbscript ".
MyVar = RTrim(" vbscript ") ' MyVar contains " vbscript".
MyVar = Trim(" vbscript ") ' MyVar contains "vbscript".

Requirements

Version 1

See Also

Left Function | Right Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Math Functions
Abs Function
Atn Function
Cos Function
Exp Function
Fix Function
Int Function
Log Function
Rnd Function
Sgn Function
Sin Function
Sqr Function
Tan Function
Derived Math Functions

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Mid Function
Returns a specified number of characters from a string.
Mid(string, start[, length])

Arguments

string
String expression from which characters are returned. If string
contains Null, Null is returned.
start
Character position in string at which the part to be taken begins. If
start is greater than the number of characters in string, Mid returns
a zero-length string ("").
length
Number of characters to return. If omitted or if there are fewer than
length characters in the text (including the character at start), all
characters from the start position to the end of the string are
returned.

Remarks

To determine the number of characters in string, use the Len


function.
The following example uses the Mid function to return six characters,
beginning with the fourth character, in a string:
Dim MyVar
MyVar = Mid("VB Script is fun!", 4, 6) ' MyVar contains
"Script".

Note The MidB function is used with byte data contained in a


string. Instead of specifying the number of characters, the
arguments specify numbers of bytes.
Requirements

Version 1

See Also

Left Function | Len Function | LTrim, RTrim, and Trim Functions |


Right Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Minute
Returns a whole number between 0 and 59, inclusive, representing
the minute of the hour.
Minute(time)

The time argument is any expression that can represent a time. If


time contains Null, Null is returned.

Remarks

The following example uses the Minute function to return the minute
of the hour: Dim MyVar MyVar = Minute(Now)

Requirements

Version 1

See Also

Day Function | Hour Function | Now Function | Second Function |


Time Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Month Function
Returns a whole number between 1 and 12, inclusive, representing
the month of the year.
Month(date)

The date argument is any expression that can represent a date. If


date contains Null, Null is returned.

Remarks

The following example uses the Month function to return the current
month: Dim MyVar MyVar = Month(Now) ' MyVar contains the
number corresponding to ' the current month.

Requirements

Version 1

See Also

Date Function | Day Function | Now Function | Weekday Function |


Year Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
MonthName Function
Returns a string indicating the specified month.
MonthName(month[, abbreviate])

Arguments

month
Required. The numeric designation of the month. For example,
January is 1, February is 2, and so on.
abbreviate
Optional. Boolean value that indicates if the month name is to be
abbreviated. If omitted, the default is False, which means that the
month name is not abbreviated.

Remarks

The following example uses the MonthName function to return an


abbreviated month name for a date expression: Dim MyVar MyVar =
MonthName(10, True) ' MyVar contains "Oct".

Requirements

Version 2

See Also

WeekdayName Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
<b>MsgBox(</b><a href="" onclick="showTip(this)">prompt</a>
[<b>, </b><a href="" onclick="showTip(this)">buttons</a>][<b>,
</b><a href="" onclick="showTip(this)">title</a>][<b>, </b><a
href="" onclick="showTip(this)">helpfile</a><b>, </b><a href=""
onclick="showTip(this)">context</a>]<b>)</b>
Dim MyVar

MyVar = <code><b>MsgBox (</b></code>"Hello World!"<code>


<b>,</b></code> 65<code><b>,</b></code> "MsgBox Example"
<code><b>)</b></code> ' MyVar contains either 1 or 2, depending
on which button is clicked.

Requirements

Version 1

See Also

InputBox Function

© 2001 Microsoft Corporation. All rights reserved.

Build: Topic Version 5.6.9309.1546


Visual Basic Scripting Edition
Now
Returns the current date and time according to the setting of your
computer's system date and time.
Now

Remarks

The following example uses the Now function to return the current
date and time: Dim MyVar MyVar = Now ' MyVar contains the current
date and time.

Requirements

Version 1

See Also

Date Function | Day Function | Hour Function | Minute Function |


Month Function | Second Function | Time Function | Weekday
Function | Year Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Oct
Returns a string representing the octal value of a number.
Oct(number)

The number argument is any valid expression.

Remarks

If number is not already a whole number, it is rounded to the nearest


whole number before being evaluated.
If number is Oct returns
Null Null.
Empty Zero (0).
Up to 11 octal
Any other number
characters,

You can represent octal numbers directly by preceding numbers in


the proper range with &O. For example, &O10 is the octal notation
for decimal 8.
The following example uses the Oct function to return the octal value
of a number: Dim MyOct MyOct = Oct(4) ' Returns 4. MyOct =
Oct(8) ' Returns 10. MyOct = Oct(459) ' Returns 713.

Requirements

Version 1

See Also

Hex Function
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
<b>Replace(</b><a href=""
onclick="showTip(this)">expression</a><b>,</b> <a href=""
onclick="showTip(this)">find</a><b>, </b><a href=""
onclick="showTip(this)">replacewith</a>[<b>,</b> <a href=""
onclick="showTip(this)">start</a>[<b>,</b> <a href=""
onclick="showTip(this)">count</a>[<b>,</b> <a href=""
onclick="showTip(this)">compare</a>]]]<b>)</b>
Dim MyString

MyString = <code><b>Replace(</b></code>"XXpXXPXXp"
<code><b>,</b></code> "p"<code><b>,</b></code> "Y"<code>
<b>)</b></code> ' A binary comparison starting at the beginning
of the string. Returns "XXYXXPXXY".

MyString = <code><b>Replace(</b></code>"XXpXXPXXp"
<code><b>,</b></code> "p"<code><b>,</b></code> "Y"<code>
<b>,</b></code> ' A textual comparison starting at position 3.
Returns "YXXYXXY". 3<code><b>,</b></code> -1<code><b>,
</b></code> 1)

Requirements

Version 2

See Also

Filter Function

© 2001 Microsoft Corporation. All rights reserved.

Build: Topic Version 5.6.9309.1546


Visual Basic Scripting Edition
RGB Function
Returns a whole number representing an RGB color value.
RGB(red, green, blue)

Arguments

red
Required. Number in the range 0-255 representing the red
component of the color.
green
Required. Number in the range 0-255 representing the green
component of the color.
blue
Required. Number in the range 0-255 representing the blue
component of the color.

Remarks

Application methods and properties that accept a color specification


expect that specification to be a number representing an RGB color
value. An RGB color value specifies the relative intensity of red,
green, and blue to cause a specific color to be displayed.
The low-order byte contains the value for red, the middle byte
contains the value for green, and the high-order byte contains the
value for blue.
For applications that require the byte order to be reversed, the
following function will provide the same information with the bytes
reversed: Function RevRGB(red, green, blue) RevRGB= CLng(blue
+ (green * 256) + (red * 65536)) End Function
The value for any argument to RGB that exceeds 255 is assumed to
be 255.
Requirements

Version 2

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Right Function
Returns a specified number of characters from the right side of a
string.
Right(string, length)

Arguments

string
String expression from which the rightmost characters are
returned. If string contains Null, Null is returned.
length
Numeric expression indicating how many characters to return. If 0,
a zero-length string is returned. If greater than or equal to the
number of characters in string, the entire string is returned.

Remarks

To determine the number of characters in string, use the Len


function.
The following example uses the Right function to return a specified
number of characters from the right side of a string:
Dim AnyString, MyStr
AnyString = "Hello World" ' Define string.
MyStr = Right(AnyString, 1) ' Returns "d".
MyStr = Right(AnyString, 6) ' Returns " World".
MyStr = Right(AnyString, 20) ' Returns "Hello World".

Note The RightB function is used with byte data contained in a


string. Instead of specifying the number of characters to return,
length specifies the number of bytes.

Requirements

Version 1
See Also

Left Function | Len Function | Mid Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Rnd Function
Returns a random number.
Rnd[(number)]

The number argument can be any valid numeric expression.

Remarks

The Rnd function returns a value less than 1 but greater than or
equal to 0. The value of number determines how Rnd generates a
random number:

If number is Rnd generates


The same number every time, using number
Less than zero
as the seed.
Greater than zero The next random number in the sequence.
Equal to zero The most recently generated number.
Not supplied The next random number in the sequence.

For any given initial seed, the same number sequence is generated
because each successive call to the Rnd function uses the previous
number as a seed for the next number in the sequence.
Before calling Rnd, use the Randomize statement without an
argument to initialize the random-number generator with a seed
based on the system timer.
To produce random integers in a given range, use this formula:
Int((upperbound - lowerbound + 1) * Rnd + lowerbound)
Here, upperbound is the highest number in the range, and
lowerbound is the lowest number in the range.

Note To repeat sequences of random numbers, call Rnd with a


negative argument immediately before using Randomize with a
numeric argument. Using Randomize with the same value for
number does not repeat the previous sequence.

Requirements

Version 1

See Also

Randomize Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Round Function
Returns a number rounded to a specified number of decimal places.
Round(expression[, numdecimalplaces])

Arguments

expression
Required. Numeric expression being rounded.
numdecimalplaces
Optional. Number indicating how many places to the right of the
decimal are included in the rounding. If omitted, integers are
returned by the Round function.

Remarks

The following example uses the Round function to round a number


to two decimal places: Dim MyVar, pi pi = 3.14159 MyVar = Round(pi,
2) ' MyVar contains 3.14.

Requirements

Version 2

See Also

Int, Fix Functions

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
ScriptEngine Function
Returns a string representing the scripting language in use.
ScriptEngine

Return Values

The ScriptEngine function can return any of the following strings:


String Description
Indicates that Microsoft® Visual Basic® Scripting
VBScript
Edition is the current scripting engine.
Indicates that Microsoft JScript® is the current
JScript
scripting engine.
Indicates that Microsoft Visual Basic for Applications
VBA
is the current scripting engine.

Remarks

The following example uses the ScriptEngine function to return a


string describing the scripting language in use:
Function GetScriptEngineInfo
Dim s
s = "" ' Build string with necessary info.
s = ScriptEngine & " Version "
s = s & ScriptEngineMajorVersion & "."
s = s & ScriptEngineMinorVersion & "."
s = s & ScriptEngineBuildVersion
GetScriptEngineInfo = s ' Return the results.
End Function

Requirements

Version 2
See Also

ScriptEngineBuildVersion Function | ScriptEngineMajorVersion


Function | ScriptEngineMinorVersion Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
ScriptEngineBuildVersion Function
Returns the build version number of the scripting engine in use.
ScriptEngineBuildVersion

Remarks

The return value corresponds directly to the version information


contained in the DLL for the scripting language in use.
The following example uses the ScriptEngineBuildVersion function
to return the build version number of the scripting engine:
Function GetScriptEngineInfo
Dim s
s = "" ' Build string with necessary info.
s = ScriptEngine & " Version "
s = s & ScriptEngineMajorVersion & "."
s = s & ScriptEngineMinorVersion & "."
s = s & ScriptEngineBuildVersion
GetScriptEngineInfo = s ' Return the results.
End Function

Requirements

Version 2

See Also

ScriptEngine Function | ScriptEngineMajorVersion Function |


ScriptEngineMinorVersion Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
ScriptEngineMajorVersion Function
Returns the major version number of the scripting engine in use.
ScriptEngineMajorVersion

Remarks

The return value corresponds directly to the version information


contained in the DLL for the scripting language in use.
The following example uses the ScriptEngineMajorVersion function
to return the version number of the scripting engine:
Function GetScriptEngineInfo
Dim s
s = "" ' Build string with necessary info.
s = ScriptEngine & " Version "
s = s & ScriptEngineMajorVersion & "."
s = s & ScriptEngineMinorVersion & "."
s = s & ScriptEngineBuildVersion
GetScriptEngineInfo = s ' Return the results.
End Function

Requirements

Version 2

See Also

ScriptEngine Function | ScriptEngineBuildVersion Function |


ScriptEngineMinorVersion Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
ScriptEngineMinorVersion Function
Returns the minor version number of the scripting engine in use.
ScriptEngineMinorVersion

Remarks

The return value corresponds directly to the version information


contained in the DLL for the scripting language in use.
The following example uses the ScriptEngineMinorVersion
function to return the minor version number of the scripting engine:
Function GetScriptEngineInfo
Dim s
s = "" ' Build string with necessary info.
s = ScriptEngine & " Version "
s = s & ScriptEngineMajorVersion & "."
s = s & ScriptEngineMinorVersion & "."
s = s & ScriptEngineBuildVersion
GetScriptEngineInfo = s ' Return the results.
End Function

Requirements

Version 2

See Also

ScriptEngine Function | ScriptEngineBuildVersion Function |


ScriptEngineMajorVersion Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Second Function
Returns a whole number between 0 and 59, inclusive, representing
the second of the minute.
Second(time)

The time argument is any expression that can represent a time. If


time contains Null, Null is returned.

Remarks

The following example uses the Second function to return the


current second: Dim MySec MySec = Second(Now) ' MySec contains
the number representing the current second.

Requirements

Version 1

See Also

Day Function | Hour Function | Minute Function | Now Function |


Time Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
SetLocale Function
Sets the global locale and returns the previous locale.
SetLocale(lcid)

The lcid argument can be any valid 32-bit value or short string that
uniquely identifies a geographical locale. Recognized values can be
found in the Locale ID chart.

Remarks

If lcid is zero, the locale is set to match the current system setting.
A locale is a set of user preference information related to the user's
language, country/region, and cultural conventions. The locale
determines such things as keyboard layout, alphabetic sort order, as
well as date, time, number, and currency formats.
The following example illustrates the use of the SetLocale function.
To use this code, paste the entire example between the <BODY>
tags of a standard HTML page.
Enter Date in UK format: <input type="text" id="UKDate"
size="20"><p>
Here's the US equivalent: <input type="text" id="USdate"
size="20"><p>
<input type="button" value="Convert" id="button1"><p>
Enter a price in German: &nbsp; <input type="text"
id="GermanNumber" size="20">
<p>
Here's the UK equivalent: <input type="text" id="USNumber"
size="20"><p>
<input type="button" value="Convert" id="button2"><p>

<script language="vbscript">
Dim currentLocale
' Get the current locale
currentLocale = GetLocale

Sub Button1_onclick
Dim original
original = SetLocale("en-gb")
mydate = CDate(UKDate.value)
' IE always sets the locale to US English so use the
' currentLocale variable to set the locale to US English
original = SetLocale(currentLocale)
USDate.value = FormatDateTime(mydate,vbShortDate)
End Sub

Sub button2_onclick
Dim original
original = SetLocale("de")
myvalue = CCur(GermanNumber.value)
original = SetLocale("en-gb")
USNumber.value = FormatCurrency(myvalue)
End Sub

</script>

See Also

GetLocale Function | Locale ID (LCID) Chart

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Sgn Function
Returns an integer indicating the sign of a number.
Sgn(number)

The number argument can be any valid numeric expression.

Return Values

The Sgn function has the following return values:

If number is Sgn returns


Greater than zero 1
Equal to zero 0
Less than zero -1

Remarks

The sign of the number argument determines the return value of the
Sgn function.
The following example uses the Sgn function to determine the sign
of a number: Dim MyVar1, MyVar2, MyVar3, MySign MyVar1 = 12:
MyVar2 = -2.4: MyVar3 = 0 MySign = Sgn(MyVar1) ' Returns 1.
MySign = Sgn(MyVar2) ' Returns -1. MySign = Sgn(MyVar3) '
Returns 0.

Requirements

Version 1

See Also

Abs Function
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Sleep Function
Pause specifies the number of milliseconds.
Sleep(int miliseconds)

The parameter represents the number of milliseconds you want to


pause.

Remarks

The Sleep function allows a user program to remain inactive for a


period of time.When the timer set by the function expires, the
program continues to execute.
Dim MyTime
MyTime = 1000 'Set pause time。
sleep(MyTime) 'Execute the script。

Requirements

Version 1

See Also

Abs Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Sin Function
Returns the sine of an angle.
Sin(number)

The number argument can be any valid numeric expression that


expresses an angle in radians.

Remarks

The Sin function takes an angle and returns the ratio of two sides of
a right triangle. The ratio is the length of the side opposite the angle
divided by the length of the hypotenuse. The result lies in the range
-1 to 1.
To convert degrees to radians, multiply degrees by pi /180. To
convert radians to degrees, multiply radians by 180/pi.
The following example uses the Sin function to return the sine of an
angle:
Dim MyAngle, MyCosecant
MyAngle = 1.3 ' Define angle in radians.
MyCosecant = 1 / Sin(MyAngle) ' Calculate cosecant.

Requirements

Version 1

See Also

Atn Function | Cos Function | Derived Math Functions | Tan Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Space Function
Returns a string consisting of the specified number of spaces.
Space(number)

The number argument is the number of spaces you want in the


string.

Remarks

The following example uses the Space function to return a string


consisting of a specified number of spaces: Dim MyString MyString =
Space(10) ' Returns a string with 10 spaces. MyString = "Hello" &
Space(10) & "World" ' Insert 10 spaces between two strings.

Requirements

Version 1

See Also

String Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Split Function
Returns a zero-based, one-dimensional array containing a specified
number of substrings.
Split(expression[, delimiter[, count[, compare]]])

Arguments

expression
Required. String expression containing substrings and delimiters. If
expression is a zero-length string, Split returns an empty array,
that is, an array with no elements and no data.
delimiter
Optional. String character used to identify substring limits. If
omitted, the space character (" ") is assumed to be the delimiter. If
delimiter is a zero-length string, a single-element array containing
the entire expression string is returned.
count
Optional. Number of substrings to be returned; -1 indicates that all
substrings are returned.
compare
Optional. Numeric value indicating the kind of comparison to use
when evaluating substrings. See Settings section for values.

Settings

The compare argument can have the following values:

Constant Value Description


vbBinaryCompare 0 Perform a binary comparison.
vbTextCompare 1 Perform a textual comparison.

Remarks
The following example uses the Split function to return an array from
a string. The function performs a textual comparison of the delimiter,
and returns all of the substrings.
Dim MyString, MyArray, Msg
MyString = "VBScriptXisXfun!"
MyArray = Split(MyString, "x", -1, 1)
' MyArray(0) contains "VBScript".
' MyArray(1) contains "is".
' MyArray(2) contains "fun!".
Msg = MyArray(0) & " " & MyArray(1)
Msg = Msg & " " & MyArray(2)
MsgBox Msg

Requirements

Version 2

See Also

Join Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Sqr Function
Returns the square root of a number.
Sqr(number)

The number argument can be any valid numeric expression greater


than or equal to 0.

Remarks

The following example uses the Sqr function to calculate the square
root of a number: Dim MySqr MySqr = Sqr(4) ' Returns 2. MySqr =
Sqr(23) ' Returns 4.79583152331272. MySqr = Sqr(0) ' Returns 0.
MySqr = Sqr(-4) ' Generates a run-time error.

Requirements

Version 1

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
<b>StrComp(</b><a href="" onclick="showTip(this)">string1</a>
<b>, </b><a href="" onclick="showTip(this)">string2</a>[<b>,
</b><a href="" onclick="showTip(this)">compare</a>]<b>)</b>

Dim MyStr1, MyStr2, MyComp

MyStr1 = "ABCD": MyStr2 = "abcd" ' Define variables.

MyComp = <code><b>StrComp(</b></code>MyStr1<code><b>,
</b></code> MyStr2<code><b>,</b></code> 1<code><b>)</b>
</code> ' Returns 0.

MyComp = <code><b>StrComp(</b></code>MyStr1<code><b>,
</b></code> MyStr2<code><b>,</b></code> 0<code><b>)</b>
</code> ' Returns -1.

MyComp = <code><b>StrComp(</b></code>MyStr2<code><b>,
</b></code> MyStr1<code><b>)</b></code> ' Returns 1.

Requirements

Version 1

© 2001 Microsoft Corporation. All rights reserved.

Build: Topic Version 5.6.9309.1546


Visual Basic Scripting Edition
String Function
Returns a repeating character string of the length specified.
String(number, character)

Arguments

number
Length of the returned string. If number contains Null, Null is
returned.
character
Character code specifying the character or string expression
whose first character is used to build the return string. If character
contains Null, Null is returned.

Remarks

If you specify a number for character greater than 255, String


converts the number to a valid character code using the formula:
character Mod 256
The following example uses the String function to return repeating
character strings of the length specified: Dim MyString MyString =
String(5, "*") ' Returns "*****". MyString = String(5, 42) ' Returns
"*****". MyString = String(10, "ABC") ' Returns "AAAAAAAAAA".

Requirements

Version 1

See Also

Space Function
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
StrReverse Function
Returns a string in which the character order of a specified string is
reversed.
StrReverse(string1)

The string1 argument is the string whose characters are to be


reversed. If string1 is a zero-length string (""), a zero-length string is
returned. If string1 is Null, an error occurs.

Remarks

The following example uses the StrReverse function to return a


string in reverse order: Dim MyStr MyStr = StrReverse("VBScript") '
MyStr contains "tpircSBV".

Requirements

Version 2

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Tan Function
Returns the tangent of an angle.
Tan(number)

The number argument can be any valid numeric expression that


expresses an angle in radians.

Remarks

Tan takes an angle and returns the ratio of two sides of a right
triangle. The ratio is the length of the side opposite the angle divided
by the length of the side adjacent to the angle.
To convert degrees to radians, multiply degrees by pi /180. To
convert radians to degrees, multiply radians by 180/pi.
The following example uses the Tan function to return the tangent of
an angle:
Dim MyAngle, MyCotangent
MyAngle = 1.3 ' Define angle in radians.
MyCotangent = 1 / Tan(MyAngle) ' Calculate cotangent.

Requirements

Version 1

See Also

Atn Function | Cos Function | Derived Math Functions | Sin Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Time Function
Returns a Variant of subtype Date indicating the current system
time.
Time

Remarks

The following example uses the Time function to return the current
system time: Dim MyTime MyTime = Time ' Return current system
time.

Requirements

Version 1

See Also

Date Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Timer Function
Returns the number of seconds that have elapsed since 12:00 AM
(midnight).
Timer

Remarks

The following example uses the Timer function to determine the time
it takes to iterate a For...Next loop N times: Function TimeIt(N) Dim
StartTime, EndTime StartTime = Timer For I = 1 To N Next EndTime
= Timer TimeIt = EndTime - StartTime End Function

Requirements

Version 5

See Also

Randomize Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
TimeSerial Function
Returns a Variant of subtype Date containing the time for a specific
hour, minute, and second.
TimeSerial(hour, minute, second)

Arguments

hour
Number between 0 (12:00 A.M.) and 23 (11:00 P.M.), inclusive, or a
numeric expression.
minute
Any numeric expression.
second
Any numeric expression.

Remarks

To specify a time, such as 11:59:59, the range of numbers for each


TimeSerial argument should be in the accepted range for the unit;
that is, 0–23 for hours and 0–59 for minutes and seconds. However,
you can also specify relative times for each argument using any
numeric expression that represents some number of hours, minutes,
or seconds before or after a certain time.
The following example uses expressions instead of absolute time
numbers. The TimeSerial function returns a time for 15 minutes
before (-15) six hours before noon (12 - 6), or 5:45:00 A.M.
Dim MyTime1
MyTime1 = TimeSerial(12 - 6, -15, 0) ' Returns 5:45:00 AM.

When any argument exceeds the accepted range for that argument,
it increments to the next larger unit as appropriate. For example, if
you specify 75 minutes, it is evaluated as one hour and 15 minutes.
However, if any single argument is outside the range -32,768 to
32,767, or if the time specified by the three arguments, either directly
or by expression, causes the date to fall outside the acceptable
range of dates, an error occurs.

Requirements

Version 1

See Also

DateSerial Function | DateValue Function | Hour Function | Minute


Function | Now Function | Second Function | TimeValue Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
TimeValue
Returns a Variant of subtype Date containing the time.
TimeValue(time)

The time argument is usually a string expression representing a time


from 0:00:00 (12:00:00 A.M.) to 23:59:59 (11:59:59 P.M.), inclusive.
However, time can also be any expression that represents a time in
that range. If time contains Null, Null is returned.

Remarks

You can enter valid times using a 12-hour or 24-hour clock. For
example, "2:24PM" and "14:24" are both valid time arguments. If the
time argument contains date information, TimeValue doesn't return
the date information. However, if time includes invalid date
information, an error occurs.
The following example uses the TimeValue function to convert a
string to a time. You can also use date literals to directly assign a
time to a Variant (for example, MyTime = #4:35:17 PM#).
Dim MyTime
MyTime = TimeValue("4:35:17 PM") ' MyTime contains 4:35:17
PM.

Requirements

Version 1

See Also

DateSerial Function | DateValue Function | Hour Function | Minute


Function | Now Function | Second Function | TimeSerial Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
TypeName(<i>varname</i>)

Dim ArrayVar(4), MyType

NullVar = Null ' Assign Null value.

MyType = <code><b>TypeName(</b></code>"VBScript"<code>
<b>)</b></code> ' Returns "String".

MyType = <code><b>TypeName(</b></code>4<code><b>)</b>
</code> ' Returns "Integer".

MyType = <code><b>TypeName(</b></code>37.50<code><b>)
</b></code> ' Returns "Double".

MyType = <code><b>TypeName(</b></code>NullVar<code><b>)
</b></code> ' Returns "Null".

MyType = <code><b>TypeName(</b></code>ArrayVar<code>
<b>)</b></code> ' Returns "Variant()".

Requirements

Version 2

See Also

IsArray Function | IsDate Function | IsEmpty Function | IsNull


Function | IsNumeric Function | IsObject Function | VarType
Function
© 2001 Microsoft Corporation. All rights reserved.

Build: Topic Version 5.6.9309.1546


Visual Basic Scripting Edition
UBound Function
Returns the largest available subscript for the indicated dimension of
an array.
UBound(arrayname[, dimension])

Arguments

arrayname
Required. Name of the array variable; follows standard variable
naming conventions.
dimension
Optional. Whole number indicating which dimension's upper bound
is returned. Use 1 for the first dimension, 2 for the second, and so
on. If dimension is omitted, 1 is assumed.

Remarks

The UBound function is used with the LBound function to determine


the size of an array. Use the LBound function to find the lower limit
of an array dimension.
The lower bound for any dimension is always 0. As a result, UBound
returns the following values for an array with these dimensions:
Dim A(100,3,4)

Return
Statement
Value
UBound(A, 1) 100
UBound(A, 2) 3
UBound(A, 3) 4

Requirements
Version 1

See Also

Dim Statement | LBound Function | ReDim Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
UCase Function
Returns a string that has been converted to uppercase.
UCase(string)

The string argument is any valid string expression. If string contains


Null, Null is returned.

Remarks

Only lowercase letters are converted to uppercase; all uppercase


letters and non-letter characters remain unchanged.
The following example uses the UCase function to return an
uppercase version of a string: Dim MyWord MyWord = UCase("Hello
World") ' Returns "HELLO WORLD".

Requirements

Version 1

See Also

LCase Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
VarType(<i>varname</i>)
Dim MyCheck

MyCheck = <code><b>VarType(</b></code>300<code><b>)</b>
</code> ' Returns 2.

MyCheck = <code><b>VarType(</b></code>#10/19/62#<code>
<b>)</b></code> ' Returns 7.

MyCheck = <code><b>VarType(</b></code>"VBScript"<code>
<b>)</b></code> ' Returns 8.

Requirements

Version 1

See Also

IsArray Function | IsDate Function | IsEmpty Function | IsNull


Function | IsNumeric Function | IsObject Function | TypeName
Function

© 2001 Microsoft Corporation. All rights reserved.

Build: Topic Version 5.6.9309.1546


<b>Weekday(</b><a href="" onclick="showTip(this)">date</a>,
[<a href="" onclick="showTip(this)">firstdayofweek</a>]<b>)
</b>

Dim MyDate, MyWeekDay

MyDate = #October 19, 1962# ' Assign a date.

MyWeekDay = <code><b>Weekday(</b></code>MyDate<code>
<b>)</b></code> ' MyWeekDay contains 6 because MyDate
represents a Friday.

Requirements

Version 1

See Also

Date Function | Day Function | Month Function | Now Function |


Year Function

© 2001 Microsoft Corporation. All rights reserved.

Build: Topic Version 5.6.9309.1546


<b>WeekdayName(</b><a href=""
onclick="showTip(this)">weekday</a><b>,</b> <a href=""
onclick="showTip(this)">abbreviate</a><b>,</b> <a href=""
onclick="showTip(this)">firstdayofweek</a><b>)</b>
Dim MyDate

MyDate = <code><b>WeekDayName(</b></code>6, True<code>


<b>)</b></code> ' MyDate contains Fri.

Requirements

Version 2

See Also

MonthName Function

© 2001 Microsoft Corporation. All rights reserved.

Build: Topic Version 5.6.9309.1546


Visual Basic Scripting Edition
Year Function
Returns a whole number representing the year.
Year(date)

The date argument is any expression that can represent a date. If


date contains Null, Null is returned.

Remarks

The following example uses the Year function to obtain the year from
a specified date: Dim MyDate, MyYear MyDate = #October 19,
1962# ' Assign a date. MyYear = Year(MyDate) ' MyYear contains
1962.

Requirements

Version 1

See Also

Date Function | Day Function | Month Function | Now Function |


Weekday Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
VBScript Keywords
Empty
False
Nothing
Null
True

Related Sections

VBScript Langauge Reference

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Empty
The Empty keyword is used to indicate an uninitialized variable
value. This is not the same thing as Null.

See Also

Null

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
False
The False keyword has a value equal to 0.

See Also

True

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Nothing
The Nothing keyword in VBScript is used to disassociate an object
variable from any actual object. Use the Set statement to assign
Nothing to an object variable. For example:
Set MyObject = Nothing

Several object variables can refer to the same actual object. When
Nothing is assigned to an object variable, that variable no longer
refers to any actual object. When several object variables refer to the
same object, memory and system resources associated with the
object to which the variables refer are released only after all of them
have been set to Nothing, either explicitly using Set, or implicitly
after the last object variable set to Nothing goes out of scope.

See Also

Dim Statement | Set Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Null
The Null keyword is used to indicate that a variable contains no valid
data. This is not the same thing as Empty.

See Also

Empty

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
True
The True keyword has a value equal to -1.

See Also

False

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Methods
In This Section

Clear Method
Execute Method
Raise Method
Replace Method
Test Method

Related Sections

VBScript Langauge Reference

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Clear Method
Clears all property settings of the Err object.
object.Clear

The object is always the Err object.

Remarks

Use Clear to explicitly clear the Err object after an error has been
handled. This is necessary, for example, when you use deferred
error handling with On Error Resume Next. VBScript calls the Clear
method automatically whenever any of the following statements is
executed:

On Error Resume Next


Exit Sub
Exit Function

The following example illustrates use of the Clear method.


On Error Resume Next
Err.Raise 6 ' Raise an overflow error.
MsgBox ("Error # " & CStr(Err.Number) & " " & Err.Description)
Err.Clear ' Clear the error.

Requirements

Version 1

See Also

Description Property | Err Object | Number Property | OnError


Statement | Raise Method | Source Property
Applies To: Err Object
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Execute Method
Executes a regular expression search against a specified string.
object.Execute(string)

Arguments

object
Required. Always the name of a RegExp object.
string
Required. The text string upon which the regular expression is
executed.

Remarks

The actual pattern for the regular expression search is set using the
Pattern property of the RegExp object.
The Execute method returns a Matches collection containing a
Match object for each match found in string. Execute returns an
empty Matches collection if no match is found.
The following code illustrates the use of the Execute method.
Function RegExpTest(patrn, strng)
Dim regEx, Match, Matches ' Create variable.
Set regEx = New RegExp ' Create a regular expression.
regEx.Pattern = patrn ' Set pattern.
regEx.IgnoreCase = True ' Set case insensitivity.
regEx.Global = True ' Set global applicability.
Set Matches = regEx.Execute(strng) ' Execute search.
For Each Match in Matches ' Iterate Matches collection.
RetStr = RetStr & "Match found at position "
RetStr = RetStr & Match.FirstIndex & ". Match Value is '"
RetStr = RetStr & Match.Value & "'." & vbCRLF
Next
RegExpTest = RetStr
End Function
MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))
Requirements

Version 5

See Also

Replace Method | Test Method


Applies To: RegExp Object

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Raise Method
Generates a run-time error.
object.Raise(number, source, description, helpfile,
helpcontext)

Arguments

object
Always the Err object.
number
A Long integer subtype that identifies the nature of the error.
VBScript errors (both VBScript-defined and user-defined errors)
are in the range 0–65535.
source
A string expression naming the object or application that originally
generated the error. When setting this property for an Automation
object, use the form project.class. If nothing is specified, the
programmatic ID of the current VBScript project is used.
description
A string expression describing the error. If unspecified, the value in
number is examined. If it can be mapped to a VBScript run-time
error code, a string provided by VBScript is used as description. If
there is no VBScript error corresponding to number, a generic error
message is used.
helpfile
The fully qualified path to the Help file in which help on this error
can be found. If unspecified, VBScript uses the fully qualified drive,
path, and file name of the VBScript Help file.
helpcontext
The context ID identifying a topic within helpfile that provides help
for the error. If omitted, the VBScript Help file context ID for the
error corresponding to the number property is used, if it exists.

Remarks
All the arguments are optional except number. If you use Raise,
however, without specifying some arguments, and the property
settings of the Err object contain values that have not been cleared,
those values become the values for your error.
When setting the number property to your own error code in an
Automation object, you add your error code number to the constant
vbObjectError. For example, to generate the error number 1050,
assign vbObjectError + 1050 to the number property.
The following example illustrates use of the Raise method.
On Error Resume Next
Err.Raise 6 ' Raise an overflow error.
MsgBox ("Error # " & CStr(Err.Number) & " " & Err.Description)
Err.Clear ' Clear the error.

Requirements

Version 1

See Also

Clear Method | Description Property | Err Object | Number Property


Source Property
Applies To: Err Object

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Replace Method
Replaces text found in a regular expression search.
object.Replace(string1, string2)

Arguments

object
Required. Always the name of a RegExp object.
string1
Required. String1 is the text string in which the text replacement is
to occur.
string2
Required. String2 is the replacement text string.

Remarks

The actual pattern for the text being replaced is set using the
Pattern property of the RegExp object.
The Replace method returns a copy of string1 with the text of
RegExp.Pattern replaced with string2. If no match is found, a copy
of string1 is returned unchanged.
The following code illustrates use of the Replace method.
Function ReplaceTest(patrn, replStr)
Dim regEx, str1 ' Create variables.
str1 = "The quick brown fox jumped over the lazy dog."
Set regEx = New RegExp ' Create regular
expression.
regEx.Pattern = patrn ' Set pattern.
regEx.IgnoreCase = True ' Make case insensitive.
ReplaceTest = regEx.Replace(str1, replStr) ' Make
replacement.
End Function

MsgBox(ReplaceTest("fox", "cat")) ' Replace 'fox' with


'cat'.
In addition, the Replace method can replace subexpressions in the
pattern. The following call to the function shown in the previous
example swaps each pair of words in the original string:
MsgBox(ReplaceText("(\S+)(\s+)(\S+)", "$3$2$1")) ' Swap pairs of
words.

Requirements

Version 5

See Also

Execute Method | Test Method


Applies To: RegExp Object

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Test Method
Executes a regular expression search against a specified string and
returns a Boolean value that indicates if a pattern match was found.
object.Test(string)

Arguments

object
Required. Always the name of a RegExp object.
string
Required. The text string upon which the regular expression is
executed.

Remarks

The actual pattern for the regular expression search is set using the
Pattern property of the RegExp object. The RegExp.Global
property has no effect on the Test method.
The Test method returns True if a pattern match is found; False if no
match is found.
The following code illustrates the use of the Test method.
Function RegExpTest(patrn, strng)
Dim regEx, retVal ' Create variable.
Set regEx = New RegExp ' Create regular expression.
regEx.Pattern = patrn ' Set pattern.
regEx.IgnoreCase = False ' Set case sensitivity.
retVal = regEx.Test(strng) ' Execute the search test.
If retVal Then
RegExpTest = "One or more matches were found."
Else
RegExpTest = "No match was found."
End If
End Function
MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))
Requirements

Version 5

See Also

Execute Method | Replace Method


Applies To: RegExp Object

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Miscellaneous
In This Section

Character Set (0 - 127)


Character Set (128 - 255)
Locale ID (LCID) Chart

Related Sections

VBScript Langauge Reference

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Character Set (0 - 127)
The following table lists 0 - 127.

Code Char Code Char Code Char Code Char


0 32 [space] 64 @ 96 `
1 33 ! 65 A 97 a
2 34 " 66 B 98 b
3 35 # 67 C 99 c
4 36 $ 68 D 100 d
5 37 % 69 E 101 e
6 38 & 70 F 102 f
7 39 ' 71 G 103 g
8 ** 40 ( 72 H 104 h
9 ** 41 ) 73 I 105 i
10 ** 42 * 74 J 106 j
11 43 + 75 K 107 k
12 44 , 76 L 108 l
13 ** 45 - 77 M 109 m
14 46 . 78 N 110 n
15 47 / 79 O 111 o
16 48 0 80 P 112 p
17 49 1 81 Q 113 q
18 50 2 82 R 114 r
19 51 3 83 S 115 s
20 52 4 84 T 116 t
21 53 5 85 U 117 u
22 54 6 86 V 118 v
23 55 7 87 W 119 w
24 56 8 88 X 120 x
25 57 9 89 Y 121 y
26 58 : 90 Z 122 z
27 59 ; 91 [ 123 {
28 60 < 92 \ 124 |
29 61 = 93 ] 125 }
30 - 62 > 94 ^ 126 ~
31 63 ? 95 _ 127
** Values 8, 9, 10, and 13 convert to backspace, tab, linefeed, and
carriage return characters, respectively. They have no graphical
representation, but depending on the application, may affect the
visual display of text.
Not supported on the current platform.

See Also

Character Set (128 - 255)

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Character Set (128 - 255)
The following table lists 128 - 255.

Code Char Code Char Code Char Code Char


128 € 160 [space] 192 À 224 à
129 161 ¡ 193 Á 225 á
130 ‚ 162 ¢ 194 Â 226 â
131 ƒ 163 £ 195 Ã 227 ã
132 ‚‚ 164 ¤ 196 Ä 228 ä
133 … 165 ¥ 197 Å 229 å
134 † 166 ¦ 198 Æ 230 æ
135 ‡ 167 § 199 Ç 231 ç
136 ˆ 168 ¨ 200 È 231 ç
137 ‰ 169 © 201 É 232 è
138 Š 170 ª 202 Ê 233 é
139 ‹ 171 ‹‹ 203 Ë 234 ê
140 Œ 172 ¬ 204 Ì 235 ë
141 173 205 Í 236 ì
142 Ž 174 ® 206 Î 237 í
143 175 ¯ 207 Ï 238 î
144 176 ° 208 Ð 239 ï
145 ' 177 ± 209 Ñ 240 ð
146 ' 178 ² 210 Ò 241 ñ
147 " 179 ³ 211 Ó 242 ò
148 " 180 ´ 212 Ô 243 ó
149 · 181 µ 213 Õ 244 ô
150 – 182 ¶ 214 Ö 245 õ
151 — 183 · 215 × 246 ö
152 ˜ 184 ¸ 216 Ø 247 ÷
153 ™ 185 ¹ 217 Ù 248 ø
154 š 186 º 218 Ú 249 ù
155 › 187 ›› 219 Û 250 ú
156 œ 188 ¼ 220 Ü 251 û
157 189 ½ 221 Ý 252 ü
158 ž 190 ¾ 222 Þ 253 ý
159 Ÿ 191 ¿ 223 ß 254 þ

Not supported on the current platform.

See Also

Character Set (0 - 127)

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Locale ID (LCID) Chart
The following table lists Locale IDs (LCID).

Locale Short Hex Decimal Locale Short Hex Decimal


Description String Value Value Description String Value Value
Afrikaans af 0x0436 1078 Icelandic is 0x040F 1039
Albanian sq 0x041C 1052 Indonesian id 0x0421 1057
Arabic –
United Arab ar-ae 0x3801 14337 Italian - Italy it-it 0x0410 1040
Emirates
Arabic - Italian -
ar-bh 0x3C01 15361 it-ch 0x0810 2064
Bahrain Switzerland
Arabic -
ar-dz 0x1401 5121 Japanese ja 0x0411 1041
Algeria
Arabic -
ar-eg 0x0C01 3073 Korean ko 0x0412 1042
Egypt
Arabic - Iraq ar-iq 0x0801 2049 Latvian lv 0x0426 1062
Arabic -
ar-jo 0x2C01 11265 Lithuanian lt 0x0427 1063
Jordan
Arabic - FYRO
ar-kw 0x3401 13313 mk 0x042F 1071
Kuwait Macedonian
Arabic - Malay - ms-
ar-lb 0x3001 12289 0x043E 1086
Lebanon Malaysia my
Arabic - Malay –
ar-ly 0x1001 4097 ms-bn 0x083E 2110
Libya Brunei
Arabic -
ar-ma 0x1801 6145 Maltese mt 0x043A 1082
Morocco
Arabic -
ar-om 0x2001 8193 Marathi mr 0x044E 1102
Oman
Arabic - Norwegian -
ar-qa 0x4001 16385 no-no 0x0414 1044
Qatar Bokmål
Arabic - Norwegian
ar-sa 0x0401 1025 no-no 0x0814 2068
Saudi Arabia – Nynorsk
Arabic -
ar-sy 0x2801 10241 Polish pl 0x0415 1045
Syria
Arabic - ar-tn 0x1C01 7169 Portuguese pt-pt 0x0816 2070
Tunisia - Portugal
Arabic - Portuguese
ar-ye 0x2401 9217 pt-br 0x0416 1046
Yemen - Brazil
Raeto-
Armenian hy 0x042B 1067 rm 0x0417 1047
Romance
Romanian -
Azeri – Latin az-az 0x042C 1068 ro 0x0418 1048
Romania
Azeri – Romanian -
az-az 0x082C 2092 ro-mo 0x0818 2072
Cyrillic Moldova
Basque eu 0x042D 1069 Russian ru 0x0419 1049
Russian -
Belarusian be 0x0423 1059 ru-mo 0x0819 2073
Moldova
Bulgarian bg 0x0402 1026 Sanskrit sa 0x044F 1103
Serbian -
Catalan ca 0x0403 1027 sr-sp 0x0C1A 3098
Cyrillic
Chinese - Serbian –
zh-cn 0x0804 2052 sr-sp 0x081A 2074
China Latin
Chinese -
Hong Kong zh-hk 0x0C04 3076 Setsuana tn 0x0432 1074
S.A.R.
Chinese –
zh-mo 0x1404 5124 Slovenian sl 0x0424 1060
Macau S.A.R
Chinese -
zh-sg 0x1004 4100 Slovak sk 0x041B 1051
Singapore
Chinese -
zh-tw 0x0404 1028 Sorbian sb 0x042E 1070
Taiwan
Spanish -
Croatian hr 0x041A 1050 es-es 0x0C0A 1034
Spain
Spanish -
Czech cs 0x0405 1029 es-ar 0x2C0A 11274
Argentina
Spanish -
Danish da 0x0406 1030 es-bo 0x400A 16394
Bolivia
Dutch – The Spanish -
nl-nl 0x0413 1043 es-cl 0x340A 13322
Netherlands Chile
Dutch - Spanish -
nl-be 0x0813 2067 es-co 0x240A 9226
Belgium Colombia
English - en-au 0x0C09 3081 Spanish - es-cr 0x140A 5130
Australia Costa Rica
Spanish -
English -
en-bz 0x2809 10249 Dominican es-do 0x1C0A 7178
Belize
Republic
English - Spanish -
en-ca 0x1009 4105 es-ec 0x300A 12298
Canada Ecuador
English – Spanish -
en-cb 0x2409 9225 es-gt 0x100A 4106
Carribbean Guatemala
English - Spanish -
en-ie 0x1809 6153 es-hn 0x480A 18442
Ireland Honduras
English - Spanish -
en-jm 0x2009 8201 es-mx 0x080A 2058
Jamaica Mexico
English - Spanish -
en-nz 0x1409 5129 es-ni 0x4C0A 19466
New Zealand Nicaragua
English – Spanish -
en-ph 0x3409 13321 es-pa 0x180A 6154
Phillippines Panama
English - Spanish -
en-za 0x1C09 7177 es-pe 0x280A 10250
South Africa Peru
English - Spanish -
en-tt 0x2C09 11273 es-pr 0x500A 20490
Trinidad Puerto Rico
English -
Spanish -
United en-gb 0x0809 2057 es-py 0x3C0A 15370
Paraguay
Kingdom
English -
Spanish - El
United en-us 0x0409 1033 es-sv 0x440A 17418
Salvador
States
Spanish -
Estonian et 0x0425 1061 es-uy 0x380A 14346
Uruguay
Spanish -
Farsi fa 0x0429 1065 es-ve 0x200A 8202
Venezuela
Finnish fi 0x040B 1035 Sutu sx 0x0430 1072
Faroese fo 0x0438 1080 Swahili sw 0x0441 1089
French - Swedish -
fr-fr 0x040C 1036 sv-se 0x041D 1053
France Sweden
French - Swedish -
fr-be 0x080C 2060 sv-fi 0x081D 2077
Belgium Finland
French - fr-ca 0x0C0C 3084 Tamil ta 0x0449 1097
Canada
French -
fr-lu 0x140C 5132 Tatar tt 0X0444 1092
Luxembourg
French -
fr-ch 0x100C 4108 Thai th 0x041E 1054
Switzerland
Gaelic –
gd-ie 0x083C 2108 Turkish tr 0x041F 1055
Ireland
Gaelic -
gd 0x043C 1084 Tsonga ts 0x0431 1073
Scotland
German -
de-de 0x0407 1031 Ukrainian uk 0x0422 1058
Germany
German -
de-at 0x0C07 3079 Urdu ur 0x0420 1056
Austria
German - Uzbek –
de-li 0x1407 5127 uz-uz 0x0843 2115
Liechtenstein Cyrillic
German - Uzbek –
de-lu 0x1007 4103 uz-uz 0x0443 1091
Luxembourg Latin
German -
de-ch 0x0807 2055 Vietnamese vi 0x042A 1066
Switzerland
Greek el 0x0408 1032 Xhosa xh 0x0434 1076
Hebrew he 0x040D 1037 Yiddish yi 0x043D 1085
Hindi hi 0x0439 1081 Zulu zu 0x0435 1077
Hungarian hu 0x040E 1038

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Objects and Collections
In This Section

Class Object
Err Object
Matches Collection
Match Object
Regular Expression (RegExp) Object
SubMatches Collection

Related Sections

VBScript Langauge Reference

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Class Object
The object created using the Class statement. Provides access to
the events of the class.

Remarks

You cannot explicitly declare a variable to be of type Class. In the


VBScript context, the term "class object" refers to any object defined
using the VBScript Class statement.
Once you have created a class definition using the Class statement,
you can create an instance of the class using the following form: Dim
X Set X = New classname
Because VBScript is a late-bound language, you cannot do any of
the following: Dim X as New classname
-or-
Dim X
X = New classname

-or-
Set X = New Scripting.FileSystemObject

Events

Class Object Events

Requirements

Version 5

See Also

Class Statement | Dim Statement | Set Statement


© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Class Object Events
The Class object provides access to the events of the class.

Events

Initialize Event
Terminate Event

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Matches Collection
Collection of regular expression Match objects.

Remarks

A Matches collection contains individual Match objects, and can be


only created using the Execute method of the RegExp object. The
Matches collection's one property is read-only, as are the individual
Match object properties.
When a regular expression is executed, zero or more Match objects
can result. Each Match object provides access to the string found by
the regular expression, the length of the string, and an index to
where the match was found.
The following code illustrates how to obtain a Matches collection
from a regular expression search and how to iterate the collection:
Function RegExpTest(patrn, strng)
Dim regEx, Match, Matches ' Create variable.
Set regEx = New RegExp ' Create regular expression.
regEx.Pattern = patrn ' Set pattern.
regEx.IgnoreCase = True ' Set case insensitivity.
regEx.Global = True ' Set global applicability.
Set Matches = regEx.Execute(strng) ' Execute search.
For Each Match in Matches ' Iterate Matches collection.
RetStr = RetStr & "Match found at position "
RetStr = RetStr & Match.FirstIndex & ". Match Value is '"
RetStr = RetStr & Match.Value & "'." & vbCRLF
Next
RegExpTest = RetStr
End Function
MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))

Requirements

Version 1

See Also
For Each...Next Statement | Match Object | RegExp Object |
SubMatches Collection

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Err Object
Contains information about run-time errors. Accepts the Raise and
Clear methods for generating and clearing run-time errors.

Remarks

The Err object is an intrinsic object with global scope — there is no


need to create an instance of it in your code. The properties of the
Err object are set by the generator of an error — Visual Basic, an
Automation object, or the VBScript programmer.
The default property of the Err object is Number. Err.Number
contains an integer and can be used by an Automation object to
return an SCODE.
When a run-time error occurs, the properties of the Err object are
filled with information that uniquely identifies the error and
information that can be used to handle it. To generate a run-time
error in your code, use the Raise method.
The Err object's properties are reset to zero or zero-length strings
("") after an On Error Resume Next statement. The Clear method
can be used to explicitly reset Err.
The following example illustrates use of the Err object:
On Error Resume Next
Err.Raise 6 ' Raise an overflow error.
MsgBox ("Error # " & CStr(Err.Number) & " " & Err.Description)
Err.Clear ' Clear the error.

Properties and Methods

Err Object Properties and Methods

Requirements
Version 1

See Also

On Error Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Err Object Properties and Methods
The Err object contains information about run-time errors.

Properties

Description Property
HelpContext Property
HelpFile Property
Number Property
Source Property

Methods

Clear Method
Raise Method

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Match Object
Provides access to the read-only properties of a regular expression
match.

Remarks

A Match object can be only created using the Execute method of


the RegExp object, which actually returns a collection of Match
objects. All Match object properties are read-only.
When a regular expression is executed, zero or more Match objects
can result. Each Match object provides access to the string found by
the regular expression, the length of the string, and an index to
where the match was found.
The following code illustrates the use of the Match object: Function
RegExpTest(patrn, strng) Dim regEx, Match, Matches ' Create
variable. Set regEx = New RegExp ' Create regular expression.
regEx.Pattern = patrn ' Set pattern. regEx.IgnoreCase = True ' Set
case insensitivity. regEx.Global = True ' Set global applicability. Set
Matches = regEx.Execute(strng) ' Execute search. For Each Match
in Matches ' Iterate Matches collection. RetStr = RetStr & "Match " &
I & " found at position " RetStr = RetStr & Match.FirstIndex & ". Match
Value is "' RetStr = RetStr & Match.Value & "'." & vbCRLF Next
RegExpTest = RetStr End Function MsgBox(RegExpTest("is.", "IS1
is2 IS3 is4"))

Properties

Match Object Properties

Requirements

Version 5
See Also

Matches Collection | RegExp Object | SubMatches Colleciton

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Match Object Properties
The Match object provides access to the read-only properties of a
regular expression match.

Properties

FirstIndex Property
Length Property
Value Property

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Regular Expression (RegExp) Object
Provides simple regular expression support.

Remarks

The following code illustrates the use of the RegExp object.


Function RegExpTest(patrn, strng)
Dim regEx, Match, Matches ' Create variable.
Set regEx = New RegExp ' Create a regular expression.
regEx.Pattern = patrn ' Set pattern.
regEx.IgnoreCase = True ' Set case insensitivity.
regEx.Global = True ' Set global applicability.
Set Matches = regEx.Execute(strng) ' Execute search.
For Each Match in Matches ' Iterate Matches collection.
RetStr = RetStr & "Match found at position "
RetStr = RetStr & Match.FirstIndex & ". Match Value is '"
RetStr = RetStr & Match.Value & "'." & vbCRLF
Next
RegExpTest = RetStr
End Function
MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))

Properties and Methods

Regular Expression Object Properties and Methods

Requirements

Version 5

See Also

Match Object | Matches Collection

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Regular Expression Object
Properties and Methods
The Regular Expression object provides simple regular expression
support.

Properties

Global Property
IgnoreCase Property
Pattern Property

Methods

Execute Method
Replace Method
Test Method

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
SubMatches Collection
Collection of regular expression submatch strings.

Remarks

A SubMatches collection contains individual submatch strings, and


can only be created using the Execute method of the RegExp
object. The SubMatches collection's properties are read-only
When a regular expression is executed, zero or more submatches
can result when subexpressions are enclosed in capturing
parentheses. Each item in the SubMatches collection is the string
found and captured by the regular expression.
The following code illustrates how to obtain a SubMatches collection
from a regular expression search and how to access its individual
members:
Function SubMatchTest(inpStr)
Dim oRe, oMatch, oMatches
Set oRe = New RegExp
' Look for an e-mail address (not a perfect RegExp)
oRe.Pattern = "(\w+)@(\w+)\.(\w+)"
' Get the Matches collection
Set oMatches = oRe.Execute(inpStr)
' Get the first item in the Matches collection
Set oMatch = oMatches(0)
' Create the results string.
' The Match object is the entire match - [email protected]
retStr = "Email address is: " & oMatch & vbNewline
' Get the sub-matched parts of the address.
retStr = retStr & "Email alias is: " & oMatch.SubMatches(0)
' dragon
retStr = retStr & vbNewline
retStr = retStr & "Organization is: " & oMatch.
SubMatches(1)' xyzzy
SubMatchTest = retStr
End Function

MsgBox(SubMatchTest("Please send mail to [email protected].


Thanks!"))
Requirements

Version 5.5

See Also

For Each...Next Statement | Match Object | Matches Collection


|RegExp Object

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Operators
In This Section

Operator Precedence
Operator Summary
Arithmetic Operators
Comparison Operators
Concatenation Operators
Logical Operators

Related Sections

VBScript Langauge Reference

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Addition Operator (+)
Sums two numbers.
result = expression1 + expression2

Arguments

result
Any numeric variable.
expression1
Any expression.
expression2
Any expression.

Remarks

Although you can also use the + operator to concatenate two


character strings, you should use the & operator for concatenation to
eliminate ambiguity and provide self-documenting code.
When you use the + operator, you may not be able to determine
whether addition or string concatenation will occur.
The underlying subtype of the expressions determines the behavior
of the + operator in the following way:

If Then
Both expressions are numeric Add.
Both expressions are strings Concatenate.
One expression is numeric and the other
Add.
is a string

If one or both expressions are Null expressions, result is Null. If both


expressions are Empty, result is an Integer subtype. However, if only
one expression is Empty, the other expression is returned
unchanged as result.
Requirements

Version 1

See Also

& Operator | - Operator | Arithmetic Operators | Concatenation


Operators | Operator Precedence | Operator Summary

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
<a href="" onclick="showTip(this)">result</a> <b>=</b> <a
href="" onclick="showTip(this)">expression1</a> <b>And</b> <a
href="" onclick="showTip(this)">expression2</a>

Arguments

result
Any numeric variable.
expression1
Any expression.
expression2
Any expression.

Remarks

If, and only if, both expressions evaluate to True, result is True. If
either expression evaluates to False, result is False. The following
table illustrates how result is determined:

If expression1 is And expression2 is The result is


True True True
True False False
True Null Null
False True False
False False False
False Null False
Null True Null
Null False False
Null Null Null

The And operator also performs a bitwise comparison of


identically positioned bits in two numeric expressions and sets the
corresponding bit in result according to the following table:

If bit in And bit in


The result is
expression1 is expression2 is
0 0 0
0 1 0
1 0 0
1 1 1

Requirements

Version 1

See Also

Logical Operators | Not Operator | Operator Precedence | Operator


Summary | Or Operator | Xor Operator

© 2001 Microsoft Corporation. All rights reserved.

Build: Topic Version 5.6.9309.1546


Visual Basic Scripting Edition
Arithmetic Operators
^ Operator
* Operator
/ Operator
\ Operator
Mod Operator
+ Operator
- Operator
Concatenation Operators

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Assignment Operator (=)
Assigns a value to a variable or property.
variable = value

Arguments

variable
Any variable or any writable property.
value
Any numeric or string literal, constant, or expression.

Remarks

The name on the left side of the equal sign can be a simple scalar
variable or an element of an array. Properties on the left side of the
equal sign can only be those properties that are writable at run time.

Requirements

Version 1

See Also

Comparison Operators | Operator Precedence | Operator Summary |


Set Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
<a href="" onclick="showTip(this)">result</a> <b>=</b>
expression1 <a href=""
onclick="showTip(this)">comparisonoperator</a> expression2

<i><a href="" onclick="showTip(this)">result</a> </i><b>=</b>


<i>object1</i><b> Is </b><i>object2</i>

Parts

result
Any numeric variable.
expression
Any expression.
comparisonoperator
Any comparison operator.
object
Any object name.

Remarks

The Is operator has specific comparison functionality that differs


from the operators in the following table. The following table
contains a list of the comparison operators and the conditions that
determine whether result is True, False, or Null:

Operator Description True if False if Null if


expression1
expression1
expression1 < or
< Less than >=
expression2 expression2
expression2
= Null
<= Less than or expression1 expression1 expression1
equal to <= > or
expression2 expression2 expression2
= Null
expression1
expression1
expression1 > or
> Greater than <=
expression2 expression2
expression2
= Null
expression1
expression1 expression1
Greater than or
>= >= <
or equal to expression2
expression2 expression2
= Null
expression1
expression1
expression1 = or
= Equal to <>
expression2 expression2
expression2
= Null
expression1
expression1 expression1
or
<> Not equal to <> =
expression2
expression2 expression2
= Null

When comparing two expressions, you may not be able to easily


determine whether the expressions are being compared as numbers
or as strings.

The following table shows how expressions are compared or what


results from the comparison, depending on the underlying subtype:

If Then
Both expressions are Perform a numeric comparison.
numeric
Both expressions are
Perform a string comparison.
strings
One expression is
The numeric expression is less than the
numeric and the other is a
string expression.
string
One expression is Empty Perform a numeric comparison, using 0
and the other is numeric as the Empty expression.
Perform a string comparison, using a
One expression is Empty
zero-length string ("") as the Empty
and the other is a string
expression.
Both expressions are
The expressions are equal.
Empty

Requirements

Version 1

See Also

= Operator | Is Operator | Operator Precedence | Operator Summary

© 2001 Microsoft Corporation. All rights reserved.

Build: Topic Version 5.6.9309.1546


Visual Basic Scripting Edition
Concatenation Operator (&)
Forces string concatenation of two expressions.
result = expression1 & expression2

Arguments

result
Any variable.
expression1
Any expression.
expression2
Any expression.

Remarks

Whenever an expression is not a string, it is converted to a String


subtype. If both expressions are Null, result is also Null. However, if
only one expression is Null, that expression is treated as a zero-
length string ("") when concatenated with the other expression. Any
expression that is Empty is also treated as a zero-length string.

Requirements

Version 1

See Also

Concatenation Operators | Operator Precedence | Operator


Summary

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Concatenation Operators
& Operator
+ Operator

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Division Operator (/)
Divides two numbers and returns a floating-point result.
result = number1/number2

Arguments

result
Any numeric variable.
number1
Any numeric expression.
number2
Any numeric expression.

Remarks

If one or both expressions are Null expressions, result is Null. Any


expression that is Empty is treated as 0.

Requirements

Version 1

See Also

* Operator | \ Operator | Arithmetic Operators | Operator Precedence


| Operator Summary

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
<a href="" onclick="showTip(this)">result</a> <b>=</b> <a
href="" onclick="showTip(this)">expression1</a> <b>Eqv</b> <a
href="" onclick="showTip(this)">expression2</a>

Arguments

result
Any numeric variable.
expression1
Any expression.
expression2
Any expression.

Remarks

If either expression is Null, result is also Null. When neither


expression is Null, result is determined according to the following
table:

If expression1 is And expression2 is The result is


True True True
True False False
False True False
False False True

The Eqv operator performs a bitwise comparison of identically


positioned bits in two numeric expressions and sets the
corresponding bit in result according to the following table:
If bit in expression1 And bit in The result is
is expression2 is
0 0 1
0 1 0
1 0 0
1 1 1

Requirements

Version 1

See Also

Imp Operator | Logical Operators | Operator Precedence | Operator


Summary

© 2001 Microsoft Corporation. All rights reserved.

Build: Topic Version 5.6.9309.1546


Visual Basic Scripting Edition
Exponentiation Operator (^)
Raises a number to the power of an exponent.
result = number^exponent

Arguments

result
Any numeric variable.
number
Any numeric expression.
exponent
Any numeric expression.

Remarks

Number can be negative only if exponent is an integer value. When


more than one exponentiation is performed in a single expression,
the ^ operator is evaluated as it is encountered from left to right.
If either number or exponent is a Null expression, result is also Null.

Requirements

Version 1

See Also

Arithmetic Operators | Operator Precedence | Operator Summary

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
<a href="" onclick="showTip(this)">result</a> <b>=</b> <a
href="" onclick="showTip(this)">expression1</a> <b>Imp</b> <a
href="" onclick="showTip(this)">expression2</a>

Arguments

result
Any numeric variable.
expression1
Any expression.
expression2
Any expression.

Remarks

The following table illustrates how result is determined:

If expression1 is And expression2 is Then result is


True True True
True False False
True Null Null
False True True
False False True
False Null True
Null True True
Null False Null
Null Null Null
The Imp operator performs a bitwise comparison of identically
positioned bits in two numeric expressions and sets the
corresponding bit in result according to the following table:

If bit in expression1 And bit in


Then result is
is expression2 is
0 0 1
0 1 1
1 0 0
1 1 1

Requirements

Version 1

See Also

Eqv Operator | Logical Operators | Operator Precedence | Operator


Summary

© 2001 Microsoft Corporation. All rights reserved.

Build: Topic Version 5.6.9309.1546


Visual Basic Scripting Edition
Integer Division Operator (\)
Divides two numbers and returns an integer result.
result = number1\number2

Arguments

result
Any numeric variable.
number1
Any numeric expression.
number2
Any numeric expression.

Remarks

Before division is performed, numeric expressions are rounded to


Byte, Integer, or Long subtype expressions.
If any expression is Null, result is also Null. Any expression that is
Empty is treated as 0.

Requirements

Version 1

See Also

* Operator | / Operator | Arithmetic Operators | Operator Precedence


| Operator Summary

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Is Operator
Compares two object reference variables.
result = object1 Is object2

Arguments

result
Any numeric variable.
object1
Any object name.
object2
Any object name.

Remarks

If object1 and object2 both refer to the same object, result is True; if
they do not, result is False. Two variables can be made to refer to
the same object in several ways.
In the following example, A has been set to refer to the same object
as B: Set A = B
The following example makes A and B refer to the same object as C:
Set A = C Set B = C

Requirements

Version 1

See Also

Comparison Operators | Operator Precedence | Operator Summary


© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Logical Operators
And Operator
Not Operator
Or Operator
Xor Operator

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Mod Operator
Divides two numbers and returns only the remainder.
result = number1 Mod number2

Arguments

result
Any numeric variable.
number1
Any numeric expression.
number2
Any numeric expression.

Remarks

The modulus, or remainder, operator divides number1 by number2


(rounding floating-point numbers to integers) and returns only the
remainder as result. For example, in the following expression, A
(which is result) equals 5.
A = 19 Mod 6.7

If any expression is Null, result is also Null. Any expression that is


Empty is treated as 0.

Requirements

Version 1

See Also

Arithmetic Operators | Operator Precedence | Operator Summary


© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Multiplication Operator (*)
Multiplies two numbers.
result = number1*number2

Arguments

result
Any numeric variable.
number1
Any numeric expression.
number2
Any numeric expression.

Remarks

If one or both expressions are Null expressions, result is Null. If an


expression is Empty, it is treated as if it were 0.

Requirements

Version 1

See Also

\ Operator | Arithmetic Operators | Operator Precedence | Operator


Summary

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Not Operator
Performs logical negation on an expression.
result = Not expression

Arguments

result
Any numeric variable.
expression
Any expression.

Remarks

The following table illustrates how result is determined:


If expression is Then result is
True False
False True
Null Null

In addition, the Not operator inverts the bit values of any variable
and sets the corresponding bit in result according to the following
table:

Bit in expression Bit in result


0 1
1 0

Requirements

Version 1

See Also
And Operator | Logical Operators | Operator Precedence | Operator
Summary | Or Operator | Xor Operator

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Operator Precedence
When several operations occur in an expression, each part is
evaluated and resolved in a predetermined order called operator
precedence. Parentheses can be used to override the order of
precedence and force some parts of an expression to be evaluated
before other parts. Operations within parentheses are always
performed before those outside. Within parentheses, however,
normal operator precedence is maintained.
When expressions contain operators from more than one category,
arithmetic operators are evaluated first, comparison operators are
evaluated next, and logical operators are evaluated last. Comparison
operators all have equal precedence; that is, they are evaluated in
the left-to-right order in which they appear. Arithmetic and logical
operators are evaluated in the following order of precedence:

Arithmetic Comparison Logical


Negation (-) Equality (=) Not
Exponentiation (^) Inequality (<>) And
Multiplication and division
Less than (<) Or
(*, /)
Integer division (\) Greater than (>) Xor
Modulus arithmetic (Mod) Less than or equal to (<=) Eqv
Addition and subtraction (+, Greater than or equal to
Imp
-) (>=)
String concatenation (&) Is &

When multiplication and division occur together in an expression,


each operation is evaluated as it occurs from left to right. Likewise,
when addition and subtraction occur together in an expression, each
operation is evaluated in order of appearance from left to right.
The string concatenation operator (&) is not an arithmetic operator,
but in precedence it does fall after all arithmetic operators and before
all comparison operators. The Is operator is an object reference
comparison operator. It does not compare objects or their values; it
checks only to determine if two object references refer to the same
object.

Requirements

Version 1

See Also

Is Operator | Operator Summary

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Operator Summary
Arithmetic Operators Operators used to perform mathematical
calculations.
Assignment Operator
Operator used to assign a value to a property or variable.
Comparison Operators
Operators used to perform comparisons.
Concatenation Operators
Operators used to combine strings.
Logical Operators
Operators used to perform logical operations.

See Also

Operator Precedence

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
<a href="" onclick="showTip(this)">result</a> <b>=</b> <a
href="" onclick="showTip(this)">expression1</a> <b>Or</b> <a
href="" onclick="showTip(this)">expression2</a>

Arguments

result
Any numeric variable.
expression1
Any expression.
expression2
Any expression.

Remarks

If either or both expressions evaluate to True, result is True. The


following table illustrates how result is determined:

If expression1 is And expression2 is Then result is


True True True
True False True
True Null True
False True True
False False False
False Null Null
Null True True
Null False Null
Null Null Null
The Or operator also performs a bitwise comparison of identically
positioned bits in two numeric expressions and sets the
corresponding bit in result according to the following table:

If bit in expression1 And bit in


Then result is
is expression2 is
0 0 0
0 1 1
1 0 1
1 1 1

Requirements

Version 1

See Also

And Operator | Logical Operators | Not Operator | Operator


Precedence | Operator Summary | Xor Operator

© 2001 Microsoft Corporation. All rights reserved.

Build: Topic Version 5.6.9309.1546


Visual Basic Scripting Edition
Subtraction Operator (-)
Finds the difference between two numbers or indicates the negative
value of a numeric expression.

Syntax 1

result = number1-number2

Syntax 2

-number

Arguments

result
Any numeric variable.
number
Any numeric expression.
number1
Any numeric expression.
number2
Any numeric expression.

Remarks

In Syntax 1, the - operator is the arithmetic subtraction operator used


to find the difference between two numbers. In Syntax 2, the -
operator is used as the unary negation operator to indicate the
negative value of an expression.
If one or both expressions are Null expressions, result is Null. If an
expression is Empty, it is treated as if it were 0.

Requirements
Version 1

See Also

+ Operator | Arithmetic Operators | Operator Precedence | Operator


Summary

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
<a href="" onclick="showTip(this)">result</a> <b>=</b> <a
href="" onclick="showTip(this)">expression1</a> <b>Xor</b> <a
href="" onclick="showTip(this)">expression2</a>

Arguments

result
Any numeric variable.
expression1
Any expression.
expression2
Any expression.

Remarks

If one, and only one, of the expressions evaluates to True, result is


True. However, if either expression is Null, result is also Null.
When neither expression is Null, result is determined according to
the following table:

If expression1 is And expression2 is Then result is


True True False
True False True
False True True
False False False

The Xor operator also performs a bitwise comparison of identically


positioned bits in two numeric expressions and sets the
corresponding bit in result according to the following table:
If bit in expression1 And bit in
Then result is
is expression2 is
0 0 0
0 1 1
1 0 1
1 1 0

Requirements

Version 1

See Also

And Operator | Logical Operators | Not Operator | Operator


Precedence | Operator Summary | Or Operator

© 2001 Microsoft Corporation. All rights reserved.

Build: Topic Version 5.6.9309.1546


Visual Basic Scripting Edition
Properties
In This Section

Description Property
FirstIndex Property
Global Property
HelpContext Property
HelpFile Property
IgnoreCase Property
Length Property
Number Property
Pattern Property
Source Property
Value Property

Related Sections

VBScript Langauge Reference

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Description Property
Returns or sets a descriptive string associated with an error.
object.Description [= stringexpression]

Arguments

object
Always the Err object.
stringexpression
A string expression containing a description of the error.

Remarks

The Description property consists of a short description of the error.


Use this property to alert the user to an error that you can't or don't
want to handle. When generating a user-defined error, assign a short
description of your error to this property. If Description isn't filled in,
and the value of Number corresponds to a VBScript run-time error,
the descriptive string associated with the error is returned.
On Error Resume Next
Err.Raise 6 ' Raise an overflow error.
MsgBox ("Error # " & CStr(Err.Number) & " " & Err.Description)
Err.Clear ' Clear the error.

Requirements

Version 1

See Also

Err Object | HelpContext Property | HelpFile Property | Number


Property | Source Property
Applies To: Err Object
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
FirstIndex Property
Returns the position in a search string where a match occurs.
object.FirstIndex

The object argument is always a Match object.

Remarks

The FirstIndex property uses a zero-based offset from the beginning


of the search string. In other words, the first character in the string is
identified as character zero (0). The following code illustrates the use
of the FirstIndex property.
Function RegExpTest(patrn, strng)
Dim regEx, Match, Matches ' Create variable.
Set regEx = New RegExp ' Create regular expression.
regEx.Pattern = patrn ' Set pattern.
regEx.IgnoreCase = True ' Set case insensitivity.
regEx.Global = True ' Set global applicability.
Set Matches = regEx.Execute(strng) ' Execute search.
For Each Match in Matches ' Iterate Matches collection.
RetStr = RetStr & "Match " & I & " found at position "
RetStr = RetStr & Match.FirstIndex & ". Match Value is "'
RetStr = RetStr & Match.Value & "'." & vbCRLF
Next
RegExpTest = RetStr
End Function
MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))

Requirements

Version 5

See Also

Length Property | Value Property


Applies To: Match Object
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Global Property
Sets or returns a Boolean value that indicates if a pattern should
match all occurrences in an entire search string or just the first one.
object.Global [= True | False ]

The object argument is always a RegExp object. The value of the


Global property is True if the search applies to the entire string,
False if it does not. Default is False.

Remarks

The following code illustrates the use of the Global property (change
the value assigned to Global property to see its effect):
Function RegExpTest(patrn, strng)
Dim regEx, Match, Matches ' Create variable.
Set regEx = New RegExp ' Create a regular expression.
regEx.Pattern = patrn ' Set pattern.
regEx.IgnoreCase = True ' Set case insensitivity.
regEx.Global = True ' Set global applicability.
Set Matches = regEx.Execute(strng) ' Execute search.
For Each Match in Matches ' Iterate Matches collection.
RetStr = RetStr & "Match found at position "
RetStr = RetStr & Match.FirstIndex & ". Match Value is '"
RetStr = RetStr & Match.Value & "'." & vbCRLF
Next
RegExpTest = RetStr
End Function
MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))

Requirements

Version 5

See Also

IgnoreCase Property | Pattern Property


Applies To: RegExp Object

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
HelpContext Property
Sets or returns a context ID for a topic in a Help File.
object.HelpContext [= contextID]

Arguments

object
Required. Always the Err object.
contextID
Optional. A valid identifier for a Help topic within the Help file.

Remarks

If a Help file is specified in HelpFile, the HelpContext property is


used to automatically display the Help topic identified. If both
HelpFile and HelpContext are empty, the value of the Number
property is checked. If it corresponds to a VBScript run-time error
value, then the VBScript Help context ID for the error is used. If the
Number property doesn't correspond to a VBScript error, the
contents screen for the VBScript Help file is displayed.
The following example illustrates use of the HelpContext property:
On Error Resume Next Dim Msg Err.Clear Err.Raise 6 ' Generate
"Overflow" error. Err.Helpfile = "yourHelp.hlp" Err.HelpContext =
yourContextID If Err.Number <> 0 Then Msg = "Press F1 or Help to
see " & Err.Helpfile & " topic for" & _ " the following HelpContext: " &
Err.HelpContext MsgBox Msg, , "error: " & Err.Description,
Err.Helpfile, Err.HelpContext End If

Requirements

Version 2

See Also
Description Property | HelpFile Property | Number Property | Source
Property
Applies To: Err Object

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
HelpFile Property
Sets or returns a fully qualified path to a Help File.
object.HelpFile [= contextID]

Arguments

object
Required. Always the Err object.
contextID
Optional. Fully qualified path to the Help file.

Remarks

If a Help file is specified in HelpFile, it is automatically called when


the user clicks the Help button (or presses the F1 key) in the error
message dialog box. If the HelpContext property contains a valid
context ID for the specified file, that topic is automatically displayed.
If no HelpFile is specified, the VBScript Help file is displayed.
On Error Resume Next
Dim Msg
Err.Clear
Err.Raise 6 ' Generate "Overflow" error.
Err.Helpfile = "yourHelp.hlp"
Err.HelpContext = yourContextID
If Err.Number <> 0 Then
Msg = "Press F1 or Help to see " & Err.Helpfile & " topic
for" & _
" the following HelpContext: " & Err.HelpContext
MsgBox Msg, , "error: " & Err.Description, Err.Helpfile,
Err.HelpContext
End If

Requirements

Version 2
See Also

Description Property | HelpContext Property | Number Property |


Source Property
Applies To: Err Object

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
IgnoreCase Property
Sets or returns a Boolean value that indicates if a pattern search is
case-sensitive or not.
object.IgnoreCase [= True | False ]

The object argument is always a RegExp object. The value of the


IgnoreCase property is False if the search is case-sensitive, True if
it is not. Default is False.

Remarks

The following code illustrates the use of the IgnoreCase property


(change the value assigned to IgnoreCase property to see its
effect):
Function RegExpTest(patrn, strng)
Dim regEx, Match, Matches ' Create variable.
Set regEx = New RegExp ' Create a regular expression.
regEx.Pattern = patrn ' Set pattern.
regEx.IgnoreCase = True ' Set case insensitivity.
regEx.Global = True ' Set global applicability.
Set Matches = regEx.Execute(strng) ' Execute search.
For Each Match in Matches ' Iterate Matches collection.
RetStr = RetStr & "Match found at position "
RetStr = RetStr & Match.FirstIndex & ". Match Value is '"
RetStr = RetStr & Match.Value & "'." & vbCRLF
Next
RegExpTest = RetStr
End Function
MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))

Requirements

Version 5

See Also

Global Property | Pattern Property


Applies To: RegExp Object

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Length Property
Returns the length of a match found in a search string.
object.Length

The object argument is always a Match object.

Remarks

The following code illustrates the use of the Length property:


Function RegExpTest(patrn, strng) Dim regEx, Match, Matches '
Create variable. Set regEx = New RegExp ' Create regular
expression. regEx.Pattern = patrn ' Set pattern. regEx.IgnoreCase =
True ' Set case insensitivity. regEx.Global = True ' Set global
applicability. Set Matches = regEx.Execute(strng) ' Execute search.
For Each Match in Matches ' Iterate Matches collection. RetStr =
RetStr & "Match " & I & " found at position " RetStr = RetStr &
Match.FirstIndex & ". Match Length is " RetStr = RetStr &
Match.Length RetStr = RetStr & " characters." & vbCRLF Next
RegExpTest = RetStr End Function MsgBox(RegExpTest("is.", "IS1
is2 IS3 is4"))

Requirements

Version 5

See Also

FirstIndex Property | Value Property


Applies To: Match Object

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Number Property
Returns or sets a numeric value specifying an error. Number is the
Err object's default property.
object.Number [= errornumber]

Arguments

object
Always the Err object.
errornumber
An integer representing a VBScript error number or an SCODE
error value.

Remarks

When returning a user-defined error from an Automation object, set


Err.Number by adding the number you selected as an error code to
the constant vbObjectError.
The following code illustrates the use of the Number property.
On Error Resume Next
Err.Raise vbObjectError + 1, "SomeObject" ' Raise Object
Error #1.
MsgBox ("Error # " & CStr(Err.Number) & " " & Err.Description)
Err.Clear ' Clear the error.

Requirements

Version 1

See Also

Description Property | HelpContext Property | HelpFile Property | Err


Object | Source Property
Applies To: Err Object

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
<a href="" onclick="showTip(this)">object</a><b>.Pattern</b> [=
"<a href="" onclick="showTip(this)">searchstring</a>"]

Function RegExpTest(patrn, strng)

Dim regEx, Match, Matches ' Create variable.

Set regEx = New RegExp ' Create a regular expression.

<code><b>regEx.Pattern = </b></code>patrn ' Set pattern.

regEx.IgnoreCase = True ' Set case insensitivity.

regEx.Global = True ' Set global applicability.

Set Matches = regEx.Execute(strng) ' Execute search.

For Each Match in Matches ' Iterate Matches collection.

RetStr = RetStr & "Match found at position "

RetStr = RetStr & Match.FirstIndex & ". Match Value is '"

RetStr = RetStr & Match.Value & "'." & vbCRLF

Next

RegExpTest = RetStr End Function

MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))

Requirements
Version 2

See Also

Global Property | IgnoreCase Property

Applies To: RegExp Object

© 2001 Microsoft Corporation. All rights reserved.

Build: Topic Version 5.6.9309.1546


Visual Basic Scripting Edition
Source Property
Returns or sets the name of the object or application that originally
generated the error.
object.Source [= stringexpression]

Arguments

object
Always the Err object.
stringexpression
A string expression representing the application that generated the
error.

Remarks

The Source property specifies a string expression that is usually the


class name or programmatic ID of the object that caused the error.
Use Source to provide your users with information when your code
is unable to handle an error generated in an accessed object. For
example, if you access Microsoft Excel and it generates a Division
by zero error, Microsoft Excel sets Err.Number to its error code for
that error and sets Source to Excel.Application. Note that if the error
is generated in another object called by Microsoft Excel, Excel
intercepts the error and sets Err.Number to its own code for Division
by zero. However, it leaves the other Err object (including Source)
as set by the object that generated the error.
Source always contains the name of the object that originally
generated the error — your code can try to handle the error
according to the error documentation of the object you accessed. If
your error handler fails, you can use the Err object information to
describe the error to your user, using Source and the other Err to
inform the user which object originally caused the error, its
description of the error, and so forth.
When generating an error from code, Source is your application's
programmatic ID.
The following code illustrates use of the Source property.
On Error Resume Next
Err.Raise 6 ' Raise an overflow error.
MsgBox ("Error # " & CStr(Err.Number) & " " & Err.Description &
Err.Source)
Err.Clear ' Clear the error.

Requirements

Version 1

See Also

Description Property | Err Object | HelpContext Property | HelpFile


Property | Number Property | On Error Statement
Applies To: Err Object

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Value Property
Returns the value or text of a match found in a search string.
object.Value

The object argument is always a Match object.

Remarks

The following code illustrates the use of the Value property.


Function RegExpTest(patrn, strng)
Dim regEx, Match, Matches ' Create variable.
Set regEx = New RegExp ' Create regular expression.
regEx.Pattern = patrn ' Set pattern.
regEx.IgnoreCase = True ' Set case insensitivity.
regEx.Global = True ' Set global applicability.
Set Matches = regEx.Execute(strng) ' Execute search.
For Each Match in Matches ' Iterate Matches collection.
RetStr = RetStr & "Match " & I & " found at position "
RetStr = RetStr & Match.FirstIndex & ". Match Value is "'
RetStr = RetStr & Match.Value & "'." & vbCRLF
Next
RegExpTest = RetStr
End Function
MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))

Requirements

Version 1

See Also

FirstIndex Property | Length Property


Applies To: Match Object
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Statements
In This Section

Call Statement
Class Statement
Const Statement
Dim Statement
Do...Loop Statement
Erase Statement
Execute Statement
ExecuteGlobal Statement
Exit Statement
For Each...Next Statement
For...Next Statement
Function Statement
If...Then...Else Statement
On Error Statement
Option Explicit Statement
Private Statement
Property Get Statement
Property Let Statement
Property Set Statement
Public Statement
Randomize Statement
ReDim Statement
Rem Statement
Select Case Statement
Set Statement
Sub Statement
While...Wend Statement
With Statement

Related Sections

VBScript Langauge Reference

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Call Statement
Transfers control to a Sub or Function procedure.
[Call] name [argumentlist]

Arguments

Call
Optional keyword. If specified, you must enclose argumentlist in
parentheses. For example:
Call MyProc(0)
name
Required. Name of the procedure to call.
argumentlist
Optional. Comma-delimited list of variables, arrays, or expressions
to pass to the procedure.

Remarks

You are not required to use the Call keyword when calling a
procedure. However, if you use the Call keyword to call a procedure
that requires arguments, argumentlist must be enclosed in
parentheses. If you omit the Call keyword, you also must omit the
parentheses around argumentlist. If you use either Call syntax to call
any intrinsic or user-defined function, the function's return value is
discarded.
Call MyFunction("Hello World")
Function MyFunction(text)
MsgBox text
End Function

Requirements

Version 1
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Class Statement
Declares the name of a class, as well as a definition of the variables,
properties, and methods that comprise the class.
Class name
statements
End Class

Arguments

name
Required. Name of the Class; follows standard variable naming
conventions.
statements
Required. One or more statements that define the variables,
properties, and methods of the Class.

Remarks

Within a Class block, members are declared as either Private or


Public using the appropriate declaration statements. Anything
declared as Private is visible only within the Class block. Anything
declared as Public is visible within the Class block, as well as by
code outside the Class block. Anything not explicitly declared as
either Private or Public is Public by default. Procedures (either Sub
or Function) declared Public within the class block become
methods of the class. Public variables serve as properties of the
class, as do properties explicitly declared using Property Get,
Property Let, and Property Set. Default properties and methods for
the class are specified in their declarations using the Default
keyword. See the individual declaration statement topics for
information on how this keyword is used.

Requirements
Version 5

See Also

Dim Statement | Function Statement | Private Statement | Property


Get Statement | Property Let Statement | Property Set Statement |
Public Statement | Set Statement | Sub Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Const Statement
Declares constants for use in place of literal values.
[Public | Private] Const constname = expression

Arguments

Public
Optional. Keyword used at script level to declare constants that are
available to all procedures in all scripts. Not allowed in procedures.
Private
Optional. Keyword used at script level to declare constants that are
available only within the script where the declaration is made. Not
allowed in procedures.
constname
Required. Name of the constant; follows standard variable naming
conventions.
expression
Required. Literal or other constant, or any combination that
includes all arithmetic or logical operators except Is.

Remarks

Constants are public by default. Within procedures, constants are


always private; their visibility can't be changed. Within a script, the
default visibility of a script-level constant can be changed using the
Private keyword.
To combine several constant declarations on the same line, separate
each constant assignment with a comma. When constant
declarations are combined in this way, the Public or Private
keyword, if used, applies to all of them.
You can't use variables, user-defined functions, or intrinsic VBScript
functions (such as Chr) in constant declarations. By definition, they
can't be constants. You also can't create a constant from any
expression that involves an operator, that is, only simple constants
are allowed. Constants declared in a Sub or Function procedure are
local to that procedure. A constant declared outside a procedure is
defined throughout the script in which it is declared. You can use
constants anywhere you can use an expression. The following code
illustrates the use of the Const statement:
Const MyVar = 459 ' Constants are Public by default.
Private Const MyString = "HELP" ' Declare Private constant.
Const MyStr = "Hello", MyNumber = 3.4567 ' Declare multiple
constants on same line.

Note Constants can make your scripts self-documenting and


easy to modify. Unlike variables, constants cannot be
inadvertently changed while your script is running.

Requirements

Version 5

See Also

Dim Statement | Function Statement | Private Statement | Public


Statement | Sub Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Dim Statement
Declares variables and allocates storage space.
Dim varname[([subscripts])][, varname[([subscripts])]] . . .

Arguments

varname
Name of the variable; follows standard variable naming
conventions.
subscripts
Dimensions of an array variable; up to 60 multiple dimensions may
be declared. The subscripts argument uses the following syntax:
upperbound [,upperbound] . . .
The lower bound of an array is always zero.

Remarks

Variables declared with Dim at the script level are available to all
procedures within the script. At the procedure level, variables are
available only within the procedure.
You can also use the Dim statement with empty parentheses to
declare a dynamic array. After declaring a dynamic array, use the
ReDim statement within a procedure to define the number of
dimensions and elements in the array. If you try to redeclare a
dimension for an array variable whose size was explicitly specified in
a Dim statement, an error occurs.

Note When you use the Dim statement in a procedure, you


generally put the Dim statement at the beginning of the
procedure.

The following examples illustrate the use of the Dim statement: Dim
Names(9) ' Declare an array with 10 elements. Dim Names() '
Declare a dynamic array. Dim MyVar, MyNum ' Declare two variables.

Requirements

Version 1

See Also

Private Statement | Public Statement | ReDim Statement | Set


Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Do...Loop Statement
Repeats a block of statements while a condition is True or until a
condition becomes True.
Do [{While | Until} condition]
[statements]
[Exit Do]
[statements]
Loop

Or, you can use this syntax:


Do
[statements]
[Exit Do]
[statements]
Loop [{While | Until} condition]

Arguments

condition
Numeric or string expression that is True or False. If condition is
Null, condition is treated as False.
statements
One or more statements that are repeated while or until condition is
True.

Remarks

The Exit Do can only be used within a Do...Loop control structure to


provide an alternate way to exit a Do...Loop. Any number of Exit Do
statements may be placed anywhere in the Do...Loop. Often used
with the evaluation of some condition (for example, If...Then), Exit
Do transfers control to the statement immediately following the
Loop.
When used within nested Do...Loop statements, Exit Do transfers
control to the loop that is nested one level above the loop where it
occurs.
The following examples illustrate use of the Do...Loop statement:
Do Until DefResp = vbNo
MyNum = Int (6 * Rnd + 1) ' Generate a random integer
between 1 and 6.
DefResp = MsgBox (MyNum & " Do you want another number?",
vbYesNo)
Loop

Dim Check, Counter


Check = True: Counter = 0 ' Initialize variables.
Do ' Outer loop.
Do While Counter < 20 ' Inner loop.
Counter = Counter + 1 ' Increment Counter.
If Counter = 10 Then ' If condition is True...
Check = False ' set value of flag to False.
Exit Do ' Exit inner loop.
End If
Loop
Loop Until Check = False ' Exit outer loop immediately.

Requirements

Version 1

See Also

Exit Statement | For...Next Statement | While...Wend Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Erase Statement
Reinitializes the elements of fixed-size arrays and deallocates
dynamic-array storage space.
Erase array

The array argument is the name of the array variable to be erased.

Remarks

It is important to know whether an array is fixed-size (ordinary) or


dynamic because Erase behaves differently depending on the type
of array. Erase recovers no memory for fixed-size arrays. Erase sets
the elements of a fixed array as follows:

Type of array Effect of Erase on fixed-array elements


Fixed numeric array Sets each element to zero.
Fixed string array Sets each element to zero-length ("").
Sets each element to the special value
Array of objects
Nothing.

Erase frees the memory used by dynamic arrays. Before your


program can refer to the dynamic array again, it must redeclare the
array variable's dimensions using a ReDim statement.
The following example illustrates the use of the Erase statement.
Dim NumArray(9)
Dim DynamicArray()
ReDim DynamicArray(9) ' Allocate storage space.
Erase NumArray ' Each element is reinitialized.
Erase DynamicArray ' Free memory used by array.

Requirements

Version 1
See Also

Dim Statement | Nothing | ReDim Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Execute Statement
Executes one or more specified statements.
Execute statement

The required statement argument is a string expression containing


one or more statements for execution. Include multiple statements in
the statement argument, using colons or embedded line breaks to
separate them.

Remarks

In VBScript, x = y can be interpreted two ways. The first is as an


assignment statement, where the value of y is assigned to x. The
second interpretation is as an expression that tests if x and y have
the same value. If they do, result is True; if they are not, result is
False. The Execute statement always uses the first interpretation,
whereas the Eval method always uses the second.

Note In Microsoft® JScript™, no confusion exists between


assignment and comparison, because the assignment operator
(=) is different from the comparison operator(==).

The context in which the Execute statement is invoked determines


what objects and variables are available to the code being run. In-
scope objects and variables are available to code running in an
Execute statement. However, it is important to understand that if you
execute code that creates a procedure, that procedure does not
inherit the scope of the procedure in which it occurred.
Like any procedure, the new procedure's scope is global, and it
inherits everything in the global scope. Unlike any other procedure,
its context is not global scope, so it can only be executed in the
context of the procedure where the Execute statement occurred.
However, if the same Execute statement is invoked outside of a
procedure (i.e., in global scope), not only does it inherit everything in
global scope, but it can also be called from anywhere, since its
context is global. The following example illustrates this behavior:
Dim X ' Declare X in global scope.
X = "Global" ' Assign global X a value.
Sub Proc1 ' Declare procedure.
Dim X ' Declare X in local scope.
X = "Local" ' Assign local X a value.
' The Execute statement here creates a
' procedure that, when invoked, prints X.
' It print the global X because Proc2
' inherits everything in global scope.
Execute "Sub Proc2: Print X: End Sub"
Print Eval("X") ' Print local X.
Proc2 ' Invoke Proc2 in Proc1's scope.
End Sub
Proc2 ' This line causes an error since
' Proc2 is unavailable outside Proc1.
Proc1 ' Invoke Proc1.
Execute "Sub Proc2: Print X: End Sub"
Proc2 ' This invocation succeeds because Proc2
' is now available globally.

The following example shows how the Execute statement can be


rewritten so you don't have to enclose the entire procedure in the
quotation marks:
S = "Sub Proc2" & vbCrLf
S = S & " Print X" & vbCrLf
S = S & "End Sub"
Execute S

Requirements

Version 1

See Also

Eval Function | ExecuteGlobal Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
ExecuteGlobal Statement
Executes one or more specified statements in the global namespace
of a script.
ExecuteGlobal statement

The required statement argument is a string expression containing


one or more statements for execution. Include multiple statements in
the statement argument, using colons or embedded line breaks to
separate them.

Remarks

In VBScript, x = y can be interpreted two ways. The first is as an


assignment statement, where the value of y is assigned to x. The
second interpretation is as an expression that tests if x and y have
the same value. If they do, result is True; if they are not, result is
False. The ExecuteGlobal statement always uses the first
interpretation, whereas the Eval method always uses the second.

Note In Microsoft® JScript™, no confusion exists between


assignment and comparison, because the assignment operator
(=) is different from the comparison operator.

All statements used with ExecuteGlobal are executed in the script's


global namespace. This allows code to be added to the program so
that any procedure can access it. For example, a VBScript Class
statement can be executed at run time and functions can
subsequently create new instances of the class.
Adding procedures and classes at runtime can be useful, but also
introduces the possibility of overwriting existing global variable and
functions at runtime. Because this can cause significant
programming problems, care should be exercised when using the
ExecuteGlobal statement. If you don't need access to a variable or
function outside of a procedure, use the Execute statement that will
only affect the namespace of the calling function.
The following example illustrates the use of the ExecuteGlobal
statement:
Dim X ' Declare X in global scope.
X = "Global" ' Assign global X a value.
Sub Proc1 ' Declare procedure.
Dim X ' Declare X in local scope.
X = "Local" ' Assign local X a value.
' The Execute statement here creates a
' procedure that, when invoked, prints X.
' It print the global X because Proc2
' inherits everything in global scope.
ExecuteGlobal "Sub Proc2: Print X: End Sub"
Print Eval("X") ' Print local X.
Proc2 ' Invoke Proc2 in Global scope resulting
' in "Global" being printed.
End Sub
Proc2 ' This line causes an error since
' Proc2 is unavailable outside Proc1.
Proc1 ' Invoke Proc1.
Execute "Sub Proc2: Print X: End Sub"
Proc2 ' This invocation succeeds because Proc2
' is now available globally.

The following example shows how the ExecuteGlobal statement


can be rewritten so you don't have to enclose the entire procedure in
the quotation marks:
S = "Sub Proc2" & vbCrLf
S = S & " Print X" & vbCrLf
S = S & "End Sub"
ExecuteGlobal S

Requirements

Version 1

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Exit Statement
Exits a block of Do...Loop, For...Next, Function, or Sub code.
Exit Do
Exit For
Exit Function
Exit Property
Exit Sub

The Exit statement syntax has these forms:

Statement Description
Provides a way to exit a Do...Loop statement. It can
be used only inside a Do...Loop statement. Exit Do
transfers control to the statement following the Loop
Exit Do
statement. When used within nested Do...Loop
statements, Exit Do transfers control to the loop that
is one nested level above the loop where it occurs.
Provides a way to exit a For loop. It can be used
only in a For...Next or For Each...Next loop. Exit
For transfers control to the statement following the
Exit For
Next statement. When used within nested For
loops, Exit For transfers control to the loop that is
one nested level above the loop where it occurs.
Immediately exits the Function procedure in which
Exit Function it appears. Execution continues with the statement
following the statement that called the Function.
Immediately exits the Property procedure in which it
appears. Execution continues with the statement
Exit Property
following the statement that called the Property
procedure.
Immediately exits the Sub procedure in which it
Exit Sub appears. Execution continues with the statement
following the statement that called the Sub.
The following example illustrates the use of the Exit statement: Sub
RandomLoop Dim I, MyNum Do ' Set up infinite loop. For I = 1 To
1000 ' Loop 1000 times. MyNum = Int(Rnd * 100) ' Generate random
numbers. Select Case MyNum ' Evaluate random number. Case 17:
MsgBox "Case 17" Exit For ' If 17, exit For...Next. Case 29: MsgBox
"Case 29" Exit Do ' If 29, exit Do...Loop. Case 54: MsgBox "Case
54" Exit Sub ' If 54, exit Sub procedure. End Select Next Loop End
Sub

Requirements

Version 1

See Also

Do...Loop Statement | For Each...Next Statement | For...Next


Statement | Function Statement | Sub Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
For Each...Next Statement
Repeats a group of statements for each element in an array or
collection.
For Each element In group
[statements]
[Exit For]
[statements]
Next [element]

Arguments

element
Variable used to iterate through the elements of the collection or
array. For collections, element can only be a Variant variable, a
generic Object variable, or any specific Automation object variable.
For arrays, element can only be a Variant variable.
group
Name of an object collection or array.
statements
One or more statements that are executed on each item in group.

Remarks

The For Each block is entered if there is at least one element in


group. Once the loop has been entered, all the statements in the
loop are executed for the first element in group. As long as there are
more elements in group, the statements in the loop continue to
execute for each element. When there are no more elements in
group, the loop is exited and execution continues with the statement
following the Next statement.
The Exit For can only be used within a For Each...Next or
For...Next control structure to provide an alternate way to exit. Any
number of Exit For statements may be placed anywhere in the loop.
The Exit For is often used with the evaluation of some condition (for
example, If...Then), and transfers control to the statement
immediately following Next.
You can nest For Each...Next loops by placing one For Each...Next
loop within another. However, each loop element must be unique.

Note If you omit element in a Next statement, execution


continues as if you had included it. If a Next statement is
encountered before it's corresponding For statement, an error
occurs.

The following example illustrates use of the For Each...Next


statement:
Function ShowFolderList(folderspec)
Dim fso, f, f1, fc, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(folderspec)
Set fc = f.Files
For Each f1 in fc
s = s & f1.name
s = s & "<BR>"
Next
ShowFolderList = s
End Function

Requirements

Version 2

See Also

Do...Loop Statement | Exit Statement | For...Next Statement |


While...Wend Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
For...Next Statement
Repeats a group of statements a specified number of times.
For counter = start To end [Step step]
[statements]
[Exit For]
[statements]
Next

Arguments

counter
Numeric variable used as a loop counter. The variable can't be an
array element or an element of a user-defined type.
start
Initial value of counter.
end
Final value of counter.
step
Amount counter is changed each time through the loop. If not
specified, step defaults to one.
statements
One or more statements between For and Next that are executed
the specified number of times.

Remarks

The step argument can be either positive or negative. The value of


the step argument determines loop processing as follows:
Loop executes
Value
if
Positive or 0 counter <= end
Negative counter >= end
Once the loop starts and all statements in the loop have executed,
step is added to counter. At this point, either the statements in the
loop execute again (based on the same test that caused the loop to
execute initially), or the loop is exited and execution continues with
the statement following the Next statement.

Note Changing the value of counter while inside a loop can


make it more difficult to read and debug your code.

Exit For can only be used within a For Each...Next or For...Next


control structure to provide an alternate way to exit. Any number of
Exit For statements may be placed anywhere in the loop. Exit For is
often used with the evaluation of some condition (for example,
If...Then), and transfers control to the statement immediately
following Next.
You can nest For...Next loops by placing one For...Next loop within
another. Give each loop a unique variable name as its counter. The
following construction is correct:
For I = 1 To 10
For J = 1 To 10
For K = 1 To 10
. . .
Next
Next
Next

Requirements

Version 1

See Also

Do...Loop Statement | Exit Statement | For Each...Next Statement |


While...Wend Statement
© 2001 Microsoft Corporation. All rights reserved.
Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Function Statement
Declares the name, arguments, and code that form the body of a
Function procedure.
[Public [Default] | Private] Function name [(arglist)]
[statements]
[name = expression]
[Exit Function]
[statements]
[name = expression]
End Function

Arguments

Public
Indicates that the Function procedure is accessible to all other
procedures in all scripts.
Default
Used only with the Public keyword in a Class block to indicate that
the Function procedure is the default method for the class. An
error occurs if more than one Default procedure is specified in a
class.
Private
Indicates that the Function procedure is accessible only to other
procedures in the script where it is declared or if the function is a
member of a class, and that the Function procedure is accessible
only to other procedures in that class.
name
Name of the Function; follows standard variable naming
conventions.
arglist
List of variables representing arguments that are passed to the
Function procedure when it is called. Commas separate multiple
variables.
statements
Any group of statements to be executed within the body of the
Function procedure.
expression
Return value of the Function.
The arglist argument has the following syntax and parts:
[ByVal | ByRef] varname[( )]

Arguments

ByVal
Indicates that the argument is passed by value.
ByRef
Indicates that the argument is passed by reference.
varname
Name of the variable representing the argument; follows standard
variable naming conventions.

Remarks

If not explicitly specified using either Public or Private, Function


procedures are public by default, that is, they are visible to all other
procedures in your script. The value of local variables in a Function
is not preserved between calls to the procedure.
You cannot define a Function procedure inside any other procedure
(e.g. Sub or Property Get).
The Exit Function statement causes an immediate exit from a
Function procedure. Program execution continues with the
statement that follows the statement that called the Function
procedure. Any number of Exit Function statements can appear
anywhere in a Function procedure.
Like a Sub procedure, a Function procedure is a separate
procedure that can take arguments, perform a series of statements,
and change the values of its arguments. However, unlike a Sub
procedure, you can use a Function procedure on the right side of an
expression in the same way you use any intrinsic function, such as
Sqr, Cos, or Chr, when you want to use the value returned by the
function.
You call a Function procedure using the function name, followed by
the argument list in parentheses, in an expression. See the Call
statement for specific information on how to call Function
procedures.

Caution Function procedures can be recursive, that is, they


can call themselves to perform a given task. However, recursion
can lead to stack overflow.

To return a value from a function, assign the value to the function


name. Any number of such assignments can appear anywhere
within the procedure. If no value is assigned to name, the procedure
returns a default value: a numeric function returns 0 and a string
function returns a zero-length string (""). A function that returns an
object reference returns Nothing if no object reference is assigned
to name (using Set) within the Function.
The following example shows how to assign a return value to a
function named BinarySearch. In this case, False is assigned to the
name to indicate that some value was not found.
Function BinarySearch(. . .)
. . .
' Value not found. Return a value of False.
If lower > upper Then
BinarySearch = False
Exit Function
End If
. . .
End Function

Variables used in Function procedures fall into two categories:


those that are explicitly declared within the procedure and those that
are not. Variables that are explicitly declared in a procedure (using
Dim or the equivalent) are always local to the procedure. Variables
that are used but not explicitly declared in a procedure are also local
unless they are explicitly declared at some higher level outside the
procedure.
Caution A procedure can use a variable that is not explicitly
declared in the procedure, but a naming conflict can occur if
anything you have defined at the script level has the same
name. If your procedure refers to an undeclared variable that
has the same name as another procedure, constant, or variable,
it is assumed that your procedure is referring to that script-level
name. To avoid this kind of conflict, use an Option Explicit
statement to force explicit declaration of variables.

Caution VBScript may rearrange arithmetic expressions to


increase internal efficiency. Avoid using a Function procedure
in an arithmetic expression when the function changes the value
of variables in the same expression.

Requirements

Version 1

See Also

Call Statement | Dim Statement | Exit Statement | Nothing | Set


Statement | Sub Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
If...Then...Else Statement
Conditionally executes a group of statements, depending on the
value of an expression.
If condition Then statements [Else elsestatements ]

Or, you can use the block form syntax:


If condition Then
[statements]
[ElseIf condition-n Then
[elseifstatements]] . . .
[Else
[elsestatements]]
End If

Arguments

condition
One or more of the following two types of expressions:
A numeric or string expression that evaluates to True or False. If
condition is Null, condition is treated as False.
An expression of the form TypeOf objectname Is objecttype. The
objectname is any object reference and objecttype is any valid
object type. The expression is True if objectname is of the object
type specified by objecttype; otherwise it is False.
statements
One or more statements separated by colons; executed if condition
is True.
condition-n
Same as condition.
elseifstatements
One or more statements executed if the associated condition-n is
True.
elsestatements
One or more statements executed if no previous condition or
condition-n expression is True.

Remarks

You can use the single-line form (first syntax) for short, simple tests.
However, the block form (second syntax) provides more structure
and flexibility than the single-line form and is usually easier to read,
maintain, and debug.

Note With the single-line syntax, it is possible to have multiple


statements executed as the result of an If...Then decision, but
they must all be on the same line and separated by colons, as in
the following statement:
If A > 10 Then A = A + 1 : B = B + A : C = C + B

When executing a block If (second syntax), condition is tested. If


condition is True, the statements following Then are executed. If
condition is False, each ElseIf (if any) is evaluated in turn. When a
True condition is found, the statements following the associated
Then are executed. If none of the ElseIf statements are True (or
there are no ElseIf clauses), the statements following Else are
executed. After executing the statements following Then or Else,
execution continues with the statement following End If.
The Else and ElseIf clauses are both optional. You can have as
many ElseIf statements as you want in a block If, but none can
appear after the Else clause. Block If statements can be nested; that
is, contained within one another.
What follows the Then keyword is examined to determine whether or
not a statement is a block If. If anything other than a comment
appears after Then on the same line, the statement is treated as a
single-line If statement.
A block If statement must be the first statement on a line. The block
If must end with an End If statement.
Requirements

Version 1

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
On Error Statement
Enables or disables error-handling.
On Error Resume Next
On Error GoTo 0

Remarks

If you don't use an On Error Resume Next statement anywhere in


your code, any run-time error that occurs can cause an error
message to be displayed and code execution stopped. However, the
host running the code determines the exact behavior. The host can
sometimes opt to handle such errors differently. In some cases, the
script debugger may be invoked at the point of the error. In still other
cases, there may be no apparent indication that any error occurred
because the host does not to notify the user. Again, this is purely a
function of how the host handles any errors that occur.
Within any particular procedure, an error is not necessarily fatal as
long as error-handling is enabled somewhere along the call stack. If
local error-handling is not enabled in a procedure and an error
occurs, control is passed back through the call stack until a
procedure with error-handling enabled is found and the error is
handled at that point. If no procedure in the call stack is found to
have error-handling enabled, an error message is displayed at that
point and execution stops or the host handles the error as
appropriate.
On Error Resume Next causes execution to continue with the
statement immediately following the statement that caused the run-
time error, or with the statement immediately following the most
recent call out of the procedure containing the On Error Resume
Next statement. This allows execution to continue despite a run-time
error. You can then build the error-handling routine inline within the
procedure.
An On Error Resume Next statement becomes inactive when
another procedure is called, so you should execute an On Error
Resume Next statement in each called routine if you want inline
error handling within that routine. When a procedure is exited, the
error-handling capability reverts to whatever error-handling was in
place before entering the exited procedure.
Use On Error GoTo 0 to disable error handling if you have
previously enabled it using On Error Resume Next.
The following example illustrates use of the On Error Resume Next
statement.
On Error Resume Next
Err.Raise 6 ' Raise an overflow error.
MsgBox "Error # " & CStr(Err.Number) & " " & Err.Description
Err.Clear ' Clear the error.

Requirements

Version 1

See Also

Err Object | Exit Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Option Explicit Statement
Forces explicit declaration of all variables in a script.
Option Explicit

Remarks

If used, the Option Explicit statement must appear in a script before


any other statements.
When you use the Option Explicit statement, you must explicitly
declare all variables using the Dim, Private, Public, or ReDim
statements. If you attempt to use an undeclared variable name, an
error occurs.

Tip Use Option Explicit to avoid incorrectly typing the name of


an existing variable or to avoid confusion in code where the
scope of the variable is not clear.

The following example illustrates use of the Option Explicit


statement.
Option Explicit ' Force explicit variable declaration.
Dim MyVar ' Declare variable.
MyInt = 10 ' Undeclared variable generates error.
MyVar = 10 ' Declared variable does not generate error.

Requirements

Version 1

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Private Statement
Declares private variables and allocates storage space. Declares, in
a Class block, a private variable.
Private varname[([subscripts])][, varname[([subscripts])]] . .
.

Arguments

varname
Name of the variable; follows standard variable naming
conventions.
subscripts
Dimensions of an array variable; up to 60 multiple dimensions may
be declared. The subscripts argument uses the following syntax:
upper [, upper] . . .
The lower bound of an array is always zero.

Remarks

Private statement variables are available only to the script in which


they are declared.
A variable that refers to an object must be assigned an existing
object using the Set statement before it can be used. Until it is
assigned an object, the declared object variable is initialized as
Empty.
You can also use the Private statement with empty parentheses to
declare a dynamic array. After declaring a dynamic array, use the
ReDim statement within a procedure to define the number of
dimensions and elements in the array. If you try to redeclare a
dimension for an array variable whose size was explicitly specified in
a Private, Public, or Dim statement, an error occurs.
Note When you use the Private statement in a procedure, you
generally put the Private statement at the beginning of the
procedure.

The following example illustrates use of the Private statement.


Private MyNumber ' Private Variant variable.
Private MyArray(9) ' Private array variable.
' Multiple Private declarations of Variant variables.
Private MyNumber, MyVar, YourNumber

Requirements

Version 1

See Also

Dim Statement | Public Statement | ReDim Statement | Set


Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Property Get Statement
Declares, in a Class block, the name, arguments, and code that
form the body of a Property procedure that gets (returns) the value
of a property.
[Public [Default] | Private] Property Get name [(arglist)]
[statements]
[[Set] name = expression]
[Exit Property]
[statements]
[[Set] name = expression]
End Property

Arguments

Public
Indicates that the Property Get procedure is accessible to all other
procedures in all scripts.
Default
Used only with the Public keyword to indicate that the property
defined in the Property Get procedure is the default property for
the class.
Private
Indicates that the Property Get procedure is accessible only to
other procedures in the Class block where it's declared.
name
Name of the Property Get procedure; follows standard variable
naming conventions, except that the name can be the same as a
Property Let or Property Set procedure in the same Class block.
arglist
List of variables representing arguments that are passed to the
Property Get procedure when it is called. Commas separate
multiple arguments. The name of each argument in a Property Get
procedure must be the same as the corresponding argument in a
Property Let procedure (if one exists).
statements
Any group of statements to be executed within the body of the
Property Get procedure.
Set
Keyword used when assigning an object as the return value of a
Property Get procedure.
expression
Return value of the Property Get procedure.

Remarks

If not explicitly specified using either Public or Private, Property


Get procedures are public by default, that is, they are visible to all
other procedures in your script. The value of local variables in a
Property Get procedure is not preserved between calls to the
procedure.
You can't define a Property Get procedure inside any other
procedure (e.g. Function or Property Let).
The Exit Property statement causes an immediate exit from a
Property Get procedure. Program execution continues with the
statement that follows the statement that called the Property Get
procedure. Any number of Exit Property statements can appear
anywhere in a Property Get procedure.
Like a Sub and Property Let procedure, a Property Get procedure
is a separate procedure that can take arguments, perform a series of
statements, and change the value of its arguments. However, unlike
a Sub and Property Let, you can use a Property Get procedure on
the right side of an expression in the same way you use a Function
or property name when you want to return the value of a property.

Requirements

Version 5

See Also
Class Statement | Dim Statement | Exit Statement | Function
Statement | Private Statement | Property Let Statement | Property
Set Statement | Public Statement | Set Statement | Sub Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Property Let Statement
Declares, in a Class block, the name, arguments, and code that
form the body of a Property procedure that assigns (sets) the value
of a property.
[Public | Private] Property Let name ([arglist,] value)
[statements]
[Exit Property]
[statements]
End Property

Arguments

Public
Indicates that the Property Let procedure is accessible to all other
procedures in all scripts.
Private
Indicates that the Property Let procedure is accessible only to
other procedures in the Class block where it's declared.
name
Name of the Property Let procedure; follows standard variable
naming conventions, except that the name can be the same as a
Property Get or Property Set procedure in the same Class block.
arglist
List of variables representing arguments that are passed to the
Property Let procedure when it is called. Commas separate
multiple arguments. The name of each argument in a Property Let
procedure must be the same as the corresponding argument in a
Property Get procedure. In addition, the Property Let procedure
will always have one more argument than its corresponding
Property Get procedure. That argument is the value being
assigned to the property.
value
Variable to contain the value to be assigned to the property. When
the procedure is called, this argument appears on the right side of
the calling expression.
statements
Any group of statements to be executed within the body of the
Property Let procedure.

Remarks

If not explicitly specified using either Public or Private, Property Let


procedures are public by default, that is, they are visible to all other
procedures in your script. The value of local variables in a Property
Let procedure is not preserved between calls to the procedure.
You can't define a Property Let procedure inside any other
procedure (e.g. Function or Property Get).
The Exit Property statement causes an immediate exit from a
Property Let procedure. Program execution continues with the
statement that follows the statement that called the Property Let
procedure. Any number of Exit Property statements can appear
anywhere in a Property Let procedure.

Note Every Property Let statement must define at least one


argument for the procedure it defines. That argument (or the last
argument if there is more than one) contains the actual value to
be assigned to the property when the procedure defined by the
Property Let statement is invoked. That argument is referred to
as value in the preceding syntax.

Like a Function and Property Get procedure, a Property Let


procedure is a separate procedure that can take arguments, perform
a series of statements, and change the value of its arguments.
However, unlike a Function and Property Get procedure, both of
which return a value, you can only use a Property Let procedure on
the left side of a property assignment expression.

Requirements

Version 5
See Also

Class Statement | Dim Statement | Exit Statement | Function


Statement | Private Statement | Property Get Statement | Property
Set Statement | Public Statement | Set Statement | Sub Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Property Set Statement
Declares, in a Class block, the name, arguments, and code that
form the body of a Property procedure that sets a reference to an
object.
[Public | Private] Property Set name([arglist,] reference)
[statements]
[Exit Property]
[statements]
End Property

Arguments

Public
Indicates that the Property Set procedure is accessible to all other
procedures in all scripts.
Private
Indicates that the Property Set procedure is accessible only to
other procedures in the Class block where it's declared.
name
Name of the Property Set procedure; follows standard variable
naming conventions, except that the name can be the same as a
Property Get or Property Let procedure in the same Class block.
arglist
List of variables representing arguments that are passed to the
Property Set procedure when it is called. Commas separate
multiple arguments. In addition, the Property Set procedure will
always have one more argument than its corresponding Property
Get procedure. That argument is the object being assigned to the
property.
reference
Variable containing the object reference used on the right side of
the object reference assignment.
statements
Any group of statements to be executed within the body of the
Property Set procedure.
Remarks

If not explicitly specified using either Public or Private, Property Set


procedures are public by default, that is, they are visible to all other
procedures in your script. The value of local variables in a Property
Set procedure is not preserved between calls to the procedure.
You can't define a Property Set procedure inside any other
procedure (e.g. Function or Property Let).
The Exit Property statement causes an immediate exit from a
Property Set procedure. Program execution continues with the
statement that follows the statement that called the Property Set
procedure. Any number of Exit Property statements can appear
anywhere in a Property Set procedure.

Note Every Property Set statement must define at least one


argument for the procedure it defines. That argument (or the last
argument if there is more than one) contains the actual object
reference for the property when the procedure defined by the
Property Set statement is invoked. That argument is referred to
as reference in the preceding syntax.

Like a Function and Property Get procedure, a Property Set


procedure is a separate procedure that can take arguments, perform
a series of statements, and change the value of its arguments.
However, unlike a Function and Property Get procedure, both of
which return a value, you can only use a Property Set procedure on
the left side of an object reference assignment (Set statement).

Requirements

Version 5

See Also

Class Statement | Dim Statement | Exit Statement | Function


Statement | Private Statement | Property Get Statement | Property
Let Statement | Public Statement | Set Statement | Sub Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Public Statement
Declares public variables and allocates storage space. Declares, in a
Class block, a private variable.
Public varname[([subscripts])][, varname[([subscripts])]] . . .

Arguments

varname
Name of the variable; follows standard variable naming
conventions.
subscripts
Dimensions of an array variable; up to 60 multiple dimensions may
be declared. The subscripts argument uses the following syntax:
upper [, upper] . . .
The lower bound of an array is always zero.

Remarks

Public statement variables are available to all procedures in all


scripts.
A variable that refers to an object must be assigned an existing
object using the Set statement before it can be used. Until it is
assigned an object, the declared object variable is initialized as
Empty.
You can also use the Public statement with empty parentheses to
declare a dynamic array. After declaring a dynamic array, use the
ReDim statement within a procedure to define the number of
dimensions and elements in the array. If you try to redeclare a
dimension for an array variable whose size was explicitly specified in
a Private, Public, or Dim statement, an error occurs.
The following example illustrates the use of the Public statement:
Public MyNumber ' Public Variant variable.
Public MyArray(9) ' Public array variable.
' Multiple Public declarations of Variant variables.
Public MyNumber, MyVar, YourNumber

Requirements

Version 1

See Also

Dim Statement | Private Statement | ReDim Statement | Set


Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Randomize Statement
Initializes the random-number generator.
Randomize [number]

The number argument can be any valid numeric expression.

Remarks

Randomize uses number to initialize the Rnd function's random-


number generator, giving it a new seed value. If you omit number,
the value returned by the system timer is used as the new seed
value.
If Randomize is not used, the Rnd function (with no arguments)
uses the same number as a seed the first time it is called, and
thereafter uses the last generated number as a seed value.

Note To repeat sequences of random numbers, call Rnd with a


negative argument immediately before using Randomize with a
numeric argument. Using Randomize with the same value for
number does not repeat the previous sequence.

The following example illustrates use of the Randomize statement.


Dim MyValue, Response
Randomize ' Initialize random-number generator.
Do Until Response = vbNo
MyValue = Int((6 * Rnd) + 1) ' Generate random value
between 1 and 6.
MsgBox MyValue
Response = MsgBox ("Roll again? ", vbYesNo)
Loop

Requirements

Version 1
See Also

Rnd Function | Timer Function

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
ReDim Statement
Declares dynamic-array variables, and allocates or reallocates
storage space at procedure level.
ReDim [Preserve] varname(subscripts) [, varname(subscripts)] .
. .

Arguments

Preserve
Preserves the data in an existing array when you change the size
of the last dimension.
varname
Name of the variable; follows standard variable naming
conventions.
subscripts
Dimensions of an array variable; up to 60 multiple dimensions may
be declared. The subscripts argument uses the following syntax:
upper [,upper] . . .
The lower bound of an array is always zero.

Remarks

The ReDim statement is used to size or resize a dynamic array that


has already been formally declared using a Private, Public, or Dim
statement with empty parentheses (without dimension subscripts).
You can use the ReDim statement repeatedly to change the number
of elements and dimensions in an array.
If you use the Preserve keyword, you can resize only the last array
dimension, and you can't change the number of dimensions at all.
For example, if your array has only one dimension, you can resize
that dimension because it is the last and only dimension. However, if
your array has two or more dimensions, you can change the size of
only the last dimension and still preserve the contents of the array.
The following example shows how you can increase the size of the
last dimension of a dynamic array without erasing any existing data
contained in the array.
ReDim X(10, 10, 10)
. . .
ReDim Preserve X(10, 10, 15)

Caution If you make an array smaller than it was originally, data


in the eliminated elements is lost.

When variables are initialized, a numeric variable is initialized to 0


and a string variable is initialized to a zero-length string (""). A
variable that refers to an object must be assigned an existing object
using the Set statement before it can be used. Until it is assigned an
object, the declared object variable has the special value Nothing.

Requirements

Version 1

See Also

Dim Statement | Set Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Rem Statement
Includes explanatory remarks in a program.
Rem comment

-or-
' comment

The comment argument is the text of any comment you want to


include. After the Rem keyword, a space is required before
comment.

Remarks

As shown in the syntax section, you can use an apostrophe (')


instead of the Rem keyword. If the Rem keyword follows other
statements on a line, it must be separated from the statements by a
colon. However, when you use an apostrophe, the colon is not
required after other statements.
The following example illustrates the use of the Rem statement.
Dim MyStr1, MyStr2
MyStr1 = "Hello" : Rem Comment after a statement separated by a
colon.
MyStr2 = "Goodbye" ' This is also a comment; no colon is
needed.
Rem Comment on a line with no code; no colon is needed.

Requirements

Version 1

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Select Case Statement
Executes one of several groups of statements, depending on the
value of an expression.
Select Case testexpression
[Case expressionlist-n
[statements-n]] . . .
[Case Else expressionlist-n
[elsestatements-n]]
End Select

Arguments

testexpression
Any numeric or string expression.
expressionlist-n
Required if Case appears. Delimited list of one or more
expressions.
statements-n
One or more statements executed if testexpression matches any
part of expressionlist-n.
elsestatements-n
One or more statements executed if testexpression doesn't match
any of the Case clauses.

Remarks

If testexpression matches any Case expressionlist expression, the


statements following that Case clause are executed up to the next
Case clause, or for the last clause, up to End Select. Control then
passes to the statement following End Select. If testexpression
matches an expressionlist expression in more than one Case clause,
only the statements following the first match are executed.
The Case Else clause is used to indicate the elsestatements to be
executed if no match is found between the testexpression and an
expressionlist in any of the other Case selections. Although not
required, it is a good idea to have a Case Else statement in your
Select Case block to handle unforeseen testexpression values. If no
Case expressionlist matches testexpression and there is no Case
Else statement, execution continues at the statement following End
Select.
Select Case statements can be nested. Each nested Select Case
statement must have a matching End Select statement.
The following example illustrates the use of the Select Case
statement.
Dim Color, MyVar
Sub ChangeBackground (Color)
MyVar = lcase (Color)
Select Case MyVar
Case "red" document.bgColor = "red"
Case "green" document.bgColor = "green"
Case "blue" document.bgColor = "blue"
Case Else MsgBox "pick another color"
End Select
End Sub

Requirements

Version 1

See Also

If...Then...Else Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Set Statement
Assigns an object reference to a variable or property, or associates a
procedure reference with an event.
Set objectvar = {objectexpression | New classname | Nothing}

-or-
Set object.eventname = GetRef(procname)

Parameters

objectvar
Required. Name of the variable or property; follows standard
variable naming conventions.
objectexpression
Optional. Expression consisting of the name of an object, another
declared variable of the same object type, or a function or method
that returns an object of the same object type.
New
Keyword used to create a new instance of a class. If objectvar
contained a reference to an object, that reference is released when
the new one is assigned. The New keyword can only be used to
create an instance of a class.
classname
Optional. Name of the class being created. A class and its
members are defined using the Class statement.
Nothing
Optional. Discontinues association of objectvar with any specific
object or class. Assigning objectvar to Nothing releases all the
system and memory resources associated with the previously
referenced object when no other variable refers to it.
object
Required. Name of the object with which event is associated.
event
Required. Name of the event to which the function is to be bound.
procname
Required. String containing the name of the Sub or Function
being associated with the event.

Remarks

To be valid, objectvar must be an object type consistent with the


object being assigned to it.
The Dim, Private, Public, or ReDim statements only declare a
variable that refers to an object. No actual object is referred to until
you use the Set statement to assign a specific object.
Generally, when you use Set to assign an object reference to a
variable, no copy of the object is created for that variable. Instead, a
reference to the object is created. More than one object variable can
refer to the same object. Because these variables are references to
(rather than copies of) the object, any change in the object is
reflected in all variables that refer to it.
Function ShowFreeSpace(drvPath)
Dim fso, d, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set d = fso.GetDrive(fso.GetDriveName(drvPath))
s = "Drive " & UCase(drvPath) & " - "
s = s & d.VolumeName & "<BR>"
s = s & "Free Space: " & FormatNumber(d.FreeSpace/1024, 0)
s = s & " Kbytes"
ShowFreeSpace = s
End Function

Using the New keyword allows you to concurrently create an


instance of a class and assign it to an object reference variable. The
variable to which the instance of the class is being assigned must
already have been declared with the Dim (or equivalent) statement.
Refer to the documentation for the GetRef function for information
on using Set to associate a procedure with an event.

Requirements
Version 1

See Also

= Operator | Dim Statement | GetRef Function | ReDim Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
Sub Statement
Declares the name, arguments, and code that form the body of a
Sub procedure.
[Public [Default] | Private] Sub name [(arglist)]
[statements]
[Exit Sub]
[statements]
End Sub

Arguments

Public
Indicates that the Sub procedure is accessible to all other
procedures in all scripts.
Default
Used only with the Public keyword in a Class block to indicate that
the Sub procedure is the default method for the class. An error
occurs if more than one Default procedure is specified in a class.
Private
Indicates that the Sub procedure is accessible only to other
procedures in the script where it is declared.
name
Name of the Sub; follows standard variable naming conventions.
arglist
List of variables representing arguments that are passed to the
Sub procedure when it is called. Commas separate multiple
variables.
statements
Any group of statements to be executed within the body of the Sub
procedure.
The arglist argument has the following syntax and parts:
[ByVal | ByRef] varname[( )]

Arguments
ByVal
Indicates that the argument is passed by value.
ByRef
Indicates that the argument is passed by reference.
varname
Name of the variable representing the argument; follows standard
variable naming conventions.

Remarks

If not explicitly specified using either Public or Private, Sub


procedures are public by default, that is, they are visible to all other
procedures in your script. The value of local variables in a Sub
procedure is not preserved between calls to the procedure.
You can't define a Sub procedure inside any other procedure (e.g.
Function or Property Get).
The Exit Sub statement causes an immediate exit from a Sub
procedure. Program execution continues with the statement that
follows the statement that called the Sub procedure. Any number of
Exit Sub statements can appear anywhere in a Sub procedure.
Like a Function procedure, a Sub procedure is a separate
procedure that can take arguments, perform a series of statements,
and change the value of its arguments. However, unlike a Function
procedure, which returns a value, a Sub procedure can't be used in
an expression.
You call a Sub procedure using the procedure name followed by the
argument list. See the Call statement for specific information on how
to call Sub procedures.

Caution Sub procedures can be recursive, that is, they can call
themselves to perform a given task. However, recursion can
lead to stack overflow.

Variables used in Sub procedures fall into two categories: those that
are explicitly declared within the procedure and those that are not.
Variables that are explicitly declared in a procedure (using Dim or
the equivalent) are always local to the procedure. Variables that are
used but not explicitly declared in a procedure are also local, unless
they are explicitly declared at some higher level outside the
procedure.

Caution A procedure can use a variable that is not explicitly


declared in the procedure, but a naming conflict can occur if
anything you have defined at the script level has the same
name. If your procedure refers to an undeclared variable that
has the same name as another procedure, constant or variable,
it is assumed that your procedure is referring to that script-level
name. To avoid this kind of conflict, use an Option Explicit
statement to force explicit declaration of variables.

Requirements

Version 1

See Also

Call Statement | Dim Statement | Exit Statement | Function


Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
While...Wend Statement
Executes a series of statements as long as a given condition is True.
While condition
Version [statements]
Wend

Arguments

condition
Numeric or string expression that evaluates to True or False. If
condition is Null, condition is treated as False.
statements
One or more statements executed while condition is True.

Remarks

If condition is True, all statements in statements are executed until


the Wend statement is encountered. Control then returns to the
While statement and condition is again checked. If condition is still
True, the process is repeated. If it is not True, execution resumes
with the statement following the Wend statement.
While...Wend loops can be nested to any level. Each Wend
matches the most recent While.

Note The Do...Loop statement provides a more structured and


flexible way to perform looping.

The following example illustrates use of the While...Wend


statement: Dim Counter Counter = 0 ' Initialize variable. While
Counter < 20 ' Test value of Counter. Counter = Counter + 1 '
Increment Counter. Alert Counter Wend ' End While loop when
Counter > 19.

Requirements
Version 1

See Also

Do...Loop Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
Visual Basic Scripting Edition
With Statement
Executes a series of statements on a single object.
With object
statements
End With

Arguments

object
Required. Name of an object or a function that returns an object.
statements
Required. One or more statements to be executed on object.

Remarks

The With statement allows you to perform a series of statements on


a specified object without requalifying the name of the object. For
example, to change a number of different properties on a single
object, place the property assignment statements within the With
control structure, referring to the object once instead of referring to it
with each property assignment. The following example illustrates use
of the With statement to assign values to several properties of the
same object.
With MyLabel
.Height = 2000
.Width = 2000
.Caption = "This is MyLabel"
End With

While property manipulation is an important aspect of With


functionality, it is not the only use. Any legal code can be used within
a With block.

Note Once a With block is entered, object can't be changed. As


a result, you can't use a single With statement to affect a
number of different objects.

You can nest With statements by placing one With block within
another. However, because members of outer With blocks are
masked within the inner With blocks, you must provide a fully
qualified object reference in an inner With block to any member of
an object in an outer With block.
Important Do not jump into or out of With blocks. If statements in a
With block are executed, but either the With or End With statement
is not executed, you may get errors or unpredictable behavior.

Requirements

Version 1

See Also

Set Statement

© 2001 Microsoft Corporation. All rights reserved.


Build: Topic Version 5.6.9309.1546
HMILine
Line control
Methods list
Name Description
Look for animation to modify the
​ FindAnimation
associated variables of the animation
Property list
Name Description
​ Height Height
Whether display the specified object or
​ IsShow
not
​ Left The left coordinate
​ Name Name
​ RotateAngle Rotation Angle
​ StrokeThickness Line width
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
The horizontical coordinate of the
​ X1
starting point of the line
The horizontical coordinate of the
​ X2
ending point of the line
The vertical coordinate of the starting
​ Y1
point of the line
The vertical coordinate of the ending
​ Y2
point of the line
​ ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object
into Var.VariableGroup0.Variable1
VBScript Example

Line0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

Line0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

Line0.IsShow = True Line0.IsShow = False


Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

Line0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = Line0.Name
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example Set the rotation Angle of the specified object to 90
VBScript Example

Line0.RotateAngle = 90
StrokeThickness
Line width
Define
Double StrokeThickness
Example Basic graphic border line width value is 5
VBScript Example

Line0.StrokeThickness = 5
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

Line0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

Line0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

Line0.Width = 100
X1
The horizontical coordinate of the starting point of the line
Define
Double X1
Example
The horizontical coordinate of the starting point of the line
VBScript Example

Line0.X1 = 0
X2
The horizontical coordinate of the ending point of the line
Define
Double X2
Example
The horizontical coordinate of the ending point of the line
VBScript Example

Line0.X2 = 100
Y1
The vertical coordinate of the starting point of the line
Define
Double Y1
Example
The vertical coordinate of the starting point of the line
VBScript Example

Line0.Y1 = 0
Y2
The vertical coordinate of the ending point of the line
Define
Double Y2
Example
The vertical coordinate of the ending point of the line
VBScript Example

Line0.Y2 = 200
ZIndex
Layer index
Define
Int32 ZIndex
Example
Set the Zindex of the specified object to 3
VBScript Example

Line0.ZIndex = 3
HMIRectangle
Rectangle control
Methods list
Name Description
Look for animation to modify the
FindAnimation
associated variables of the animation
Property list
Name Description
Fill Fill color
FillColor Fill color
Height Height
Whether show the specified object or
IsShow
not
Left The left coordinate
Name Name
Opacity Opacity
RotateAngle Rotation Angle
StrokeThickness Appearance of border line width
ToolTip Tooltip text
Top The top coordinate
Width Width
ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

Rectangle0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Fill
Set the fill color of controls(Colors.red)
Define
Object Fill
Example
Set the fill color of the specified object
VBScript Example

Rectangle0.Fill = Colors.red
FillColor
Gets or sets the string value of the background brush of the controls
("#FFFFFFFF")
Define
String FillColor
Example
Set the fill color of the specified object
VBScript Example

Rectangle0.FillColor = "#FFFFFFFF"
Height
Height
Define
Double Height
Example
Set the height of the specified object to 100
VBScript Example

Rectangle0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

Rectangle0.IsShow = True Rectangle0.IsShow =


False
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

Rectangle0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = Rectangle0.Name
Opacity
Opacity
Define
Double Opacity
Example
The graphics displays translucent effect
VBScript Example

Rectangle0.Opacity = 0.5
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Sets the rotation angle of the specified object to 90
VBScript Example

Rectangle0.RotateAngle = 90
StrokeThickness
Appearance of border line width
Define
Double StrokeThickness
Example Basic graphic border line width value is 5
VBScript Example

Rectangle0.StrokeThickness = 5
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

Rectangle0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

Rectangle0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

Rectangle0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example
Set the Zindex of the specified object to 3
VBScript Example

Rectangle0.ZIndex = 3
HMIRoundRectangle
Rounded rectangle control
Methods list
Name Description
Look for animation to modify the
FindAnimation
associated variables of the animation
Property list
Name Description
Fill Fill color
FillColor Fill color
Height Height
IsShow Whether show the specify object or not
Left The left coordinate
Name Name
Opacity Opacity
The Angle of the rounded rectangle
RadiusX
variable elliptical x radius of the circle
The Angle of the rectangular variable
RadiusY
round radius of elliptical y
RotateAngle Rotation Angle
StrokeThickness Appearance of border line width
ToolTip Tooltip text
Top The top coordinate
Width Width
ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

RoundedRectangle0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Fill
Set the fill color of controls(Colors.red)
Define
Object Fill
Example
Set the fill color of the specified object
VBScript Example

RoundedRectangle0.Fill = Colors.red
FillColor
Gets or sets the string("#FFFFFFFF")value of controls of the
background brush
Define
String FillColor
Example
Set the fill color of the specified object
VBScript Example

RoundedRectangle0.FillColor = "#FFFFFFFF"
Height
Height
Define
Double Height
Example
Set the height of the specified object to 100
VBScript Example

RoundedRectangle0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

RoundedRectangle0.IsShow = True
RoundedRectangle0.IsShow = False
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

RoundedRectangle0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = RoundedRectangle0.Name
Opacity
Opacity
Define
Double Opacity
Example
The graph displays translucent effect
VBScript Example

RoundedRectangle0.Opacity = 0.5
RadiusX
The ellipse's x radius of the rounded rectangle
Define
Double RadiusX
Example Set x radius to 45
VBScript Example

RoundedRectangle0.RadiusX = 45
RadiusY
The ellipse's y radius of the rounded rectangular
Define
Double RadiusY
Example Set y radius to 45
VBScript Example

RoundedRectangle0.RadiusY = 45
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Set the rotation angle of the specified object to 90
VBScript Example

RoundedRectangle0.RotateAngle = 90
StrokeThickness
Appearance of border line width
Define
Double StrokeThickness
Example Basic graphic border line width value is 5
VBScript Example

RoundedRectangle0.StrokeThickness = 5
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

RoundedRectangle0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

RoundedRectangle0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

RoundedRectangle0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example
Set the Zindex of the specified object to 3
VBScript Example

RoundedRectangle0.ZIndex = 3
HMIEllipse
Ellipse control
Methods list
Name Description
Look for animation to modify the
FindAnimation
associated variables of the animation
Property list
Name Description
Fill Fill color
FillColor Fill color
Height Height
Whether show the specified object or
IsShow
not
Left The left coordinate
Name Name
Opacity Opacity
RotateAngle Rotation Angle
StrokeThickness Appearance of border line width
ToolTip Tooltip text
Top The top coordinate
Width Width
ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

Ellipse0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Fill
Set the fill color of controls(Colors.red)
Define
Object Fill
Example
Set the fill color of the specified object
VBScript Example

Ellipse0.Fill = Colors.red
FillColor
Gets or sets the string("#FFFFFFFF")value of controls of the
background brush
Define
String FillColor
Example
Set the fill color of the specified object
VBScript Example

Ellipse0.FillColor = "#FFFFFFFF"
Height
Height
Define
Double Height
Example
Set the height of the specified object to 100
VBScript Example

Ellipse0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

Ellipse0.IsShow = True Ellipse0.IsShow = False


Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

Ellipse0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = RoundedRectangle0.Name
Opacity
Opacity
Define
Double Opacity
Example
The graphics displays translucent effect
VBScript Example

Ellipse0.Opacity = 0.5
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Sets the rotation Angle of the specified object to 90
VBScript Example

Ellipse0.RotateAngle = 90
StrokeThickness
Appearance of border line width
Define
Double StrokeThickness
Example Basic graphic border line width value is 5
VBScript Example

Ellipse0.StrokeThickness = 5
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

Ellipse0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

Ellipse0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

Ellipse0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example
Set the Zindex of the specified object to 3
VBScript Example

Ellipse0.ZIndex = 3
HMIPolyLine
Polyline control
Methods list
Name Description
Look for animation to modify the
FindAnimation
associated variables of the animation
Property list
Name Description
Height Height
Whether display the specified object or
IsShow
not
Left The left coordinate
Name Name
RotateAngle Rotation Angle
StrokeThickness Line width
ToolTip Tooltip text
Top The top coordinate
Width Width
ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

PolyLine0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

PolyLine0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

PolyLine0.IsShow = True PolyLine0.IsShow = False


Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

PolyLine0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = PolyLine0.Name
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Sets the rotation Angle of the specified object to 90
VBScript Example

PolyLine0.RotateAngle = 90
StrokeThickness
Line width
Define
Double StrokeThickness
Example Basic graphic border line width value is 5
VBScript Example

PolyLine0.StrokeThickness =5
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

PolyLine0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

PolyLine0.Top=100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

PolyLine0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example
Set the Zindex of the specified object to 3
VBScript Example

PolyLine0.ZIndex = 3
HMIPolygon
Polygon control
Methods list
Name Description
Look for animation to modify the
FindAnimation
associated variables of the animation
Property list
Name Description
Fill Fill color
FillColor Fill color
Height Height
Whether display the specified object or
IsShow
not
Left The left coordinate
Name Name
Opacity Opacity
RotateAngle Rotation Angle
StrokeThickness Appearance of border line width
ToolTip Tooltip text
Top The top coordinate
Width Width
ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

Polygon0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Fill
Set the fill color of controls(Colors.red)
Define
Object Fill
Example
Set the fill color of the specified object
VBScript Example

Polygon0.Fill = Colors.red
FillColor
Gets or sets the string value of controls of the background brush
("#FFFFFFFF")
Define
String FillColor
Example
Set the fill color of the specified object
VBScript Example

Polygon0.FillColor = "#FFFFFFFF"
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

Polygon0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

Polygon0.IsShow = True Polygon0.IsShow = False


Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

Polygon0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = Polygon0.Name
Opacity
Opacity
Define
Double Opacity
Example
The graphics displays translucent effect
VBScript Example

Polygon0.Opacity = 0.5
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Sets the rotation Angle of the specified object to 90
VBScript Example

Polygon0.RotateAngle = 90
StrokeThickness
Appearance of border line width
Define
Double StrokeThickness
Example Basic graphic border line width value is 5
VBScript Example

Polygon0.StrokeThickness = 5
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

Polygon0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

Polygon0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

Polygon0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example
Set the Zindex of the specified object to 3
VBScript Example

Polygon0.ZIndex = 3
HMIBezierCurve
Bezier curve control
Methods list
Name Description
Look for animation to modify the
FindAnimation
associated variables of the animation
Property list
Name Description
Height Height
Whether display the specified object or
IsShow
not
Left The left coordinate
Name Name
RotateAngle Rotation Angle
StrokeThickness Line width
ToolTip Tooltip text
Top The top coordinate
Width Width
ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

BezierCurve0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

BezierCurve0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

BezierCurve0.IsShow = True BezierCurve0.IsShow =


False
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

BezierCurve0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

Text0.Text = BezierCurve0.Name
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Sets the rotation Angle of the specified object to 90
VBScript Example

BezierCurve0.RotateAngle = 90
StrokeThickness
Line width
Define
Double StrokeThickness
Example Basic graphic border line width value is 5
VBScript Example

BezierCurve0.StrokeThickness = 5
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

BezierCurve0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

BezierCurve0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

BezierCurve0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 2
VBScript Example

BezierCurve0.ZIndex = 2
HMIClosedCurve
Closed curve control
Methods list
Name Description
Look for animation to modify the
FindAnimation
associated variables of the animation
Property list
Name Description
Fill Fill color
FillColor Fill color
Height Height
IsShow Whether display the specified object
Left The left coordinate
Name Name
Opacity Opacity
RotateAngle Rotation Angle
StrokeThickness Line width of border
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
​ ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

ClosedCurve0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Fill
Set the fill color of controls(Colors.red)
Define
Object Fill
Example
Set the fill color of the specified object
VBScript Example

ClosedCurve0.Fill = Colors.red
FillColor
Gets or sets the string value of controls of the background brush
("#FFFFFFFF")
Define
String FillColor
Example
Set the fill color of the specified object
VBScript Example

ClosedCurve0.FillColor = "#FFFFFFFF"
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

ClosedCurve0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

ClosedCurve0.IsShow = True ClosedCurve0.IsShow =


False
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

ClosedCurve0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

Text0.Text = ClosedCurve0.Name
Opacity
Opacity
Define
Double Opacity
Example
The graphics displays translucent effect
VBScript Example

ClosedCurve0.Opacity = 0.5
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Sets the rotation Angle of the specified object to 90
VBScript Example

ClosedCurve0.RotateAngle = 90
StrokeThickness
Line width of border
Define
Double StrokeThickness
Example Line width of border is 5
VBScript Example

ClosedCurve0.StrokeThickness = 5
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

ClosedCurve0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

ClosedCurve0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

ClosedCurve0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 2
VBScript Example

ClosedCurve0.ZIndex = 2
HMIArc
Arc control
Methods list
Name Description
Look for animation to modify the
​ FindAnimation
associated variables of the animation
Property list
Name Description
​ Height Height
​ IsShow Whether display the specified object
​ Left The left coordinate
​ Name Name
​ RotateAngle Rotation Angle
​ StartAngle Start angle
​ StrokeThickness Line width of border
​ SweepAngle Sweep angle
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
​ ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object
into Var.VariableGroup0.Variable1
VBScript Example

Arc0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

Arc0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

Arc0.IsShow = True Arc0.IsShow = False


Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

Arc0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

Text0.Text = Arc0.Name
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Sets the rotation Angle of the specified object to 90
VBScript Example

Arc0.RotateAngle = 90
StartAngle
Start angle
Define
Double StartAngle
Example
The Start Angle value is 90 of the circular arc
VBScript Example

Arc0.StartAngle = 90
StrokeThickness
Line width
Define
Double StrokeThickness
Example Basic graphic border line width value is 5
VBScript Example

Arc0.StrokeThickness = 5
SweepAngle
Sweep Angle
Define
Double SweepAngle
Example
Sweep Angle value is 90
VBScript Example

Arc0.SweepAngle = 90
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

Arc0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

Arc0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

Arc0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 2
VBScript Example

Arc0.ZIndex = 2
HMIArch
Arcuate control
Methods list
Name Description
Look for animation to modify the
FindAnimation
associated variables of the animation
Property list
Name Description
Fill Fill color
FillColor Fill color
Height Height
Whether display the specified object or
IsShow
not
Left The left coordinate
Name Name
Opacity Opacity
RotateAngle Rotation Angle
StartAngle Start angle
StrokeThickness Line width
SweepAngle Sweep Angle
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
​ ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object
into Var.VariableGroup0.Variable1
VBScript Example

Arch0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Fill
Set the fill color of controls(Colors.red)
Define
Object Fill
Example
Set the fill color of the specified object
VBScript Example

Arch0.Fill = Colors.red
FillColor
Gets or sets the string value of controls of the background brush
("#FFFFFFFF")
Define
String FillColor
Example
Set the fill color of the specified object
VBScript Example

Arch0.FillColor = "#FFFFFFFF"
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

Arch0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

Arch0.IsShow = True Arch0.IsShow = False


Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

Arch0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

Text0.Text = Arch0.Name
Opacity
Opacity
Define
Double Opacity
Example
The graphics displays translucent effect
VBScript Example

Arch0.Opacity = 0.5
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Sets the rotation Angle of the specified object to 90
VBScript Example

Arch0.RotateAngle = 90
StartAngle
Start angle
Define
Double StartAngle
Example
The Start Angle value is 90 of the circular arc
VBScript Example

Arch0.StartAngle = 90
StrokeThickness
Appearance of border line width
Define
Double StrokeThickness
Example Basic graphic border line width value is 5
VBScript Example

Arch0.StrokeThickness = 5
SweepAngle
Sweep Angle
Define
Double SweepAngle
Example
Sweep Angle value is 90
VBScript Example

Arch0.SweepAngle = 90
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

Arch0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

Arch0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

Arch0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 2
VBScript Example

Arch0.ZIndex = 2
HMIPie
Sector control
Methods list
Name Description
Look for animation to modify the
FindAnimation
associated variables of the animation
Property list
Name Description
Fill Fill color
FillColor Fill color
Height Height
Whether display the specified object or
IsShow
not
Left The left coordinate
Name Name
Opacity Opacity
RotateAngle Rotation Angle
StartAngle Start Angle
StrokeThickness Appearance of border line width
SweepAngle Sector scan Angle
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
​ ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object
into Var.VariableGroup0.Variable1
VBScript Example

Pie0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Fill
Set the fill color of the control(Colors.red)
Define
Object Fill
Example
Set the fill color of the specified object
VBScript Example

Pie0.Fill = Colors.red
FillColor
Gets or sets the string value of controls of the background brush
("#FFFFFFFF")
Define
String FillColor
Example
Set the fill color of the specified object
VBScript Example

Pie0.FillColor = "#FFFFFFFF"
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

Pie0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

Pie0.IsShow = True Pie0.IsShow = False


Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

Pie0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

Text0.Text = Pie0.Name
Opacity
Opacity
Define
Double Opacity
Example
The graphics displays translucent effect
VBScript Example

Pie0.Opacity = 0.5
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Set the rotation Angle of the specified object to 90
VBScript Example

Pie0.RotateAngle = 90
StartAngle
Start Angle
Define
Double StartAngle
Example
The starting Angle value of the fan is 90
VBScript Example

Pie0.StartAngle = 90
StrokeThickness
Appearance of border line width
Define
Double StrokeThickness
Example Basic graphic border line width value is 5
VBScript Example

Pie0.StrokeThickness = 5
SweepAngle
Sector scan Angle
Define
Double SweepAngle
Example
Sector scan Angle value is 90
VBScript Example

Pie0.SweepAngle = 90
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

Pie0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

Pie0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

Pie0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 2
VBScript Example

Pie0.ZIndex = 2
HMIPipe
Pipe control
Methods list
Name Description
Look for animation to modify the
​ FindAnimation
associated variables of the animation
Property list
Name Description
​ ForwardFlow Liquid flow direction
​ Height Height
Whether display the specified object or
​ IsShow
not
​ Left The left coordinate
​ LiquidWidth Liquid width
​ Name Name
​ PipeWidth Pipe width
​ RotateAngle Rotation angle
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
​ ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object
into Var.VariableGroup0.Variable1
VBScript Example

Pipe0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
ForwardFlow
Liquid flow direction
Define
Boolean ForwardFlow
Example
Set the flow direction of the specified object to True
VBScript Example

Pipe0.ForwardFlow = True
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

Pipe0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

Pipe0.IsShow = True Pipe0.IsShow = False


Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

Pipe0.Left = 100
LiquidWidth
Liquid width
Define
Double LiquidWidth
Example
VBScript Example

Pipe0.LiquidWidth = 30
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

Text0.Text = Pipe0.Name
PipeWidth
Pipe width
Define
Double PipeWidth
Example
Set the pipe width to 100
VBScript Example

Pipe0.PipeWidth = 100
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Set the rotation Angle of the specified object to 90
VBScript Example

Pipe0.RotateAngle = 90
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

Pipe0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

Pipe0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

Pipe0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 2
VBScript Example

Pipe0.ZIndex = 2
HMIText
Text control
Methods list
Name Description
Look for animation to modify the
​ FindAnimation
associated variables of the animation
Property list
Name Description
​ FontSize Font size
​ Height Height
Whether display the specified object or
​ IsShow
not
​ Left The left coordinate
​ Name Name
​ Opacity Opacity
​ RotateAngle Rotation angle
​ Text The text content
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
​ ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object
into Var.VariableGroup0.Variable1
VBScript Example

Text0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
FontSize
Font size
Define
Double FontSize
Example
Set the font size of the specified object
VBScript Example

Text0.FontSize = 20
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

Text0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

Text0.IsShow = True Text0.IsShow = False


Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

Text0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = Text0.Name
Opacity
Opacity
Define
Double Opacity
Example
The graphics displays translucent effect
VBScript Example

Text0.Opacity = 0.5
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example Set the rotation Angle of the specified object to 90
VBScript Example

Text0.RotateAngle = 90
Text
The text content
Define
String Text
Example
Set the display text
VBScript Example

Text0.Text = "SCADA"
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

Text0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

Text0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

Text0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 2
VBScript Example

Text0.ZIndex = 2
HMIGroup
Combinatorial graphics control
Methods list
Name Description
Look for animation to modify the
​ FindAnimation associated variables of the
animation
​ GetElementByName Get object by name
Property list
Name Description
​ Height Height
Whether display the specified object or
​ IsShow
not
​ Left The left coordinate
​ Name Name
The logical parent element of this
​ Parent
element
​ RotateAngle Rotation angle
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object
into Var.VariableGroup0.Variable1
VBScript Example

Group0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
GetElementByName
Get object by name
Define
GetElementByName(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of object

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

Group0.GetElementByName("Polygon18").Fill = Colors.Yellow
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

Group0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

Group0.IsShow = True Group0.IsShow = False


Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

Group0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = Group0.Name
Parent
Get the logical parent element of this element
Define
HMIGroup Parent
Example
Polygon18 is one of the sub-graphics of Group0 ,Set the height of
rectangle0 to 100 in the extended properties of Group0
VBScript Example

Polygon18.Parent.Parent.Rectangle0.Height = 100
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example Set the rotation Angle of the specified object to 90
VBScript Example

Group0.RotateAngle = 90
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

Group0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

Group0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

Group0.Width = 100
HMIButton
Button control
Methods list
Name Description
Look for animation to modify the
FindAnimation
associated variables of the animation
Property list
Name Description
Background The background color
BorderBrush Border color
Content Get or the set the text content of button
FontSize Font size
Foreground Foreground
Height Height
Get or set a value, the value indicating
IsEnabled
whether the control can operation
IsShow Whether display the specified object
IsTriggerOpen Whether to use the default styles
Left The left coordinate
Name Name
Opacity Opacity
RotateAngle Rotation Angle
ToolTip Tooltip text
Top The top coordinate
Width Width
ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

Button0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Background
The background color(Colors.Red)
Define
Object Background
Example
Set the background color of the specified object
VBScript Example

Button0.Background = Colors.Red
BorderBrush
Border color(Colors.Red)
Define
Object BorderBrush
Example
Set the border color of the specified object
VBScript Example

Button0.BorderBrush = Colors.Red
Content
Gets or sets the text content of button
Define
String Content
Example
Set the text of the specified object to "Delta SCADA"
VBScript Example

Button0.Content = "Delta SCADA"


FontSize
Font size
Define
Double FontSize
Example
Set the font size of the specified object
VBScript Example

Button0.FontSize = 20
Foreground
The foreground(Colors.Red)
Define
Object Foreground
Example
Set the foreground color of the specified object
VBScript Example

Button0.Foreground = Colors.Red
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

Button0.Height = 100
IsEnabled
Gets or sets a value, the value indicating whether the control can
operation
Define
Boolean IsEnabled
Example
True :The specified object is Enabled
VBScript Example

Button0.IsEnabled = True
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

Button0.IsShow = True Button0.IsShow = False


IsTriggerOpen
Whether to use the default styles
Define
Boolean IsTriggerOpen
Example True :Refers to using the default style,False :Don't use
the default style
VBScript Example

Button0.IsTriggerOpen = True
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

Button0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = Button0.Name
Opacity
Opacity
Define
Double Opacity
Example
The graphics display translucent effect
VBScript Example

Button0.Opacity = 0.5
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example Set the rotation Angle of the specified object to 90
VBScript Example

Button0.RotateAngle = 90
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

Button0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

Button0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

Button0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 3
VBScript Example

Button0.ZIndex = 3
HMICheckBox
Check box control
Methods list
Name Description
Look for animation to modify the
FindAnimation
associated variables of the animation
Property list
Name Description
Get or the set the text content of check
Content
box
FontSize Font size
Foreground Foreground
Height Height
Get or set whether the control is
IsChecked
selected
Get or set a value, the value indicating
IsEnabled
whether the control can operation
IsShow Whether display the specified object
Left The left coordinate
Name Name
Opacity Opacity
RotateAngle Rotation Angle
ToolTip Tooltip text
Top The top coordinate
Width Width
ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

CheckBox0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Content
Get or the set the text content of check box
Define
String Content
Example
Set the text of the specified object to "Delta SCADA"
VBScript Example

CheckBox0.Content = "Delta SCADA"


FontSize
Font size
Define
Double FontSize
Example
Set the font size of the specified object
VBScript Example

CheckBox0.FontSize = 20
Foreground
The foreground color(Colors.Red)
Define
Object Foreground
Example Set the foreground color of the specified object
VBScript Example

CheckBox0.Foreground = Colors.Red
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

CheckBox0.Height = 100
IsChecked
Gets or sets whether the control is selected
Define
Boolean IsChecked
Example
The control is selected
VBScript Example

CheckBox0.IsChecked = True
IsEnabled
Gets or sets a value, the value indicating whether the control can
operation
Define
Boolean IsEnabled
Example
True :The specified object is Enabled
VBScript Example

CheckBox0.IsEnabled = True
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

CheckBox0.IsShow = True CheckBox0.IsShow = False


Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

CheckBox0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = CheckBox0.Name
Opacity
Opacity
Define
Double Opacity
Example
The graphics display translucent effect
VBScript Example

CheckBox0.Opacity = 0.5
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Set the rotation Angle of the specified object to 90
VBScript Example

CheckBox0.RotateAngle = 90
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

CheckBox0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

CheckBox0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

CheckBox0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 3
VBScript Example

CheckBox0.ZIndex = 3
HMIComboBox
Combo box control
Methods list
Name Description
​ AddItem Add item
​ AddItems Add items collection
​ ClearItems Empty the collection
Look for animation to modify the
​ FindAnimation
associated variables of the animation
Remove the specified items according
​ RemoveAtItem
to the index
​ RemoveItem Remove the specified items
Property list
Name Description
Background The background color
BorderBrush Border color
FontSize Font size
Foreground Foreground
Height Height
Get or set a value, the value indicating
IsEnabled
whether the control can operation
IsShow Whether display the specified object
Left The left coordinate
Name Name
Opacity Opacity
RotateAngle Rotation Angle
Select the specified item accordding to
SelectedIndex
the index
SelectedValue Select the current value
Get or the set up the Combo box text
Text
content
ToolTip Tooltip text
Top The top coordinate
Width Width
ZIndex Layer index
AddItem
Add item
Define
AddItem(item)
Parameter
Data
Name Required/Optional Description
Type
item Required String to add items

Example Add item“a”


VBScript Example

ComboBox0.AddItem("a")
AddItems
Add items collection
Define
AddItems(items)
Parameter
Data
Name Required/Optional Description
Type
To add items, separated by
items required String
commas

Example 1.Add items collection“a,b,c”


VBScript Example

ComboBox0.AddItems("a,b,c")

2.Add items collection “all system users”


VBScript Example

ComboBox0.AddItems(UserCmd.GetAllUserNames())
ClearItems
Empty the collection
Define
ClearItems()
Example
Empty the collection
VBScript Example

ComboBox0.ClearItems()
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

ComboBox0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
RemoveAtItem
​Remove the specified items according to the index
Define
RemoveAtItem(index)
Parameter
Data
Name Required/Optional Description
Type
​Remove the
index Required int specified items according to the
index

Example
Remove the first item in the combo box
VBScript Example

ComboBox0.RemoveAtItem(0)
RemoveItem
Remove the specified items
Define
RemoveItem(item)
Parameter
Data
Name Required/Optional Description
Type
item required String Items to be removed

Example Remove the specified item“a”


VBScript Example

ComboBox0.RemoveItem("a")
BorderBrush
The border color(Colors.Red)
Define
Object BorderBrush
Example
Set the border color of the specified object
VBScript Example

ComboBox0.BorderBrush = Colors.Red
FontSize
Font size
Define
Double FontSize
Example
Set the font size of the specified object
VBScript Example

ComboBox0.FontSize = 20
Foreground
The foreground color(Colors.Red)
Define
Object Foreground
Example
Set the foreground color of the specified object
VBScript Example

ComboBox0.Foreground = Colors.Red
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

ComboBox0.Height = 100
IsEnabled
Gets or sets a value, the value indicating whether the control can
operation
Define
Boolean IsEnabled
Example
True :The specified object is Enabled
VBScript Example

ComboBox0.IsEnabled = True
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

ComboBox0.IsShow = True ComboBox0.IsShow = False


Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

ComboBox0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = ComboBox0.Name
Opacity
Opacity
Define
Double Opacity
Example
The graphics display translucent effect
VBScript Example

ComboBox0.Opacity = 0.5
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Set the rotation Angle of the specified object to 90
VBScript Example

ComboBox0.RotateAngle = 90
SelectedIndex
Select the specified item accordding to the index
Define
Int32 SelectedIndex
Example
Select the first item in the combo box
VBScript Example

ComboBox0.SelectedIndex = 0
SelectedValue
Select the current value
Define
String SelectedValue
Example
Select "a" in the combo box as the current value
VBScript Example

ComboBox0.SelectedValue = "a"
Text
Get or the set up the text content of the combo box
Define
String Text
Example
Set the text of the specified object to "Delta SCADA"
VBScript Example

ComboBox0.Text = "Delta SCADA"


ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

ComboBox0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

ComboBox0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

ComboBox0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 3
VBScript Example

ComboBox0.ZIndex = 3
HMILabel
Label control
Methods list
Name Description
Look for animation to modify the
FindAnimation
associated variables of the animation
Property list
Name Description
Background The background color
FontSize Font size
Foreground Foreground
Height Height
Get or set a value, the value indicating
IsEnabled
whether the control can operation
IsShow Whether display the specified object
Left The left coordinate
Name Name
Opacity Opacity
RotateAngle Rotation Angle
Get or the set up the text content of the
Text
label
ToolTip Tooltip text
Top The top coordinate
Width Width
ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object
into Var.VariableGroup0.Variable1
VBScript Example

Label0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Background
The background color(Colors.Red)
Define
Object Background
Example
Set the background color of the specified object
VBScript Example

Label0.Background = Colors.Red
FontSize
Font size
Define
Double FontSize
Example
Set the font size of the specified object
VBScript Example

Label0.FontSize = 20
Foreground
The foreground color(Colors.Red)
Define
Object Foreground
Example
Set the foreground color of the specified object
VBScript Example

Label0.Foreground = Colors.Red
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

Label0.Height = 100
IsEnabled
Gets or sets a value, the value indicating whether the control can
operation
Define
Boolean IsEnabled
Example
True :The specified object is Enabled
VBScript Example

Label0.IsEnabled = True
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

Label0.IsShow = True Label0.IsShow = False


Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

Label0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = Label0.Name
Opacity
Opacity
Define
Double Opacity
Example
The graphics display translucent effect
VBScript Example

Label0.Opacity = 0.5
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Set the rotation Angle of the specified object to 90
VBScript Example

Label0.RotateAngle = 90
Text
Gets or sets up the text content of the label
Define
String Text
Example
Set the text of the specified object to "Delta SCADA"
VBScript Example

Label0.Text= "Delta SCADA"


ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

Label0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

Label0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

Label0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 3
VBScript Example

Label0.ZIndex = 3
HMITextBox
Text box control
Methods list
Name Description
Look for animation to modify the
FindAnimation
associated variables of the animation
Focus Set the focus on the text box
SelectedAll Select all the contents of the text box
Property list
Name Description
Get or set a value, the value indicating
AcceptsReturn
whether the text content wrap
Background The background color
BorderBrush Border color
FontSize Font size
Foreground Foreground
Height Height
Get or set a value, the value indicating
IsEnabled
whether the control can operation
IsShow Whether display the specified object
Left The left coordinate
Name Name
Opacity Opacity
RotateAngle Rotation Angle
Get or the set up the text content of the
Text
text box
ToolTip Tooltip text
Top The top coordinate
Width Width
ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

TextBox0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Focus
Set the focus on the text box
Define
Focus()
Example Set the focus on the TextBox0
VBScript Example

TextBox0.Focus()
SelectedAll
Select all the contents of the text box
Define
SelectAll()
Example Select all the contents of the text box 0(Note: first, set the
focus on the TextBox0)
VBScript Example

TextBox0.Focus()
TextBox0.SelectAll()
AcceptsReturn
Gets or sets a value, the value indicating whether the text content
wrap
Define
Boolean AcceptsReturn
Example
True: the text content wrap False: the text content will not wrap
VBScript Example

TextBox0.AcceptsReturn = True
TextBox0.AcceptsReturn = False
Background
The background color(Colors.Red)
Define
Object Background
Example
Set the background color of the specified object
VBScript Example

TextBox0.Background = Colors.Red
BorderBrush
The border color(Colors.Red)
Define
Object BorderBrush
Example
Set the border color of the specified object
VBScript Example

TextBox0.BorderBrush = Colors.Red
FontSize
Font size
Define
Double FontSize
Example
Set the font size of the specified object
VBScript Example

TextBox0.FontSize = 20
Foreground
The foreground color(Colors.Red)
Define
Object Foreground
Example
Set the foreground color of the specified object
VBScript Example

TextBox0.Foreground = Colors.Red
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

TextBox0.Height = 100
IsEnabled
Gets or sets a value, the value indicating whether the control can
operation
Define
Boolean IsEnabled
Example
True :The specified object is Enabled
VBScript Example

TextBox0.IsEnabled = True
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

TextBox0.IsShow = True TextBox0.IsShow = False


Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

TextBox0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox1.Text = TextBox0.Name
Opacity
Opacity
Define
Double Opacity
Example
Graphical display translucent effect
VBScript Example

TextBox0.Opacity = 0.5
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Set the rotation Angle of the specified object to 90
VBScript Example

TextBox0.RotateAngle = 90
Text
Gets or sets up the text content of text box
Define
String Text
Example
Set the text of the specified object to "Delta SCADA"
VBScript Example

TextBox0.Text = "Delta SCADA"


ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

TextBox0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

TextBox0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

TextBox0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 3
VBScript Example

Text0.ZIndex = 3
HMIPasswordBox
Password box control
Methods list
Name Description
Look for animation to modify the
FindAnimation
associated variables of the animation
Property list
Name Description
Background The background color
BorderBrush The border color
FontSize Font size
Foreground The foreground color
Height Height
Get or set a value, the value indicating
IsEnabled whether the text content carriage
returns
IsShow Whether display the specified object
Left The left coordinate
Name Name
Opacity Opacity
Get or set the password content,
Password
shown as a small dot
RotateAngle Rotation Angle
ToolTip Tooltip text
Top The top coordinate
Width Width
ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

PasswordBox0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Background
The background color(Colors.Red)
Define
Object Background
Example
Set the background color of the specified object
VBScript Example

PasswordBox0.Background = Colors.Red
BorderBrush
The border color(Colors.Red)
Define
Object BorderBrush
Example
Set the border color of the specified object
VBScript Example

PasswordBox0.BorderBrush = Colors.Red
FontSize
Font size
Define
Double FontSize
Example
Set the font size of the specified object
VBScript Example

PasswordBox0.FontSize = 20
Foreground
The foreground color(Colors.Red)
Define
Object Foreground
Example
Set the foreground color of the specified object
VBScript Example

PasswordBox0.Foreground = Colors.Red
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

PasswordBox0.Height = 100
IsEnabled
Gets or sets a value, the value indicating whether the control can
operation
Define
Boolean IsEnabled
Example
True :The specified object is Enabled
VBScript Example

PasswordBox0.IsEnabled = True
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

PasswordBox0.IsShow = True PasswordBox0.IsShow =


False
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

PasswordBox0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = PasswordBox0.Name
Opacity
Opacity
Define
Double Opacity
Example
The graphics display translucent effect
VBScript Example

PasswordBox0.Opacity = 0.5
Password
Gets or sets the password content, shown as a small dot
Define
String Password
Example
Set the password content to “123456”
VBScript Example

PasswordBox0.Password = "123456"
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Set the rotation Angle of the specified object to 90
VBScript Example

PasswordBox0.RotateAngle = 90
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

PasswordBox0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

PasswordBox0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

PasswordBox0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 3
VBScript Example

PasswordBox0.ZIndex = 3
HMIDateTimePicker
Date time picker control
Methods list
Name Description
​ Compare Date/time to compare
​ CompareDate Date to compare
​ CompareTime Time to compare
Look for animation to modify the
​ FindAnimation
associated variables of the animation
​ GetTimeValue Get the time value
Property list
Name Description
​ Background The background color
​ FontSize Font size
​ Foreground The foreground color
​ Height Height
​ IntervalHours Get hours interval
​ IntervalMilliseconds Get interval number of milliseconds
​ IntervalMinutes Get interval number of minutes
​ IntervalSeconds Get interval number of seconds
Get or set a value, the value
​ IsEnabled indicating whether the control can
operation
​ IsShow Whether display the specified object
​ Left The left coordinate
​ Name Name
​ Opacity Opacity
​ RotateAngle Rotation angle
​ ToolTip Tooltip text
​ Top The top coordinate
Get or set the display values of the
​ Value
calendar date time
Get the display values of the
​ ValueTime
calendar date time
​ Width Width
​ ZIndex Layer index
Compare
Date/Time comparison
Define
Compare(dateTime)
Parameter
Data
Name Required/Optional Description
Type
dateTime Required DateTime DataTime
Return
The return value is greater than 1, the date displayed by control is
greater than the input date; less than zero, less than the input date,
equal to zero is equal to the input date
Example
Call this script, compared the current date with the date displayed by
calendar, if the return value is greater than zero, indicate that the
date displayed by calendar is greater than the input date; equal to
zero, indicate that the date displayed by calendar is equal to the
input date; less than zero, indicate that the date displayed by
calendar is less than the input date.
VBScript Example

DateTimePicker0.Compare(DateTime.Now)
CompareDate
Date/Time comparison
Define
CompareDate(dateTime)
Parameter
Data
Name Required/Optional Description
Type
dateTime Required DateTime Date/Time
Return
The return value is greater than 1, the date displayed by control is
greater than the input date; less than zero, less than the input date,
equal to zero is equal to the input date
Example
Call this script, compared the current date with the date displayed by
calendar, if the return value is greater than zero, indicate that the
date displayed by calendar is greater than the input date; equal to
zero, indicate that the date displayed by calendar is equal to the
input date; less than zero, indicate that the date displayed by
calendar is less than the input date.
VBScript Example

DateTimePicker0.CompareDate(DateTime.Now)
CompareTime
Date/Time comparison
Define
CompareTime(dateTime)
Parameter
Data
Name Required/Optional Description
Type
dateTime Required DateTime Date/Time
Return
The return value is greater than 1, the date displayed by control is
greater than the input date; less than zero, less than the input date,
equal to zero is equal to the input date
Example
Call this script, compared the current date with the time displayed by
calendar, if the return value is greater than zero, indicate that the
time displayed by calendar is greater than the input time; equal to
zero, indicate that the time displayed by calendar is equal to the
input time; less than zero, indicate that the time displayed by
calendar is less than the input time.
VBScript Example

DateTimePicker0.CompareTime(DateTime.Now)
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

DateTimePicker0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
GetTimeValue
Get the time value
Define
GetTimeValue(name)
Parameter
Data
Name Required/Optional Description
Type
name Required String The name of the time
Return

Returns the time value


Example
Call this script to get the time value, the incoming value y - year, M -
Month, d -Day, h - hour, m - minute, s - seconds, the following script
returns value of the month.
VBScript Example

DateTimePicker0.GetTimeValue("M")
Background
The background color(Colors.Red)
Define
Object Background
Example Set the background color of the specified object
VBScript Example

DateTimePicker0.Background = Colors.Red
FontSize
Font size
Define
Double FontSize
Example
Set the font size of the specified object
VBScript Example

DateTimePicker0.FontSize = 20
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

DateTimePicker0.Height = 100
IntervalHours
Get interval hours
Define
Int32 IntervalHours
Example
Get interval hours to display in the text box
VBScript Example

TextBox0.Text = DateTimePicker0.IntervalHours
IntervalMilliseconds
Get interval milliseconds
Define
Int32 IntervalMilliseconds
Example
Get interval milliseconds to display in the text box
VBScript Example

TextBox0.Text =
DateTimePicker0.IntervalMilliseconds
IntervalMinutes
Get interval minutes
Define
Int32 IntervalMinutes
Example
Get interval minutes to display in the text box
VBScript Example

TextBox0.Text = DateTimePicker0.IntervalMinutes
IntervalSeconds
Get interval seconds
Define
Int32 IntervalSeconds
Example
Get interval seconds to display in the text box
VBScript Example

TextBox0.Text = DateTimePicker0.IntervalSeconds
IsEnabled
Gets or sets a value, the value indicating whether the control can
operation
Define
Boolean IsEnabled
Example
True :The specified object is Enabled
VBScript Example

DateTimePicker0.IsEnabled = True
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

DateTimePicker0.IsShow = True
DateTimePicker0.IsShow = False
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

DateTimePicker0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = DateTimePicker0.Name
Opacity
Opacity
Define
Double Opacity
Example
The graphics display translucent effect
VBScript Example

DateTimePicker0.Opacity = 0.5
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Set the rotation Angle of the specified object to 90
VBScript Example

DateTimePicker0.RotateAngle = 90
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

DateTimePicker0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

DateTimePicker0.Top = 100
Value
Gets or sets values of time of calendar date displayed
Define
DateTime Value
Example
Get values of DataTimePicker0 to display in text box
VBScript Example

TextBox0.Text = DateTimePicker0.Value
ValueTime
Get values of time of calendar date displayed
Define
DateTime ValueTime
Example
Get values of DataTimePicker0 to display in text box
VBScript Example

TextBox0.Text = DateTimePicker0.ValueTime
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

DateTimePicker0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 3
VBScript Example

DateTimePicker0.ZIndex = 3
HMIDatePicker
Date control
Methods list
Name Description
CompareDate Comparison the date
Look for animation to modify the
FindAnimation
associated variables of the animation
Property list
Name Description
Background The background color
BorderBrush Border color
FontSize Font size
Foreground The foreground color
Height Height
Get or set a value, the value indicating
IsEnabled
whether the control can operation
IsShow Whether display the specified object
Left The left coordinate
Name Name
Opacity Opacity
RotateAngle Rotation Angle
Get or set the date string of the date
Text
displayed
ToolTip Tooltip text
Top The top coordinate
ValueTime Get the date value of the calendar
Width Width
ZIndex Layer index
CompareDate
Date comparison
Define
CompareDate(dateTime)
Parameter
Data
Name Required/Optional Description
Type
dateTime Required DateTime
Example
Call this script, compared the current date with the date displayed by
calendar, if the return value is greater than zero, indicate that the
date displayed by calendar is greater than the incoming date; equal
to zero, indicate that the date displayed by calendar is equal to the
incoming date; less than zero, indicate that the date displayed by
calendar is less than the incoming date.
VBScript Example

DatePicker0.CompareDate(DateTime.Now)
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

DatePicker0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Background
The background color(Colors.Red)
Define
Object Background
Example
Set the background color of the specified object
VBScript Example

DatePicker0.Background = Colors.Red
BorderBrush
The border color(Colors.Red)
Define
Object BorderBrush
Example
Set the border color of the specified object
VBScript Example

DatePicker0.BorderBrush = Colors.Red
FontSize
The font size
Define
Double FontSize
Example
Set the font size of the specified object
VBScript Example

DatePicker0.FontSize = 20
Foreground
The foreground color(Colors.Red)
Define
Object Foreground Example
Set the foreground color of the specified object
VBScript Example

DatePicker0.Foreground = Colors.Red
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

DatePicker0.Height = 100
IsEnabled
Gets or sets a value, the value indicating whether the control can
operation
Define
Boolean IsEnabled
Example The specified object is Enabled
VBScript Example

DatePicker0.IsEnabled = True
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

DatePicker0.IsShow = True DatePicker0.IsShow =


False
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

DatePicker0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = DatePicker0.Name
Opacity
Opacity
Define
Double Opacity
Example
The graphics display translucent effect
VBScript Example

DatePicker0.Opacity = 0.5
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Set the rotation Angle of the specified object to 90
VBScript Example

DatePicker0.RotateAngle = 90
Text
Gets or sets up the string of the date displayed
Define
String Text
Example
VBScript Example

DatePicker0.Text = "2014/8/9"
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

DatePicker0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

DatePicker0.Top = 100
ValueTime
Get values of calendar date displayed
Define
DateTime ValueTime
Example
VBScript Example

TextBox0.Text = DatePicker0.ValueTime
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

DatePicker0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 3
VBScript Example

DatePicker0.ZIndex = 3
HMICalendar
Calendar control
Methods list
Name Description
Look for animation to modify the
FindAnimation
associated variables of the animation
Property list
Name Description
Background The background color
BorderBrush The border color
Foreground The foreground color
Get or set a value, the value indicating
IsEnabled
whether the control can operation
IsShow Whether display the specified object
Left The left coordinate
Name Name
Opacity Opacity
ToolTip Tooltip text
Top The top coordinate
ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

Calendar0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Background
The background color(Colors.Red)
Define
Object Background
Example
Set the background color of the specified object
VBScript Example

Calendar0.Background = Colors.Red
BorderBrush
The border color(Colors.Red)
Define
Object BorderBrush
Example
Set the border color of the specified object
VBScript Example

Calendar0.BorderBrush = Colors.Red
Foreground
The foreground color(Colors.Red)
Define
Object Foreground
Example
Set the foreground color of the specified object
VBScript Example

Calendar0.Foreground = Colors.Red
IsEnabled
Gets or sets a value, the value indicating whether the control can
operation
Define
Boolean IsEnabled
Example The specified object is Enabled
VBScript Example

Calendar0.IsEnabled = True
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

Calendar0.IsShow = True Calendar0.IsShow =


False
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

Calendar0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = Calendar0.Name
Opacity
Opacity
Define
Double Opacity
Example
The graphics display translucent effect
VBScript Example

Calendar0.Opacity = 0.5
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

Calendar0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

Calendar0.Top = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 3
VBScript Example

Calendar0.ZIndex = 3
HMIImage
Image control
Methods list
Name Description
Look for animation to modify the
FindAnimation
associated variables of the animation
Property list
Name Description
Height Height
IsShow Whether display the specified object
Left The left coordinate
Name Name
Opacity Opacity
​ RotateAngle Rotation angle
SwitchingPath Switch the image path
ToolTip Tooltip text
Top The top coordinate
Width Width
ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object
into Var.VariableGroup0.Variable1
VBScript Example

Image0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

Image0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

Image0.IsShow = True Image0.IsShow = False


Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

Image0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = Image0.Name
Opacity
Opacity
Define
Double Opacity
Example
The graphics displays translucent effect
VBScript Example

Image0.Opacity = 0.5
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Set the rotation Angle of the specified object to 90
VBScript Example

Image0.RotateAngle = 90
SwitchingPath
Switch the image path
Define
String SwitchingPath
Example Switch the image path, test.jpg must exist under the
Image of the project file
VBScript Example

Image0.SwitchingPath = "C:\test.jpg"
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

Image0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

Image0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

Image0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 3
VBScript Example

Image0.ZIndex = 3
HMIGIFImage
GIF image control
Methods list
Name Description
Look for animation to modify the
​ FindAnimation
associated variables of the animation
​ StartAnimate Start animation
​ StopAnimate Stop animation
Property list
Name Description
​ Height Height
​ IsEnabled whether can operation
​ IsShow Whether display the specified object
​ Left The left coordinate
​ Name Name
​ Opacity Opacity
​ RotateAngle Rotation angle
ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

GIFImage0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
StartAnimate
Start animation
Define
StartAnimate()
Example
Execute the script will start animation of GIF images
VBScript Example

Call GIFImage0.StartAnimate()
StopAnimate
Stop animation
Define
StopAnimate()
Example
Execute the script will stop animation of GIF images
VBScript Example

Call GIFImage0.StopAnimate()
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

GIFImage0.Height = 100
IsEnabled
Gets or sets a value, the value indicating whether the control can
operation
Define
Boolean IsEnabled
Example The specified object is Enabled
VBScript Example

GIFImage0.IsEnabled = True
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

GIFImage0.IsShow = True GIFImage0.IsShow = False


Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

GIFImage0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = GIFImage0.Name
Opacity
Opacity
Define
Double Opacity
Example
The graphics displays translucent effect
VBScript Example

GIFImage0.Opacity = 0.5
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Set the rotation Angle of the specified object to 90
VBScript Example

GIFImage0.RotateAngle = 90
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

GIFImage0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

GIFImage0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

GIFImage0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 3
VBScript Example

GIFImage0.ZIndex = 3
HMINixieTube
Nixie tube control
Methods list
Name Description
Look for animation to modify the
FindAnimation
associated variables of the animation
Property list
Name Description
Background The background color
Bit Digital tube integer number
Get or set a value, the value indicating
​ IsEnabled
whether the control can operation
IsShow Whether display the specified object
Left The left coordinate
Name Name
Number The numeric value displayed
Opacity Opacity
​ RotateAngle Rotation angle
ToolTip Tooltip text
Top The top coordinate
​ ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

NixieTube0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Background
The background color(Colors.Red)
Define
Object Background
Example
Set the background color of the specified object
VBScript Example

NixieTube0.Background = Colors.Red
Bit
Digital tube's integer number
Define
int Bit
Example
Set the integer number to 3
VBScript Example

NixieTube0.Bit = 3
IsEnabled
Gets or sets a value, the value indicating whether the control can
operation
Define
Boolean IsEnabled
Example The specified object is Enabled
VBScript Example

NixieTube0.IsEnabled = True
IsShow
Whether display the specified object
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

NixieTube0.IsShow = True NixieTube0.IsShow =


False
Left
The left coordinate
Define
Double Left
Example
Object's abscissa value of the left side in the picture is 100
VBScript Example

NixieTube0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = NixieTube0.Name
Number
The number displayed by Digital tube
Define
double Number
Example
Set the number of the specified object to 1.23
VBScript Example

NixieTube0.Number = 1.23
Opacity
Opacity
Define
Double Opacity
Example
The graphics display translucent effect
VBScript Example

NixieTube0.Opacity = 0.5
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Sets the rotation Angle of the specified object to 90
VBScript Example

NixieTube0.RotateAngle = 90
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

NixieTube0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example
Objects in the picture on the top of the y coordinate value is 100
VBScript Example

NixieTube0.Top = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 3
VBScript Example

NixieTube0.ZIndex = 3
HMICurvedRuler
Curved ruler control
Methods list
Name Description
Look for animation to modify the
​ FindAnimation
associated variables of the animation
Property list
Name Description
​ BigTickNumber The number of big tick
​ EndOffset The end value of the ruler
​ IsArcVisible Whether display the arc or not
Get or set a value, the value indicating
​ IsEnabled
whether the control can operation
Whether display the specified object or
​ IsShow
not
​ IsTextVisible Whether display the text or not
​ Left The left coordinate
​ LineBrush The current color of the ruler
​ Name Name
​ Opacity Opacity
​ RotateAngle Rotation angle
​ ScanAngle Scan angle
​ SmallTickNumber The number of small tick
​ StartAngle Start angle
​ StartOffset The start value of the ruler
​ TickHeight Height
​ ToolTip Tooltip text
​ Top The top coordinate
​ ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

CurvedRuler0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
BigTickNumber
Gets or sets the number of big scales on the CurvedRuler
Define
Int BigTickNumber
Example Set the number of the big scale to 10
VBScript Example

CurvedRuler0.BigTickNumber = 10
EndOffset
Gets or sets the end value of the CurvedRuler
Define
Double EndOffset
Example Set the end value of the ruler to 110
VBScript Example

CurvedRuler0.EndOffset = 110
IsArcVisible
Whether display the arc or not
Define
Boolean IsArcVisible
Example True:display the arc False:hidden the arc
VBScript Example

CurvedRuler0..IsArcVisible = True
CurvedRuler0..IsArcVisible = False
IsEnabled
Get or set a value, the value indicating whether the control can
operation
Define
Boolean IsEnabled
Example The specified object is Enabled
VBScript Example

CurvedRuler0.IsEnabled = True
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

CurvedRuler0.IsShow = True CurvedRuler0.IsShow =


False
IsTextVisible
Whether display the text or not
Define
Boolean IsTextVisible
Example True:display text False:hidden text
VBScript Example

CurvedRuler0.IsTextVisible = True
CurvedRuler0.IsTextVisible = False
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

CurvedRuler0.Left = 100
LineBrush
Gets or sets the current color of ruler(Colors.red)
Define
Object LineBrush
Example
Set the current color of the specified object
VBScript Example

CurvedRuler0.LineBrush = Colors.red
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = CurvedRuler0.Name
Opacity
Opacity
Define
Double Opacity
Example
The graphics display translucent effect
VBScript Example

CurvedRuler0.Opacity = 0.5
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Sets the rotation Angle of the specified object to 90
VBScript Example

CurvedRuler0.RotateAngle = 90
ScanAngle
Gets or sets the scanning angle of the scale
Define
Double ScanAngle
Example
Sets the scan Angle of the specified object to 180
VBScript Example

CurvedRuler0.ScanAngle = 180
SmallTickNumber
Gets or sets the number of small scales on the CurvedRuler
Define
Int SmallTickNumber
Example Set the number of the small scale to 5
VBScript Example

CurvedRuler0.SmallTickNumber = 5
StartAngle
Start angle
Define
Double StartAngle
Example
The Start Angle value is 90 of the circular arc
VBScript Example

CurvedRuler0.StartAngle = 90
StartOffset
Gets or sets the start value of the CurvedRuler
Define
Double StartOffset
Example Set the start value of the ruler to 10
VBScript Example

CurvedRuler0.StartOffset = 10
TickHeight
Gets or sets the height of the scale
Define
Double TickHeight
Example Set the height of the scale to 10
VBScript Example

CurvedRuler0.TickHeight = 10
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

CurvedRuler0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

CurvedRuler0.Top = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 3
VBScript Example

CurvedRuler0.ZIndex = 3
HMITable
Table control
Methods list
Name Description
Look for animation to modify the
​ FindAnimation
associated variables of the animation
Property list
Name Description
​ DataBackground Set data background color
Set first column background
FirstColumnBackground
color
FirstRowBackground Set first row background color
​ Height Height
Whether to display the specified
​ IsShow
object
Whether display the oblique line
IsShowObliqueLine
in the upper left corner
Whether to enable row cross
IsShowRowCross
display
​ Left The left coordinate
​ Name Name
​ Opacity Opacity
​ RotateAngle Rotation Angle
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
​ ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object
into Var.VariableGroup0.Variable1
VBScript Example

Table0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
DataBackground
Set data background color(Colors.Red),it only works when the row
cross display property is invalid.
Define
Object DataBackground
Example Set data background color
VBScript Example

Table0.DataBackground = Colors.Red
FirstColumnBackground
Set first column background color(Colors.Red), it only works when
the oblique line in the upper left corner is display
Define
Object FirstColumnBackground
Example Set first column background color
VBScript Example

Table0.FirstColumnBackground = Colors.Red
FirstRowBackground
Set first row background color(Colors.Red)
Define
Object FirstRowBackground
Example Set first row background color
VBScript Example

Table0.FirstRowBackground = Colors.Red
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

Table0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

Table0.IsShow = True Table0.IsShow= False


IsShowObliqueLine
Set whether to display the oblique line in the upper left corner
Define
Boolean IsShowObliqueLine
Example True :display the oblique line in the upper left corner
False :hide the oblique line in the upper left corner
VBScript Example

Table0.IsShowObliqueLine = True
Table0.IsShowObliqueLine = False
IsShowRowCross
Set whether to enable the row cross display
Define
Boolean IsShowRowCross
Example True :Enable the property of row cross display False :
Unable the property of row cross display
VBScript Example

Table0.IsShowRowCross = True Table0.IsShowRowCross


= False
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

Table0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = Table0.Name
Opacity
Opacity
Define
Double Opacity
Example
The graphics displays translucent effect
VBScript Example

Table0.Opacity = 0.5
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Set the rotation Angle of the specified object to 90
VBScript Example

Table0.RotateAngle = 90
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

Table0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

Table0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

Table0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 3
VBScript Example

Table0.ZIndex = 3
HMIUniBarcode
UniBarcode control
Methods list
Name Description
Look for animation to modify the
​ FindAnimation
associated variables of the animation
​ Save Save as picture
​ Save Save as picture
Property list
Name Description
​ Background The background color
​ Height Height
Get or set a value, the value indicating
​ IsEnabled
whether the control can operation
​ IsShow Whether display the specified object
​ Left The left coordinate
​ Name Name
​ Opacity Opacity
​ RotateAngle Rotation Angle
Get or the set up the text content of the
​ Text
barcode
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
​ ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

UniBarcode0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Save
Save
Define
Save()
Example
Save
VBScript Example

Call UniBarcode0.Save()
Save
Save as pictures
Define
Save(name)
Parameter
Data
Name Required/Optional Description
Type
The absolute path where the
name Required String
picture is saved

Example
Save
VBScript Example

Call UniBarcode0.Save("D:\UniBarcode.jpg")
Background
The background color(Colors.Red)
Define
Object Background
Example
Set the background color of the specified object
VBScript Example

UniBarcode0.Background = Colors.Red
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

UniBarcode0.Height = 100
IsEnabled
Gets or sets a value, the value indicating whether the control can
operation
Define
Boolean IsEnabled
Example
True :The specified object is Enabled
VBScript Example

UniBarcode0.IsEnabled = True
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

UniBarcode0.IsShow = True UniBarcode0.IsShow =


False
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

UniBarcode0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = UniBarcode0.Name
Opacity
Opacity
Define
Double Opacity
Example
Graphical display translucent effect
VBScript Example

UniBarcode0.Opacity = 0.5
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Set the rotation Angle of the specified object to 90
VBScript Example

UniBarcode0.RotateAngle = 90
Text
Gets or sets up the text content of the barcode
Define
String Text
Example
Set the text of the specified object to "01234567"
VBScript Example

UniBarcode0.Text = "01234567"
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

UniBarcode0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

UniBarcode0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

UniBarcode0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 3
VBScript Example

UniBarcode0.ZIndex = 3
HMIQRCode
QRCode control
Methods list
Name Description
Look for animation to modify the
​ FindAnimation
associated variables of the animation
​ Save Save as picture
​ Save Save as picture
Property list
Name Description
​ Background The background color
​ Height Height
Get or set a value, the value indicating
​ IsEnabled
whether the control can operation
​ IsShow Whether display the specified object
​ Left The left coordinate
​ Name Name
​ Opacity Opacity
​ RotateAngle Rotation Angle
Get or the set up the text content of the
​ Text
QR code
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
​ ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

QRCode0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Save
Save
Define
Save()
Example
Save
VBScript Example

Call QRCode0.Save()
Save
Save as pictures
Define
Save(name)
Parameter
Data
Name Required/Optional Description
Type
The absolute path where the
name Required String
picture is saved

Example
Save
VBScript Example

Call QRCode0.Save("D:\UniBarcode.jpg")
Background
The background color(Colors.Red)
Define
Object Background
Example
Set the background color of the specified object
VBScript Example

QRCode0.Background = Colors.Red
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

QRCode0.Height = 100
IsEnabled
Gets or sets a value, the value indicating whether the control can
operation
Define
Boolean IsEnabled
Example
True :The specified object is Enabled
VBScript Example

QRCode0.IsEnabled = True
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

QRCode0.IsShow = True QRCode0.IsShow = False


Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

QRCode0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = QRCode0.Name
Opacity
Opacity
Define
Double Opacity
Example
Graphical display translucent effect
VBScript Example

QRCode0.Opacity = 0.5
RotateAngle
Rotation Angle
Define
Double RotateAngle
Example
Set the rotation Angle of the specified object to 90
VBScript Example

QRCode0.RotateAngle = 90
Text
Gets or sets up the text content of the QRCode.Does not support
Chinese characters
Define
String Text
Example
Set the text of the specified object to "DIAView test123"
VBScript Example

QRCode0.Text = "DAIView test123"


ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

QRCode0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

QRCode0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

QRCode0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 3
VBScript Example

QRCode0.ZIndex = 3
HMIRealTimeChart
Real time chart control
Methods list
Name Description
​ AddNewLimitLine Add a new limit line
Image array translate into
​ ArrayToString
string
​ DeletevalueAll Delete all data points
​ Export Export data
​ ExportRealData Export excel
Look for animation to modify
​ FindAnimation the associated variables of
the animation
​ HiddenSeries Hidden curve
Get saved path selected by
​ OpenShowFileDialog
dialog box
​ Print Print
​ RemoveAllLimitLine Remove all the limit line
​ Save Save
​ Save Save as pictures
Curve correlation variable
​ SetSeriesVariablePath
substitution
Set the time interval and
​ SetTimeRangeWithRefresh
refresh interval
​ StartTimer Start timer
​ StopTimer Stop timer
​ VisiableSeries Display curves

Property list​
Name Description
​ Height Height
​ IsShow Whether display specified object
Whether display the positioning
​ IsShowBtnCrossLine
line button
​ IsShowBtnLeftMost Whether display the most left
button
Whether display the left shift
​ IsShowBtnLeftShift
button
​ IsShowBtnReSet Whether display the reset button
Whether display the most right
​ IsShowBtnRightMost
button
Whether display the right shift
​ IsShowBtnRigthShift
button
Whether display the curve
​ IsShowRealBtnConfig
configuration button
​ IsShowRealBtnPrint Whether display the print button
​ IsShowRealBtnSave Whether display the save button
Whether display the began or
​ IsShowRealBtnStop
pause button
Whether display the pause time
​ IsShowStopTime
button
​ Left The left coordinate
​ Name Name
Get or set the maximum scale of
​ NumberInterval
numerical axis
Get or set the minimum scale of
​ NumberSmallInterval
numerical axis
Get or set the maximum scale of
​ NumericalAxisMaximum
numerical axis
Get or set the minimum scale of
​ NumericalAxisMinimum
numerical axis
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
​ ZIndex Layer index
AddNewLimitLine
Add new limit line (The "UpperAndLowerDisplay" is checked in the control
property)
Define
AddNewLimitLine(variablePath ,defaultValue ,color , thickness)
Parameter
Name Required/Optional Data Type Description
variablePath Required String Variable path
defaultValue Required Double Default value (default)
color Required Brush Line fill color
thickness Required Double Line thicknesses
Example

Add new limit line

VBScript Example

Call
RealtimeChart0.AddNewLimitLine("Var.Variable",0,Colors.Red,5)
ArrayToString
Image array translate into string
Define
ArrayToString(seriesName)
Parameter

Name Required/Optional Data Type Description


seriesName Required String Name of the curve, separate by commas
Example
Export curve image into the report
The operation steps are as follows:
a.Create a RealTimeChart0 in the screen and associate variables that need to be viewed.
b.Create a new report template "Report0", select a cell to associate real-time variables and refresh time.
c.In the report template, the menu bar --> Realtime Variable --> System --> Image, to add the
corresponding number of curve pictures.
d.Add a button to the created screen and write in the script (the following two different examples):

1. The two diferent curve pictures from two different realtimechart are exported to the same report
("D:\Test.xlsx"is the save path of Excel,"report0"is the report
template,"RealtimeChart0.ArrayToString("Series0")" is the pictures set)
VBScript Example

Call
ReportCmd.ExportDataByTemplate("D:\Test.xlsx","Report0",RealtimeChart0.ArrayTo

2. The two diferent curve pictures from one realtimechart are exported to the same report
VBScript Example

Call
ReportCmd.ExportDataByTemplate("D:\Test.xlsx","Report0",RealtimeChart0.ArrayTo
DeletevalueAll
Delete all data points
Define
DeletevalueAll()
Example
Delete all data points
VBScript Example

Call RealtimeChart0.DeletevalueAll()
Export
Export data
Define
Export(seriesName ,templateName)
Parameter
Data
Name Required/Optional Description
Type
Name of the
seriesName Required String
curve
templateName Required String Report template

Example
Export a curve image into the report
VBScript Example

Call
RealtimeChart0.Export("Series0;Series1","Report0")
ExportRealData
Export excel
Define
ExportRealData(seriesName)
Parameter
Name Required/Optional Data Type Description
seriesName Required String Name of the curve

Example
Export excel
VBScript Example

Call RealtimeChart0.ExportRealData("Series0")
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

RealtimeChart0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
HiddenSeries
Hide the curve
Define
HiddenSeries(seriesName)
Parameter
Data
Name Required/Optional Description
Type
Name of the curve,
seriesName Required String
separate by commas

Example
Hide the curve
VBScript Example

Call RealtimeChart0.HiddenSeries("Series0")
OpenShowFileDialog
Get saved path which selected by dialog box
Define
OpenShowFileDialog()
Example
Get saved path which selected by dialog box
VBScript Example

tt = RealtimeChart0.OpenShowFileDialog()
Call
ReportCmd.ExportDataByTemplate(tt,"Report0",RealtimeChart0.ArrayToString("Seri
Print
Print
Define
Print()
Example
Print
VBScript Example

Call RealtimeChart0.Print()
RemoveAllLimitLine
Remove all the limit line
Define
RemoveAllLimitLine()
Example
Remove all the limit line
VBScript Example

Call RealtimeChart0.RemoveAllLimitLine()
Save
Save
Define
Save()
Example
Save
VBScript Example

Call RealtimeChart0.save()
Save
Save as pictures
Define
Save(path , seriesName)
Parameter
Data
Name Required/Optional Description
Type
path Required String An absolute path
Name of curve,
seriesName Required String
separate by commas

Example
Save
VBScript Example

Call RealtimeChart0.save("D:\test.jpg","Series0")
SetSeriesVariablePath
Curve correlation variable substitution
Define
SetSeriesVariablePath(pathList)
Parameter
Data
Name Required/Optional Description
Type
The new variable path of the variables that replace the
pathList Required String
old variables , separate by commas

Example
Curve correlation variable substitution
VBScript Example

Call RealtimeChart0.SetSeriesVariablePath("Var.variable0,Var.variable1")
SetTimeRangeWithRefresh
Set the time interval and refresh time
Define
SetTimeRangeWithRefresh(rangeH ,rangeM ,rangeS ,refreshH ,
refreshM ,refreshS)
Parameter
Name Required/Optional Data Type Description
rangeH Required Int Time interval,hour
rangeM Required Int Time interval,minute
rangeS Required Int Time interval,second
refreshH Required Int Refresh,hour
refreshM Required Int Refresh,minute
refreshS Required Int Refresh,second
Example
Set the time interval and refresh time
VBScript Example

Call
RealtimeChart0.SetTimeRangeWithRefresh(0,0,1,0,0,1)
StartTimer
Start timer
Define
StartTimer()
Example
Start Timer
VBScript Example

Call RealtimeChart0.StartTimer()
StopTimer
Stop timer
Define
StopTimer()
Example
Stop Timer
VBScript Example

Call RealtimeChart0.StopTimer()
VisiableSeries
Display the curve
Define
VisiableSeries(seriesName)
Parameter
Data
Name Required/Optional Description
Type
Name of the curve,
seriesName Required String
separate by commas

Example
Display the curve
VBScript Example

Call RealtimeChart0.VisiableSeries("Series0")
SetPageRange
Sets the initial page range value
Defination
SetPageRange(index)
Parameter
Name required/Optional Datatype Description
Sets the initial page range
index required int
value

Example
Sets the initial page range value
VBScript Example

Call
realtimechart0.SetPageRange(Var.realtime0.index)
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

RealtimeChart0.Height = 100
IsShow
Whether display the specified object
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

RealtimeChart0.IsShow = True
RealtimeChart0.IsShow = False
IsShowBtnCrossLine
Whether display the positioning line button
Define
Boolean IsShowBtnCrossLine
Example
Display the positioning line
VBScript Example

RealtimeChart0.IsShowBtnCrossLine = True
IsShowBtnLeftMost
Whether display the most left button
Define
Boolean IsShowBtnLeftMost
Example
Display the most left button
VBScript Example

RealtimeChart0.IsShowBtnLeftMost = True
IsShowBtnLeftShift
Whether display the left shift button
Define
Boolean IsShowBtnLeftShift
Example
Display moves to the left button
VBScript Example

RealtimeChart0.IsShowBtnLeftShift = True
IsShowBtnReSet
Whether display the reset button
Define
Boolean IsShowBtnReSet
Example
Display the reset button
VBScript Example

RealtimeChart0.IsShowBtnReSet = True
IsShowBtnRightMost
Whether display the most right button
Define
Boolean IsShowBtnRightMost
Example
Display the most right button
VBScript Example

RealtimeChart0.IsShowBtnRightMost = True
IsShowBtnShiftRigthShift
Whether display the right shift button
Define
Boolean IsShowBtnRigthShift
Example
Display button to the right
VBScript Example

RealtimeChart0.IsShowBtnRigthShift = True
IsShowRealBtnConfig
Whether display the curve configuration button
Define
Boolean IsShowRealBtnConfig
Example
Display curve configuration button
VBScript Example

RealtimeChart0.IsShowRealBtnConfig = True
IsShowRealBtnPrint
Whether display the print button
Define
Boolean IsShowRealBtnPrint
Example
Display print button
VBScript Example

RealtimeChart0.IsShowRealBtnPrint = True
IsShowRealBtnSave
Whether display the save button
Define
Boolean IsShowRealBtnSave
Example
Display the save button
VBScript Example

RealtimeChart0.IsShowRealBtnSave = True
IsShowRealBtnStop
Whether display the begin or pause button
Define
Boolean IsShowRealBtnStop
Example
Display the begin or pause button
VBScript Example

RealtimeChart0.IsShowRealBtnStop = True
IsShowStopTime
Whether display the pause time button
Define
Boolean IsShowStopTime
Example
Display the pause time button
VBScript Example

RealtimeChart0.IsShowStopTime = True
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

RealtimeChart0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = RealtimeChart0.Name
NumberInterval
Get or set the maximum scale of numerical axis
Define
Double NumberInterval
Example
Set the maximum scale of numerical axis to 20
VBScript Example

RealTimeChart0.NumberInterval = 20
NumberSmallInterval
Get or set the minimum scale of numerical axis
Define
Double NumberSmallInterval
Example
Set the minimum scale of numerical axis to 20
VBScript Example

RealTimeChart0.NumberSmallInterval = 4
NumericalAxisMaximum
Get or set the numerical axis maximum
Define
Double NumericalAxisMaximum
Example
Set the numerical axis maximum to 120
VBScript Example

RealTimeChart0.NumberAxisMaximum = 120
NumericalAxisMinimum
Get or set the numerical axis minimum
Define
Double NumericalAxisMinimum
Example
Set the numerical axis minimum to 20
VBScript Example

RealTimeChart0.NumberAxisMinumum = 20
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

RealtimeChart0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

RealtimeChart0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

RealtimeChart0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example
Set the Zindex of the specified object to 3
VBScript Example

RealtimeChart0.ZIndex = 3
HMIHistoryChart
History chart control
Methods list
Name Description
​ AddNewLimitLine Add new limit line
​ ArrayToString Image array translate into string
​ Export Export data
​ Export Export excel
Look for animation to modify
​ FindAnimation the associated variables of the
animation
​ FirstAction The most left
​ GetDataTable Store data to data table
​ HiddenSeries Hidden curve
​ Import Import excel
​ LastAction The most right
​ NextAction Right shift
Get the path of save dialog
​ OpenShowFileDialog
select
​ PreAction Left shift
​ Print Print
Set the end time of the query
​ QueryEndTime
data
​ QueryHistoryDate Query of the historical data
Query of the historical data(with
​ QueryHistoryDate
parameters)
​ QueryInveral Set the query interval
Set the start time of the query
​ QueryStartTime
data
​ QueryUnit Set the query unit
​ RemoveAllLimitLine Remove all the limit line
​ Save Save
​ Save Save as pictures
​ SetSeriesVariablePath Curve correlation variable
substitution
​ SetVarRecordRulerName Set the name of query rule
​ VisiableSeries Display curve
Property list
Name Description
​ Height Height
Whether display the specified
​ IsShow
object
Whether display the curve
​ IsShowBtnConfig
configuration button
Whether display the positioning
​ IsShowBtnCrossLine
line
Whether display the import and
​ IsShowBtnMenu
export button
​ IsShowBtnPrint Whether display the print button
​ IsShowBtnSave Whether display the save button
​ IsShowBtnUpdate Whether display the query button
Whether display the quick time
​ IsShowCbTime
setting button
Whether display the time setting
​ IsShowSetTime
button
​ IsShowStatusBar Whether display the status column
​ IsShowToolBar Whether display the tools column
​ Left The left coordinate
​ Name Name
Get or set the maximum value of
​ NumberAxisMaximum
numerical axis
Get or set the minimum value of
​ NumberAxisMinimum
numerical axis
Get or set the maximum scale of
​ NumberInterval
numerical axis
Get or set the minimum scale of
​ NumberSmallInterval
numerical axis
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
​ ZIndex Layer index
AddNewLimitLine
Add new limit line (The "UpperAndLowerDisplay" is checked in the control
property)
Define
AddNewLimitLine(variablePath ,defaultValue ,color , thickness)
Parameter
Name Required/Optional Data Type Description
variablePath Required String Variable path
defaultValue Required Double Default value (default)
color Required Brush Line fill color
thickness Required Double Line thicknesses
Example

Add a new limit line

VBScript Example

Call
HistoryChart0.AddNewLimitLine("Var.variable",0,Colors.Red,5)
ArrayToString
Image array translate into string
Define
ArrayToString(seriesName)
Parameter

Name Required/Optional Data Type Description


seriesName Required String Name of the curve, separate by commas
Example
Export curve image into the report
The operation steps are as follows:
a.Create a HistoryChart0 in the screen and associate variables that need to be viewed.
b.Create a new report template "Report0", select a cell to associate history variables and time.
c.In the report template, the menu bar --> Realtime Variable --> System --> Image, to add the
corresponding number of curve pictures.
d.Add a button to the created screen and write in the script:
VBScript Example

dt = HistoryChart0.GetDataTable("Series0") ' Get "series0" data of the HistoryChart0


dt1 = HistoryChart1.GetDataTable("Series0")
dt2 = HistoryChart2.GetDataTable("Series0")
Call DbAccessCmd.SetPrimary(dt,"TriggerTime") 'Set "TriggerTime" as the primary key
Call DbAccessCmd.SetPrimary(dt1,"TriggerTime")
Call DbAccessCmd.SetPrimary(dt2,"TriggerTime")
Call dt.Merge(dt1) 'Merge dt1 data into dt
Call dt.Merge(dt2)
Call
ReportCmd.ExportDataByTemplate("D:\Test12.xlsx","Report0",dt,HistoryChart0.Ar
Export
Export curve with report template
Define
Export(saveFilePath ,seriesName ,templateName)
Parameter
Data
Name Required/Optional Description
Type
Save the full path, the default is empty
saveFilePath Required String
string
seriesName Required String Name of the curve
templateName Required String Report template
Example
1.Export Curve picture through dialog
VBScript Example

Call HistoryChart0.Export("","Series0;Series1","Report0")

2.Export Curve picture to specified path


VBScript Example

Call
HistoryChart0.Export("D:\Test1.xlsx","Series0;Series1","Report0")
Export
Export excel
Define
Export(seriesName)
Parameter
Name Required/Optional Data Type Description
seriesName Required String Name of the curve

Example
Export curve image into excel
VBScript Example

Call HistoryChart0.Export("Series0")
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

HistoryChart0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
FirstAction
The most left
Define
FirstAction()
Example
The most left
VBScript Example

Call HistoryChart0.FirstAction()
GetDataTable
Store data to data table
Define
GetDataTable(seriesName)
Parameter

Name Required/Optional Data Type Description


seriesName Required String Name of curve, separate by commas
Example

Store data to data table

VBScript Example

dt = HistoryChart0.GetDataTable("Series0") 'Get data of "Series0"


dt1 = HistoryChart0.GetDataTable("Series1")
Call DbAccessCmd.SetPrimary(dt,"TriggerTime") 'Set "TriggerTime" as primary key
Call DbAccessCmd.SetPrimary(dt1,"TriggerTime")
Call dt.Merge(dt1) 'merge dt1 data into dt
Call
ReportCmd.ExportDataByTemplate("D:\Test12.xlsx","Report2",dt,HistoryChart0.Ar
HiddenSeries
Hide curve
Define
HiddenSeries(seriesName)
Parameter
Data
Name Required/Optional Description
Type
Name of curve,
seriesName Required String
separate by commas

Example
Hide curve
VBScript Example

Call HistoryChart0.HiddenSeries("Series0")
Import
Import excel
Define
Import(seriesName)
Parameter
Data
Name Required/Optional Description
Type
The name of
seriesName Required String
import curve

Example
Import excel
VBScript Example

Call HistoryChart0.Import("Series0")
LastAction
The most right
Define
LastAction()
Example
The most right
VBScript Example

Call HistoryChart0.LastAction()
NextAction
Right shift
Define
NextAction()
Example
Right shift
VBScript Example

Call HistoryChart0.NextAction()
OpenShowFileDialog
Get saved path which selected by dialog box
Define
OpenShowFileDialog()
Example
Get saved path which selected by dialog box
VBScript Example

tt = HistoryChart0.OpenShowFileDialog()
Call
ReportCmd.ExportDataByTemplate(tt,"Report0",HistoryChart0.ArrayToString("Serie
PreAction
Left shift
Define
PreAction()
Example
Left shift
VBScript Example

Call HistoryChart0.PreAction()
Print
Print
Define
Print()
Example
Print
VBScript Example

Call HistoryChart0.Print()
QueryEndTime
Set the end time of the query data
Define
QueryEndTime(dt)
Parameter
Name Required/Optional Data Type Description
dt Required DateTime End time

Example
Set the end time of the query data
VBScript Example

Call
HistoryChart0.QueryStartTime(DateTimePicker0.ValueTime)
Call
HistoryChart0.QueryEndTime(DateTimePicker1.ValueTime)
Call HistoryChart0.QueryInveral(1)
Call HistoryChart0.QueryUnit(0)
Call HistoryChart0.QueryHistoryDate()
QueryHistoryDate
Query of the historical data
Define
QueryHistoryDate()
Example
1.Query the historical data(Timing record)
VBScript Example

Call
HistoryChart0.QueryStartTime(DateTimePicker0.ValueTime)
Call
HistoryChart0.QueryEndTime(DateTimePicker1.ValueTime)
Call HistoryChart0.SetVarRecordRulerName("s1")
Call HistoryChart0.QueryHistoryDate()

2.Query the historical data(Change record)


VBScript Example

Call
HistoryChart0.QueryStartTime(DateTimePicker0.ValueTime)
Call
HistoryChart0.QueryEndTime(DateTimePicker1.ValueTime)
Call HistoryChart0.QueryHistoryDate()

3.Query the historical group data


VBScript Example

Call
HistoryChart0.QueryStartTime(DateTimePicker0.ValueTime)
Call
HistoryChart0.QueryEndTime(DateTimePicker1.ValueTime)
Call HistoryChart0.QueryInveral(1)
Call HistoryChart0.QueryUnit(0)
Call HistoryChart0.QueryHistoryDate()
QueryHistoryDate
Query of the historical data
Define
QueryHistoryDate(startTime , endTime , inveralTime , index)
Parameter

Data
Name Required/Optional Description
Type
startTime Required DateTime Start time
endTime​ Required DateTime End time
inveralTime Required Int Time interval
Time interval unit(Value of 0-5,Corresponding to s、
index Required Int
mi、h、d、m、y)
Example
1.Query the historical data(Timing record)
VBScript Example

Call HistoryChart0.SetVarRecordRulerName("s1") 'Set the query rule to "s1"


Call
HistoryChart0.QueryHistoryDate(DateTimePicker0.ValueTime,DateTimePicker1.Value

2.Query the historical data(Change record) or Query the historical group data
VBScript Example

Call
HistoryChart0.QueryHistoryDate(DateTimePicker0.ValueTime,DateTimePicker1.Value
QueryInveral
Set the query interval
Define
QueryInveral(inveral)
Parameter
Name Required/Optional Data Type Description
inveral Required Int Interval

Example
Query the historical group data
VBScript Example

Call
HistoryChart0.QueryStartTime(DateTimePicker0.ValueTime)
Call
HistoryChart0.QueryEndTime(DateTimePicker1.ValueTime)
Call HistoryChart0.QueryInveral(1)
Call HistoryChart0.QueryUnit(0)
Call HistoryChart0.QueryHistoryDate()
QueryStartTime
Set the start time of the query data
Define
QueryStartTime(dt)
Parameter
Name Required/Optional Data Type Description
dt Required DateTime Start time

Example
Query the historical group data
VBScript Example

Call
HistoryChart0.QueryStartTime(DateTimePicker0.ValueTime)
Call
HistoryChart0.QueryEndTime(DateTimePicker1.ValueTime)
Call HistoryChart0.QueryInveral(1)
Call HistoryChart0.QueryUnit(0)
Call HistoryChart0.QueryHistoryDate()
QueryUnit
Set the query unit
Define
QueryUnit(index)
Parameter

Data
Name Required/Optional Description
Type
Time interval unit(Value of 0-5,
index​ Required Int
Corresponding to s、mi、h、d、m、y)
Example

Query the historical group data

VBScript Example

Call
HistoryChart0.QueryStartTime(DateTimePicker0.ValueTime)
Call
HistoryChart0.QueryEndTime(DateTimePicker1.ValueTime)
Call HistoryChart0.QueryInveral(1)
Call HistoryChart0.QueryUnit(0)
Call HistoryChart0.QueryHistoryDate()
RemoveAllLimitLine
Remove all limit line
Define
RemoveAllLimitLine()
Example
Remove all limit line
VBScript Example

Call HistoryChart0.RemoveAllLimitLine()
Save
Save
Define
Save()
Example
Save
VBScript Example

Call HistoryChart0.Save()
Save
Save as pictures
Define
Save(path , seriesName)
Parameter
Data
Name Required/Optional Description
Type
path Required String Absolute path
Name of curve,
seriesName Required String
separate by commas

Example
Save
VBScript Example

CallHistoryChart0.Save("D:\test.jpg","Series0")
SetSeriesVariablePath
Curve correlation variable substitution
Define
SetSeriesVariablePath(pathList)
Parameter
Data
Name Required/Optional Description
Type
The new variable path of the variables that replace the
pathList​ Required String
old variables , separate by commas

Example
Curve correlation variable substitution
VBScript Example

Call HistoryChart0.SetSeriesVariablePath("Var.variable0,Var.variable1")
SetVarRecordRulerName
Set the name of query rule
Define
SetVarRecordRulerName(RuleName)
Parameter
Name Required/Optional Data Type Description
RuleName Required String The name of timer

Example
Set the name of query rule,s1 is the timer name
VBScript Example

Call HistoryChart0.SetVarRecordRulerName("s1")
VisiableSeries
Display the curve
Define
VisiableSeries(seriesName)
Parameter
Data
Name Required/Optional Description
Type
Name of curve,
seriesName Required String
separate by commas

Example
Display the curve
VBScript Example

Call HistoryChart0.VisiableSeries("Series0")
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

HistoryChart0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

HistoryChart0.IsShow = True HistoryChart0.IsShow


= False
IsShowBtnConfig
Whether display the curve configuration button
Define
Boolean IsShowBtnConfig
Example
Whether display curve configuration button
VBScript Example

HistoryChart0.IsShowBtnConfig = True
IsShowBtnCrossLine
Whether display the positioning line button
Define
Boolean IsShowBtnCrossLine
Example
Display the positioning line
VBScript Example

HistoryChart0.IsShowBtnCrossLine = True
IsShowBtnMenu
Whether display the import or export button
Define
Boolean IsShowBtnMenu
Example
Display of import or export button
VBScript Example

HistoryChart0.IsShowBtnXYMenu = True
IsShowBtnPrint
Whether display the print button
Define
Boolean IsShowBtnPrint
Example
Display of print button
VBScript Example

HistoryChart0.IsShowBtnPrint = True
IsShowBtnSave
Whether display the save button
Define
Boolean IsShowBtnSave
Example
Display of save button
VBScript Example

HistoryChart0.IsShowBtnSave = True
IsShowBtnUpdate
Whether display the query button
Define
Boolean IsShowBtnUpdate
Example
Display of query button
VBScript Example

HistoryChart0.IsShowBtnUpdate = True
IsShowCbTime
Whether display the quick time setting button
Define
Boolean IsShowCbTime
Example
Display of quick time setting button
VBScript Example

HistoryChart0.IsShowCbTime = True
IsShowSetTime
Whether display the time setting button
Define
Boolean IsShowSetTime
Example
Display of time setting button
VBScript Example

HistoryChart0.IsShowSetTime = True
IsShowStatusBar
Whether display the the status column
Define
Boolean IsShowStatusBar
Example
Whether to display the status column
VBScript Example

HistoryChart0.IsShowStatusBar = True
IsShowToolBar
Whether display the tools column
Define
Boolean IsShowToolBar
Example
Whether display the tools column
VBScript Example

HistoryChart0.IsShowToolBar = True
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

HistoryChart0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = HistoryChart0.Name
NumberAxisMaximum
Get or set the maximum scale of numerical axis
Define
Double NumberAxisMaximum
NumberAxisMinimum
Get or set the minimum scale of numerical axis
Define
Double NumberAxisMinimum
NumberInterval
Get or set the large scale of numerical axis
Define
Double NumberInterval
NumberSmallInterval
Get or set the small scale of numerical axis
Define
Double NumberSmallInterval
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

HistoryChart0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

HistoryChart0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

HistoryChart0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 3
VBScript Example

HistoryChart0.ZIndex = 3
HMIXYChart
XY chart control
Methods list
Name Description
​ AddNewLimitLine Add a new limit line
​ AddPoint New data points
Image array translate into
​ ArrayToString
string
​ DeletePoint Delete the data points
​ DeletevalueAll Delete all the data points
​ Export Export the visible curve
​ ExportHistoryData Export history data
​ ExportRealData Export real-time data
​ ExportRealData Export real-time data
Look for animation to modify
​ FindAnimation the associated variables of the
animation
​ FirstAction The most left
​ GetDataTable Store data to data table
​ HiddenSeries Hide curve
​ HistoryXySeriesExport Export history XY curve
​ Import Import excel
​ LastAction The most right
Bottom margin under the
​ MarginBottom
curve
​ MarginLeft Left margin of the curve
​ MarginRight Right margin of the curve
​ MarginTop Top margin of the curve
​ NextAction Right shift
Get the path of save which
​ OpenShowFileDialog
dialog select
​ PreAction Left shift
​ Print Print
​ QueryDate Data query
​ QueryEndTime Set the end time of the query
data
​ QueryHistoryDate Query of the historical data
​ QueryInveral Set the query interval
Set the start time of the query
​ QueryStartTime
data
​ QueryUnit Set the query unit
​ RemoveAllLimitLine Remove all limit line
​ Save Save
​ Save Save as pictures
​ SeriesIsUpdate whether to update the curve
Set the color of points and
​ SetLimitLinePointColor
curves outside the limit line
Set the color of points and
​ SetLineAndPointColor
curves
Set the range of the vertical
​ SetSeriesMultiAxisMaxMin
axis of the multi-axis curve
Curve correlation variable
​ SetSeriesVariablePath
substitution
​ SetVarRecordRulerName Set the name of query rule
​ StartTimer Start timer
​ StopTimer Stop timer
​ UpdatePoint Update data point
​ VisiableSeries Display the curve
​ XAxisTransformRatio The X axis ratio
XY curvilinear coordinates
​ XyValueTransform translate into window
coordinates
​ YAxisTransformRatio The Y axis ratio

Property list​
Name Description
​ DataSize Refresh count
​ Height Height
​ IsShow Whether display the specified
object
Whether display the positioning
​ IsShowBtnCrossLine
line button
​ IsShowBtnXYClear Whether display the clear button
​ IsShowBtnXYDown Whether display the down button
Whether display the left shift
​ IsShowBtnXYLeft
button
Whether display the import and
​ IsShowBtnXYMenu
export button
​ IsShowBtnXYPrint Whether display the print button
Whether display the real-time
​ IsShowBtnXYRelConfig
curve configuration button
Whether display the right shift
​ IsShowBtnXYRight
button
​ IsShowBtnXYSave Whether display the save button
Whether display the start or stop
​ IsShowBtnXYStop
button
​ IsShowBtnXYUp Whether display the up button
Whether display the history curve
​ IsShowHtBtnXYConfig
configuration button
Whether display the history curve
​ IsShowHtBtnXYQuery
query button
Whether display the the status
​ IsShowStatusBar
column
Whether display the quick time
​ IsShowXYCbTime
setting button
Whether display the time setting
​ IsShowXYSetTime
button
Left The left coordinate
Name Name
ToolTip Tooltip text
Top The top coordinate
Width Width
​ XAxisInterval Get or set the large scale of X
axis
​ XAxisMaximum Get or set the maximum of X axis
​ XAxisMinimum Get or set the minimum of X axis
Get or set the small scale of X
​ XAxisSmallInterval
axis
Get or set the large scale of Y
​ YAxisInterval
axis
​ YAxisMaximum Get or set the maximum of Y axis
​ YAxisMinimum Get or set the minimum of Y axis
Get or set the small scale of Y
​ YAxisSmallInterval
axis
ZIndex Layer index
AddNewLimitLine
Add new limit line (The "UpperAndLowerDisplay" is checked in the
control property)
Define
AddNewLimitLine(variablePath ,defaultValue ,color , thickness)
Parameter
Data
Name Required/Optional Description
Type
variablePath Required String Variable path
Default value
defaultValue Required Double
(default)
color Required Brush Line fill color
thickness Required Double Line thicknesses
Example

Add new limit line

VBScript Example

Call XYchart0.AddNewLimitLine("Var.变
量",90,Colors.Red,5)
AddPoint
Add data point
Define
AddPoint(seriesName ,x ,y)
Parameter
Data
Name Required/Optional Description
Type
seriesName Required String curve name
x Required Double X value
y Required Double Y value

Example
Add data point
VBScript Example

Call XYchart0.AddPoint("Series0",50,50)
ArrayToString
Image array translate into string
Define
ArrayToString(seriesName)
Parameter

Name Required/Optional Data Type Description


seriesName Required String Name of the curve, separate by commas
Example1
Export real-time curve image of XYChart into the report:
The operation steps are as follows:
a.Create a XYChart0 in the screen and associate variables that need to be viewed.
b.Create a new report template "Report0", select a cell to associate real-time variables and refresh time.
c.In the report template, the menu bar --> Realtime Variable --> System --> Image, to add the
corresponding number of curve pictures.
d.Add a button to the created screen and write in the script (the following two different examples):
1. The two diferent curve pictures from two different realtimechart are exported to the same report
("D:\Test.xlsx"is the save path of Excel,"report0"is the report
template,"RealtimeChart0.ArrayToString("Series0")" is the pictures set)
VBScript Example

Call
ReportCmd.ExportDataByTemplate("D:\Test.xlsx","Report0",XYChart0.ArrayToString

2. The two diferent curve pictures from one realtimechart are exported to the same report
VBScript Example

Call
ReportCmd.ExportDataByTemplate("D:\Test.xlsx","Report0",XYChart0.ArrayToString
Example2
The two diferent curve pictures from two different XYchart are exported to the same report
The operation steps are as follows:
a.Create a XYChart0 in the screen and associate variables that need to be viewed.
b.Create a new report template "Report0", select a cell to associate history variables and time.
c.In the report template, the menu bar --> Realtime Variable --> System --> Image, to add the
corresponding number of curve pictures.
d.Add a button to the created screen and write in the script:
VBScript Example

dt = XYChart0.GetDataTable("SeriesConfig0,SeriesConfig1")
Call
ReportCmd.ExportDataByTemplate("D:\test.xlsx","Report0",dt,XYChart0.ArrayToSt
DeletePoint
Delete data point
Define
DeletePoint(seriesName , itemIndex)
Parameter
Data
Name Required/Optional Description
Type
seriesName Required String Name of curve
select the curve
itemIndex Required int
points' index

Example
Delete data point
VBScript Example

Call XYChart0.DeletePoint("Series0",0)
DeletevalueAll
Delete all data points
Define
DeletevalueAll()
Example
Delete all data points
VBScript Example

Call XY曲线0.DeletevalueAll()
Export
Export the visible curve
Define
Export(exportSeriesName)
Parameter
Name Required/Optional Data Type Description
seriesName Required String The name of the curve

Example
Export the visible curve
VBScript Example

Call XYChart0.Export("Series0,SeriesConfig0,SeriesConfig1")
ExportHistoryData
Export history data
Define
ExportHistoryData(historyseriesName)
Parameter
Data
Name Required/Optional Description
Type
The name of
historyseriesName Required String
curve

Example
Export history data
VBScript Example

Call XYChart0.ExportHistoryData("Series0")
ExportRealData
Export real-time data
Define
ExportRealData(seriesName)
Parameter
Name Required/Optional Data Type Description
seriesName Required String The name of curve

Example
Export real-time data
VBScript Example

Call XYChart0.ExportRealData("Series0")
ExportData
Export data
Define
ExportRealData(seriesName , templateName)
Parameter
Data
Name Required/Optional Description
Type
seriesName Required String The name of curve
The name of report
templateName Required String
template

Example
Export data
VBScript Example

Call XYChart0.ExportRealData("Series0","Report0")
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

XYChart0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
FirstAction
The most left
Define
FirstAction()
Example
The most left
VBScript Example

Call XYChart0.FirstAction()
GetDataTable
Store data to data table
Define
GetDataTable(seriesName)
Parameter
Data
Name Required/Optional Description
Type
Name of the curve, separate by
seriesName Required String
commas

Example
Store data to data table
VBScript Example

dim dt
dt = XYChart0.GetDataTable("SeriesConfig0")
Call ReportCmd.DirectExportDataToExcel(dt,"D:\XYDT.xlsx",1)
HiddenSeries
The hidden curve
Define
HiddenSeries(seriesName)
Parameter
Data
Name Required/Optional Description
Type
Name of the curve,
seriesName Required String
separate by commas

Example
The hidden curve
VBScript Example

Call XYChart0.HiddenSeries("Series0")
HistoryXySeriesExport
Export data
Define
HistoryXySeriesExport(seriesName , templateName)
Parameter
Data
Name Required/Optional Description
Type
seriesName Required String History curve of XY name
The name of report
templateName Required String
template

Example
Export data
VBScript Example

Call XYChart0.HistoryXySeriesExport("Series0","Report0")
Import
Import excel
Define
Import(seriesName)
Parameter
Data
Name Required/Optional Description
Type
The name of the
seriesName Required String
import curve

Example
Import excel
VBScript Example

Call XYChart0.Import("Series0")
LastAction
The most right
Define
LastAction()
Example
The most right
VBScript Example

Call XYChart0.LastAction()
MarginBottom
Bottom margin under the curve
Define
MarginBottom()
Example
Bottom margin under the curve
VBScript Example

Button0.Content = XYChart0.MarginBottom()
MarginLeft
Left margin of the curve
Define
MarginLeft()
Example
Left margin of the curve
VBScript Example

Button0.Content = XYChart0.Marginleft()
MarginRight
Right margin of the curve
Define
MarginRight()
Example
Right margin of the curve
VBScript Example

Button0.Content = XYChart0.MarginRight()
MarginTop
Top margin of the curve
Define
MarginTop()
Example
Top margin of the curve
VBScript Example

Button0.Content = XYChart0.MarginTop()
NextAction
Right shift
Define
NextAction()
Example
Right shift
VBScript Example

Call XYChart0.NextAction()
OpenShowFileDialog
Get the saved path which selected by dialog box
Define
OpenShowFileDialog()
Example
Get saved path which selected by dialog box
VBScript Example

tt = XYChart0.OpenShowFileDialog()
Call
ReportCmd.ExportDataByTemplate(tt,"Report0",XYChart0.ArrayToString("Series0")&
PreAction
Left shift
Define
PreAction()
Example
Left shift
VBScript Example

Call XYChart0.PreAction()
Print
Print
Define
Print()
Example
Print
VBScript Example

Call XYChart0.Print()
QueryDate
Query history data
Define
QueryDate()
Example
1.Query the historical data(Timing record)
VBScript Example

Call
XYChart0.QueryStartTime(DateTimePicker0.ValueTime)
Call
XYChart0.QueryEndTime(DateTimePicker1.ValueTime)
Call XYChart0.SetVarRecordRulerName("s1")
Call XYChart0.QueryHistoryDate()

2.Query the historical data(Change record)


VBScript Example

Call
XYChart0.QueryStartTime(DateTimePicker0.ValueTime)
Call
XYChart0.QueryEndTime(DateTimePicker1.ValueTime)
Call XYChart0.QueryHistoryDate()

3.Query the historical group data


VBScript Example

Call
XYChart0.QueryStartTime(DateTimePicker0.ValueTime)
Call
XYChart0.QueryEndTime(DateTimePicker1.ValueTime)
Call XYChart0.QueryInveral(1)
Call XYChart0.QueryUnit(0)
Call XYChart0.QueryHistoryDate()
QueryEndTime
Set the end time of the query data
Define
QueryEndTime(dt)
Parameter
Name Required/Optional Data Type Description
dt Required DateTime End time

Example
Set the end time of the query data
VBScript Example

Call
XYChart0.QueryStartTime(DateTimePicker0.ValueTime)
Call
XYChart0.QueryEndTime(DateTimePicker1.ValueTime)
Call XYChart0.QueryInveral(1)
Call XYChart0.QueryUnit(0)
Call XYChart0.QueryHistoryDate()
QueryHistoryDate
Query history data
Define
QueryHistoryDate(startTime , endTime , inveralTime , index)
Parameter

Data
Name Required/Optional Description
Type
startTime Required DateTime Start time
endTime​ Required DateTime End time
inveralTime Required Int Time interval
Time interval unit(Value of 0-5,Corresponding to s、
index​ Required Int
mi、h、d、m、y)
Example
1.Query the historical data(Timing record)
VBScript Example

Call XYChart0.SetVarRecordRulerName("s1")
Call
XYChart0.QueryHistoryDate(DateTimePicker0.ValueTime,DateTimePicker1.ValueTime

2.Query the historical data(Change record) or Query the historical group data
VBScript Example

Call
XYChart0.QueryHistoryDate(DateTimePicker0.ValueTime,DateTimePicker1.ValueTime
QueryInveral
Set the query interval
Define
QueryInveral(inveral)
Parameter
Name Required/Optional Data Type Description
inveral Required Int Time interval

Example
Query the historical group data
VBScript Example

Call
XYChart0.QueryStartTime(DateTimePicker0.ValueTime)
Call
XYChart0.QueryEndTime(DateTimePicker1.ValueTime)
Call XYChart0.QueryInveral(1)
Call XYChart0.QueryUnit(0)
Call XYChart0.QueryHistoryDate()
QueryStartTime
Set the start time of the data query
Define
QueryStartTime(dt)
Parameter
Name Required/Optional Data Type Description
dt Required DateTime start time

Example
Query the historical group data
VBScript Example

Call
XYChart0.QueryStartTime(DateTimePicker0.ValueTime)
Call
XYChart0.QueryEndTime(DateTimePicker1.ValueTime)
Call XYChart0.QueryInveral(1)
Call XYChart0.QueryUnit(0)
Call XYChart0.QueryHistoryDate()
QueryUnit
Set the query unit
Define
QueryUnit(index)
Parameter
Data
Name Required/Optional Description
Type
Time interval unit(Value of 0-
index​ Required Int 5,Corresponding to s、mi、h、
d、m、y)
Example
Query the historical group data
VBScript Example

Call
XYChart0.QueryStartTime(DateTimePicker0.ValueTime)
Call
XYChart0.QueryEndTime(DateTimePicker1.ValueTime)
Call XYChart0.QueryInveral(1)
Call XYChart0.QueryUnit(0)
Call XYChart0.QueryHistoryDate()
RemoveAllLimitLine
Remove all limit line
Define
RemoveAllLimitLine()
Example
Remove all limit line
VBScript Example

Call XYChart0.RemoveAllLimitLine()
Save
Save
Define
Save()
Example
Save
VBScript Example

Call XYChart0.Save()
Save
Save as pictures
Define
Save(path , seriesName)
Parameter
Data
Name Required/Optional Description
Type
path Required String Absolute path
The name of curve,
seriesName Required String
separate by commas

Example
Save
VBScript Example

Call XYChart0.Save("D:\test.jpg","Series0")
SeriesIsUpdate
Whether to update the curve
Define
SeriesIsUpdate(seriesName ,isUpdate)
Parameter
Data
Name Required/Optional Description
Type
The name of curve,
seriesName Required String
separate by commas
isUpdate Required Bool whether to update

Example
Whether to update the curve
VBScript Example

Call XYChart0.SeriesIsUpdate("Series0",True)
SetLimitLinePointColor
Set the color of points and curves outside the limit line
Define
SetLimitLinePointColor(maxVariablePath , minVariablePath ,brush )
Parameter

Data
Name Required/Optional Description
Type
Variable path of the maximum value of the
maxVariablePath Required String
limit line
Variable path of the minimum value of the
minVariablePath Required String
limit line
brush Required Brush New color of the points and curves
Example
Set the color of points and curves outside the limit line
Note: LINE+Metro+this script: Ten sections of different colors of points and curves update
Circularly
LINE+Custom+this script: The points and curves colors outside the limit line are the color set
by the script
LINE+Normal+this script: The points color outside the limit line are the color set by the script,
and the curves color don't change.
VBScript Example

Call
XYChart0.SetLimitLinePointColor("Var.XY.up","Var.XY.Lower",Colors.Red)
SetLineAndPointColor
Set the color of points and curves
Define
SetLineAndPointColor(brush )
Parameter
Data
Name Required/Optional Description
Type
New color of the points and
brush Required Brush
curves
Example
Set the color of points and curves
Note: LINE+Metro+this script: Ten sections of different colors of
points and curves update Circularly
LINE+Custom+this script: The points and curves colors are the color
set by the script
LINE+Normal+this script: The points color are the color set by the
script, and the curves color don't change.
VBScript Example

Call XYChart0.SetLineAndPointColor(Colors.Red)
SetSeriesMultiAxisMaxMin
Set the range of the vertical axis of the multi-axis curve
Define
SetSeriesMultiAxisMaxMin(seriesName , max , min)
Parameter
Name Required/Optional Data Type Description
seriesName Required String Curve name
max Required Double Set the max value
min Required Double Set the min value
Example
Set the maximum and minimum values of the vertical axis of the multi-
axis curve Series0 to 120 and -20 respectively
VBScript Example

call
XYChart0.SetSeriesMultiAxisMaxMin("Series0",120,-20)
SetSeriesVariablePath
Curve correlation variable substitution
Define
SetSeriesVariablePath(relpathList,htpathList)
Parameter

Data
Name Required/Optional Description
Type
The new variable path of the real-time variables that replace
relpathList Required String the old variables,group X and Y variables are separated by a
semicolon,variable groups are separated by commas
The new variable path of the history variables that replace the
htpathList Required String old variables,group X and Y variables are separated by a
semicolon,variables groups are separated by commas
Example

Curve correlation variable substitution

VBScript Example

Call
XYChart0.SetSeriesVariablePath("Var.variable0;Var.variable1","HistoryRecord;Hi
SetVarRecordRulerName
Set the name of query rule
Define
SetVarRecordRulerName(RuleName)
Parameter
Name Required/Optional Data Type Description
RuleName Required String The name of timer
Example
1.Set the name of query rule,s1 is the timer name
VBScript Example

Call XYChart0.SetVarRecordRulerName("s1")

2.Query the historical data(Timing record)


VBScript Example

Call
XYChart0.QueryStartTime(DateTimePicker0.ValueTime)
Call
XYChart0.QueryEndTime(DateTimePicker1.ValueTime)
Call XYChart0.SetVarRecordRulerName("s1")
Call XYChart0.QueryHistoryDate()
StartTimer
Start timer
Define
StartTimer()
Example
Start timer
VBScript Example

Call XYChart0.StartTimer()
StopTimer
Stop timer
Define
StopTimer()
Example
Stop timer
VBScript Example

Call XYChart0.StopTimer()
UpdatePoint
Update data point
Define
UpdatePoint(seriesName ,itemIndex , x , y)
Parameter
Data
Name Required/Optional Description
Type
Name of curve,
seriesName Required String
separate by commas
itemIndex​ Required Int Select the curve index
x Required Double Data point
y Required Double Data point
Example

Update data point

VBScript Example

Call XYChart0.UpdatePoint("Series0",0,50,50)
VisiableSeries
Display curves
Define
VisiableSeries(seriesName)
Parameter
Data
Name Required/Optional Description
Type
Name of the curve,
seriesName Required String
separate by commas

Example
Display curves
VBScript Example

Call XYChart0.VisiableSeries("Series0")
XAxisTransformRatio
The X axis ratio
Define
XAxisTransformRatio()
Example
The X axis ratio
VBScript Example

Button0.Content = XYChart0.XAxisTransformRatio()
XyValueTransform
XY curvilinear coordinates into window coordinates
Define
XyValueTransform(xy)
Parameter
Data
Name Required/Optional Description
Type
Coordinates type string,
seriesName Required String
such as "20,20"

Example
XY curvilinear coordinates into window coordinates
VBScript Example

Button0.Content =
XYChart0.XyValueTransform("20,20")
YAxisTransformRatio
The Y axis ratio
Define
YAxisTransformRatio()
Example
The Y axis ratio
VBScript Example

Button0.Content = XYChart0.YAxisTransformRatio()
DataSize
Refresh count
Define
int DataSize
Example
Set the refreshing count to 10
VBScript Example

XYchart0.DataSize = 10
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

XYchart0.Height = 100
IsShow
Whether display the specified object
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

XYchart0.IsShow = True XYchart0.IsShow = False


IsShowBtnCrossLine
Whether display the positioning line button
Define
Boolean IsShowBtnCrossLine
Example
Display the positioning line
VBScript Example

XYchart0.IsShowBtnCrossLine = True
IsShowBtnXYClear
Whether display the Clear Button
Define
Boolean IsShowBtnXYClear
Example
Display the Clear Button
VBScript Example

XYchart0.IsShowBtnXYClear = True
IsShowBtnXYDown
Whether display the down button
Define
Boolean IsShowBtnXYDown
Example
Display the down button
VBScript Example

XYchart0.IsShowBtnXYDown = True
IsShowBtnXYLeft
Whether display the left shift button
Define
Boolean IsShowBtnXYLeft
Example
Display the left shift button
VBScript Example

XYchart0.IsShowBtnXYLeft = True
IsShowBtnXYMenu
Whether display the import and export button
Define
Boolean IsShowBtnXYMenu
Example
Display the import and export button
VBScript Example

XYchart0.IsShowBtnXYMenu = True
IsShowBtnXYPrint
Whether display the print button
Define
Boolean IsShowBtnXYPrint
Example
Display the print button
VBScript Example

XYchart0.IsShowBtnXYPrint = True
IsShowBtnXYRelConfig
Whether display the real-time curve configuration button
Define
Boolean IsShowBtnXYRelConfig
Example
Display the real-time curve configuration button
VBScript Example

XYchart0.IsShowBtnXYRelConfig = True
IsShowBtnXYRight
Whether display the right shift button
Define
Boolean IsShowBtnXYRight
Example
Display the right shift button
VBScript Example

XYchart0.IsShowBtnXYRight = True
IsShowBtnXYSave
Whether display the save button
Define
Boolean IsShowBtnXYSave
Example
Display the save button
VBScript Example

XYchart0.IsShowBtnXYSave = True
IsShowBtnXYStop
Whether display the start or stop button
Define
Boolean IsShowBtnXYStop
Example
Display the start or stop button
VBScript Example

XYchart0.IsShowBtnXYStop = True
IsShowBtnXYUp
Whether display the up button
Define
Boolean IsShowBtnXYUp
Example
Display the up button
VBScript Example

XYchart0.IsShowBtnXYUp = True
IsShowHtBtnXYConfig
Whether display the history curve configuration button
Define
Boolean IsShowHtBtnXYConfig
Example
Display the history curve configuration button
VBScript Example

XYchart0.IsShowHtBtnXYConfig = True
IsShowHtBtnXYQuery
Whether display the history curve query button
Define
Boolean IsShowHtBtnXYQuery
Example
Display the history curve query button
VBScript Example

XYchart0.IsShowHtBtnXYQuery = True
IsShowStatusBar
Whether display the status column
Define
Boolean IsShowStatusBar
Example
Display the status column
VBScript Example

XYchart0.IsShowStatusBar = True
IsShowXYCbTime
Whether display the quick time setting button
Define
Boolean IsShowXYCbTime
Example
Display the quick time setting button
VBScript Example

XYchart0.IsShowXYCbTime = True
IsShowXYSetTime
Whether display the time setting button
Define
Boolean IsShowXYSetTime
Example
Display the time setting button
VBScript Example

XYchart0.IsShowXYSetTime = True
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

XYchart0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = XYchart0.Name
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

XYchart0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

XYchart0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

XYchart0.Width = 100
XAxisInterval
Get or set the large scale of X axis(The interval between two
adjacent large scale lines)
Define
Double XAxisInterval
Example Set the large scale of X axis to 20
VBScript Example

XYchart0.XAxisInterval = 20
XAxisMaximum
Get or set the maximum value of X axis
Define
Double XAxisMaximum
Example Set the maximum value of X axis to120
VBScript Example

XYchart0.XAxisMaximum = 120
XAxisMinimum
Get or set the minimum value of X axis
Define
Double XAxisMinimum
Example Set the minimum value of X axis to 20
VBScript Example

XYchart0.XAxisMinimum = 20
XAxisSmallInterval
Get or set the small scale of X axis(The number of small scale lines
between two adjacent large scale lines.)
Define
Double XAxisSmallInterval
Example Set the small scale of X axis to 4
VBScript Example

XYchart0.XAxisSmallInterval = 4
YAxisInterval
Get or set the large scale of Y axis(The interval between two
adjacent large scale lines)
Define
Double YAxisInterval
Example Set the large scale of Y axis to 20
VBScript Example

XYchart0.YAxisInterval = 20
YAxisMaximum
Get or set the maximum value of Y axis
Define
Double YAxisMaximum
Example
Set the maximum value of Y axis to 120
VBScript Example

XYchart0.YAxisMaximum = 120
YAxisMinimum
Get or set the minimum value of Y axis
Define
Double YAxisMinimum
Example set the minimum value of Y axis to 20
VBScript Example

XYchart0.YAxisMinimum = 20
YAxisSmallInterval
Get or set the minimum scale of Y axis(The number of small scale
lines between two adjacent large scale lines.)
Define
Double YAxisSmallInterval
Example Set the small scale of Y axis to 4
VBScript Example

XYchart0.YAxisSmallInterval = 4
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 3
VBScript Example

XYchart0.ZIndex = 3
HMICustomChart
Customized chart control
Methods list
Name Description
AddNewLimitLine Add new limit line
Calculate the specific
values of the upper
CalculateValue
and lower control
lines
Each curve is
associated with a
CategoryPointCount
variable, and refresh
at the same time
Time and data load
ContrastDataLoad
contrastively
Set coordinates of
CustomAxisLabel
string axis
The loading of the
DataTableDataLoad curve whose data
source is DataTable
Export history curve
ExportHistorySeriesData
with report template
Export the curve
ExportItemSourceAsDataTable whose data source is
DataTable
Export real-time
ExportRelSeriesData curve with report
template
Export customized
ExportSeriesData
curves
Lo ok for animation
to modify the
FindAnimation
associated variables
of the animation
HistorySeries Load history curve
HistorySortXYSeries Load sorted historical
XY curve
Load history XY
HistoryXYSeries
curve
ImportSeriesData Import curves
Print Print
Query history XY
QueryDataXYFromDataBase
curve
Column graph
RealTimeFixedTimeSeries
superposition curve
Load real-time XY
RealTimeXYPoint
data
Query real-time
RelTimeSeries
curve
Query real-time XY
RelTimeXYSeries
curve
Load points of the
RelTimeXYUpdateSeries
real-time XY curve
RemoveAllLimitLine Remove all limit line
Save Save
SetActiveSeriesNo Set current curve
Set title Color of the
SetChartHeaderColor
chart
Set legend position
SetChartLegendPosition
of the chart
Setting the major grid
SetChartMajorGridLine
line
Setting the major grid
SetChartMinorGridLine
line
Set the refresh cycle
SetPeroidRefreshTime
of the curve
SetPeroidStartTime Set the start time
SetPeroidTimeRange Set time range
SetSeriesLegendDisplay Set whether to
display legend of a
curve
Set symbol text color
SetSymbolTextColor
of the curve
Get the column
SetTableNameForColumns name of data source
in the data table
Set the name of
SetVarRecordRulerName
query rule
Initialize the
SetXAxisRange
transverse
Set whether the
SetYAxisAutoChanged vertical axis can
automatically adjust
Query of the history
ShowQueryChartTimeBetweenData
curve
Contrast of the real
ShowRelativeChartTime
time history curve
StartSeries Start loading curve
StopSeries Stop loading curve
Property list
Name Description
Height Height
Whether display the specified object or
IsShow
not
Left The left coordinate
Name Name
ToolTip Tooltip text
Top The top coordinate
Width Width
ZIndex Layer index
AddNewLimitLine
Add new limit line (The "UpperAndLowerDisplay" is checked in the control
property)
Define
AddNewLimitLine(variablePath ,defaultValue ,color , thickness)
Parameter

Name Required/Optional Data Type Description


variablePath Required String Variable path
defaultValue Required Double Default value (default)
color Required Brush Line fill color
thickness Required Double Line thicknesses
Example

Add a new limit line

VBScript Example

Call
CustomChart0.AddNewLimitLine("Var.variable",0,Colors.Red,5)
CalculateValue
Calculate the specific values of the upper and lower control lines
Define
CalculateValue(count , variablePath1 , variablePath2 , number)
Parameter

Data
Name Required/Optional Description
Type
count Required Int Value count
variablePath1 Required String Variable path
variablePath2 Required String Variable path
The multiple of the standard
number Required Int
deviation
Example
Calculate the specific values of the upper and lower control lines
Note: Each 20 data is refreshed, then calculate specified value and assigned to two
Variable;
The upper and lower limit is related to Var.Variable and Var.Variable1 respectively.
VBScript Example

Call
CustomChart0.CalculateValue(20,"Var.Variable","Var.Variable1",1)
CategoryPointCount
Each curve is associated with a variable, and refresh at the same time
Define
CategoryPointCount(seriesno ,cnames , variablePaths)
Parameter

Name Required/Optional Data Type Description


seriesno Required Int The curve index
cnames Required String Data source name of the horizontal axis
variablePaths Required String Variable path
Example

The custom curve refresh real-timely

VBScript Example

Call
CustomChart0.CategoryPointCount(0,"0,1,2","Var.Custom.variable,Var.Custom.vari
Call CustomChart0.SetPeroidRefreshTime(1000)
ContrastDataLoad
Time and data load contrastively
Define
ContrastDataLoad(table , timeInterval , labindex , indexs)
Parameter

Name Required/Optional Data Type Description


Data table of data
table Required DataTable
source
Time interval of data
timeInterval Required Int
loading , default is 1
The index of the
laindex Required Int column of the vertical
axis data source
The corresponding
index of a curve data
indexs Required String
source, separated by
commas
Example

Time and data load contrastively

Note: the“test.xlsx” sample as shown in the following figure

VBScript Example

dt=
ReportCmd.DirectImportToDataTable("E:\test.xlsx")
'Import Excel to DataTable
Call CustomChart0.ContrastDataLoad(dt,1,0,"1,2,3")
CustomAxisLabel
Set coordinates of string axis
Define
CustomAxisLabel(index , cnames)
Parameter

Data
Name Required/Optional Description
Type
The value is 0 or 1, indicating that
index Required Int the String axis is a horizontal axis
or a vertical axis.
The coordinates, separated by
cnames Required String
commas
Example
Set coordinates of string Axis : one,two,three
Note:The sample of "customchart.xlsx" as shown in the following figure

VBScript Example

dt=
ReportCmd.DirectImportToDataTable("E:\customchart.xlsx")
'Import Excel to DataTable
Call CustomChart0.DataTableDataLoad(dt,0,0,1)
Call CustomChart0.CustomAxisLabel(0,"one,two,three")
DataTableDataLoad
The loading of the curve whose data source is DataTable
Define
DataTableDataLoad(table , seriesIndex , xbingingIndex , ybingingIndex)
Parameter

Name Required/Optional Data Type Description


table Required DateTable Data table of data source
seriesIndex Required Int The curve index
The index of the column
xbingingIndex Required Int of the horizontical axis
data source
The index of the column
ybingingIndex Required Int of the Vertical axis data
source
Example
The loading of the curve whose data source is DataTable
Note:The sample of "customchart.xlsx" as shown in the following figure

VBScript Example

dt=
ReportCmd.DirectImportToDataTable("E:\customchart.xlsx")
'Import Excel to DataTable
Call CustomChart0.DataTableDataLoad(dt,0,0,1)
ExportHistorySeriesData
Export history curve with report template
Define
ExportHistorySeriesData(seriesName ,templateName , variableList)
Parameter
Name Required/Optional Data Type Description
seriesName Required String curve name
templateName Required String template name
variableList Required String variable name

Example
Export the history curve Series0,Associated variables are:"Var.variable0"
VBScript Example

Call
CustomChart0.ExportHistorySeriesData("Series0","report0","Var.Variable0")
ExportItemSourceAsDataTable
Export the curve whose data source is DataTable
Define
ExportItemSourceAsDataTable(seriesName)
Parameter
Name Required/Optional Data Type Description
seriesName Required String The curve name

Example
Export history curve
Note:the data source of Series0 is DataTable
VBScript Example

Call CustomChart0.ExportItemSourceAsDataTable("Series0")
ExportRelSeriesData
Export real-time curve with report template
Define
ExportRelSeriesData(seriesName ,templateName)
Parameter
Name Required/Optional Data Type Description
seriesName Required String The curve name
templateName Required String The template name

Example
Export real-time curve with report template
VBScript Example

Call
CustomChart0.ExportRelSeriesData("Series0","report0")
ExportSeriesData
Export customized curves
Define
ExportSeriesData(seriesName)
Parameter
Data
Name Required/Optional Description
Type
The name of
seriesName Required String curves,separate
by commas

Example
Export customized curves Series0,Series1
VBScript Example

Call
CustomChart0.ExportSeriesData("Series0,Series1")
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

CustomChart0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
HistorySeries
Load history curve
Define
HistorySeries(seriesno , startTime , endTime , intervalTime , intervalUnit , variablePath)
Parameter

Name Required/Optional Data Type Description


seriesno Required Int The curve index
startTime Required DateTime Query start time
endTime Required DateTime Query end time
intervalTime Required long Query interval
intervalUnit Required String Query interval unit
variablePath Required String Variable path
Example
1.Query the historical data(Timing record)
VBScript Example

Call CustomChart0.SetVarRecordRulerName("s1")
Call
CustomChart0.HistorySeries(2,DateTimePicker0.ValueTime,DateTimePicker1.ValueTi

2.Query the historical data(Change record)


VBScript Example

Call
CustomChart0.HistorySeries(4,DateTimePicker0.ValueTime,DateTimePicker1.ValueTi
HistorySortXYSeries
Load sorted historical XY curve
Define
HistorySortXYSeries(seriesno , startTime , endTime , intervalTime , intervalUnit , variableXPaths ,
variableYPaths)
Parameter

Name Required/Optional Data Type Description


seriesno Required Int The curve index
startTime Required DateTime Query start time
endTime Required DateTime Query end time
intervalTime Required long Query interval
intervalUnit Required String Query interval unit
variableXPath Required String X Variable path
variableYPath Required String Y Variable path
Example
1.Load sorted historical XY curve(Timing record)
VBScript Example

Call CustomChart0.SetVarRecordRulerName("s1")
Call
CustomChart0.HistorySortXYSeries(3,DateTimePicker0.ValueTime,DateTimePicker1.V

2.Load sorted historical XY curve(changed record)


VBScript Example

Call
CustomChart0.HistorySortXYSeries(5,DateTimePicker0.ValueTime,DateTimePicker1.V
HistoryXYSeries
Load history XY curve
Define
HistoryXYSeries(seriesno , startTime , endTime , intervalTime , intervalUnit , variableXPaths ,
variableYPaths)
Parameter

Name Required/Optional Data Type Description


seriesno Required Int Curve index
startTime Required DateTime Query start time
endTime Required DateTime Query end time
intervalTime Required long Query interval
intervalUnit Required String Query interval unit
variableXPath Required String X variable path
variableYPath Required String Y variable path
Example
1.Load sorted historical XY curve(Timing record)
VBScript Example

Call CustomChart0.SetVarRecordRulerName("s1")
Call
CustomChart0.HistoryXYSeries(3,DateTimePicker0.ValueTime,DateTimePicker1.Value

2.Load sorted historical XY curve(changed record)


VBScript Example

Call
CustomChart0.HistoryXYSeries(5,DateTimePicker0.ValueTime,DateTimePicker1.Value
ImportSeriesData
Import curves
Define
ImportSeriesData(seriesIndex ,XAxisType)
Parameter
Data
Name Required/Optional Description
Type
Curve index(When there
seriesIndex Required String are more curves, separate
by commas)
Horizontal axis
XAxisType Required String classification
("Time","Double","String")

Example
Import Series0 curve,horizontal axis type is"Time"
VBScript Example

Call CustomChart0.ImportSeriesData("0","Time")
Print
Print
Define
Print()
Example
Print customize curves
VBScript Example

Call CustomChart0.Print()
QueryDataXYFromDataBase
Query history XY curves(Historical cohort record the query script)
Define
QueryDataXYFromDataBase(seriesno , startTime , endTime , count)
Parameter

Name Required/Optional Data Type Description


seriesno Required Int Curve index
startTime Required DateTime Query start time
endTime Required DateTime Query end time
count Required Int Query the front part of data,-1 means all the data
Example

Query history XY curves

VBScript Example

Call CustomChart0.SetTableNameForColumns("aaa","history record","history reco


Call
CustomChart0.QueryDataXYFromDataBase(0,DateTimePicker0.ValueTime,DateTimePicke
RealTimeFixedTimeSeries
Column graph superposition curve
Define
RealTimeFixedTimeSeries(seriesno , tableName , startTime , endTime , columnNames , rangeFormat)
Parameter

Data
Name Required/Optional Description
Type
seriesno Required Int The curve index
tableName Required String Database table name
startTime Required DateTime Query start time
endTime Required DateTime Query end time
columnNames Required String Column name
Format: 2 represents the period is year; 3 represents
rangeFormat Required Int
the period is month
Example
Column graph superposition curve(histoty group record)
VBScript Example

Call
CustomChart0.RealTimeFixedTimeSeries("0,1,2","bbb",DateTimePicker8.ValueTime,D
Call CustomChart0.SetPeroidRefreshTime(1000)
RealTimeXYPoint
Load real-time XY data(History group record the query script)
Define
RealTimeXYPoint(seriesno , interval , startLocation , endLocation)
Parameter

Name Required/Optional Data Type Description


seriesno Required Int Curve index
interval Required Double Horizontal axis spacing
startLocation Required Double Horizontal axis minimum
endLocation Required Double Horizontal axis maximum
Example

Load real-time XY data

VBScript Example

Call
CustomChart0.SetTableNameForColumns("aaa","RecordVariable","RecordVariable1",0
Call CustomChart0.RealTimeXYPoint(0,10,0,100)
Call CustomChart0.SetPeroidRefreshTime(1000)
RealTimeSeries
Query real-time curve
Define
RelTimeSeries(seriesno , variablePaths)
Parameter
Name Required/Optional Data Type Description
seriesno Required Int Curve index
variablePaths Required Double Variable index

Example
Query real-time curve
VBScript Example

Call CustomChart0.SetPeroidTimeRange(100)
Call CustomChart0.RelTimeSeries(0,"Var.variable")
Call CustomChart0.SetPeroidRefreshTime(1000)
RelTimeXYSeries
Query real-time XY curve
Define
RelTimeSeries(seriesno , variableXPaths , variableYPaths)
Parameter
Name Required/Optional Data Type Description
seriesno Required Int Curve index
variableXPaths Required String X variable path
variableYPaths Required String Y variable path

Example
Query real-time XY curve
VBScript Example

Call
CustomChart0.RelTimeXYSeries(0,"Var.variable","Var.variable1")
Call CustomChart0.SetPeroidRefreshTime(1000)
RelTimeXYUpdateSeries
Load points of the real-time XY curve
Define
RelTimeXYUpdateSeries(seriesno , variableCPaths , variableXPaths,variableYPaths)
Parameter

Name Required/Optional Data Type Description


seriesno Required Int Curve index
variableCPaths Required String The variable path to clear the data flag
variableXPaths Required Double X variable path
variableYPaths Required Double Y variable path
Example
Load points of the real-time XY curve

VBScript Example

Call CustomChart0.SetPeroidRefreshTime(1000)
Call
CustomChart0.RelTimeXYUpdateSeries(1,"Var.VAriable2","Var.CustomChart.custom"

'Var.VAriable2 is discrete variable


RemoveAllLimitLine
Remove all limit line
Define
RemoveAllLimitLine()
Example
Remove all limit line
VBScript Example

Call CustomChart0.RemoveAllLimitLine()
Save
Save
Define
Save()
Example
Save customize curve
VBScript Example

CustomChart0.Save()
SetActiveSeriesNo
Set current curve
Define
SetActiveSeriesNo(seriesno)
Parameter
Data
Name Required/Optional Description
Type
Curve index,Start from
seriesno Required Int
0

Example
Set current curve
VBScript Example

Call CustomChart0.SetActiveSeriesNo(1)
SetChartHeaderColor
Set title Color of the chart
Define
SetChartHeaderColor(color)
Parameter
Name Required/Optional Data Type Description
color Required Brush Setting color

Example
Set title Color of the chart
VBScript Example

Call CustomChart0.SetChartHeaderColor(Colors.Blue)
SetChartLegendPosition
Set legend position of the chart
Define
SetChartLegendPosition(positionIndex , InsideOrOutside)
Parameter
Data
Name Required/Optional Description
Type
The value is 0,1,2,3,
indicating the position
positionIndex Required Int
is left, upper, right,
and lower.
The value is 0 or 1,
indicating that the
InsideOrOutside Required Int
legend is outside or
inside the chart.
Example
Set the legend position in the right side of the chart
VBScript Example

Call CustomChart0.SetChartLegendPosition(2,1)
SetChartMajorGridLine
Setting the major grid line
Define
SetChartMajorGridLine(color , thickness , collection)
Parameter

Data
Name Required/Optional Description
Type
color Required Brush Grid line color
thickness Required Double Grid line thickness
Dotted line format, separate by
collection Required String
a commas. Example"2,4"
Example

Setting the major grid line

VBScript Example

Call
CustomChart0.SetChartMajorGridLine(Colors.Pink,3,"2,4")
SetChartMinorGridLine
Setting the minor grid line
Define
SetChartMinorGridLine(color , thickness,collection)
Parameter

Data
Name Required/Optional Description
Type
color Required Brush Grid line color
thickness Required Double Grid line thickness
Dotted line format, separate by a commas.
collection Required String
Example"2,4"
Example

Setting the minor grid line

VBScript Example

Call
CustomChart0.SetChartMinorGridLine(Colors.YellowGreen,1,"3,5")
SetPeroidRefreshTime
Set the curve refresh interval
Define
SetPeroidRefreshTime(ms)
Parameter
Name Required/Optional Data Type Description
ms Required Int unit ms

Example
query real-time curve
VBScript Example

Call CustomChart0.SetPeroidTimeRange(100)
Call CustomChart0.RelTimeSeries(0,"Var.Varible")
Call CustomChart0.SetPeroidRefreshTime(1000)
SetPeroidStartTime
Set start time
Define
SetPeroidStartTime(Time)
Parameter
Name Required/Optional Data Type Description
ms Required Int Unit ms

Example
Set start time
VBScript Example

Call CustomChart0.SetPeroidStartTime()
SetPeroidTimeRange
Set time range
Define
SetPeroidTimeRange(ms)
Parameter
Name Required/Optional Data Type Description
ms Required Int Unit ms

Example
Set time range
VBScript Example

Call CustomChart0.SetPeroidTimeRange(100)
SetSeriesLegendDisplay
Set whether to display legend of a curve
Define
SetSeriesLegendDisplay(seriesIndex , isShow)
Parameter
Data
Name Required/Optional Description
Type
seriesIndex Required Int Curve index
True:display
isShow Required Bool legend;False:do not
display legend

Example
Do not display legend of the curve0
VBScript Example

Call CustomChart0.SetSeriesLegendDisplay(0,False)
SetSymbolTextColor
Set symbol text color of the curve
Define
SetSymbolTextColor(serisesIndex , color)
Parameter
Name Required/Optional Data Type Description
seriesIndex Required Int Curve index
color Required Brush Symbol text color

Example
Set symbol text color of the curve to red
VBScript Example

Call CustomChart0.SetSymbolTextColor(0,Colors.Red)
SetTableNameForColumns
Get the column name of data source in the data table
Define
SetTableNameForColumns(tableName ,xcolumnName , ycolumnName , fixType)
Parameter

Data
Name Required/Optional Description
Type
tableName Required String History group name
The horizontal axis data source column name(The name
xcolumnName Required String
of history record、"Time")
The vertical axis data source column name,that is name
ycolumnName Required String
of history record
Type Required Int 0 means fixed X axis;1 meansvariable X axis
Example
1.Get the column name of data source in the data table
VBScript Example

Call CustomChart0.SetTableNameForColumns("aaa","Time","RecordVariable",0)

2.Get the column name of data source in the data table


VBScript Example

Call
CustomChart0.SetTableNameForColumns("aaa","RecordVariable","RecordVariable1",0
SetVarRecordRulerName
Set the name of query rule
Define
SetVarRecordRulerName(RuleName)
Parameter

Name Required/Optional Data Type Description


RuleName Required String The name of timer
Example
1.Set the name of query rule,s1 is the timer name
VBScript Example

Call CustomChart0.SetVarRecordRulerName("s1")

2.Query the historical data(Timing record)


VBScript Example

Call CustomChart0.SetVarRecordRulerName("s1")
Call
CustomChart0.HistorySeries(2,DateTimePicker0.ValueTime,DateTimePicker1.V
SetXAxisRange
Initialize the transverse,used to initialize icons' transverse range
such as the annual report, monthly report and weekly report etc, and
curve points information
Define
SetXAxisRange(range)
Parameter
Data
Name Required/Optional Description
Type
The values are 0、1、2、3、4、
range Required Int 5,correspond year、month、
week、day、hour、minute
Example

Initialize the transverse

VBScript Example

Call CustomChart0.SetXAxisRange(0)
SetYAxisAutoChanged
Set whether the vertical axis can automatically adjust
Define
SetYAxisAutoChanged(autoChanged)
Parameter
Name Required/Optional Data Type Description
autoChanged Required Bool True or False

Example
Set the vertical axis can automatically adjust
VBScript Example

Call CustomChart0.SetYAxisAutoChanged(True)
ShowQueryChartTimeBetweenData
Query history curve
Define
ShowQueryChartTimeBetweenData(seriesno ,startTime , endTime)
Parameter
Name Required/Optional Data Type Description
seriesno Required Int Curve index
startTime Required DateTime Query start time
endTime Required DateTime Query end time

Example
Query history curve
VBScript Example

Call CustomChart0.SetTableNameForColumns("aaa","Time","RecordVariable",0)
Call
CustomChart0.ShowQueryChartTimeBetweenData(0,DateTimePicker0.ValueTime,DateTim
ShowRelativeChartTime
Real-time curve configuration
Define
ShowRelativeChartTime(seriesno ,startTime , endTime ,rstartTime , rendTime)
Parameter

Name Required/Optional Data Type Description


seriesno Required Int Curve index collection,separated by commas
startTime Required DateTime History start time
endTime Required DateTime History end time
rstartTime Required DateTime Real time start time
rendTime Required DateTime Real time history curve of contrast
Example
Compare real time curves and historical curves
VBScript Example

Call CustomChart0.SetTableNameForColumns("aaa","Time","RecordVariable",0)
Call
CustomChart0.ShowRelativeChartTime("0,1",DateTimePicker0.ValueTime,DateTimePic
Call CustomChart0.SetPeroidRefreshTime(1000)
StartSeries
Start loading curves
Define
StartSeries()
Example
Start loading curves
VBScript Example

CustomChart0.StartSeries()
StopSeries
Stop loading curves
Define
StopSeries()
Example
Stop loading curves
VBScript Example

CustomChart0.StopSeries()
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

CustomChart0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

CustomChart0.IsShow = True CustomChart0.IsShow =


False
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

CustomChart0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

Text0.Text = CustomChart0.Name
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

CustomChart0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

CustomChart0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

CustomChart0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 2
VBScript Example

CustomChart0.ZIndex = 2
HMIPieChart
Pie chart control
Methods list
Name Description
Look for animation to modify the
FindAnimation
associated variables of the animation
Property list
Name Description
Height Height
Whether display the specified object or
IsShow
not
Left The left coordinate
Name Name
ToolTip Tooltip text
Top The top coordinate
Width Width
ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

PieChart0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

PieChart0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

PieChart0.IsShow = True PieChart0.IsShow = False


Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

PieChart0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

Text0.Text = PieChart0.Name
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

PieChart0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

PieChart0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

PieChart0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 2
VBScript Example

PieChart0.ZIndex = 2
HMIPieChart3D
3D pie chart control
Methods list
Name Description
Look for animation to modify the
​ FindAnimation associated variables of the
animation
Curve correlation variable
​ SetSeriesVariablePath
substitution
​ StartTimer Start timer
​ StopTimer Stop timer
Property list
Name Description
​ Height Height
​ IsShow Whether display the specified object
​ Left The left coordinate
​ Name Name
Get or set the 3D pie chart rotation
​ Rotation
angle
​ Tilt Get or set the 3D pie chart angle
ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

PieChart3D0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
SetSeriesVariablePath
Curve correlation variable substitution
Define
SetSeriesVariablePath(pathList)
Parameter
Data
Name Required/Optional Description
Type
The new variable path of the variables that replace
pathList Required String
the old variables , separate by commas

Example
Curve correlation variable substitution
VBScript Example

Call PieChart3D0.SetSeriesVariablePath("Var.variable0,Var.variable1")
StartTimer
Start timer
Define
StartTimer()
Example
Start Timer
VBScript Example

Call PieChart3D0.StartTimer()
StopTimer
Stop timer
Define
StopTimer()
Example
Stop Timer
VBScript Example

Call PieChart3D0.StopTimer()
Default.
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

PieChart3D0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

PieChart3D0.IsShow = True PieChart3D0.IsShow =


False
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

PieChart3D0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

Text0.Text = PieChart3D0.Name
Rotation
Get or set the 3D pie chart rotation angle
Double Rotation
Print()
Example
Set the rotation Angle of the specified object to 90
VBScript Example

PieChart3D0.Rotation = 90
Tilt
Get or set the 3D pie chart angle
Double Tilt
Print()
Example
Set the Angle of the specified object to 30
VBScript Example

PieChart3D0.Tilt = 30
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

PieChart3D0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

PieChart3D0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

PieChart3D0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 2
VBScript Example

PieChart3D0.ZIndex = 2
HMIColumnChart
Column chart control
Methods list
Name Description
​ AddNewLimitLine Add a new limit line
Look for animation to modify the
​ FindAnimation
associated variables of the animation
​ RemoveAllLimitLine Remove all the limit lines
Property list
Name Description
​ Height Height
​ IsShow Whether display the specified object
​ Left The left coordinate
​ Name Name
ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
ZIndex Layer index
AddNewLimitLine
Add a new limit line (The "UpperAndLowerDisplay" is checked in the control
property)
Define
AddNewLimitLine(variablePath ,defaultValue ,color , thickness)
Parameter

Name Required/Optional Data Type Description


variablePath Required String Variable path
defaultValue Required Double Default value (default)
color Required Brush Line fill color
thickness Required Double Line thicknesses
Example

Add new limit line

VBScript Example

Call
ColumnChart0.AddNewLimitLine("Var.Variable",0,Colors.Red,5)
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

ColumnChart0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
RemoveAllLimitLine
Remove all the limit lines
Define
RemoveAllLimitLine()
Example
Remove all the limit line
VBScript Example

Call ColumnChart0.RemoveAllLimitLine()
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

ColumnChart0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

ColumnChart0.IsShow = True ColumnChart0.IsShow =


False
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

ColumnChart0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

Text0.Text = ColumnChart0.Name
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

ColumnChart0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

ColumnChart0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

ColumnChart0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example Set the Layer index of the specified object to 2
VBScript Example

ColumnChart0.ZIndex = 2
HMIHistoryColumnChart
History column chart control
Methods list
Name Description
AddNewLimitLine Add a new limit line
Look for animation to
modify the associated
FindAnimation
variables of the
animation
Print Print
Query Query history data
Save Save
Set the start and end
SetDateConditionListStartEndTime
time
Replace the variables
SetSeriesVariablePath associated with the
curve

Property list​
Name Description
​ Height Height
Whether display the specified
​ IsShow
object or not
​ Left The left coordinate
​ Name Name
Get or set the maximum of the
NumberAxisMaximum
number axis
Get or set the minimum of the
NumberAxisMinimum
number axis
The large scale of the numerical
NumberInterval
axis
The small scale of the numerical
NumberSmallInterval
axis
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
​ ZIndex Layer index
AddNewLimitLine
Add a new limit line (upper and lower limit display in control properties is checked)
Define
AddNewLimitLine(variablePath ,defaultValue ,color , thickness)
Parameter

Name Required/Optional Data Type Description


VariablePath Required String Variable path
DefaultValue Required Double Default value
Color Required Brush Line fill color
Thickness Required Double Line thicknesses
Example

Add a new limit line

VBScript Example

HistoryColumnChart0.AddNewLimitLine("Var.Variable0",0,Colors.Red,5)
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

HistoryColumnChart0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Print
Print
Define
Print()
Example
Print the history histogram controls
VBScript Example

Call HistoryColumnChart0.Print()
Query
Query history data
Define
Query()
Example
Query history data
Note : when the history is timing record,The query rules should be set up in the toolbar before querying
data.
VBScript Example

Call
HistoryColumnChart0.SetDateConditionListStartEndTime(DateTimePicker0.ValueTime
Call HistoryColumnChart0.Query()
Save
Save
Define
Save()
Example
Save the history histogram controls
VBScript Example

Call HistoryColumnChart0.Save()
SetDateConditionListStartEndTime
Set the start and end times
Define
SetDateConditionListStartEndTime(startTime , endTime)
Parameter
Name Required/Optional Data Type Description
startTime Required DateTime Start time
endTime​ Required DateTime End time

Example
Set the start and end times
VBScript Example

Call
HistoryColumnChart0.SetDateConditionListStartEndTime(DateTimePicker0.ValueTime
SetSeriesVariablePath
Replace the variables associated with the curve
Define
SetSeriesVariablePath(pathList)
Parameter
Data
Name Required/Optional Description
type
The name of the new variable to be replaced in turn,separated
pathList Required String
by comma

Example
Replace the variables associated with the curve
VBScript Example

Call
HistoryColumnChart0.SetSeriesVariablePath("Var.HColumn.Variable,Var.HColumn.Va
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

HistoryColumnChart0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

HistoryColumnChart0.IsShow = True
HistoryColumnChart0.IsShow = False
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

HistoryColumnChart0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = HistoryColumnChart0.Name
NumberAxisMaximum
Get or set the maximum of the number axis
Define
Double NumberAxisMaximum
Example Set the maximum value of number axis to120
VBScript Example

HistoryColumnChart0.NumberAxisMaximum = 120
NumberAxisMinimum
Get or set the minimum of the number axis
Define
Double NumberAxisMinimum
Example Set the minimum value of number axis to 20
VBScript Example

HistoryColumnChart0.NumberAxisMinimum = 20
NumberInterval
The large scale of number axis(The interval between two adjacent
large scale lines)
Define
Double NumberInterval
Example Set the large scale of number axis to 20
VBScript Example

HistoryColumnChart0.NumberInterval = 20
NumberSmallInterval
The small scale of number axis(The number of small scale lines
between two adjacent large scale lines.)
Define
Double NumberSmallInterval
Example Set the small scale of number axis to 4
VBScript Example

HistoryColumnChart0.NumberSmallInterval = 4
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

HistoryColumnChart0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

HistoryColumnChart0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

HistoryColumnChart0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example
Set the Zindex of the specified object to 3
VBScript Example

HistoryColumnChart0.ZIndex = 3
HMIRecordBox
Record box control
Methods list
Name Description
DataExport Export all the data
Look for animation to modify the
FindAnimation associated variables of the
animation
Print Print
QueryHistoryDate The inquiry of historical record
The inquiry of historical record
QueryHistoryWithType
with type
Save Save

Property list​
Name Description
​ Height Height
Whether display the
​ IsShow
specified object or not
Whether to show the print
IsShowBtnPrint
button
Whether to show the save
IsShowBtnSave
button
Whether to show the
IsShowRdBtnConfig
setting button of column
Whether to show the
IsShowRdBtnUpdate
query button
Whether to show the
IsShowRdCbTime Quick QueryTimeSet
button
Whether to show the
IsShowRdRecordSelectedType RecordSelectedType
button
Whether to show the
IsShowRdRtExport
export button
IsShowRdSetTime Whether to show the
QueryTimeSet button
​ Left The left coordinate
​ Name Name
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
​ ZIndex Layer index
DataExport
Export all the data
Define
DataExport(isAllExport)
Parameter
Data
Name Required/Optional Description
Type
Whether to export all
the data(true:export all
isAllExport Required Boolean
the data,false:export
the current page)

Example
Export all the data
VBScript Example

RecordBox0.DataExport(True)
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

RecordBox0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Print
Print
Define
Print()
Example
Print the record box
VBScript Example

RecordBox0.Print()
QueryHistoryDate
The inquiry of historical record
Define
QueryHistoryDate(StartTime ,EndTime)
Parameter
Name Required/Optional Data Type Description
StartTime Required DateTime Start time
EndTime Required DateTime End time

Example
Query the data within the specified time period
VBScript Example

Call
RecordBox0.QueryHistoryDate(DateTimePicker0.ValueTime,DateTimePicker1.ValueTim
QueryHistoryWithType
The inquiry of historical record with type
Define
QueryHistoryDate(StartTime ,EndTime,type)
Parameter
Name Required/Optional Data Type Description
StartTime Required DateTime Start time
EndTime Required DateTime End time
Type Required Int Type

Example
Query the data within the specified time period with type
VBScript Example

Call
RecordBox0.QueryHistoryWithType(DateTimePicker0.ValueTime,DateTimePicker1.Valu
Save
Save
Define
Save()
Example
Save the record box
VBScript Example

RecordBox0.Save()
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

RecordBox.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

RecordBox.IsShow = True RecordBox.IsShow = False


IsShowBtnPrint
Show the Print Button
Define
Boolean IsShowBtnPrint
Example
Whether the record box control to show the Print Button
VBScript Example

RecordBox0.IsShowBtnPrint = true
IsShowBtnSave
Show the Save Button
Define
Boolean IsShowBtnSave
Example
Whether the record box control to show the Save Button
VBScript Example

RecordBox0.IsShowBtnSave = true
IsShowRdBtnConfig
Show the Column Setting button
Define
Boolean IsShowRdBtnConfig
Example
Whether the record box control to show the Column Setting button
VBScript Example

RecordBox0.IsShowRdBtnConfig = true
IsShowRdBtnUpdate
Show the query button
Define
Boolean IsShowRdBtnUpdate
Example
Whether the record box control to show the query button
VBScript Example

RecordBox0.IsShowRdBtnUpdate = true
IsShowRdCbTime
Show the QuickQueryTimeSet button
Define
Boolean IsShowRdCbTime
Example
Whether the record box control to show the QuickQueryTimeSet
button
VBScript Example

RecordBox0.IsShowRdCbTime = true
IsShowRdRecordSelectedType
Show the RecordSelectedType button
Define
Boolean IsShowRdRecordSelectedType
Example
Whether the record box control to show the RecordSelectedType
button
VBScript Example

RecordBox0.IsShowRdRecordSelectedType = true
IsShowRdRtExport
Show the export button
Define
Boolean IsShowRdRtExport
Example
Whether the record box to show the export button
VBScript Example

RecordBox0.IsShowRdRtExport = true
IsShowRdSetTime
Show the QueryTimeSet button
Define
Boolean IsShowRdSetTime
Example
Whether the record box control to show the QueryTimeSet button
VBScript Example

RecordBox0.IsShowRdSetTime = true
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

RecordBox0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = RecordBox0.Name
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

RecordBox0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

RecordBox0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

RecordBox0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example
Set the Zindex of the specified object to 3
VBScript Example

RecordBox0.ZIndex = 3
HMIAlarmWindow
Alarm window control
Methods list
Name Description
Reply to the selected
​ AckAlarm
alarm
Reply all the alarm that
​ AckAllAlarm
record type is alarm
Reply all the alarm that
​ AckAllRecovery
record type is recover
​ DataExport Export the data
Look for animation to
​ FindAnimation modify the associated
variables of the animation
Get the content of the
​ GetCurrentAlarmColumnInf currently selected alarm
column
Get the data table of the
​ GetHistoryAlarmItemDataTable
historical data
Get the current number of
​ GetRowNum
real-time alarm Windows
​ Print Print
The query of the historical
​ QueryHistoryAlarm
alarm
​ Save Save
Set the currently selected
​ SetCurrentSelectRowIndex
item
Set the parameters of the
​ SetExportValue
alarm data export script
Start loading the real-time
​ StartRealTimeAlarm
alarm data
Stop loading the real-time
​ StopRealTimeAlarm
alarm data

Property list​
Name Description
​ Height Height
Whether display the specified
​ IsShow
object or not
Whether to show the header of the
IsShowHistoryTabItem
history alarm
Whether to show the header of the
IsShowRelTableItem
real-time alarm
​ Left The left coordinate
​ Name Name
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
​ ZIndex Layer index
AckAlarm
Reply to a selected alarm
Define
AckAlarm()
Example Reply to a selected alarm
VBScript Example

Call AlarmWindow0.AckAlarm()
AckAllAlarm
Reply all the alarm that record type is alarm
Define
AckAllAlarm()
Example
Reply all the alarm that record type is alarm
VBScript Example

Call AlarmWindow0.AckAllAlarm()
AckAllRecovery
Reply all the alarm that record type is recover
Define
AckAllRecovery()
Example
Reply all the alarm that record type is recover
VBScript Example

Call AlarmWindow0.AckAllRecovery()
DataExport
Export data
Define
DataExport()
Example
Export data
VBScript Example

Call AlarmWindow0.SetExportValue(False,True)
Call AlarmWindow0.DataExport()
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

AlarmWindow0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
GetCurrentAlarmColumnInf
Get the content of the currently selected alarm column
Define
GetCurrentAlarmColumnInf(columnlndex)
Parameter
Data
Name Required/Optional Description
Type
Column index (value
columnlndex Required Int
range: 0~14)

Example
Get the content of the currently selected alarm column
VBScript Example

Text0.Text =
AlarmWindow0.GetCurrentAlarmColumnInf(5)
GetHistoryAlarmItemDataTable
Get the data table of the historical data
Define
GetHistoryAlarmItemDataTable(beginTime , endTime)
Parameter
Data
Name Required/Optional Description
Type
beginTime Required DateTime The begin time
endTime Required DateTime The end time

Example
Get the data table of the historical data
VBScript Example

dt =
AlarmWindow0.GetHistoryAlarmItemDataTable(DateTimePicker0.ValueTime,DateTimePi
Call ReportCmd.DirectExportDataToExcel(dt,"D:\Test_Alarm.xlsx",1)
GetRowNum
Get the current number of real-time alarm Windows
Define
GetRowNum(variablePath)
Parameter
Data
Name Required/Optional Description
Type
Variable path,Assign the
variablePath Required Int returned value to this
variable
Example
Get the current number of real-time alarm Windows, and pass the
returned value to the parameter "var.variable 0"
VBScript Example

Call AlarmWindow0.GetRowNum("Var.Variable0")
Print
Print
Define
Print()
Example Print
VBScript Example

Call AlarmWindow0.Print()
QueryHistoryAlarm
The inquiry of historical data
Define
QueryHistoryAlarm(startTime , endTime)
Parameter
Data
Name Required/Optional Description
Type
startTime Required DateTime The query of the start time
endTime Required DateTime The query of the end time

Example
The inquiry of historical alarm
VBScript Example

Call
AlarmWindow0.QueryHistoryAlarm(DateTimePicker0.ValueTime,DateTimePicker1.Value
Save
Save
Define
Save()
Example Save
VBScript Example

Call AlarmWindow0.Save()
SetCurrentSelectRowIndex
Set the currently selected item
Define
SetCurrentSelectRowIndex(selectlndex)
Parameter
Data
Name Required/Optional Description
Type
selectlndex Required Int Select row index

Example
Select the third row and get the contents of column 5 of that row
VBScript Example

Call AlarmWindow0.SetCurrentSelectRowIndex(3)
Text0.Text =
AlarmWindow0.GetCurrentAlarmColumnInf(5)
SetExportValue
Set the parameters of the alarm data export script
Define
SetExportValue(isReal , isExportAll)
Parameter
Data
Name Required/Optional Description
Type
Whether it is a real - time
isReal Required Bool
alarm
isExportAll Required Bool Whether to export all report

Example
Export real-time alarm
VBScript Example

Call AlarmWindow0.SetExportValue(True,True)
Call AlarmWindow0.DataExport()
StartRealTimeAlarm
Start loading the real-time alarm data
Define
StartRealTimeAlarm()
Example
Start loading the real-time alarm data
VBScript Example

Call AlarmWindow0.StartRealTimeAlarm()
StopRealTimeAlarm
Stop loading the real-time alarm data
Define
StopRealTimeAlarm()
Example
Stop loading the real-time alarm data
VBScript Example

Call AlarmWindow0.StopRealTimeAlarm()
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

AlarmWindow0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

AlarmWindow0.IsShow = True AlarmWindow0.IsShow =


False
IsShowHistoryTabItem
Whether to show the header of the history alarm
Define
Boolean IsShowHistoryTabItem
Example
Set to show the header of the history alarm
VBScript Example

AlarmWindow0.IsShowHistoryTabItem = True
IsShowRelTableItem
Whether to show the header of the real-time alarm
Define
Boolean IsShowRelTableItem
Example
Set to show the header of the real-time alarm
VBScript Example

AlarmWindow0.IsShowRelTableItem = True
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

AlarmWindow0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = AlarmWindow0.Name
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

AlarmWindow0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

AlarmWindow0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

AlarmWindow0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example
Set the Zindex of the specified object to 3
VBScript Example

AlarmWindow0.ZIndex = 3
HMIScrollAlarm
Scroll alarm control
Methods list
Name Description
Look for animation to modify the
​ FindAnimation associated variables of the
animation
Start loading the real-time alarm
​ StartRealTimeAlarm
data
​ StopRealTimeAlarm Stop loading the real-time alarm data

Property list​
Name Description
​ Height Height
Whether display the specified object or
​ IsShow
not
​ Left The left coordinate
​ Name Name
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
​ ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

ScrollAlarm0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
StartRealTimeAlarm
Start loading the real-time alarm data
Define
StartRealTimeAlarm()
Example
Start loading the real-time alarm data
VBScript Example

Call ScrollAlarm0.StartRealTimeAlarm()
StopRealTimeAlarm
Stop loading the real-time alarm data
Define
StopRealTimeAlarm()
Example
Stop loading the real-time alarm data
VBScript Example

Call ScrollAlarm0.StopRealTimeAlarm()
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

ScrollAlarm0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

ScrollAlarm0.IsShow = True ScrollAlarm0.IsShow =


False
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

ScrollAlarm0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = ScrollAlarm0.Name
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

ScrollAlarm0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

ScrollAlarm0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

ScrollAlarm0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example
Set the Zindex of the specified object to 3
VBScript Example

ScrollAlarm0.ZIndex = 3
HMIReport
Report control
Methods list
Name Description
Add real-time
​AddRealTimeSubReport refresh of
subreport
The table cell is
​CellBindingToVariable bound to the
variable
Repace template
​ChangeVariablePath
variables
Empty the entire
​ClearCellContent contents of the
report cell
Empty the entire
contents of the
​ClearCellContentForSheet
specified
worksheet
Clear historical
​ClearSubReportHisData
data of subreport
Export the
general
​ExportDataToXls data(Excel file or
report forms
template)
Export the
​ExportDataToXlsByDialog general data(Pop-
up the dialog box)
Export subreport
​ExportSubReport
data
Export the data of
​ExportToXls the time interval
to the template
​ExportToXlsForDataTable Export the
specified data
table to the excel
forms
Query the save
​ExportToXlsPagesDlg dialog box of the
sectional data
Look for
animation to
modify the
​FindAnimation
associated
variables of the
animation
To obtain the
​GetCellValue
value of the cell
Get the
statement's
​GetCurrentRowValue content of the
column specified
by the current line
Statistical
​GetDataColumnStaticsValue calculations to the
Data Table
To obtain the Data
Table for the
​GetDataTableExcludeHistoryData
query of the
historical data
Get the Data
Table of the data
​GetDataTableFromReport
source from the
report
Get the report
template
​GetProjectReportTemplates sequence from
the current
directory
​GetQueryHistoryData Get the data of a
specified period
and import it to
the Data Table
Get data from the
table, and the
​GetQueryHIstoryGroupData
name of the table
is specified
Write the Data
​GetReportDataTable Table to the
database
Hide the columns
​HiddenReportColumns
of the query
Import file to
​ImportDataToControl
report
Pop-up dialog to
​ImportDataToControlByDialog
import files
Open the current
​OpenDataTemplate
report template
Open the
​OpenDataTemplate specified report
template
​Print Print
Print the paged
​PrintTemplate
data
To obtain the path
​ProjectDirectory
of the project
Query the alarm
​QueryAlarmData
data
External database
​QueryDataFromExtern
report queries
Query results
according to the
​QueryHistoryData
setting time
interval
​QueryHistoryDataByCommon Query of the
general historical
data
​QueryHistoryDataForSheet Worksheet query
Query historical
​QuerySubReportHisData
data of subreport
Query the system
​QuerySystemEventData
event
Query records of
​QueryVariableOperations the variable
operating
Registry variable
​RegisterVariableToCell transfer into table
cell
Remove real-time
​RemoveRealTimeSubReport refresh of
subreport
Export the real-
​ReplaceCellVariableToControl time data for
replacement
Modify the
​SaveReportAndOpenToCurrentTemplate opened template
and save
Setup the number
​SetActiveGridColumnCount of columns of the
worksheet
Setup the number
​SetActiveGridRowCount of rows of the
worksheet
Setup the active
​SetActiveWorkSheet
worksheet
Setup the
​SetCellBackgroundColor background color
of the table cell
Setup the font
​SetCellFontColor color of the table
cell
​SetCellValue Setup the content
of the table cell
Setup the name
​SetColumnNames
of the column
Setup the current
​SetCurrentReportTemplate template of the
report form
Setup the date
​SetDateFormat
format
Setup Pdf export
​SetPdfSetting method
format
Setup the starting
location of the
​SetQueryDataStartPosition
data in the report
form
Whether to
remove the
​SetRealTimeClearOld
content of
previous lines
Setup the main
​SetRealTimeVariableChange variables of
variable alteration
Set main variable
of subreport(with
​SetSubReportMainVariable
the lowest refresh
rate)
Set the name of
​SetVarRecordRulerName
worksheet ruler
Setup a whole
​SetWholeRowValueToCells row of data from
the start position
Setup the end
​SetWorkSheetEndTime
time of query
Setup the time
​SetWorkSheetIntervalTime
interval of query
​SetWorkSheetStartTime Setup the start
time of query
Set the worksheet
​SetWorkSheetTotalIntervalTime time interval into
the dictionary
The Data Table is
displayed in the
​ShowDataTableForReport
report form
controls
Start to update
​StartSubReportRT real-time data of
the subreport
The real-time data
​StartUpdateDataFromRT
start updating
Stop the changes
​StopRealTimeVariableChange of the real-time
variable
Remove all the
binding which
​StopRegisterVaraibleChange
variables convert
into table cell
Stop to update
​StopSubReportRT the real-time data
of the subreport
Set the query time
ascending and
​TriggerTimeOrder
descending order
sorting
Unbound the
​UnBindingEventChange table cell change
events
Unbundle
​UnRegisterVariableToCell variables convert
into table cell
​VisiableReportColumns Show the
columns of the
query
Property list
Name Description
​ Height Height
Get or setup the number of days that
​ IntervalDay
query data interval
Get or setup the number of hours that
​ IntervalHour
query data interval
Get or setup the number of
​ IntervalMillisecond
milliseconds that query data interval
Get or setup the number of minutes
​ IntervalMinute
that query data interval
Get or setup the number of months
​ IntervalMonth
that query data interval
Get or setup the number of quarters
​ IntervalQuarter
that query data interval
Get or setup the number of seconds
​ IntervalSecond
that query data interval
​ IntervalUnit Unit of time interval
Get or setup the number of years that
​ IntervalYear
query data interval
Whether display the specified object or
​ IsShow
not
​ Left The left coordinate
​ Name Name
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
​ ZIndex Layer index
AddRealTimeSubReport
Add real-time refresh of subreport
Define
AddRealTimeSubReport(subReportName , mode)
Parameter

Data
Name Required/Optional Description
Type
subReportName Required String The name of subreport
1 means that the variable is updated in the
mode Required Int increasing number of rows, otherwise it is
updated in the specified cell

Example The real-time variables bound to subreport0 start to update. The data is
displayed in the increasing number of rows, and the number of refreshed rows is 20
VBScript Example

Call Report0.StartSubReportRT()
Call Report0.AddRealTimeSubReport("SubReport0",1)
Call
Report0.SetSubReportMainVariable("SubReport0","Var.Variable",20)'Set
main variable
CellBindingToVariable
The table cell is bound to the variable
Define
CellBindingToVariable(sheetIndex , rowIndex , columnIndex ,
variablePath)
Parameter

Data
Name Required/Optional Description
Type
sheetIndex Required Int The worksheet index
rowIndex Required Int The row num ber
columnIndex Required Int The column number
variablePath Required String The variable path

Example Assign values from 1 to 10 rows in column 6 of worksheet 0


to 10 variables
VBScript Example

For i = 1 To 10
Call
Report0.CellBindingToVariable(0,i,6,"Var.Variable"&i)
Next

Related script :
Unbound the table cell change events
VBScript Example

Call Report0.UnBindingEventChange(0)
ChangeVariablePath
Repace variables of report template
Define
ChangeVariablePath(rowIndex , columnIndex , variablePath)
Parameter
Data
Name Required/Optional Description
Type
rowIndex Required Int The row num ber
columnIndex Required Int The column number
variablePath Required String The variable path

Example Replace the variable in row 2 and column 2 of worksheet0 with


VarRecord.RecordVariable
VBScript Example

Call
Report0.ChangeVariablePath(2,2,"VarRecord.RecordVariable")
ClearCellContent
Empty the entire contents of the report cell (In the case of unbound
report template, all contents of the report cell can be emptied; In the
case of binding, it is equivalent to re-opening the report template.)
Define
ClearCellContent()
Example
Empty the entire contents of the report cell
VBScript Example

Call Report0.ClearCellContent()
ClearCellContentForSheet
Empty the entire contents of the specified worksheet
Define
ClearCellContentForSheet(sheetIndex)
Parameter
Data
Name Required/Optional Description
Type
sheetIndex Required Int The worksheet index

Example Empty the contents of the worksheet0


VBScript Example

Call Report0.ClearCellContentForSheet(0)
ClearSubReportHisData
Clear historical data of subreport
Define
ClearSubReportHisData(subReportName)
Parameter
Data
Name Required/Optional Description
Type
subReportName Required String The name of subreport

Example Clear the historical data in subreport0


VBScript Example

Call Report0.ClearSubReportHisData("SubReport0")
ExportDataToXls
Export the general data(All data can be exported except toolbar
data queries and script data queries of "QueryHistoryData" and
"QueryHistoryDataForSheet")
Define
ExportDataToXls(filePath)
Parameter
Data
Name Required/Optional Description
Type
filePath Required String Absolute path

Example
Export the general data
VBScript Example

Call Report0.ExportDataToXls("D:\test.xls")
ExportDataToXlsByDialog
Export the general data(All data can be exported except toolbar
data queries and script data queries of "QueryHistoryData" and
"QueryHistoryDataForSheet")
Define
ExportDataToXlsByDialog()
Example
Export the general data
VBScript Example

Call Report0.ExportDataToXlsByDialog()
ExportSubReport
Export subreport data
Define
ExportSubReport(filePath)
Parameter
Data
Name Required/Optional Description
Type
filePath Required String Save path of file

Example Export subreport0


VBScript Example

call Report0.ExportSubReport("D:\test1.xls")
ExportToXls
Export the data of the time interval to the template,Use pagination to query
(suggest using this method to export, export faster)
Define
ExportToXls(excelfilePath)
Parameter
Data
Name Required/Optional Description
Type
excelfilePath Required String Absolute path
Example
Export the data of the time interval to the template(data query must be done
first)
VBScript Example

Call Report0.ExportToXls("D:\test.xls")

Can be combined with the script QueryHistoryData() :

VBScript Example

Call
Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call
Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.SetVarRecordRulerName(0,"s1")
Call Report0.QueryHistoryData()
ExportToXlsForDataTable
Export the specified data table to the excel forms
Define
ExportToXlsForDataTable(dt , excelPath , excelVersion)
Parameter

Data
Name Required/Optional Description
Type
dt Required DataTable The data source
excelPath Required String Export the absolute path
excel version(0 stands for
excelVersion Required Int 2003,otherwise stands for
2007)
Example
1.Export the specified data table to the excel
VBScript Example

dt = DbAccess.DatabaseAccess.GetTable()
Call
ReportForms0.ExportToXlsForDataTable(dt,"D:\test.xls",1)

2.Export the DataTable from the report control to excel (This situation must
be combined with scripts such as the general historical data query,system
event query and operation variable record query)
VBScript Example

dt = ReportForms0.GetDataTableExcludeHistoryData()
Call
ReportForms0.ExportToXlsForDataTable(dt,"D:\test.xls",1)

3. Export the contents of the report directly to Excel.


VBScript Example

dt = ReportForms0.GetDataTableFromReport(1)
Call
ReportForms0.ExportToXlsForDataTable(dt,"D:\test.xls",1)
ExportToXlsPagesDlg
Query the save dialog of the segmented data
Define
ExportToXlsPagesDlg()
Example
Query the save dialog of the segmented data
VBScript Example

Call Report0.ExportToXlsPagesDlg()

Can be combined with the script QueryHistoryData() :


VBScript Example

Call
Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call
Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.SetVarRecordRulerName(0,"s1")
Call Report0.QueryHistoryData()
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

Report0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
GetCellValue
To obtain the value of the table cell
Define
GetCellValue(rowIndex , columnIndex)
Parameter
Data
Name Required/Optional Description
Type
The number of rows,
rowIndex Required Int
starting from 1
The number of columns,
columnIndex Required Int
starting from 1

Example To obtain the value of the cell(1,1)


VBScript Example

Button0.Content = Report0.GetCellValue(1,1)
GetCurrentRowValue
Get the content of the report forms specified by the current line
Define
GetCurrentRowValue(columnIndex)
Parameter
Data
Name Required/Optional Description
Type
The number of columns,
columnIndex Required Int
starting from 1
Example
Get the content of the report forms in the first column of current line
VBScript Example

Button0.Content = Report0.GetCurrentRowValue(1)
GetDataColumnStaticsValue
Statistical calculations to the Data Table
Define
GetDataColumnStaticsValue(dt , columnName , functionName)
Parameter
Data
Name Required/Optional Description
Type
dt Required DataTable The data source
columnName Required String Column names collection,seperated by commas
Function names
functionName Required String
collection(avg,min,max,sum),seperated by commas

Example 1. Calculate the average value of "RecordVariable" (Timing record


variable:"VarRecord.RecordVariable")
VBScript Example

Call Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.SetVarRecordRulerName(0,"s1") 'Set the query rules for historical
data,and interval time is 1s
dt = Report0.GetQueryHistoryData(0,"VarRecord.RecordVariable","1") 'Get
data within the specified time period,and the parameter "1" means "Value"
ff =
Report0.GetDataColumnStaticsValue(dt,"VarRecord.RecordVariable","avg")
Call Report0.SetCellValue(ff,1,5) 'Displays the calculated results in the first
row and fifth column of the Report control

2.Calculate the average value of "RecordVariable" ( Group record


variable:"HistRecord.aaa.RecordVariable"), and "aaa" is the history variable group
VBScript Example

Call Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.SetWorkSheetIntervalTime(0,1000) 'The time interval for the
history group is 1000 ms
dt = Report0.GetQueryHistoryData(0,"HistRecord.aaa.RecordVariable","1")
ff =
Report0.GetDataColumnStaticsValue(dt,"HistRecord.aaa.RecordVariable","avg")
Call Report0.SetCellValue(ff,2,5)

or
VBScript Example

Call Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.SetWorkSheetIntervalTime(0,1000) 'The time interval for the
history group is 1000 ms
dt = Report0.GetQueryHistoryData(0,"HistRecord.aaa.RecordVariable","1")
ff = Report0.GetDataColumnStaticsValue(dt,"1","avg") 'The "1" represents the
index of the historical variable and begins with "1".
Call Report0.SetCellValue(ff,2,5)

3.Calculate the average value of column "age" in "DatabaseAccess"


VBScript Example

dt = DbAccess.DatabaseAccess.GetTable()
ff = Report0.GetDataColumnStaticsValue(dt,"age","avg")
Call Report0.SetCellValue(ff,3,5)
GetDataTableExcludeHistoryData
To obtain the Data Table for the query of the historical data(This
script must be combined with those scripts such as the general
historical data query,system event query and operation variable
record query)
Define
GetDataTableExcludeHistoryData()
Example
To obtain the Data Table for the query of the historical data
VBScript Example

dt = Report0.GetDataTableExcludeHistoryData()
Call
Report0.ExportToXlsForDataTable(dt,"D:\test.xls",1)
'the parameter "1" means "excel version"("0" is 2003,otherwise
2007)
GetDataTableFromReport
Get the Data Table of the data source from the report (The contents
of the report display)
Define
GetDataTableFromReport(model)
Parameter
Data
Name Required/Optional Description
Type
0 means have no column
model Required Int name,otherwise have a column
name
Example
Get the Data Table of the data source from the report
VBScript Example

dt = Report0.GetDataTableFromReport(1)
Call
Report0.ExportToXlsForDataTable(dt,"D:\test.xls",1)
GetProjectReportTemplates
Get the report template sequence from the current directory
Define
GetProjectReportTemplates()
Example
Get the report template sequence from the current directory
VBScript Example

Text0.Text = Report0.GetProjectReportTemplates()
GetQueryHistoryData
Get the data of a specified period and import it to the Data Table
Define
GetQueryHistoryData(sheetIndex , conditions , types)
Parameter

Data
Name Required/Optional Description
Type
sheetIndex Required Int The worksheep index
conditions Required String Conditions is the variable collection, separated by commas
Types are divided into TriggeringTime、Value, which can
types Required String
use 0 and 1 instead

Example 1. Get the "Variable record (Timing record)" data to the DataTable within a specified time, and
display in the Report control
VBScript Example

Call Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.SetVarRecordRulerName(0,"s1")
dt =
Report0.GetQueryHistoryData(0,"VarRecord.RecordVariable,VarRecord.RecordVariab
Call Report0.ShowDataTableForReport(1,1,dt)

2.Get the "Variable group record" data in the specified time to the DataTable, and display in the Report
control
VBScript Example

Call Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.SetWorkSheetIntervalTime(0,1000)
dt = Report0.GetQueryHistoryData(0,"HistRecord.aaa.RecordVariable","1")
Call Report0.ShowDataTableForReport(1,1,dt)
GetQueryHistoryGroupData
Get data from the table, and the name of the table is specified
Define
GetQueryHistoryGroupData(sheetIndex , tableName , columnNames , rowCount)
Parameter

Data
Name Required/Optional Description
Type
sheetIndex Required Int The worksheep index
tableName Required String The name of the historical variables group
columnNames Required String Historical variables collection,separated by commas
rowCount Required Int The number of rows
Example
Get data from the table, and the name of the table is specified
VBScript Example

Call Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.SetWorkSheetIntervalTime(0,1000)
dt =
Report0.GetQueryHistoryGroupData(0,"aaa","HistRecord.aaa.RecordVariable,HistRe
Call Report0.ShowDataTableForReport(1,1,dt)
GetReportDataTable
Write the Data Table to the database
Define
GetReportDataTable(mainKey)
Parameter
Data
Name Required/Optional Description
Type
Specify which column as the
mainKey Required Int
primary key
Example
The report shows the data in the database access table, manually
modify the data in the table, and then use this script to save to the
database
VBScript Example

dt = Report0.GetReportDataTable(0)
cc = DbAccess.DatabaseAccess.SaveTable(dt)

Related script:Report displays the data in the database access table


VBScript Example

dt = DbAccess.DatabaseAccess.GetTable()
Call Report0.ShowDataTableForReport(1,1,dt)
HiddenReportColumns
Hide the columns of the query
Define
HiddenReportColumns(columns)
Parameter
Data
Name Required/Optional Description
Type
columns Required String The number of columns

Example
Hide the columns of the query
VBScript Example

Call Report0.HiddenReportColumns("Alarm")

Related script:Display the columns of the query


VBScript Example

Call Report0.VisiableReportColumns("Alarm")
ImportDataToControl
Import file to report
Define
ImportDataToControl(filePath)
Parameter
Data
Name Required/Optional Description
Type
filePath Required String The path of file

Example
Import file to report
VBScript Example

Call Report0.ImportDataToControl("D:\test.xls")
ImportDataToControlByDialog
Pop-up dialog to import files
Define
ImportDataToControlByDialog()
Example
Pop-up dialog to import files
VBScript Example

Call Report0.ImportDataToControlByDialog()
OpenDataTemplate
Open the current report template
Define
OpenDataTemplate()
Example
Open the current template
VBScript Example

Call Report0.OpenDataTemplate()
OpenDataTemplate
Open the template specified worksheet
Define
OpenDataTemplate(sheetIndex , templatePath)
Parameter
Data
Name Required/Optional Description
Type
sheetIndex Required String The worksheep index
The name of the report
templatePath Required String
template

Example
Open the template specified worksheet
VBScript Example

Call Report0.OpenDataTemplate(0,"Report0")
Print
Print
Define
Print()
Example Print
VBScript Example

Call Report0.Print()
PrintTemplate
Print the paged data
Define
PrintTemplate()
Example
Print the paged data
VBScript Example

Call Report0.PrintTemplate()

Related scripts:
VBScript Example

Call
Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call
Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.SetVarRecordRulerName(0,"s1")
Call Report0.QueryHistoryData()
ProjectDirectory
To obtain the path of the project
Define
ProjectDirectory()
Example
To obtain the path of the project
VBScript Example

Text0.Text = Report0.ProjectDirectory()
QueryAlarmData
Query the alarm data
Define
QueryAlarmData(sheetIndex)
Parameter
Data
Name Required/Optional Description
Type
The worksheep index,starting from
sheetIndex Required Int
0

Example
Query the alarm data
VBScript Example

Call
Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call
Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.QueryAlarmData(0)
QueryDataFromExtern
Query the external database report forms
Define
QueryDataFromExtern(sheetIndex , dt)
Parameter
Data
Name Required/Optional Description
Type
The worksheep index,
sheetIndex Required Int
starting from 0
dt Required DataTable The data source
Example
Query the external database report forms ( Operation method:1.
Create a report template for the external database 2. Bind to the
report control 3. Execute the query script)
VBScript Example

dt = DbAccess.DatabaseAccess.GetTable()
Call Report0.QueryDataFromExtern(0,dt)
QueryHistoryData
Query results according to the setting time interval
Define
QueryHistoryData()
Example
1. According to the rule "s1" query timing "variable record" (the report control
must be associated with the historical report template)
VBScript Example

Call
Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call
Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.SetVarRecordRulerName(0,"s1")
Call Report0.QueryHistoryData()

2. Query "variable group record" according to the interval time of 1000ms (the
report control must be associated with historical group report template)
VBScript Example

Call
Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call
Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.SetWorkSheetIntervalTime(0,1000)
Call Report0.QueryHistoryData()
QueryHistoryDataByCommon
Query of the general historical data
Define
QueryHistoryDataByCommon(sheetIndex , conditions , types)
Parameter

Data
Name Required/Optional Description
Type
sheetIndex Required Int The worksheep index
conditions Required String The condition is the variable set, separated by commas
Types are divided into TriggeringTime and Value,which can
types Required String
be replace by 0 and 1
Example
1.Query variable records (Timing records)
VBScript Example

Call Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.SetVarRecordRulerName(0,"s1")
Call
Report0.QueryHistoryDataByCommon(0,"VarRecord.RecordVariable,VarRecord.RecordV

2.Query variable group records, and "aaa" is the history group


VBScript Example

Call Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.SetWorkSheetIntervalTime(0,1000)
Call
Report0.QueryHistoryDataByCommon(0,"HistRecord.aaa.RecordVariable,HistRecord.a
QueryHistoryDataForSheet
Query the specified worksheet, and need to associate the corresponding
report template
Define
QueryHistoryDataForSheet()
Example 1.Query the "variable record" of the timing (the report control must
be associated with the historical report template)
VBScript Example

Call
Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call Report0.SetWorkSheetEndTime(0,
DateTimePicker1.ValueTime)
Call Report0.SetVarRecordRulerName(0,"s1")
Call Report0.QueryHistoryDataForSheet()

2.Query "variable group records" (report control must be associated with


historical group report template)
VBScript Example

Call
Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call Report0.SetWorkSheetEndTime(0,
DateTimePicker1.ValueTime)
Call Report0.SetWorkSheetIntervalTime(0,1000)
Call Report0.QueryHistoryDataForSheet()
QuerySubReportHisData
Query historical data of sub report
Define
QuerySubReportHisData(subReportName)
Parameter
Data
Name Required/Optional Description
Type
subReportName Required Int The name of subreport

Example
Query historical data of SubReport0
VBScript Example

Call
Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call
Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.SetVarRecordRulerName(0,"s1")
Call Report0.QuerySubReportHisData("SubReport0")
QuerySystemEventData
Query system event
Define
QuerySystemEventData(sheetIndex)
Parameter
Data
Name Required/Optional Description
Type
sheetIndex Required Int The worksheet index,start from zero

Example
Query system event
VBScript Example

Call
Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call
Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.QuerySystemEventData(0)
QueryVariableOperations
Query records of the variable operating
Define
QueryVariableOperations(sheetIndex , opVariablePaths)
Parameter

Data
Name Required/Optional Description
Type
sheetIndex Required Int The worksheet index,start from zero
The path collection of the operation variable
(null means all,"Operation"is the root
opVariablePaths Required String
node,"Operation.OperatingVariablesGroup0"
is the query of group
Example
1.Query the variable operating records (Query the root node)
VBScript Example
Call Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.QueryVariableOperations(0,"Operation")

2.Query the variable operating records (Query all data)


VBScript Example
Call Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.QueryVariableOperations(0,"")

3.Query the variable operating records by group (Query


"Operation.OperationVariableGroup0")
VBScript Example
Call Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.QueryVariableOperations(0,"Operation.OperationVariableGroup0")
RegisterVariableToCell
Registry variable transfer into table cell
Define
RegisterVariableToCell(variablePath , rowIndex , columnIndex)
Parameter

Data
Name Required/Optional Description
Type
variablePath Required String The variable path
The number of the rows,
rowIndex Required Int
starting from 1
The number of the columns,
columnIndex Required Int
starting from 1
Example
1. Register "Var. Variable0" to cell (1,1)
VBScript Example

Call Report0.SetActiveWorkSheet(1) 'When there are


multiple worksheets at the same time, the current active
worksheet can be set
Call
Report0.RegisterVariableToCell("Var.Variable0",1,1)

2. Register 10 variables separately to cells


VBScript Example

Call Report0.SetActiveWorkSheet(1)
For i = 1 To 10
Call
Report0.RegisterVariableToCell("Var.Variable"&i,3,i)
Next

Related scripts:
a. All unbind of variable to cell
VBScript Example

Call Report0.StopRegisterVaraibleChange()

b. Unbind variables to cell


VBScript Example

Call
Report0.UnRegisterVariableToCell("Var.Variable0",1,1)
RemoveRealTimeSubReport
Remove real-time refresh of subreport
Define
RemoveRealTimeSubReport(subReportName)
Parameter
Data
Name Required/Optional Description
Type
subReportName Required String The name of subreport

Example Remove real-time refresh of subreport0


VBScript Example

Call Report0.RemoveRealTimeSubReport("SubReport0")
ReplaceCellVariableToControl
Replace real-time report data (refresh real-time data, perform a
refresh once)
Define
ReplaceCellVariableToControl()
Example
Replace real-time report data
VBScript Example

Call Report0.ReplaceCellVariableToControl()
SaveReportAndOpenToCurrentTemplate
Modify the opened template and save
Define
SaveReportAndOpenToCurrentTemplate()
Example
Modify the opened template and save
VBScript Example

Call Report0.SaveReportAndOpenToCurrentTemplate()
SetActiveGridColumnCount
Setup the number of columns of the worksheet
Define
SetActiveGridColumnCount(columnCount)
Parameter
Data
Name Required/Optional Description
Type
columnCount Required Int The number of columns

Example
Setup the number of columns of the worksheet to 30
VBScript Example

Call Report0.SetActiveGridColumnCount(30)
SetActiveGridRowCount
Setup the number of rows of the worksheet
Define
SetActiveGridRowCount(rowCount)
Parameter
Data
Name Required/Optional Description
Type
rowCount Required Int The number of rows

Example
Setup the number of rows of the worksheet to 100
VBScript Example

Call Report0.SetActiveGridRowCount(100)
SetActiveWorkSheet
Setup the active worksheet
Define
SetActiveWorkSheet(sheetIndex)
Parameter
Data
Name Required/Optional Description
Type
The worksheet index,start
sheetIndex Required Int
from 0

Example
Setup the active worksheet
VBScript Example

Call Report0.SetActiveWorkSheet(1)
Call
Report0.SetCellBackgroundColor(1,1,Colors.Red)
SetCellBackgroundColor
Setup the background color of the table cell
Define
SetCellBackgroundColor(rowIndex , columnIndex ,
backgroundColor)
Parameter
Data
Name Required/Optional Description
Type
The number of
rowIndex Required Int
rows,start from 1
The number of
columnIndex Required Int
columns,start from 1
backgroundColor Required Brush The background color

Example Setup the background color of the table cell to red(The


colors method of the system)
VBScript Example

Call
Report0.SetCellBackgroundColor(1,1,Colors.Red)
SetCellFontColor
Set the font color of the table cell
Define
SetCellFontColor(rowIndex , columnIndex , foreColor)
Parameter
Data
Name Required/Optional Description
Type
The number of rows,start
rowIndex Required Int
from 1
The number of
columnIndex Required Int
columns,start from 1
foreColor Required Brush The font color

Example Set the font color of the table cell to red(The colors
methor of the system)
VBScript Example

Call Report0.SetCellFontColor(1,1,Colors.Red)
SetCellValue
Call the script to set the value of table cells
Define
SetCellValue(value , rowIndex , columnIndex)
Parameter
Data
Name Required/Optional Description
Type
The value to set to the
value Required Object
table cells
The number of rows,start
rowIndex Required Int
from 1
The number of
columnIndex Required Int
columns,start from 1

Example Set the value of the table cell to 20 or“test”or“True”


VBScript Example

Call Report0.SetActiveWorkSheet(1) 'when multiple


worksheets exist, the current active worksheet can be set
Call Report0.SetCellValue(20,1,1)
Call Report0.SetCellValue("test",2,2)
Call Report0.SetCellValue(True,3,3)
SetColumnNames
Set the name of the column in the script access table
Define
SetColumnNames(startRow , startColumn , columnNames)
Parameter
Data
Name Required/Optional Description
Type
Set the beginning row of
the database table in the
startRow Required Int
report,the index starting
from 1
Set the beginning
column of the database
startColumn Required Int
table in the report,the
index starting from 1
The collection of the
columnNames Required String column name,separated
by commas
Example

Set the column name

VBScript Example

Call Report0.SetColumnNames(1,1,"SetColumnName")
SetCurrentReportTemplate
Set the current template of the report form
Define
SetCurrentReportTemplate(templateName)
Parameter
Data
Name Required/Optional Description
Type
The current template of
templateName Required String
the report form

Example
Set the current template of the report form
VBScript Example

Call
Report0.SetCurrentReportTemplate("HistoryReport")
Call Report0.OpenDataTemplate()
SetDateFormat
Set the date format
Define
SetDateFormat(format)
Parameter
Data
Name Required/Optional Description
Type
The date format(0 on behalf of
yyyy/MM/dd hh:mm:ss,1 on
behalf of yyyy-MM-dd
hh:mm:ss,2 on behalf of
format Required Int
yyyy/MM/dd,3 on behalf of
hh:mm:ss,4 on behalf of
yyyy,five digit of Taiwan format
years)
Example
Set the date format
VBScript Example

Call Report0.SetDateFormat(0)
SetPdfSetting
Setup Pdf export format
Define
SetPdfSetting(pdfColumnCount , pdfMargin , pageSize)
Parameter
Data
Name Required/Optional Description
Type
The number of
pdfColumnCount Required Int
columns
pdfMargin Required Float Page margins
Paper size, such as
pageSize Required String
A4, A5, etc

Example
Pdf export format setting
VBScript Example

Call Report0.SetPdfSetting(5,10,"A4")
SetQueryDataStartPosition
Set the starting location of the data in the report form
Define
SetQueryDataStartPosition(startRow , startColumn , _isShowColumnHeader)
Parameter

Data
Name Required/Optional Description
Type
Set the starting row of the data in the report
startRow Required Int
form,the index starting from 1
Set the starting column of the data in the report
startColumn Required Int
form,the index starting from 1
Whether to display the column header(0
_isShowColumnHeader Required Int means do not to display,greater than 0 means
to display)
Example
Set the starting location of the data in the report
VBScript Example

Call Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.SetVarRecordRulerName(0,"s1")
Call Report0.SetQueryDataStartPosition(3,1,1) 'Start at row 3, column 1, and display
Call
Report0.QueryHistoryDataByCommon(0,"VarRecord.RecordVariable,VarRecord.RecordV
SetRealTimeClearOld
Whether to remove the content of previous lines
Define
SetRealTimeClearOld(_isClearOld)
Parameter
Data
Name Required/Optional Description
Type
Whether to remove(0
_isClearOld Required Int means do not to remove,1
means to remove)
Example
Do not clear the contents of previous rows for real-time data refresh
(need to associate the real-time report template)
VBScript Example

Call Report0.SetRealTimeClearOld(0)
Call Report0.StartUpdateDataFromRT(1)
Call
Report0.SetRealTimeVariableChange("Var.Variable",10)
'The number of refresh rows is 10
SetRealTimeVariableChange
Set the main variables of variable alteration
Define
SetRealTimeVariableChange(_valuePath , _totalRowCount)
Parameter
Data
Name Required/Optional Description
Type
_valuePath Required String The variable path
Set the total number of
_totalRowCount Required Int
rows

Example
Set the main variables of variable alteration
VBScript Example

Call Report0.StartUpdateDataFromRT(1)
Call
Report0.SetRealTimeVariableChange("Var.Variable0",100)
SetSubReportMainVariable
Set main variable of subreport(with the lowest refresh rate)
Define
SetSubReportMainVariable(subReportName , variablePath , totalRowCount)
Parameter

Data
Name Required/Optional Description
Type
subReportName Required String The name of subreport
variablePath Required String The main variable path
totalRowCount Required Int Tow count

Example The real-time variables bound to subreport0 start to update. The data is
displayed in the increasing number of rows, and the number of refreshed rows is 20
VBScript Example

Call Report0.StartSubReportRT()
Call Report0.AddRealTimeSubReport("SubReport0",1)
Call
Report0.SetSubReportMainVariable("SubReport0","Var.Variable",20)'Set
main variable
SetVarRecordRulerName
Set the name of the query rule
Define
SetVarRecordRulerName(RuleName)
Parameter
Data
Name Required/Optional Description
Type
The name of the timer for a
RuleName Required String
timed record

Example
Set the name of the query rule,“s1” is the timer name for the timing
record
VBScript Example

Call Report0.SetVarRecordRulerName("s1")
SetWholeRowValueToCells
Set a whole row of data from the start position
Define
SetWholeRowValueToCells(obj , startRow , startColumn)
Parameter

Data
Name Required/Optional Description
Type
obj Required String The data of rows
The number of rows,the
startRow Required Int
index starting from 1
The number of column,the
startColumn Required Int
index starting from 1
Example
Set a whole row of data from the start position
VBScript Example

Call
Report0.SetWholeRowValueToCells("30,test,5,true",1,1)
SetWorkSheetEndTime
Set the end time of query
Define
SetWorkSheetEndTime(worksheetIndex , _endTime)
Parameter
Data
Name Required/Optional Description
Type
The worksheet index,
worksheetIndex Required Int
starting from 0
_endTime Required DateTime The end time
Example
Query the data recorded by the history group (need to associate report
templates)
VBScript Example

Call
Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call
Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.SetWorkSheetIntervalTime(0,1000)
Call Report0.QueryHistoryData()
SetWorkSheetIntervalTime
Set the end time of query
Define
SetWorkSheetIntervalTime(worksheetIndex , intervalTime)
Parameter
Data
Name Required/Optional Description
Type
The worksheet index,starting
worksheetIndex Required Int
from 0
intervalTime Required Int64 The time interval,the unit is ms
Example
Query the data recorded by the history group (need to associate report
templates)
VBScript Example

Call
Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call
Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.SetWorkSheetIntervalTime(0,1000)
Call Report0.QueryHistoryData()
SetWorkSheetStartTime
Set the start time of query
Define
SetWorkSheetStartTime(worksheetIndex , _startTime)
Parameter
Data
Name Required/Optional Description
Type
The worksheet index,starting
worksheetIndex Required Int
from 0
_startTime Required DateTime The start time
Example
Query the data recorded by the history group (need to associate report
templates)
VBScript Example

Call
Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call
Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Call Report0.SetWorkSheetIntervalTime(0,1000)
Call Report0.QueryHistoryData()
SetWorkSheetTotalIntervalTime
Set the worksheet time interval into the dictionary
Define
SetWorkSheetTotalIntervalTime(worksheetIndex)
Parameter
Data
Name Required/Optional Description
Type
The worksheet index,starting
worksheetIndex Required Int
from 0
Example
Set the interval time of the worksheet to the dictionary, and when the interval is
less than 0, query according to the original data in the database
VBScript Example

Call
Report0.SetWorkSheetStartTime(0,DateTimePicker0.ValueTime)
Call
Report0.SetWorkSheetEndTime(0,DateTimePicker1.ValueTime)
Report0.IntervalDay = 0
Report0.IntervalHour = 0
Report0.IntervalMinute = 0
Report0.IntervalSecond = 1
Report0.IntervalMillisecond = 0
Call Report0.SetWorkSheetTotalIntervalTime(0)
Call Report0.QueryHistoryData()
ShowDataTableForReport
The Data Table is displayed in the report form controls
Define
ShowDataTableForReport(fromRowIndex , fromColumnIndex , dt)
Parameter
Data
Name Required/Optional Description
Type
Start number of
fromRowIndex Required Int rows,the index
starting from 1
Start number of
fromColumnIndex Required Int column,the index
starting from 1
dt Required DataTable The data source
Example
The Data Table is displayed in the report form controls
VBScript Example

dt = DbAccess.DatabaseAccess.GetTable()
Call Report0.ShowDataTableForReport(1,1,dt)
StartSubReportRT
Start to update real-time data of the subreport
Define
StartSubReportRT()
Example The real-time variables bound to subreport0 start to update. The data is
displayed in the increasing number of rows, and the number of refreshed rows is 20
VBScript Example

Call Report0.StartSubReportRT()
Call Report0.AddRealTimeSubReport("SubReport0",1)
Call
Report0.SetSubReportMainVariable("SubReport0","Var.Variable",20)'Set
main variable
StartUpdateDataFromRT
The real-time data start updating
Define
StartUpdateDataFromRT(_model)
Parameter
Data
Name Required/Optional Description
Type
The value is 1 means variable
changes increasing the
_model Required Int
rows,otherwise changes in the
specified table cell
Example
1.Real-time data starts to update, and data changes in the same cell
VBScript Example

Call Report0.StartUpdateDataFromRT(0)

2.Real-time data starts to update, data is displayed in increasing


number of rows
VBScript Example

Call Report0.SetRealTimeClearOld(0) 'Whether to clear


existing data, 0 is not cleared, 1 is cleared
Call Report0.StartUpdateDataFromRT(1)
Call
Report0.SetRealTimeVariableChange("Var.Variable",10)
'Refresh rows 10

Related scripts:
Stop real-time variable changes
VBScript Example

Call Report0.StopRealTimeVariableChange()
StopRealTimeVariableChange
Stop the changes of the real-time variable
Define
StopRealTimeVariableChange()
Example
Stop the changes of the real-time variable
VBScript Example

Call Report0.StopRealTimeVariableChange()
StopRegisterVaraibleChange
Remove all the binding which variables convert into table cell
Define
StopRegisterVaraibleChange()
Example
Remove all the binding which variables convert into table cell
VBScript Example

Call Report0.StopRegisterVaraibleChange()
StopSubReportRT
Stop to update the real-time data of the subreport
Define
StopSubReportRT()
Example Stop real-time data refresh of all sub-reports in Report0
VBScript Example

Call Report0.StopSubReportRT()
TriggerTimeOrder
Set the query time ascending and descending order sorting
Define
TriggerTimeOrder(order)
Parameter
Data
Name Required/Optional Description
Type
0 is in ascending order and 1 is in
order Required Int
descending order
Example
Set the data for the query to be sorted in descending chronological order
VBScript Example

Call Report0.ClearCellContent()
Call
Report0.SetWorkSheetStartTime(0,Datetimepicker0.ValueTime)
Call
Report0.SetWorkSheetEndTime(0,Datetimepicker1.ValueTime)
Call Report0.SetVarRecordRulerName(0,"s1")
Call Report0.TriggerTimeOrder(1)
Call Report0.QueryHistoryData()
UnBindingEventChange
Unbound the table cell change events
Define
UnBindingEventChange(sheetIndex)
Parameter
Data
Name Required/Optional Description
Type
The worksheet
sheetIndex Required Int
index,starting from 0

Example
Unbound the table cell change events
VBScript Example

Call Report0.UnBindingEventChange(0)
UnRegisterVariableToCell
Unbundle variables convert into table cell
Define
UnRegisterVariableToCell(variablePath , rowIndex , columnIndex)
Parameter

Data
Name Required/Optional Description
Type
variablePath Required String The variable path
The number of rows,starting
rowIndex Required Int
from 1
The number of
columnIndex Required Int
columns,starting from 1
Example
Unbundle variables convert into table cell
VBScript Example

Call
Report0.UnRegisterVariableToCell("Var.Variable0",1,1)
ReportColumnsVisiable
Show the columns of the query
Define
VisiableReportColumns(columns)
Parameter
Data
Name Required/Optional Description
Type
columns Required String The number of columns

Example
Show the columns of the query
VBScript Example

Call Report0.VisiableReportColumns("Alarm")
SetColumnHidden
Unbundle variables convert into table cell
Define
SetColumnHidden( rowIndex , columnIndex,hide)
Parameter
Data
Name Required/Optional Description
Type
hide Required bool hide
rowIndex Required Int The number of rows,starting from 1
columnIndex Required Int The number of columns,starting from 1
Example
Unbundle variables convert into table cell
VBScript Example

Call
Report0.SetColumnHidden(Var.ReportCell.SrartRow,Var.ReportCell.EndRow,True)
SetRowHidden
Unbundle variables convert into table cell
Define
SetRowHidden( rowIndex , columnIndex,hide)
Parameter
Data
Name Required/Optional Description
Type
hide Required bool hide
rowIndex Required Int The number of rows,starting from 1
columnIndex Required Int The number of columns,starting from 1
Example
Unbundle variables convert into table cell
VBScript Example

Call
Report0.SetColumnHidden(Var.ReportCell.SrartRow,Var.ReportCell.EndRow,True)
FillSelectedCellRowColumnColor
Fill the selected cell row background color
Defination
FillSelectedCellRowColumnColor(RowOrColumn,fillColor)
Parameter
Name Required/Optional Datatype Description
0 is a row, otherwise
RowOrColumn required int
a column
Fill Color required Brush Color

Example
Fill line 0 with pink
VBScript Example

Call
Report0.FillSelectedCellsRowColumnColor(0,Color.Pink)
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

Report0.Height = 100
IntervalDay
Get or setup the number of days that query data interval
Define
Int64 IntervalDay
IntervalHour
Get or setup the number of hours that query data interval
Define
Int64 IntervalHour
IntervalMillisecond
Get or setup the number of milliseconds that query data interval
Define
Int64 IntervalMillisecond
IntervalMinute
Get or setup the number of minutes that query data interval
Define
Int64 IntervalMinute
IntervalMonth
Get or setup the number of months that query data interval
Define
Int64 IntervalMonth
IntervalQuarter
Get or setup the number of quarters that query data interval
Define
Int64 IntervalQuarter
IntervalSecond
Get or setup the number of seconds that query data interval
Define
Int64 IntervalSecond
IntervalUnit
Time interval unit,ms is by millisecond;ss is by second;mi is by
minute;hh is by hour;dd is by day;mm is by month;qq is by quarter;yy
is by year
Define
Int64 IntervalUnit
IntervalYear
Get or setup the number of years that query data interval
Define
Int64 IntervalYear
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

Report0.IsShow = True Report0.IsShow = False


Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

Report0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = Report0.Name
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

Report0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

Report0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

Report0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example
Set the Zindex of the specified object to 3
VBScript Example

Report0.ZIndex = 3
HMIRecipeBrowser
Recipe browser control
Methods list
Name Description
ChangeRecipeBrowser Change the recipe browser
Look for animation to modify
FindAnimation the associated variables of
the animation
Get the content of the
GetCurrentRecipeColumnInf specified column which the
row is selected
Get the recipe item name
GetRecipeItemName
which current selected
Print Print
Refresh Refresh
Save Save
SaveRecipe Save recipe

Property list​
Name Description
​ Height Height
Whether display the specified object or
​ IsShow
not
IsShowStatusBar The properties of status bar
IsShowToolBar Whether to display the tool bar
​ Left The left coordinate
​ Name Name
RecipeName The name of the recipe
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
​ ZIndex Layer index
ChangeRecipeBrowser
Change the recipe browser
Define
ChangeRecipeBrowser(RecipeBrowserName)
Parameter
Data
Name Required/Optional Description
Type
The name of
RecipeBrowserName Required String
recipe

Example
Change the recipe browser
VBScript Example

RecipeBrowser0.ChangeRecipeBrowser("test")
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

RecipeBrowser0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
GetCurrentRecipeColumnInf
Get the content of the specified column which the row is selected
Define
GetCurrentRecipeColumnInf(columnName)
Parameter
Data
Name Required/Optional Description
type
columnName Required String Column name

Example
Get the content of the selected row which the column name is “water”
VBScript Example

TextBox0.Text = RecipeBrowser0.GetCurrentRecipeColumnInf("water")
GetRecipeItemName
Get the recipe item name which currently selected
Define
GetRecipeItemName()
Example
Get the recipe item name which currently selected
VBScript Example

TextBox.Text = RecipeBrowser0.GetRecipeItemName()
Print
Print
Define
Print()
Example Print
VBScript Example

RecipeBrowser0.Print()
Refresh
Refresh
Define
Refresh()
Example Refresh
VBScript Example

RecipeBrowser0.Refresh()
Save
Save
Define
Save()
Example Save
VBScript Example

RecipeBrowser0.Save()
SaveRecipe
Save recipe
Define
SaveRecipe()
Example Save recipe
VBScript Example

RecipeBrowser0.SaveRecipe()
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

RecipeBrowser0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

RecipeBrowser0.IsShow = True
RecipeBrowser0.IsShow = False
IsShowStatusBar
The properties of status bar
Define
Boolean IsShowStatusBar
Example Set the recipe browser window(RecipeBrowserWindow)
to:do not display the status bar
VBScript Example

RecipeBrowser0.IsShowStatusBar = False
IsShowToolBar
Whether to display the tool bar
Define
Boolean IsShowToolBar
Example Set the recipe browser window(RecipeBrowserWindow)
to:do not display the tool bar
VBScript Example

RecipeBrowser0.IsShowToolBar = False
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

RecipeBrowser0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = RecipeBrowser0.Name
RecipeName
The name of the recipe
Define
String RecipeName
Example Set the name of the recipe browser window to AAA
VBScript Example

RecipeBrowser0.RecipeName = "AAA"
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

RecipeBrowser0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

RecipeBrowser0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

RecipeBrowser0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example
Set the Zindex of the specified object to 3
VBScript Example

RecipeBrowser0.ZIndex = 3
HMIRuler
Ruler control
Methods list
Name Description
Look for animation to modify the
​ FindAnimation
associated variables of the animation
​ Print Print
​ Save Save
​ StartTimer Start timer
​ StopTimer Stop timer

Property list​
Name Description
​ Height Height
Whether display the specified object or
​ IsShow
not
​ Left The left coordinate
​ Name Name
​ Textvisibility Whether to display the status column
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
​ ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object
into Var.VariableGroup0.Variable1
VBScript Example

Ruler0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Print
Print
Define
Print()
Example
Print
VBScript Example

Ruler0.Print()
Save
Save
Define
Save()
Example
Save
VBScript Example

Ruler0.Save()
StartTimer
Start timer
Define
StartTimer()
Example
Start Timer
VBScript Example

Ruler0.StartTimer()
StopTimer
Stop timer
Define
StopTimer()
Example
Stop Timer
VBScript Example

Ruler0.StopTimer()
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

Ruler0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

Ruler0.IsShow = True Ruler0.IsShow = False


Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

Ruler0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = Ruler0.Name
Textvisibility
The display of the status column
Define
Boolean Textvisibility
Example
Whether to display the status column
VBScript Example

Ruler0.Textvisibility = True
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

Ruler0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

Ruler0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

Ruler0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example
Set the Zindex of the specified object to 3
VBScript Example

Ruler0.ZIndex = 3
HMICircleGauge
Dashboard control
Methods list
Name Description
Look for animation to modify the
FindAnimation
associated variables of the animation
Print Print
Save Save
StartTimer Start timer
StopTimer Stop timer

Property list​
Name Description
​ Height Height
Whether display the specified object or
​ IsShow
not
​ Left The left coordinate
​ Name Name
Textvisibility Whether to display the status column
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
​ ZIndex Layer index
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

CircleGauge0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Print
Print
Define
Print()
Example
Print
VBScript Example

CircleGauge0.Print()
Save
Save
Define
Save()
Example
Save
VBScript Example

CircleGauge0.Save()
StartTimer
Start timer
Define
StartTimer()
Example
Start Timer
VBScript Example

CircleGauge0.StartTimer()
StopTimer
Stop timer
Define
StopTimer()
Example
Stop Timer
VBScript Example

CircleGauge0.StopTimer()
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

CircleGauge0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

CircleGauge0.IsShow = True CircleGauge0.IsShow =


False
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

CircleGauge0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = CircleGauge0.Name
Textvisibility
The display of the status column
Define
Boolean Textvisibility
Example
Whether to display the status column
VBScript Example

CircleGauge0.Textvisibility = True
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

CircleGauge0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

CircleGauge0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

CircleGauge0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example
Set the Zindex of the specified object to 3
VBScript Example

CircleGauge0.ZIndex = 3
HMIVideoMonitor
The video monitor control
Methods list
Name Description
Capture and save video or
CapturePicture
picture(select path)
Capture and save video or picture(with
CapturePicture
path)
Look for animation to modify the
FindAnimation
associated variables of the animation

Property list​
Name Description
​ Height Height
Whether display the specified object or
​ IsShow
not
​ Left The left coordinate
​ Name Name
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
​ ZIndex Layer index
CapturePicture
Capture and save video or picture(select path)
Define
CapturePicture(isShowSaveFileDialog)
Parameter
Data
Name Required/Optional Description
Type
Whether it
isShowSaveFileDialog Required Bool shows the save
file dialog

Example
Capture and save video or picture
VBScript Example

Call VideoMonitor0.CapturePicture(True) Call


VideoMonitor0.CapturePicture(False)
CapturePicture
Capture and save video or picture(with path)
Define
CapturePicture(string path)
Parameter
Data
Name Required/Optional Description
Type
StringPath Required String Absolute path

Example
Capture and save video or picture
VBScript Example

Call VideoMonitor0.CapturePicture("D:\test.jpg")
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

VideoMonitor0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

VideoMonitor0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

VideoMonitor0.IsShow = True VideoMonitor0.IsShow


= False
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

VideoMonitor0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = VideoMonitor0.Name
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

VideoMonitor0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

VideoMonitor0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

VideoMonitor0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example
Set the Zindex of the specified object to 3
VBScript Example

VideoMonitor0.ZIndex = 3
HMIWebBrowser
The web browser control
Methods list
Name Description
Look for animation to modify the
FindAnimation
associated variables of the animation

Property list​
Name Description
​ Height Height
​ Home Get or set the homepage address
Whether display the specified object or
​ IsShow
not
​ Left The left coordinate
​ Name Name
​ ToolTip Tooltip text
​ Top The top coordinate
Url Get or set the address
​ Width Width
​ ZIndex Layer index
Default
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

WebBrowser0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Default
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

WebBrowser0.Height = 100
Home
Get or set the homepage address
Define
Double Home
Example
Set the homepage address to Baidu
VBScript Example

WebBrowser0.Home = "https://www.baidu.com"
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

WebBrowser0.IsShow = True WebBrowser0.IsShow =


False
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

WebBrowser0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = WebBrowser0.Name
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

WebBrowser0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

WebBrowser0.Top = 100
Url
Get or set the address
Define
Double Url
Example
Set the address to Baidu
VBScript Example

WebBrowser0.Url = "https://www.baidu.com"
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

WebBrowser0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example
Set the Zindex of the specified object to 3
VBScript Example

WebBrowser0.ZIndex = 3
HMIRTSPVideoMonitor
The RTSPvideo monitor control
Methods list
Name Description
Look for animation to modify the
FindAnimation
associated variables of the animation

Property list​
Name Description
​ Height Height
Whether display the specified object or
​ IsShow
not
​ Left The left coordinate
​ Name Name
​ ToolTip Tooltip text
​ Top The top coordinate
​ Width Width
​ ZIndex Layer index
Default
FindAnimation
Look for animation to modify the associated variables of the animation
Define
FindAnimation(name)
Parameter
Data
Name Required/Optional Description
type
name Required String The name of animation

Example
Change the associated variables of the visibility animation of the object into
Var.VariableGroup0.Variable1
VBScript Example

RTSPVideoMonitor0.FindAnimation("HMIShowHideAnimation").Expression
= "Var.VariableGroup0.Variable1"
Default
Height
Height
Define
Double Height
Example Set the height of the specified object to 100
VBScript Example

RTSPVideoMonitor0.Height = 100
IsShow
Whether display the specified object or not
Define
Boolean IsShow
Example True :The specified object is displayed on the screen
False :The specified object hidden on the screen
VBScript Example

RTSPVideoMonitor0.IsShow = True
RTSPVideoMonitor0.IsShow = False
Left
The left coordinate
Define
Double Left
Example Object's left side of the coordinate values is 100 on the
screen
VBScript Example

RTSPVideoMonitor0.Left = 100
Name
Name
Define
String Name
Example
Get the default name of the specified object
VBScript Example

TextBox0.Text = RTSPVideoMonitor0.Name
ToolTip
Tooltip text
Define
String ToolTip
Example Set the ToolTip of the specified object to "test"
VBScript Example

RTSPVideoMonitor0.ToolTip = "test"
Top
The top coordinate
Define
Double Top
Example Object's the top of the coordinate value is 100 in the
picture
VBScript Example

RTSPVideoMonitor0.Top = 100
Width
Width
Define
Double Width
Example Set the width of the specified object to 100
VBScript Example

RTSPVideoMonitor0.Width = 100
ZIndex
Layer index
Define
Int32 ZIndex
Example
Set the Zindex of the specified object to 3
VBScript Example

RTSPVideoMonitor0.ZIndex = 3
HMIActionCmd
Action script command
Methods list
Name Description
AnalogValueInput Analog the input action
ButtonValueInput The button input action
DiscreteValueInput The discrete value input action
StringValueInput The string input action
ToggleInput The setting input
AnalogValueInput
Analog input action
Define
AnalogValueInput(expression ,minValue ,maxValue)
Parameter

Data
Name Required/Optional Description
Type
expression Required String The variable expression
minValue Required Double The minimum value allowed to enter
maxValue Required Double The maximum value allowed to enter

Example For example,add the input action to the graphics(as shown VBScript
below),when runtime, click this graphics dialog box will pop up the analog of input
box,enter a value, click ok to assign the input values to the associated variables.
VBScript Example

ActionCmd.AnalogValueInput("Var.VariableGroup1.Variable1",0,100)
ButtonValueInput
The button input action
Define
ButtonValueInput(expression ,action ,value) action=0-Setting,1-Increase,2-
Decrease,3-Multiply,4-Divide
Parameter
Data
Name Required/Optional Description
Type
expression Required String The variable expression
The name of the action,action=0-Setting,1-
action Required Int32
Increase,2-Decrease,3-Multiply,4-Divide
value Required Double The operating value
Example
For example,add the input action to the graphics(as VBScript below),when runtime,
click this graphics dialog box will assign the input values to the associated
variables.The following code mean that click the graphic one time will increase 10 to
the variable's value
VBScript Example

ActionCmd.ButtonValueInput("Var.VariableGroup1.Variable1",1,10)
DiscreteValueInput
The discrete value input action
Define
DiscreteValueInput(expression ,trueValue ,falseValue)
Parameter
Data
Name Required/Optional Description
Type
expression Required String The variable expression
trueValue Required String The displayed value when the expression value is True
falseValue Required String The displayed value when the expression value is False
Example
For example,add the discrete value input action to the graphics(as VBScript below),when runtime,
click this graphics dialog box will pop up the discrete value input box,enter a value, click ok to assign
the input values to the associated variables
VBScript Example

ActionCmd.DiscreteValueInput("Var.VariableGroup1.Variable1","True","False")
StringValueInput
The string input action
Define
StringValueInput(expression ,isPassWord)
Parameter

Data
Name Required/Optional Description
Type
expression Required String The variable expression
isPassWord Required Boolean Whether the password is displayed
Example
For example,add the string input action to the graphics(as VBScript below),when
runtime, click this graphics dialog box will pop up the string input box,enter a value,
click ok to assign the input values to the associated variables
VBScript Example

ActionCmd.StringValueInput("Var.VariableGroup1.Variable1",False)
ToggleInput
The setting input
Define
ToggleInput(expression)
Parameter
Data
Name Required/Optional Description
Type
expression Required String The name of variable

Example
Set the value of "variable" to "0" or "1"
VBScript Example

ActionCmd.ToggleInput("Var.Script.variable")
HMICmd
Operating picture commands
Methods list
Name Description
​CloseDialogWindow Close the dialog window
​CloseWindow Close window
​ExitApplication Exit the program
​ExitApplication Exit the program
To obtain the value of the
​GetEnterKey
Enter Key
​MaxWindow Maximize the window
​MinWindow Minimize the Window
​OpenDialogWindow Open the dialog window
​OpenDialogWindow Open the dialog window
​OpenDialogWindow Open the dialog window
​OpenDialogWindow Open the dialog window
​OpenDialogWindow Open the dialog window
​OpenWindow Open the window
Just open the specified
​OpenWindowAndCloseOther screen, close the other
picture
​PrintFullWorkSpace Print the whole workspace
Save the full workspace as
​SaveFullWorkSpaceAsImage
an image
CloseDialogWindow
Close the dialog window
Define
CloseDialogWindow()
Example
Close the dialog window
VBScript Example

HMICmd.CloseDialogWindow()
CloseWindow
Close window
Define
CloseWindow(windowName)
Parameter
Name Required/Optional Data Type Description
windowName Required String Screen name

Example
Close the window of screen 0.Close the window of screen 0,screen
1,screen 2,multiple images and so on.
VBScript Example

HMICmd.CloseWindow("Screen0") or
HMICmd.CloseWindow("Screen0,Screen1,Screen2")
ExitApplication
Exit application
Define
ExitApplication(isNeedNotice)
Parameter
Name Required/Optional Data Type Description
isNeedNotice Required Bool Is notice

Example
Exit application
VBScript Example

HMICmd.ExitApplication(True)
ExitApplication
Exit application
Define
ExitApplication()
Example
Exit application
VBScript Example

HMICmd.ExitApplication()
GetEnterKey
To obtain the value of Enter Key
Define
GetEnterKey(eventArgs)
Parameter
Name Required/Optional Data Type Description
eventArgs Required String EventPara.EventArgs
Example
1.Add a "TextBox" and a "Rectangle" to the window;
2.Add a "TimerTicked Program" to "Window
Program":TextBox0.Focus(),make the cursor in the TextBox0;
3.Configure script to obtain the value of the Enter Key,if get the value
of the Enter Key,the color of Rectangle is red,else the color is blue;
VBScript Example

TextBox0.Focus()
If HMICmd.GetEnterKey(EventPara.EventArgs) = true
then
Rectangle0.Fill = Colors.Red
Else
Rectangle0.Fill = Colors.Blue
End If
MaxWindow
Maximize the window
Define
MaxWindow()
Example
Maximize the window
VBScript Example

HMICmd.MaxWindow()
MinWindow
Minimize the Window
Define
MinWindow()
Example
Minimize the Window
VBScript Example

HMICmd.MinWindow()
OpenDialogWindow
Open dialog window
Define
OpenDialogWindow(windowName)
Parameter
Data
Name Required/Optional Description
Type
windowName Required String The screen name

Example
Open dialog window
VBScript Example

HMICmd.OpenDialogWindow("Window0")
OpenDialogWindow
Open dialog window
Define
OpenDialogWindow(windowName,isShowTitle)
Parameter
Data
Name Required/Optional Description
Type
windowName Required String The window name
isShowTtile Required Bool Is show title

Example Open dialog window0


VBScript Example

Call HMICmd.OpenDialogWindow("window0",true)
OpenDialogWindow
Open dialog window in the specified screen
Define
OpenDialogWindow(windowName,screenNum,isMode)
Parameter
Data
Name Required/Optional Description
Type
windowName Required String The window name
screenNum Required Int The screen number
isModel Required Bool Is modal window or not

Example Open dialog "window0" in the "screen1"


VBScript Example

Call HMICmd.OpenDialogWindow("window0",1,true)
OpenDialogWindow
Open dialog window in the specified screen
Define
OpenDialogWindow(windowName,screenNum,isMode,isFullScreen)
Parameter
Data
Name Required/Optional Description
Type
windowName Required String The window name
screenNum Required Int The screen number
isModel Required Bool Is modal window or not
isFullScreen Required Bool Is full screen or not

Example Open dialog "window0" in the "screen1"


VBScript Example

Call
HMICmd.OpenDialogWindow("Window0",1,true,true)
OpenDialogWindow
Open dialog window in the specified screen
Define
OpenDialogWindow(windowName,screenNum,isMode,left,top)
Parameter
Data
Name Required/Optional Description
Type
windowName Required String The window name
screenNum Required Int The screen number
isModel Required Bool Is modal window or not
The left end position of
left Optional Double
the window
The top end position of
top Optional Double
the window

Example Open dialog "window0" in the "screen1"


VBScript Example

Call
HMICmd.OpenDialogWindow("Window0",1,true,100,200)
OpenWindow
Open the window
Define
OpenWindow(windowName)
Parameter
Data
Name Required/Optional Description
Type
windowName Required String The screen name

Example
Open the screen 0 and 1 together
VBScript Example

HMICmd.OpenWindow("Screen0,Screen1")
OpenWindowAndCloseOther
Just open the specified screen, close the other screen
Define
OpenWindowAndCloseOther(windowName)
Parameter
Data
Name Requireed/Optional Description
Type
windowName Required String The screen name

Example
Open the screen 0 and 1 together, close the other screen
VBScript Example

HMICmd.OpenWindowAndCloseOther("Screen0,Screen1")
PrintFullWorkSpace
Print the whole workspace
Define
PrintFullWorkSpace()
Example
Print the whole workspace
VBScript Example

HMICmd.PrintFullWorkSpace()
SaveFullWorkSpaceAsImage
Save the full workspace as an image
Define
SaveFullWorkSpaceAsImage(filePath)
Parameter
Data
Name Required/Optional Description
Type
filePath Required String Absolute path of the image

Example
Save the full workspace as the image0
VBScript Example

HMICmd.SaveFullWorkSpaceAsImage("D:\image0.jpg")
IODataItem
IO data
Methods list
Name Description
GetDeviceStatus Get device status

Property list​
Name Description
​ Address The communication address
Data conversion type Int, 0-no
transformation, 1-linear
​ DataConversionTypeInt
transformation, 2-root
transformation
​ Description Description
The maximum value of
​ MeasureHigh
engineering
The minimum value of
​ MeasureLow
engineering
​ Name Address name
​ ScanTime Scan cycle
​ VariablePath Alarm variable absolute path
Default
GetDeviceStatus
Get device status
Define
Int GetDeviceStatus()
Return
Int
Example
0 means normal communication, 2 means disconnection or stop
VBScript Example

IO.Device0.GetDeviceStatus()
Address
The communication address
Define
String Address
Description
Annotation
This property is read-only

Example Get address


VBScript Example

Text0.Text = IO.Device0.NewAddres0.Address
DataConversionTypeInt
Data conversion type Int, 0-no transformation, 1-linear
transformation, 2-root transformation
Define
Int32 DataConversionTypeInt
Description
Annotation
This property is read/write

Example
Set to linear transformation
VBScript Example

IO.Device0.NewAddres0.DataConversionTypeInt = 1
Description
Description
Define
String Description
Description
Annotation
This property is read/write

Example
Get description information of "NewAddress0"
VBScript Example

Text0.Text = IO.Device0.NewAddress0.Description
MeasureHigh
The maximum value of engineering
Define
Object MeasureHigh
Description
Annotation
This property is read/write

Example
Set the maximum value of address of engineering
VBScript Example

IO.Device0.NewAddres0.MeasureHigh = 100
MeasureLow
The minimum value of engineering
Define
Object MeasureLow
Description
Annotation
This property is read/write

Example
Set the minimum value of the address to 0
VBScript Example

IO.Device0.NewAddres0.MeasureLow = 0
Name
Address name
Define
String Name
Description
Annotation
This property is read-only

Example
Get address name
VBScript Example

Text0.Text = IO.Device0.NewAddres0.Name
ScanTime
Scan cycle
Define
Int32 ScanTime
Description
Annotation
This property is read-only

Example Get the scan cycle


VBScript Example

Text0.Text = IO.Device0.NewAddres0.ScanTime
VariablePath
Variable absolute path
Define
String VariablePath
Description
Annotation
This property is read-only

Example
The specified address binding to the variable path
VBScript Example

IO.Device0.NewAddres0.VariablePath =
"var.NewVariable"
IODevice
Equipment base class and object associated with the underlying
IoServer
Property list​
Name Description
Description Description
The last connection time of the
DeviceConnectLastTime
device
Get the communications
DeviceConnectPara
information of device
The last disconnection time of
DeviceDisconnectLastTime
the device
DeviceType The device type
Name The device name
Get the equipment status, 0-
Status
normal,2-disconnect or stop
Get the spend time that the
SpendTime
device needed to scan
Description
Description
Define
String Description
Description
Annotation
This property is read-only

Example Get the description of device


VBScript Example

Text0.Text = IO.Device0.Description
DeviceConnectLastTime
The last connection time of the device
Define
String DeviceConnectLastTime
Description
​ nnotation
A
This property is read-only

Example Get the last connection time of device


VBScript Example

Text0.Text = IO.Device0.DeviceConnectLastTime
DeviceConnectPara
Get the communications information of device
Define
String DeviceConnectPara
Description
​ nnotation
A
This property is read-only

Example Get the communications information of device


VBScript Example

Text0.Text = IO.Device0.DeviceConnectPara
DeviceDisconnectLastTime
The last disconnection time of the device
Define
String DeviceDisconnectLastTime
Description
​ nnotation
A
This property is read-only

Example Get the last disconnection time of the device


VBScript Example

Text0.Text = IO.Device0.DeviceDisconnectLastTime
DeviceType
The device type
Define
String DeviceType
Description
Annotation
This property is read-only

Example Get device type


VBScript Example

Text0.Text = IO.Device0.DeviceType
Name
The device name
Define
String Name
Description
Annotation
This property is read-only

Example
Get device name
VBScript Example

Text0.Text = IO.Device0.Name
Status
Get the equipment status
Define
Int32 Status
Description
Annotation
This property is read/write

Return
0-normal,2-disconnect or stop
Example
Get equipment status
VBScript Example

Text0.Text = IO.Device0.Status
SpendTime
Get the spend time that the device needed to scan
Define
Int32 SpendTime
Description
​ nnotation
A
This property is read-only

Example Get the spend time that the device needed to scan
VBScript Example

Text0.Text = IO.Device0.SpendTime
IOManagement
IO management
Methods list
Name Description
The last connection time
GetDeviceConnectLastTime
of device
Get communications
GetDeviceConnectPara
information of device
Get the last disconnection
GetDeviceDisconnectLastTime
time of the device
GetDeviceStatus Get device status
Get address information
GetItemAddress that corresponds to the
address name
GetLocalIP Get local IP
GetLocalLansIP Get all Local Lans IP
GetMacAddress Get mac address
Get the spend time that
GetScanDeviceSpendTime
the device needed to scan
Get the file on remote
ReadRemoteFile
device
ReStart Restart device
Modify COM baud rate
SetDeviceCOMBaudRate
dynamically
Modify COM port
SetDeviceCOMPort
dynamically
Modify IP address
SetDeviceSocketIP
dynamically
Modify socket port
SetDeviceSocketPort
dynamically
StartDevice Start device
StopDevice Stop device
Write local file to remote
WriteRemoteFile
device
GetDeviceConnectLastTime
The last connection time of the device
Define
GetDeviceConnectLastTime(deviceName)
Parameter
Data
Name Required/Optional Description
Type
deviceName Required String The device name

Return
String
Example
Get the last connection time of device
VBScript Example

IOCmd.GetDeviceConnectLastTime("Device0")
GetDeviceConnectPara
Get the communications information of device
Define
GetDeviceConnectPara(deviceName)
Parameter
Data
Name Required/Optional Description
Type
deviceName Required String The device name

Return
String
Example
Get the communications information of device
VBScript Example

IOCmd.GetDeviceConnectPara("Device0")
GetDeviceDisconnectLastTime
Get the last disconnection time of device
Define
GetDeviceDisconnectLastTime(deviceName)
Parameter
Data
Name Required/Optional Description
Type
deviceName Required String The device name

Return
String
Example
Get the last disconnection time of device
VBScript Example

IOCmd.GetDeviceDisconnectLastTime("Device0")
GetDeviceStatus
Get device status
Define
GetDeviceStatus(devicename)
Parameter
Data
Name Required/Optional Description
Type
deviceName Required String Device name

Return
Int
Example
0-normal,2-disconnect or stop
VBScript Example

IOCmd.GetDeviceStatus("Device0")
GetItemAddress
Get address information that corresponds to the address name
Define
GetItemAddress(deviceName,addressName)
Parameter
Data
Name Required/Optional Description
Type
deviceName Required String The device name
addressName Required String The address name

Return
String
Example
Get address information that corresponds to the address name
VBScript Example

IOCmd.GetItemAddress("Device0","Address1")
GetLocalIP
Get local IP
Define
GetLocalIP( )
Return
String
Example
Get local IP
VBScript Example

IOCmd.GetLocalIP()
GetLocalLansIP
Get all Local Lans IP
Define
GetLocalLansIP()
Return
String
Example
Get all Local Lans IP
VBScript Example
List = IOCmd.GetLocalLansIP()
strs = ""
For i=0 To List.Length-1
strs =strs + CStr(List(i)) + " , "
Next
MsgBox strs
GetMacAddress
Get mac address
Define
GetMacAddress(ip)
Parameter
Data
Name Required/Optional Description
Type
ip Required String IP address

Return
String
Example
Get the device's mac address which specified IP
VBScript Example

IOCmd.GetMacAddress("192.168.1.1")
GetScanDeviceSpendTime
Get the spend time that the device needed to scan
Define
GetScanDeviceSpendTime(deviceName)
Parameter
Data
Name Required/Optional Description
Type
deviceName Required String Device name

Return
String
Example
Get the spend time that the device needed to scan
VBScript Example

IOCmd.GetScanDeviceSpendTime("Device0")
ReadRemoteFile
Get the file on remote device
Define
String
ReadRemoteFile(localPath,IsReplaceFile,deviceName,remoteIP,port,remoteFilePath,timeOutSecond
s,isDeleteFileReadFinish)
Parameter
Data
Name Required/Optional Description
Type
localPath Required String Local path
IsReplaceFile Required Bool Whether replace or not
deviceName Required String The device name
remoteIP Required String The IP of the remote device
port Required Int Port
remoteFilePath Required String The file path on the remote device
timeOutSeconds Required Int Timeout
isDeleteFileReadFinish Required Bool Whether delete file or not after finish
Return

String
Example
Get the file on remote device
VBScript Example

IOCmd.ReadRemoteFile("D:\",true,"device0","192.168.1.1",21,"E:\",100,false)
ReStart
Restart device
Define
Int ReStart(deviceName)
Parameter
Data
Name Required/Optional Description
Type
deviceName Required String The device name

Return
Int
Example
Restart device
VBScript Example

IOCmd.ReStart("Device0")
SetDeviceCOMBaudRate
Modify the COM baud rate dynamically
Define
bool SetDeviceCOMBaudRate(deviceName,baudRate)
Parameter
Data
Name Required/Optional Description
Type
deviceName Required String The device name
baudRate Required String Baud rate

Return
Bool
Example
Modify the COM baud rate dynamically
VBScript Example

IOCmd.SetDeviceCOMBaudRate("Device0","115200")
SetDeviceCOMPort
Modify the COM port dynamically
Define
bool SetDeviceCOMPort(deviceName,comPort)
Parameter
Data
Name Required/Optional Description
Type
deviceName Required String The device name
comPort Required String The COM port

Return
Bool
Example
Modify the COM port dynamically
VBScript Example

IOCmd.SetDeviceCOMPort("Device0","COM1")
SetDeviceSocketIP
Modify IP address dynamically
Define
bool SetDeviceSocketIP(deviceName,ip)
Parameter
Data
Name Required/Optional Description
Type
deviceName Required String The device name
ip Required String IP address

Return
Bool
Example
Modify IP address dynamically
VBScript Example

IOCmd.SetDeviceSocketIP("Device0","192.168.1.100")
SetDeviceSocketPort
Modify socket port dynamically
Define
bool SetDeviceSocketPort(deviceName,port)
Parameter
Data
Name Required/Optional Description
Type
deviceName Required String The device name
port Required String Port

Return
Bool
Example
Modify socket port dynamically
VBScript Example

IOCmd.SetDeviceSocketPort("Device0","100")
StartDevice
Start device
Define
StartDevice(devicename)
Parameter
Data
Name Required/Optional Description
Type
Device name(used to
deviceName Required String
obtain the driver name)

Return
Int
Example
Start device
VBScript Example

IOCmd.StartDevice("Device0")
StopDevice
Stop device
Define
StopDevice(deviceName)
Parameter
Data
Name Required/Optional Description
Type
deviceName Required String Device name

Return
Int
Example
Stop device
VBScript Example

IOCmd.StopDevice("Device0")
WriteRemoteFile
Write local file to remote device
Define
String
WriteRemoteFile(localPathFile,deviceName,remoteIP,port,remoteFilePath,timeOutSeco
nds)
Parameter
Data
Name Required/Optional Description
Type
localPathFile Required String Local file path
deviceName Required String The device name
remoteIP Required String Remote device's IP
port Required Int Port
remoteFilePath Required String File path of remote file
timeOutSeconds Required Int Timeout
Return

String
Example
Write local file to remote device
VBScript Example

IOCmd.WriteRemoteFile("D:\","device0","192.168.1.1",21,"E:\",100)
AnalogVariable
Analog variable
Methods list
Name Description
The return value transfer into the
​ ToString
specified format string
​ ChangeValue Change variable value
Property list
Name Description
​ AbsolutePath Variable absolute path
Dead zone, variable extent of change
​ DeadBand
as a minimum
Decimal digits, value range is from 0 to
​ DecimalPlaces
15
​ Description The description of variable
​ EngineeringUnit The Engineering unit
​ InitValue Variable initial value
Whether to save the current value
​ IsInitValueSaved
when the program exits
​ MaxValue The maximum value of the variable
​ MinValue The minimum value of the variable
​ Name The variable name
​ UniqueIdentifier The unique identifier
​ Value The value of variable,object type
To obtain a variable's value with the
​ ValueAndUnit
additional project unit
​ ValueAsDouble Variable value
ToString
The return value transfer into the specified format string
Define
ToString(format)
Parameter
Data
Name Required/Optional Description
Type
format Required String Format

Return
The return value transfer into the specified format string
Example
VBScript Example

cc = Var.Analog1.ToString("C")
MsgBox cc
ChangeValue
Change variable value
Define
ChangeValue(value,reason)
Parameter
Data
Name Required/Optional Description
Type
value Required Double Target value
This value will be entered into
reason Required String
the operation variable

Return
void
Example
Change variable value
VBScript Example

Call Var.Analog1.ChangeValue(9.1,"test")
AbsolutePath
Variable absolute path
Define
String AbsolutePath
Description
Annotation
This property is read-only

Example
Display the variable full path
VBScript Example

TextBox0.Text =
Var.NewVariableGroup.NewVariable.AbsolutePath
DeadBand
Dead zone, variable extent of change as a minimum
Define
Double DeadBand
Description
Annotation
This property is read/write

Example
Set dead zone to 2
VBScript Example

Var.NewVariableGroup.NewVariable2.DeadBand = 2
DecimalPlaces
Decimal digits, value range is from 0 to 15
Define
Int32 DecimalPlaces
Description
Annotation
This property is read/write

Example
Set the decimal digits to 5
VBScript Example

Var.NewVariableGroup.NewVariable2.DecimalPlaces =
5
Description
The description of variable
Define
String Description
Description
Annotation
This property is read/write

Example Modify the discriptions of a variables to "an analog


variable"
VBScript Example

Var.NewVariableGroup.NewVariable.Description = "an
analog variable"
EngineeringUnit
The Engineering unit
Define
String EngineeringUnit
Description
Annotation
This property is read/write

Example
Set the engineering unit to degrees Celsius
VBScript Example

Var.NewVariableGroup.NewVariable2.EngineeringUnit
= "Degrees Celsius"
InitValue
Variable initial value
Define
Int InitValue
Description
Annotation
This property is read/write

Example Get variable initial value


VBScript Example

TextBox0.Text = Var.Variable.InitValue
IsInitValueSaved
Whether to save the current value when the program exits
Define
Boolean IsInitValueSaved
Description
Annotation
This property is read/write

Example
Set the property to true
VBScript Example

Var.NewVariableGroup.NewVariable.IsInitValueSaved
= true
MaxValue
The maximum value of the variable
Define
Double MaxValue
Description
Annotation
This property is read/write

Example
Set the maximum value of the variable to 200
VBScript Example

Var.NewVariableGroup.NewVariable2.MaxValue = 200
MinValue
The minimum value of the variable
Define
Double MinValue
Description
Annotation
This property is read/write

Example
The minimum value of the variable to -200
VBScript Example

Var.NewVariableGroup.NewVariable2.MinValue = -200
Name
The variable name
Define
String Name
Description
Annotation
This property is read-only

Example
Display the variable name
VBScript Example

TextBox0.Text =
Var.NewVariableGroup.NewVariable.Name
UniqueIdentifier
The unique identifier
Define
Int32 UniqueIdentifier
Description
Annotation
This property is read-only

Example
Display unique identifier
VBScript Example

TextBox0.Text =
Var.NewVariableGroup.NewVariable.UniqueIdentifier
Value
The variable value,object type
Define
Object Value
Description
Annotation
This property is read/write

Example
Modify the value of the variable to 50
VBScript Example

Var.NewVariableGroup.NewVariable2.Value = 50
ValueAndUnit
To obtain a variable's value with the additional project unit
Define
String ValueAndUnit
Description
Annotation
The property is read-only

Example
Display the value of variable and the engineering unit
VBScript Example

TextBox0.Text =
Var.NewVariableGroup.NewVariable2.ValueAndUnit
ValueAsDouble
The variable value
Define
Double ValueAsDouble
Description
Annotation
This property is read/write

Example
Modify the value of variable to 200
VBScript Example

Vars.NewVariableGroup.NewVariable.ValueAsDouble =
200
DigitalVariable
The digital variable
Methods list

Name Description
​ ChangeValue Change variable value
Property list
Name Description
​ AbsolutePath Absolute path of variable
​ Description Discription of variable
​ InitValue Variable initial value
Whether to save the current value
​ IsInitValueSaved
when the program exits
​ Name Variable name
UniqueIdentifier The unique identifier
Value Value of variable,object type
​ ValueAsBool Value of variable
ChangeValue
Change variable value
Define
ChangeValue(value,reason)
Parameter
Data
Name Required/Optional Description
Type
value Required Bool Target value
This value will be entered into
reason Required String
the operation variable

Return
void
Example
Change variable value
VBScript Example

Call Var.Digital1.ChangeValue(True,"test")
AbsolutePath
Variable absolute path
Define
String AbsolutePath
Description
Annotation
This property is read-only

Example
Display the variable full path
VBScript Example

TextBox0.Text =
Var.NewVariableGroup.NewVariable.AbsolutePath
Description
The description of variable
Define
String Description
Description
Annotation
This property is read/write

Example Modify the discriptions of variables to "a digital variable"


VBScript Example

Var.NewVariableGroup.NewVariable.Description = "a
digital variable"
InitValue
Variable initial value
Define
Bool InitValue
Description
Annotation
This property is read/write

Example Get variable initial value


VBScript Example

TextBox0.Text = Var.Digital1.InitValue
IsInitValueSaved
Whether to save the current value when the program exits
Define
Boolean IsInitValueSaved
Description
Annotation
This property is read/write

Example
Set the property to true
VBScript Example

Var.NewVariableGroup.NewVariable.IsInitValueSaved
= true
Name
The variable name
Define
String Name
Description
Annotation
This property is read-only

Example
Display the variable name
VBScript Example

TextBox0.Text =
Var.NewVariableGroup.NewVariable.Name
UniqueIdentifier
The only label ID
Define
Int32 UniqueIdentifier
Description
​ nnotation
A
This property is read-only

Example
Display the only label ID
VBScript Example

TextBox0.Text =
Var.NewVariableGroup.NewVariable.UniqueIdentifier
Value
The value of variable,object type
Define
Object Value
Description
Annotation
This property is read/write

Example Set the value of the variable to 50


VBScript Example

Var.NewVariableGroup.NewVariable1.Value = 50
ValueAsBool
The value of variable
Define
Boolean ValueAsBool
Description
​ nnotation
A
This property is read/write

Example
Set the value of variable to true
VBScript Example

Var.NewVariableGroup.NewVariable1.ValueAsBool =
true
SystemVariable
System variable
Property list
Name Description
CurrentUserName The current login user
Date The date string of current system
The number of days of the current
Day
system date
What day of the week of the current
DayOfWeek
system date
The day of the year of the current
DayOfYear
system date
The project running time,the unit is in
ElapsedTime
seconds
Whether there is a alarm in the current
HasAlarm
system
Hour The current system time in hour
Millisecond The current system time in millisecond
Minute The current system time in minute
Month The current system time in month
Now The date and time of current system
ProjectDir Current project directory
Second The current system time in second
StartTime The start time of current project
Time The string of current system time
Year The current system date
CurrentUserName
The current login user
Define
String CurrentUserName
Description
Annotation
This property is read-only

Example
Display the current login user
VBScript Example

TextBox0.Text = Sys.CurrentUserName
Date
The date string of current system
Define
String Date
Description
Annotation
The property is read-only

Example
Display the string of current system date
VBScript Example

TextBox0.Text = Sys.Date
Day
The number of days of the current system date
Define
Int32 Day
Description
Annotation
This property is read-only

Example
Display the number of days of the current system date
VBScript Example

TextBox0.Text = Sys.Day
DayOfWeek
The day of week of the current system date
Define
Int32 DayOfWeek
Description
Annotation
This property is read-only

Example Display the day of the week of the current system date
VBScript Example

TextBox0.Text = Sys.DayOfWeek
DayOfYear
The day of year of the current system date
Define
Int32 DayOfYear
Description
Annotation
This property is read-only

Example Display the day of year of the current system date


VBScript Example

TextBox0.Text = Sys.DayOfYear
ElapsedTime
The project running time,the unit is in seconds
Define
Double ElapsedTime
Description
Annotation
This property is read-only

Example Display the project running time,the unit is in seconds


VBScript Example

TextBox0.Text = Sys.ElapsedTime
HasAlarm
Whether there is alarm in the current system
Define
Boolean HasAlarm
Description
Annotation
This property is read-only

Example Display whether there is alarm in the current system


VBScript Example

TextBox0.Text = Sys.HasAlarm
Hour
The current system time in hour
Define
Int32 Hour
Description
Annotation
This property is read-only

Example Display the current system time in hour


VBScript Example

TextBox0.Text = Sys.Hour
Millisecond
The current system time in millisecond
Define
Int32 Millisecond
Description
Annotation
This property is read-only

Example Display the current system time in millisecond


VBScript Example

TextBox0.Text = Sys.Millisecond
Minute
The current system time in minute
Define
Int32 Minute
Description
Annotation
This property is read-only

Example
Display the current system time in minute
VBScript Example

TextBox0.Text = Sys.Minute
Month
The current system time in month
Define
Int32 Month
Description
Annotation
This property is read-only

Example
Display the current system time in month
VBScript Example

TextBox0.Text = Sys.Month
Now
The date and time of current system
Define
String Now
Description
Annotation
This property is read-only

Example
Display the date and time of current system
VBScript Example

TextBox0.Text = Sys.Now
ProjectDir
Current project directory
Define
String ProjectDir
Description
Annotation
This property is read-only

Example Query current project directory


VBScript Example

TextBox0.Text = Sys.ProjectDir
Second
The current system time in seconds
Define
Int32 Second
Description
Annotation
This property is read-only

Example
Display the current system time in seconds
VBScript Example

TextBox0.Text = Sys.Second
StartTime
The start time of current project
Define
DateTime StartTime
Description
Annotation
This property is read-only

Example
Display the start time of current project
VBScript Example

TextBox0.Text = Sys.StartTime
Time
The string of current system time
Define
String Time
Description
Annotation
This property is read-only

Example
Display the string of current system time
VBScript Example

TextBox0.Text = Sys.Time
Year
The current system date
Define
Int32 Year
Description
Annotation
This property is read-only

Example Display the current system date


VBScript Example

TextBox0.Text = Sys.Year
VariableGroup
The variable group
Property list
Name Description
AbsolutePath The variable group absolute path
Description The description of variable group
Name The name of variable group
UniqueIdentifier The only label ID
AbsolutePath
The variable group absolute path
Define
String AbsolutePath
Description
Annotation
This property is read-only

Example Display the variable group absolute path by pop-up a


dialog
VBScript Example

TextBox0.Text = Var.NewVariableGroup1.AbsolutePath
Description
The description of variable group
Define
String Description
Description
Annotation
This property is read/write

Example
Modify the description of variable group to "Switch variable"
VBScript Example

Var.NewVariableGroup1.Description = "Switch
variable"
Name
Variable group name
Define
String Name
Description
Annotation
This property is read-only

Example
Display the variable group name
VBScript Example

TextBox0.Text = Var.NewVariableGroup1.Name
UniqueIdentifier
The only label ID
Define
Int32 UniqueIdentifier
Description
Annotation
This property is read-only

Example
Display the only label ID of variable group
VBScript Example

TextBox0.Text =
Var.NewVariableGroup1.UniqueIdentifier
TextVariable
String variable
Methods list

Name Description
ChangeValue Change variable value
Property list
Name Description
AbsolutePath Variable absolute path
Description The description of variable
InitValue Variable initial value
Whether to save the current value
IsInitValueSaved
when the program exits
Name Variable name
UniqueIdentifier The only label ID
Value The value of variable,object type
ValueAsString The variable value
ChangeValue
Change variable value
Define
ChangeValue(value,reason)
Parameter
Data
Name Required/Optional Description
Type
value Required String Target value
This value will be entered into
reason Required String
the operation variable

Return
void
Example
Change variable value
VBScript Example

Call Var.Digital1.ChangeValue("Value","test")
AbsolutePath
Variable absolute path
Define
String AbsolutePath
Description
Annotation
This property is read-only

Example
Pop-up a dialog to display the variable full path
VBScript Example

MsgBox
Var.NewVariableGroup.NewVariable.AbsolutePath
Description
The description of variable
Define
String Description
Description
Annotation
This property is read/write

Example Modify the discriptions of variables to "a string variable"


VBScript Example

Var.NewVariableGroup.NewVariable.Description = "a
string variable"
InitValue
Variable initial value
Define
String InitValue
Description
​ nnotation
A
This property is read/write

Example Get variable initial value


VBScript Example

TextBox0.Text = Var.String1.InitValue
IsInitValueSaved
Whether to save the current value when the program exits
Define
Boolean IsInitValueSaved
Description
Annotation
This property is read/write

Example
Set the property to true
VBScript Example

Var.NewVariableGroup.NewVariable.IsInitValueSaved
= true
Name
The variable name
Define
String Name
Description
Annotation
This property is read-only

Example
Display the variable name by pop-up a dialog
VBScript Example

MsgBox Var.NewVariableGroup.NewVariable.Name
UniqueIdentifier
The only label ID
Define
Int32 UniqueIdentifier
Description
Annotation
This property is read-only

Example
Display the only label ID by pop-up a dialog
VBScript Example

MsgBox
Var.NewVariableGroup.NewVariable.UniqueIdentifier
Value
The value of variable,object type
Define
Object Value
Description
Annotation
This property is read/write

Example Set the value of variable to "pipeline"


VBScript Example

Var.NewVariableGroup.NewVariable.ValueAsString =
"pipeline"
ValueAsString
Variable value
Define
String ValueAsString
Description
Annotation
This property is read/write

Example Set the initial value of variable to Pipe


VBScript Example

Var.NewVariableGroup.NewVariable.ValueAsString =
"Pipe"
VariableCmd
Variable command
Methods list
Name Description
Get number of variables
GetExtendedDomainCount which specified the domain
and types
Get the set of variables which
GetExtendedDomainVars specified the domain and
types
Get values of variables which
GetVariableValue
is specified the path
Set values of variables which
SetVariableValue
is specified the path
GetExtendedDomainCount
Get number of variables which specified the domain and types
Define
GetExtendedDomainCount(extendedDomain,varType)
Parameter
Data
Name Required/Optional Description
Type
extendedDomain Required String Extended domain
Variable type,0
means analog,1
varType Required Int
means digital,2
means string
Example
Get number of string variables which domain name is "aaa"
VBScript Example

TextBox0.Text =
VarCmd.GetExtendedDomainCount("aaa",2)
GetExtendedDomainVars

Get the set of variables which specified the domain and types
Define
GetExtendedDomainVars(extendedDomain,varType)
Parameter
Data
Name Required/Optional Description
Type
extendedDomain Required String Extended domain
Variable type,0
means analog,1
varType Required Int
means digital,2
means string
Example
Get the set of string variables which domain name is "aaa"
VBScript Example

List = VarCmd.GetExtendedDomainVars("aaa",2)
Count = VarCmd.GetExtendedDomainCount("aaa",2)
For i = 0 To Count - 1
MsgBox CStr(LIST(i))
Next
GetVariableValue
Get values of variables which is specified the path
Define
GetVariableValue(VariablePath , errorValue)
Parameter
Data
Name Required/Optional Description
Type
VariablePath Required String The variable path
Return an error value,
return when the
errorValue Required Object
variable path was not
found
Example
Get the value of variable "Var.variable0"
VBScript Example

TextBox0.Text =
VarCmd.GetVariableValue("Var.Variable0",0)
SetVariableValue
Set values of variables which is specified the path
Define
SetVariableValue(VariablePath , Value)
Parameter

Name Required/Optional Data Type Description


VariablePath Required String The variable path
Value Required Object The value to set
Example
More variable assignment,that means set the value of "Var.variable0、
Var.variable1、Var.variable2" to"Var.VariableGroup0.variable0、
Var.VariableGroup0.variable1、Var.VariableGroup0.variable2"
VBScript Example

For i = 0 To 2
tt = VarCmd.GetVariableValue("Var.variable"&i, 0)
Call
VarCmd.SetVariableValue("Var.VariableGroup0.variable"&i,tt)
Next
ReportCommand
The report command scripts
Methods list
Name Description
Export the DataTable to
DirectExportDataToExcel
Excel table
Import the content of the
DirectImportToDataTable
table to DataTable
Import the specified
DirectImportToDataTable content of the table to the
DataTable
DirectPrintDataTable DataTable print
Print directly according to
DirectPrintTemplateForPath
the template
Export the history data and
curve control pictures to
ExportDataByTemplate
excel according to the
template
Export the real-time data
and curve control pictures
ExportDataByTemplate
to excel according to the
template
ExportDataTableToExcel Export data to excel
Export the history data to
ExportHistoryDataByTemplate excel according to the
template
ReadCsvFileByTemplate Read CSV file
SetWorkSheetEndTime Set the end time of query
Set the time interval of
SetWorkSheetIntervalTime
query
SetWorkSheetStartTime Set the start time of query
DirectExportDataToExcel
Export the DataTable to Excel table
Define
DirectExportDataToExcel(data ,excelFilePath ,version)
Parameter

Data
Name Required/Optional Description
Type
data Required DataTable Data source
excelFilePath Required String The excel file path
Excel version(0:office97To2003;1:office07 and newer
version Required Int
version)
Example
1. Get the data in the database access table and export it with the current time as the Excel name
VBScript Example

If month(now()) < 10 then


Nowtime = Year(now())&"0"&month(now())&Day(now())
Else
Nowtime = Year(now())&month(now())&Day(now())
End If
dt = DbAccess.DatabaseAccess.GetTable()
Call ReportCmd.DirectExportDataToExcel(dt,"D:\"&Nowtime&".xlsx",1)

2. Export historical data for the last hour in the database


VBScript Example

StartTime = DateAdd("d",-1,now()) 'Returns the date of the specified interval


EndTime = FormatDateTime(Sys.Now,0)
aql = "SELECT * FROM " + DbAccess.DatabaseAccess.TableName +" where
Triggertime between '"+StartTime+"' and '"+EndTime+"'"
dt =
DbAccessCmd.ExecuteDataTable("DbAccess.DatabaseAccess","sqlservercompact",sql
Call ReportCmd.DirectExportDataToExcel(dt,"D:\test.xlsx",1)
DirectImportToDataTable
Import the content of the table to the DataTable
Define
DirectImportToDataTable(excelFilePath)
Parameter
Data
Name Required/Optional Description
Type
excelFilePath Required String The file path

Example
Import file data of the specified path and display it in the report control
VBScript Example

dt =
ReportCmd.DirectImportToDataTable("D:\datatable.xlsx")
Call Report0.ShowDataTableForReport(1,1,dt)
DirectImportToDataTable
Import the table contents into the DataTable
Define
DirectImportToDataTable(excelFilePath ,rowHeaderIndex ,startRowIndex
,endRowIndex )
Parameter
Data
Name Required/Optional Description
Type
excelFilePath Required String The file path
Index of the row in which the
rowHeaderIndex Required Int
header is placed,starting at 1
startRowIndex Required Int Index of start row
endRowIndex Required Int Index of end row
Example
Import the data from line 5 to line 20 of the file in the specified path and display it
in the report control
VBScript Example

dt =
ReportCmd.DirectImportToDataTable("D:\datatable.xlsx",0,5,20)
Call Report0.ShowDataTableForReport(1,1,dt)
DirectPrintDataTable
DataTable print
Define
DirectPrintDataTable(data ,pageMediaSize ,topMargin ,bottomMargin
,leftMargin ,rightMargin ,lanscape ,scale)
Parameter

Data
Name Required/Optional Description
Type
data Required DataTable Data Source
pageMediaSize Required Int Page setup,8 is A4
The top margin,default
topMargin Required Double
value is 0
The bottom
bottomMargin Required Double margin,default value is
0
The left margin,default
leftMargin Required Double
value is 0
The right margin,default
rightMargin Required Double
value is 0
The print direction,1 is
lanscape Required Int lateral, 2 is in the
longitudinal direction
Factor,the default value
scale Required Int
is 100
Example
Custom Settings page to print the DataTable data
VBScript Example

dt =
ReportCmd.DirectImportToDataTable("D:\datatable.xlsx")
Call
ReportCmd.DirectPrintDataTable(dt,8,0,0,0,0,1,100)
DirectPrintTemplateForPath
Print directly according to the template
Define
DirectPrintTemplateForPath(Path,pageMediaSize,topMargin,bottomMargin ,leftMargin
,rightMargin,lanscape,scale)
Parameter

Data
Name Required/Optional Description
Type
path Required String The file path
pageMediaSize Required Int Page setup,8 is A4
topMargin Required Double The top margin,default value is 0
bottomMargin Required Double The bottom margin,default value is 0
leftMargin Required Double The left margin,default value is 0
rightMargin Required Double The right margin, default value is 0
The print direction,1 is lateral, 2 is in the
lanscape Required Int
longitudinal direction
scale Required Int Factor,the default value is 100
Print directly according to the template
VBScript Example

Call
ReportCmd.DirectPrintTemplateForPath("D:\test.xlsx",8,0,0,0,0,1,100)
ExporDataByTempLate
Export the history data and curve control pictures to excel according to the template
Define
ExportDataByTemplate(fileName ,templateName,dt ,imageBytes)
Parameter

Data
Name Required/Optional Description
Type
fileName Required String The file path saved
templateName Required String Report template name
dt Required DataTable The export data
imageBytes Required String The picture string,each picture are separated by“|”
Example
Export three historical curve data and images to Excel table according to the report template
VBScript Example

dt = HistoryChart0.GetDataTable("Series0") 'Gets the "Series0" data in Histo


dt1 = HistoryChart1.GetDataTable("Series0")
dt2 = HistoryChart2.GetDataTable("Series0")
Call DbAccessCmd.SetPrimary(dt,"TriggerTime") 'Set "TriggerTime" as the prim
Call DbAccessCmd.SetPrimary(dt1,"TriggerTime")
Call DbAccessCmd.SetPrimary(dt2,"TriggerTime")
Call dt.Merge(dt1) 'Merge dt1 data into dt
Call dt.Merge(dt2)
Call
ReportCmd.ExportDataByTemplate("D:\Test.xlsx","HistoryReport0",dt,HistoryChart
ExportDataByTemplate
Export the real-time data and curve control pictures to excel according to the template
Define
ExportDataByTemplate(fileName ,templateName ,imageBytes)
Parameter

Data
Name Required/Optional Description
Type
fileName Required String The file path saved
templateName Required String Report template name
imageBytes Required String The picture string,each picture are separated by “|”
Example
Export two real-time curve data and images to Excel table according to the report template
"RealReport0"
VBScript Example

Call
ReportCmd.ExportDataByTemplate("D:\Test.xlsx","RealReport0",RealTimeChart0.Ar
ExportDataTableToExcel
Export data to excel
Define
ExportDataTableToExcel(fileName , dt , sheetIndex , rowIndex , colIndex ,
overWrite)
Parameter

Data
Name Required/Optional Description
Type
fileName Required String The file path saved
dt Required DataTable Data source
sheetIndex Required Int Worksheet index
rowIndex Required Int Start row number
colIndex Required Int Start column number
overWrite Required Bool Whether to overwrite the original sheet
Example
Export the data in the database to the worksheet0 of the file test1.xls, and display
the data from the second row and the third column
VBScript Example

dt = DbAccess.DatabaseAccess1.GetTable()
Call
ReportCmd.ExportDataTableToExcel("D:\test1.xls",dt,0,2,3,True)
ExportHistoryDataByTemplate
Export the history data to excel according to the template
Define
ExportDataByTemplate(templateName ,excelFileTime)
Parameter

Data
Name Required/Optional Description
Type
templateName Required String The report template name
excelFileTime Required String The file path
Example
Export the last hour of historical data to Excel according to report template "report 0"
VBScript Example

starttime = dateadd("h",-1,now())
Call ReportCmd.SetWorkSheetStartTime(0,starttime)
Call ReportCmd.SetWorkSheetIntervalTime(0,1000)
Call ReportCmd.SetWorkSheetEndTime(0,Sys.Now)
Call
ReportCmd.ExportHistoryDataByTemplate("Report0","D:\123.xlsx")
ReadCsvFileByTemplate
Read CSV file
Define
ReadCsvFileByTemplate(templatePath,csvFilePath)
Parameter

Data
Name Required/Optional Description
Type
templatePath Required String Report template name
csvFilePath Required String The file path
Example
The report template "Report 0" associates the real-time variables, and then
executes this script to assign the values of the corresponding cells in the
.csv file to the variables in the template.
VBScript Example

Call
ReportCmd.ReadCsvFileByTemplate("Report0","D:\test.csv")
SetWorkSheetEndTime
Set the end time of query
Define
SetWorkSheetEndTime(sheetIndex ,EndTime)
Parameter
Data
Name Required/Optional Description
Type
sheetIndex Required Int The worksheet index
EndTime Required DateTime End time

Example
Set the current system time to end time
VBScript Example

Call ReportCmd.SetWorkSheetEndTime(0,Sys.Now)
SetWorkSheetIntervalTime
Set the time interval of query
Define
SetWorkSheetIntervalTime(sheetIndex ,intervalTime)
Parameter
Data
Name Required/Optional Description
Type
sheetIndex Required Int The worksheet index
intervalTime Required Int64 Time interval

Example
Set the time interval to 1 s
VBScript Example

Call ReportCmd.SetWorkSheetIntervalTime(0,1000)
SetWorkSheetStartTime
Set the start time of query
Define
SetWorkSheetStartTime(sheetIndex ,StartTime)
Parameter
Data
Name Required/Optional Description
Type
sheetIndex Required Int The worksheet index
StartTime Required DateTime Start time

Example
Set the current system time to start time
VBScript Example

Call ReportCmd.SetWorkSheetStartTime(0,Sys.Now)
AlarmGroup
Alarm group
Property list
Name Description
​ AbsolutePath The full path of alarm group
The number of the alarm group
​ AckedAlarmCount
currently in responses state
The number of the alarm group
​ AlarmCount
currently in alarm state
The number of the alarm group
​ AllAlarmCount
currently in all alarms and responses
​ Description The description of alarm group
Whether there is alarm in the current
​ HasAlarm
alarm group
​ Name The name of alarm group
​ UniqueIdentifier The only label ID of alarm group
AbsolutePath
The full path of alarm group
Define
String AbsolutePath
Description
Annotation
This property is read-only

Example Display the absolute path of "AlarmGroup0" by text


control
VBScript Example

Text0.Text = Alarm.AlarmGroup0.AbsolutePath
AckedAlarmCount
The number of the alarm group currently in responses state
Define
Int32 AckedAlarmCount
Description
Annotation
This property is read-only

Example
Display the number of the alarm group currently in responses
state by text control
VBScript Example

Text0.Text = Alarm.AlarmGroup0.AckedAlarmCount
AlarmCount
The number of the alarm group currently in alarm state
Define
Int32 AlarmCount
Description
Annotation
This property is read-only

Example Display the number of the alarm group currently in alarm


state by text control
VBScript Example

Text0.Text = Alarm.AlarmGroup0.AlarmCount
AllAlarmCount
The number of the alarm group currently in alarms and responses
Define
Int32 AllAlarmCount
Description
Annotation
This property is read-only

Example Display the number of the alarm group currently in


alarms and responses by text control
VBScript Example

Text0.Text = Alarm.AlarmGroup0.AllAlarmCount
Description
The description of alarm group
Define
String Description
Description
Annotation
This property is read/write

Example
Modify the property to "Temperature alarm group"
VBScript Example

Alarm.AlarmGroup0.Description = "Temperature alarm


group"
HasAlarm
Whether there is alarm in the current alarm group
Define
Boolean HasAlarm
Description
Annotation
This property is read only

Example
Display whether there is alarm in the "AlarmGroup0" by text control
VBScript Example

Text0.Text = Alarm.AlarmGroup0.HasAlarm
Name
The name of alarm group
Define
String Name
Description
Annotation
This property is read-only

Example Display the name of alarm group by text control


VBScript Example

Text0.Text = Alarm.AlarmGroup.Name
UniqueIdentifier
The unique identifier of alarm group
Define
Int32 UniqueIdentifier
Description
Annotation
This property is read-only

Example Display the unique identifier of alarm group by text control


VBScript Example

Text0.Text = Alarm.AlarmGroup0.UniqueIdentifier
AnalogAlarm
Analog variable alarm model
Property list
Name Description
AbsolutePath Absolute path of alarm
AlarmType Alarm type
Current value of alarm
CurrentValue
variable
Alarm variable current
CustomerExpressionContent
custom expression Content
Alarm variable current
CustomerExpressionValue
custom expression Value
Analog deviation or the limit
DelayValue of the alarm delay time, the
unit is second
Description Description of alarm
The analog alarm deviation
DeviationDeadBandValue
value of the dead zone
The analog alarm deviation
DeviationTargetValue
value of the target
HighContent Analog high alarm text
The text of analog high high
HighHighContent
alarm
Analog high high alarm
HighHighValue
value
HighValue Analog high alarm value
The last time of the alarm
LastTriggerTime
time
The alarm level,the highest
level is 999,0-199:slight,
Level 200-399:lighter,400-599:
general,600-799:heavier,
800-999:serious
LimitDeadBandValue The upper or lower limits of
dead zone value of the
analog alarm
LowContent The text of analog low alarm
The alarm text of the analog
LowerDeviationContent
deviation lower limit
The alarm value of the
LowerDeviationValue
analog deviation lower limit
The text of analog low low
LowLowContent
alarm
The value of analog low low
LowLowValue
alarm
The value of analog low low
LowValue
alarm
Name The alarm name
The alarm text of analog
RateOfChangeContent
rate
The unit of change
RateOfChangeUnit rate,second is 1,minute is
60,hour is 3600
The alarm value of the
RateOfChangeValue
analog change rate
Alarm variable status, -1: no
alarm; 0: all alarms are
Status
restored; 1.new alarm; 2:
any alarm will be response
UniqueIdentifier The alarm unique identifier
The alarm text of the analog
UpperDeviationContent
deviation upper limit
The alarm value of the
UpperDeviationValue
analog deviation upper limit
AbsolutePath
The alarm absolute path
Define
String AbsolutePath
Description
Annotation
This property is read-only

Example Display the absolute path of the "AlarmVariable0" in alarm


group "AlarmGroup0"
VBScript Example

Text0.Text =
Alarm.AlarmGroup0.AlarmVariable0.AbsolutePath
AlarmType
Alarm type
Define
Int32 AlarmType
Description
​ nnotation
A
This property is read/write

Example Set the alarm type of alarm


"Alarm.AlarmGroup0.AlarmVariable0" to lower alarm (2) and higher
alarm (4),the value is equal to 6
VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.AlarmType = 6
CurrentValue
Current value of alarm variable
Define
Object CurrentValue
Description
Annotation
This property is read-only

Example Display current value of alarm variable by text control


VBScript Example

Text0.Text =
Alarm.AlarmGroup0.AlarmVariable.CurrentValue
CustomerExpressionContent
Alarm variable current custom expression content
Define
String CustomerExpressionContent
Description
Annotation
This property is read/write

Example Display Alarm variable current custom expression by text


control
VBScript Example

Text0.Text =
Alarm.AlarmGroup0.AlarmVariable.CustomerExpressionContent
CustomerExpressionValue
Alarm variable current custom expression value
Define
ObjectCustomerExpressionvalue
Description
Annotation
This property is read/write

Example Display Alarm variable current custom expression


by value control
VBScript Example

Text0.Text =
Alarm.AlarmGroup0.AlarmVariable.CustomerExpressionvalue
DelayValue
Analog deviation or the limit of the alarm delay time, the unit is
second
Define
Int32 DelayValue
Description
Annotation
This property is read/write

Example Modify the analog deviation or the limit of the alarm delay
time to 1 second
VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.DelayValue = 1
Description
Alarm description
Define
String Description
Description
Annotation
This property is read/write

Example Modify the description of alarm to“AlarmDescription”


VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.Description =
"AlarmDescription"
DeviationDeadBandValue
The analog alarm deviation value of the dead zone
Define
Double DeviationDeadBandValue
Description
Annotation
This property is read/write

Example Modify the analog alarm deviation value of the dead zone to 1
VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.DeviationDeadBandValue
= 1
DeviationTargetValue
The analog alarm deviation value of the target
Define
Double DeviationTargetValue
Description
Annotation
This property is read/write

Example Modify the analog alarm deviation value of the target to 1


VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.DeviationTargetValue
= 1
HighContent
Analog high alarm text
Define
String HighContent
Description
Annotation
This property is read/write

Example Modify the analog high alarm text to“high alarm”


VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.HighContent =
"high alarm"
HighHighContent
The text of analog high high alarm
Define
String HighHighContent
Description
​ nnotation
A
This property is read/write

Example
Modify the analog high high alarm text to “high high alarm”
VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.HighHighContent =
"high high alarm"
HighHighValue
Analog high high alarm value
Define
Double HighHighValue
Description
Annotation
This property is read/write

Example Modify the analog high high alarm value to 1


VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.HighHighValue = 1
HighValue
Analog high alarm value
Define
Double HighValue
Description
​ nnotation
A
This property is read/write

Example Modify the analog high alarm value to 1


VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.HighValue = 1
LastTriggerTime
Time of last alarm trigger
Define
DateTime LastTriggerTime
Example Display the last time of the alarm time by text control
VBScript Example

Text0.Text =
Alarm.AlarmGroup0.AlarmVariable0.LastTriggerTime
Level
The alarm level,the highest level is 999,0-199:slight,200-399:
lighter,400-599:general,600-799:heavier,800-999:serious
Define
Int32 Level
Description
Annotation
This property is read/write

Example
Set alarm level
VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.Level = 300
LimitDeadBandValue
The upper or lower limits of dead zone value of the analog alarm
Define
Double LimitDeadBandValue
Description
Annotation
This property is read/write

Example Modify the value of the upper or lower limits of the analog
alarm dead zone to 1
VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.LimitDeadBandValue
= 1
LowContent
The text of analog low alarm
Define
String LowContent
Description
Annotation
This property is read/write

Example Modify the text of analog low alarm to “low alarm”


VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.LowContent = "low
alarm"
LowerDeviationContent
The alarm text of the analog deviation lower limit
Define
String LowerDeviationContent
Description
Annotation
This property is read/write

Example Modify the alarm text of the analog deviation lower limit to
“deviation lower limit alarm”
VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.LowerDeviationContent
= "deviation lower limit alarm"
LowerDeviationValue
The alarm value of the analog deviation lower limit
Define
Double LowerDeviationValue
Description
Annotation
This property is read/write

Example Modify the alarm value of the analog deviation lower limit
to 1
VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.LowerDeviationValue
= 1
LowLowContent
The text of analog low low alarm
Define
String LowLowContent
Description
Annotation
This property is read/write

Example Modify the text of analog low low alarm to “low low alarm”
VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.LowLowContent =
"low low alarm"
LowLowValue
The value of analog low low alarm
Define
Double LowLowValue
Description
Annotation
This property is read/write

Example Modify the value of analog low low alarm to 1


VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.LowLowValue = 1
LowValue
The value of analog low low alarm
Define
Double LowValue
Description
Annotation
This property is read/write

Example Modify the value of analog low low alarm to 1


VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.LowValue = 1
Name
Alarm name
Define
String Name
Description
Annotation
This property is read-only

Example Text displays the alarm name


VBScript Example

Text0.Text = Alarm.AlarmGroup0.AlarmVariable0.Name
RateOfChangeContent
The alarm text of analog rate
Define
String RateOfChangeContent
Description
Annotation
This property is read/write

Example Modify the alarm text of analog rate to “analog rate alarm”
VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.RateOfChangeContent
= "analog rate alarm"
RateOfChangeUnit
The unit of change rate,second is 1,minute is 60,hour is 3600
Define
Int32 RateOfChangeUnit
Description
Annotation
This property is read/write

Example Modify the unit of change rate to 60


VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.RateOfChangeUnit
= 60
RateOfChangeValue
The alarm value of the analog change rate
Define
Double RateOfChangeValue
Description
Annotation
This property is read/write

Example Modify the alarm value of the analog change rate to 1


VBScript Example

Alarm.NewAlarmGroup.NewAlarm1.RateOfChangeValue =
1
Status
Alarm variable status, -1: no alarm; 0: all alarms are restored; 1.new
alarm; 2: any alarm will be response
Define
Int32 Status
Description
Annotation
This property is read-only

Example
Text display alarm variable status
VBScript Example

Text0.Text =
Alarm.AlarmGroup0.AlarmVariable0.Status
UniqueIdentifier
The alarm unique identifier
Define
Int32 UniqueIdentifier
Description
Annotation
This property is read-only

Example Assign the alarm unique identifier to the text


VBScript Example

Text0.Text =
Alarm.AlarmGroup0.AlarmVariable0.UniqueIdentifier
UpperDeviationContent
The alarm text of the analog deviation upper limit
Define
String UpperDeviationContent
Description
Annotation
This property is read/write

Example Modify the content of the alarm text of the analog deviation
upper limit to “deviation upper limit alarm”
VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.UpperDeviationContent
= "deviation upper limit alarm"
UpperDeviationValue
The alarm value of the analog deviation upper limit
Define
Double UpperDeviationValue
Description
Annotation
This property is read/write

Example Modify the alarm value of the analog deviation upper limit
to 1
VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.UpperDeviationValue
= 1
DigitalAlarm
Digital variable alarm
Property list
Name Description
AbsolutePath Absolute path of alarm
AlarmType Alarm type
CurrentValue Current value of alarm variable
Description Description of alarm
The alarm level,the highest level is
999,0-199:slight,200-399:
Level
lighter,400-599:general,600-
799:heavier,800-999:serious
Name The alarm name
OffAlarmContent Digital close the alarm text
OffToOnAlarmContent Digital close to open alarm text
OnAlarmContent Digital open the alarm text
OnToOffAlarmContent Digital open to close alarm text
Alarm variable status, -1: no alarm;
0: all alarms are restored; 1.new
Status
alarm; 2: any alarm will be
response
UniqueIdentifier The unique identifier of alarm
AbsolutePath
The alarm absolute path
Define
String AbsolutePath
Description
Annotation
This property is read-only

Example Display the absolute path of the "AlarmVariable0" in alarm


group "AlarmGroup0"
VBScript Example

Text0.Text =
Alarm.AlarmGroup0.AlarmVariable0.AbsolutePath
AlarmType
Alarm type
Define
Int32 AlarmType
Description
​ nnotation
A
This property is read/write

Example Set the alarm type of alarm


"Alarm.AlarmGroup0.AlarmVariable0" to lower alarm (2) and higher
alarm (4),the value is equal to 6
VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.AlarmType = 6
CurrentValue
Current value of alarm variable
Define
Object CurrentValue
Description
Annotation
This property is read-only

Example Display current value of alarm variable by text control


VBScript Example

Text0.Text =
Alarm.AlarmGroup0.AlarmVariable.CurrentValue
Description
Alarm description
Define
String Description
Description
Annotation
This property is read/write

Example Modify the description of alarm to“AlarmDescription”


VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.Description =
"AlarmDescription"
Level
The alarm level,the highest level is 999,0-199:slight,200-399:
lighter,400-599:general,600-799:heavier,800-999:serious
Define
Int32 Level
Description
Annotation
This property is read/write

Example
Set alarm level
VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.Level = 300
Name
Alarm name
Define
String Name
Description
Annotation
This property is read-only

Example Text displays the alarm name


VBScript Example

Text0.Text = Alarm.AlarmGroup0.AlarmVariable0.Name
OffAlarmContent
Digital close the alarm text
Define
String OffAlarmContent
Description
Annotation
This property is read/write

Example
Modify the text of the digital close the alarm to "OffAlarm"
VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.OffAlarmContent =
"OffAlarm"
OffToOnAlarmContent
Digital close to open alarm text
Define
String OffToOnAlarmContent
Description
Annotation
This property is read/write

Example Modify the text of the digital close to open alarm to


"OffToOnAlarm"
VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.OffToOnAlarmContent
= "OffToOnAlarm"
OnAlarmContent
Digital open the alarm text
Define
String OnAlarmContent
Description
Annotation
This property is read/write

Example Modify the text of the digital open the alarm to "OnAlarm"
VBScript Example

Alarm.AlarmGroup0.AlarmVariable0.OnAlarmContent =
"OnAlarm"
OnToOffAlarmContent
Digital open to close alarm text
Define
String OnToOffAlarmContent
Description
Annotation
This property is read/write

Example Modify the text of the digital open to close alarm to


"OnToOffAlarm"
VBScript Example

Alarm.0AlarmGroup0.AlarmVariable0.OnToOffAlarmContent
= "OnToOffAlarm"
Status
Alarm variable status, -1: no alarm; 0: all alarms are restored; 1.new
alarm; 2: any alarm will be response
Define
Int32 Status
Description
Annotation
This property is read-only

Example
Text display alarm variable status
VBScript Example

Text0.Text =
Alarm.AlarmGroup0.AlarmVariable0.Status
UniqueIdentifier
The alarm unique identifier
Define
Int32 UniqueIdentifier
Description
Annotation
This property is read-only

Example Assign the alarm unique identifier to the text


VBScript Example

Text0.Text =
Alarm.AlarmGroup0.AlarmVariable0.UniqueIdentifier
AlarmCmd
Alarm command
Methods list
Name Description
Check whether alarm variable
RecheckAlarm
generates alarm
SaveAlarmConfig Save alarm config
Property list
Name Description
AckedAlarmCount The number of alarm in reply condition
AlarmCount The number of alarm in the alarm state
All the number alarm which includes
AllAlarmCount
alarm and reply
RecheckAlarm
Check whether alarm variable generates alarm
Define
RecheckAlarm(alarmPaths)
Parameter
Data
Name Required/Optional Description
Type
alarmPaths Required String Format

Return
Void
Example
Check whether alarm variable generates alarm
VBScript Example

Call
AlarmCmd.RecheckAlarm("Alarm.AlarmValue1;Alarm.AlarmValue2")
SaveAlarmConfig
Save alarm configuration
Define
SaveAlarmConfig()
Example
Save alarm configuration
VBScript Example

Call AlarmCmd.SaveAlarmConfig()
AckedAlarmCount
The number of alarm in reply condition
Define
Int32 AckedAlarmCount
Description
​ nnotation
A
This property is read-only

Example
The text shows the number of alarms in the response state
VBScript Example

Text0.Text = AlarmCmd.AckedAlarmCount
AlarmCount
The number of alarm in the alarm state
Define
Int32 AlarmCount
Description
Annotation
This property is read-only

Example
The text shows the number of alarms in the alarm state
VBScript Example

Text0.Text = AlarmCmd.AlarmCount
AllAlarmCount
All the number alarm which includes alarm and reply
Define
Int32 AllAlarmCount
Description
​ nnotation
A
This property is read-only

Example
Display the number of alarm currently in alarms and responses by
text control
VBScript Example

Text0.Text = AlarmCmd.AllAlarmCount
AudioAlarmConfig
Alarm sound configuration
Methods list
Name Description
GetUserCustomContent Get the user custom content
SetUserCustomContent Set the user custom content
GetUserCustomContent
Get the user custom content
Define
GetUserCustomContent(category ,name ,isRecoveryTrigger)
Parameter
Data
Name Required/Optional Description
Type
Get the content of
the specified
category, 0-all
alarms, 1-alarm
category Required Int group, 2-alarm
level, 3-alarm
type, 4-alarm
variable, other
values are invalid
name Required Object When
category=0, the
Name value is is
invalid
When
category=1, the
Name value is the
Name of the
alarm group
When
category=2, the
Name value is: 1-
very serious, 2-
severe, 4-
general, 8- not
urgent, 16- slight
When
category=3, the
Name value is: 1-
low, 2- low, 4-
high, 8- high, 16-
small deviation,
32- large
deviation, 64-
change rate, 512-
on, 024- off,
2048- switch shift
When
category=4, the
Name value is the
path of the alarm
variable
Triggered when
isRecoveryTrigger Required Bool
alarm is restored
Example

Get the user custom content

VBScript Example

Text0.Text =
AudioAlarmConfig.GetUserCustomContent(2,4,False)
SetUserCustomContent
Set the user custom content
Define
SetUserCustomContent(category ,name ,isRecoveryTrigger ,newValue
,isLoopSpeech)
Parameter

Data
Name Required/Optional Description
Type
Get the content of
the specified
category, 0-all
alarms, 1-alarm
category Required Int
group, 2-alarm level,
3-alarm type, 4-
alarm variable, other
values are invalid
name Required Object When category=0,
the Name value is is
invalid
When category=1,
the Name value is
the Name of the
alarm group
When category=2,
the Name value is:
1- very serious, 2-
severe, 4- general,
8- not urgent, 16-
slight
When category=3,
the Name value is:
1- low, 2- low, 4-
high, 8- high, 16-
small deviation, 32-
large deviation, 64-
change rate, 512-
on, 024- off, 2048-
switch shift
When category=4,
the Name value is
the path of the alarm
variable
Triggered when
isRecoveryTrigger Required Bool
alarm is restored
User-defined voice
newValue Required String
content
Set whether to loop
isLoopSpeech Required Bool
playback
Example

Set the user custom content

VBScript Example

Call
AudioAlarmConfig.SetUserCustomContent(2,4,False,"Data
exception",False)
UserCmd
Authority management
Methods list
Name Description
​ AddUser Add user
Add users and set the user
​ AddUser
information
Modify the password of the current
​ ChangePassword
login user
​ ChangePasswordBox Change password
​ EditUser Edit user's name and description
Edit user's name ,description,type
​ EditUser
and password
​ EditUser Edit user’s type
​ GetAllUserCount Get all user count
​ GetAllUserNames Get all the user’s name list
​ GetCurrentUserName Get current user name
​ GetUserDescription Get current user description
​ GetUserNameByIndex Get user name by index
​ GetUserType Get current user type
​ Login User login authentication
​ LoginBox User login
​ Logout User logout
​ RemoveUser Remove user
​ UserManagerBox User management
Property list
Name Description
​ UserName Current user name
AddUser
Add user
Define
AddUser(userName ,password)
Parameter
Data
Name Required/Optional Description
Type
userName Required String username
password Required String password

Return
If add success,it will return True,otherwise return False
Example
First of all, the current user has login
VBScript Example

Call UserCmd.AddUser("username","123")
AddUser
Add users and set the user information
Define
AddUser(userName ,password ,description ,role)
Parameter
Data
Name Required/Optional Description
Type
userName Required String Username
password Required String Password
description Required String Description
role Required String User's role
Return
If success,it will return True,otherwise return False
Example
If you want to add an administrator, the current user must be a
system administrator, only one system administrator, and add the
operator cannot be deleted, the current user must be an
administrator
VBScript Example

Call UserCmd.AddUser("username","123","I am an
operator","Operator")
ChangePassword
Modify the password of the current login user
Define
ChangePassword(oldPassWord ,password)
Parameter
Data
Name Required/Optional Description
Type
oldPassword Required String Old password
password Required String New password

Return
If success,it will return True,otherwise return False
Example
Modify the password,first of all,you have login
VBScript Example

Call
UserCmd.ChangePassword("oldpassword","newpassword")
ChangePasswordBox
Change password
Define
ChangePasswordBox()
Example
Modify the password,first of all,you have login
VBScript Example

UserCmd.ChangePasswordBox()
EditUser
Edit user's name and description
Define
EditUser(userName ,newName ,description)
Parameter
Data
Name Required/Optional Description
Type
userName Required String Username
newName Required String The name to be modified
description Required String User description
Return
If success,it will return True,otherwise return False
Example
First of all, the administrator has been login
VBScript Example

UserCmd.EditUser("username","newname","HasBeenModified“)
EditUser
Edit user's name ,description,type and password
Define
EditUser(userName ,newName ,description , role , password)
Parameter

Data
Name Required/Optional Description
Type
userName Required String Username
newName Required String Edit username
description Required String Description
role Required String User's type
password Required String Password
Return
If success,it will return True,otherwise return False
Example The administrator has been login
VBScript Example

UserCmd.EditUser("username","username","EditUser","Operator","111111")
EditUser
Edit user’s type
Define
EditUser(userName , role)
Parameter
Data
Name Required/Optional Description
Type
userName Required String Username
role Required String User's type

Return
If success,it will return True,otherwise return False
Example
Types can be modified:Admin,Operator
VBScript Example

UserCmd.EditUser("username","Admin")
GetAllUserCount
Get all user count
Define
GetAllUserCount()
Return
Query all user count
Example
VBScript Example

TextBox0.Text = UserCmd.GetAllUserCount()
GetAllUserNames
Get all the user’s name list
Define
GetAllUserNames()
Example
All the user’s name list
VBScript Example

TextBox0.Text = UserCmd.GetAllUserNames()
GetCurrentUserName
Get current user name
Define
GetCurrentUserName()
Return
Return current user name
Example
VBScript Example

TextBox0.Text = UserCmd.GetCurrentUserName()
GetUserDescription
Get current user description
Define
GetUserDescription(userName)
Parameter
Data
Name Required/Optional Description
Type
userName Required String User name

Return
Get user description
Example
VBScript Example

TextBox0.Text = UserCmd.GetUserDescription("user")
GetUserNameByIndex
Get user name by index
Define
GetUserNameByIndex(index)
Parameter
Data
Name Required/Optional Description
Type
index Required int User index

Return
Return user name by index
Example
VBScript Example

TextBox0.Text = UserCmd.GetUserNameByIndex(1)
GetUserType
Get current user type
Define
GetUserType(userName)
Parameter
Data
Name Required/Optional Description
Type
userName Required String Username

Example
Get current user type
VBScript Example

TextBox0.Text = UserCmd.GetUserType("user")
Login
User login authentication
Define
Login(userName ,password)
Parameter
Data
Name Required/Optional Description
Type
userName Required String Username
password Required String User's password

Return
If login success,it will return True,otherwise return False
Example User login
VBScript Example

Call UserCmd.Login("username","password")
LoginBox
User login
Define
LoginBox()
Example User login
VBScript Example

UserCmd.LoginBox()
Logout
User logout
Define
Logout()
Example Logout
VBScript Example

UserCmd.Logout()
RemoveUser
Remove user
Define
RemoveUser(userName)
Parameter
Data
Name Required/Optional Description
Type
userName Required String Username

Return
If success,it will return True,otherwise return False
Example
Delete user called "newuser",you must have administrator privileges,
and youself cannot be deleted
VBScript Example

UserCmd.RemoveUser("newuser")
UserManagerBox
User management
Define
UserManagerBox()
Example
Pop-up "UserManager" window,display user information
VBScript Example

UserCmd.UserManagerBox()
UserName
Current username
Define
String UserName
Description
Annotation
This property is read-only

Example Query the current login username


VBScript Example

TextBox0.Text = UserCmd.UserName
RecordVariable
Variable record
Methods list
Name Description
NotifySave Inform to save the historical data
Inform to save the historical data,can
NotifySave
be forced store
Property list
Name Description
Get or set the time interval of
IntervalTime
the storage
NotifySave
Inform to save the historical data
Define
NotifySave()
Example
Inform to save the historical data
VBScript Example

Call Record.VariableRecord0.NotifySave()
NotifySave
Inform to save the historical data
Define
NotifySave(isForcedStorage)
Parameter
Data
Name Required/Optional Description
Type
Whether to forced
store,the shortest is
isForcedStorage Required Bool
trigger again per
second

Example
Inform to save the historical data
VBScript Example

Call Record.VariableRecord0.NotifySave(true)
IntervalTime
Get or set the time interval of the storage
Define
Int IntervalTime
Example
Set the variable record 0 storage time interval to 1 second
VBScript Example

Record.VariableRecord0.IntervalTime = 1
HistRecordGroup
Variable record group
Property list
Name Description
Description Discription of variable record group
Name Variable record group name
The data table name of variable record
TableName
group
Description
Description of the variable record group
Define
String Description
Description
Annotation
This property is read/write

Example
Modify the discription of the variables record group "HistoryGroup0"
to "test"
VBScript Example

HistRecord.HistoryGroup0.Description="test"
Name
The name of the variable record group
Define
String Name
Description
Annotation
This property is read only

Example
Display the name of the variable record group "HistoryGroup0"
VBScript Example

TextBox0.Text = HistRecord.HistoryGroup0.Name
TableName
The data table name of the variable record group
Define
String TableName
Description
Annotation
This property is read only

Example
Display the data table name of the variable record group
"HistoryGroup0"
VBScript Example

TextBox0.Text = HistRecord.HistoryGroup0.TableName
HistRecordItem
Variable record
Property list
Name Description
Description Description
Expression Expression
Name Name
RealColName Datatable mame
StoredValueTypeStr Value type
Description
Description of the variable record group
Define
String Description
Description
Annotation
This property is read/write

Example
Modify the discription of the "historical record 1" in variables record
group "HistoryGroup0" to "record number of products"
VBScript Example

HistRecord.HistoryGroup0.historical
record1.Description = "record number of products"
Expression
Expression
Define
String Expression
Description
​ nnotation
A
This property is read only

Example
Display the expression of "variable record1"
VBScript Example

TextBox0.Text =
HistRecord.HistoryGroup0.historical
record1.Expression
Name
Name
Define
String Name
Description
Annotation
This property is read only

Example
Display the name of "variable record1"
VBScript Example

TextBox0.Text =
HistRecord.HistoryGroup0.historical record1.Name
RealColName
The datatable's column name
Define
String RealColName
Description
Annotation
This property is read only

Example
Query the datatable's column name of "variable record1"
VBScript Example

TextBox0.Text =
HistRecord.HistoryGroup0.historical
record1.RealColName
StoredValueTypeStr
Value type
Define
String StoredValueTypeStr
Description
Annotation
Value type,simulation value: double,switching value: boolean,text
content: string

Example
Display the value type of "variable record1"
VBScript Example

TextBox0.Text =
HistRecord.HistoryGroup0.HistRecord1.StoredValueTypeStr
HistRecordCmd
Polygon controls
Methods list
Name Description
QueryRealTimeData Query real-time data
QueryWithStorageItemName Query history group data
QueryRealTimeData
Query real time data
Define
QueryRealTimeData(histStorageGroupName)
Parameter

Data
Name Required/Optional Description
Type
History storage group
histStorageGroupName Required String
name
Example
Get real time data of the history storage group "HistoryGroup0"
Add a "Report0" to window,display the data table in "Report0"
VBScript Example

dt =
HistRecordCmd.QueryRealTimeData("HistRecord.HistoryGroup0")
Call Report0.ClearCellContent()
Call Report0.ShowDataTableForReport(1,1,dt)
QueryWithStorageItemName
Query history storage group data
Define
QueryWithStorageItemName(histStorageGroupName , histStorageItemNames ,
startTime , endTime , rowsCount)
Parameter

Data
Name Required/Optional Description
Type
The name of variable storage
histStorageGroupName Required String group
History storage variable
histStorageItemNames Required String name,separated with commas

startTime Required DateTime Start time


endTime Required DateTime End time
The maximum number of lines
to read, 0 to read the empty
rowsCount Required Int
table, negative to read all of
them
Example
Access "historical records" of history group "HistoryGroup0" and the data of "historical
records" in the recent one hour's
Use the DateAdd function to set the query time range for the past hour
Add a "Report0" to the window to display the query data

VBScript Example

StartTime = DateAdd("h",-1,now())
dt =
HistRecordCmd.QueryWithStorageItemName("HistoryGroup0","historical
record,historical record1",StartTime,Sys.Now,-1)
Call Report0.ClearCellContent()
Call Report0.ShowDataTableForReport(1,1,dt)
EventScript
Event script
Property list
Name Description
Description Description
Expression Expression
Interval Time interval,the unit is millisecond
IntTriggerMode Trigger mode
IsEnable Whether to enable the script
Name The name of user script
ScriptContent The script content
UniqueIdentifier The unique identifier
Description
Description
Define
String Description
Description
Annotation
This property is read/write

Example
Display the "ConditionScript" description information in a textbox
VBScript Example

TextBox0.Text = Script.ConditionScript.Description
Expression
Expression
Define
String Expression
Description
Annotation
This property is read/write

Example
Get the expression of "ConditionScript"
VBScript Example

TextBox0.Text = Script.ConditionScript.Expression
Interval
Time interval,the unit is millisecond
Define
Int32 Interval
Description
Annotation
This property is read/write

Example
Get the interval of "ConditionScript"
VBScript Example

TextBox0.Text = Script.ConditionScript.Interval
IntTriggerMode
Trigger mode
Define
IntTriggerMode
Description
Annotation
This property is read/write

Example
Get the triggermode of "ConditionScript"
VBScript Example

TextBox0.Text =
Script.ConditionScript.IntTriggerMode
IsEnable
Whether to enable the script
Define
Boolean IsEnable
Description
​ nnotation
A
This property is read/write

Example
Query whether the "ConditionScript" is enabled
VBScript Example

TextBox0.Text = Script.ConditionScript.IsEnable
Name
The name of user script
Define
String Name
Description
Annotation
This property is read-only

Example
Get the name of "ConditionScript"
VBScript Example

TextBox0.Text = Script.ConditionScript.Name
ScriptContent
The script content
Define
String ScriptContent
Description
Annotation
This property is read/write

Example
Get the content of "ConditionScript"
VBScript Example

TextBox0.Text =
Script.ConditionScript.ScriptContent
UniqueIdentifier
The unique identifier ID
Define
Int32 UniqueIdentifier
Description
Annotation
This property is read-only

Example
Get the unique ID of "ConditionScript"
VBScript Example

TextBox0.Text =
Script.ConditionScript.UniqueIdentifier
TimerScript
Timer script
Property list
Name Description
Description Description
EndTime The end time
Interval Time interval,the unit is millisecond
IntTriggerMode Trigger mode
IsEnable Whether to enable the script
IsEnableEndTime Whether to use the end time
The Months, separated by commas,
MonthDays
such as "1,20,22,25"
Name The name of user script
ScriptContent The content of script
StartTime Start time
UniqueIdentifier The unique identifier ID
The Weeks, separated by commas,
WeekDays such as“0,1,2,3”,0 to 6 represent from
Sunday to Saturday
Description
Description
Define
String Description
Description
Annotation
This property is read/write

Example
Display the "TimeScript" description information
VBScript Example

TextBox0.Text = Script.TimeScript.Description
EndTime
End time
Define
DateTime EndTime
Description
Annotation
This property is read/write

Example
Query the endtime information of "TimeScript"
VBScript Example

TextBox0.Text = Script.TimeScript.EndTime
Interval
Time interval,the unit is millisecond
Define
Int32 Interval
Description
Annotation
This property is read/write

Example
Query the interval of "TimeScript"
VBScript Example

TextBox0.Text = Script.TimeScript.Interval
IntTriggerMode
Trigger mode
Define
IntTriggerMode
Description
​ nnotation
A
This property is read/write

Example
Get the "TimeScript" triggermode
VBScript Example

TextBox0.Text = Script.TimeScript.IntTriggerMode
IsEnable
Whether to enable the script
Define
Boolean IsEnable
Description
​ nnotation
A
This property is read/write

Example
Query whether the "TimeScript" is enabled
VBScript Example

TextBox0.Text = Script.TimeScript.IsEnable
IsEnableEndTime
Whether to use the end time
Define
Boolean IsEnableEndTime
Description
Annotation
This property is read/write

Example
Query whether the "TimeScript" use endtime
VBScript Example

TextBox0.Text = Script.TimeScript.IsEnableEndTime
MonthDays
The Months, separated by commas, such as "1,20,22,25"
Define
String MonthDays
Description
Annotation
This property is read/write

Example
Query the months of "TimeScript"
VBScript Example

TextBox0.Text = Script.TimeScript.MonthDays
Name
The name of user script
Define
String Name
Description
Annotation
This property is read-only

Example
Get the name of "TimeScript"
VBScript Example

TextBox0.Text = Script.TimeScript.Name
ScriptContent
The script content
Define
String ScriptContent
Description
Annotation
This property is read/write

Example
Get the content of "TimeScript"
VBScript Example

TextBox0.Text = Script.TimeScript.ScriptContent
StartTime
Start time
Define
DateTime StartTime
Description
Annotation
This property is read/write

Example
Get the start time of "TimeScript"
VBScript Example

TextBox0.Text = Script.TimeScript.StartTime
UniqueIdentifier
The unique identifier ID
Define
Int32 UniqueIdentifier
Description
​ nnotation
A
This property is read-only

Example
Get the unique ID of "TimeScript"
VBScript Example

TextBox0.Text = Script.TimeScript.UniqueIdentifier
WeekDays
The Weeks, separated by commas,such as“0,1,2,3”,0 to 6
represent from Sunday to Saturday
Define
String WeekDays
Description
Annotation
This property is read/write

Example
Query the weeks of "TimeScript"
VBScript Example

TextBox0.Text = Script.TimeScript.WeekDays
ScriptCmd
Save user script
Methods list
Name Description
Save Save user script
Save
Save user script
Define
Save()
Example
Save user script
VBScript Example

Call ScriptCmd.Save()
Recipe
Recipe
Property list
Name Description
CurrentRecipeItem Current recipe item
Description Description
CurrentRecipeItem
Current recipe item
Define
String CurrentRecipeItem
Description
Annotation
This property is read-only

Example Get current recipe item


VBScript Example

TextBox0.Text = Recipe.Recipe.CurrentRecipeItem
Description
Description
Define
String Description
Description
Annotation
This property is read/write

Example Get description of the recipe


VBScript Example

Recipe.Drink.Description = "AppleDrink"
TextBox0.Text = Recipe.Drink.Description
RecipeCmd
Recipe command
Methods list
Name Description
​ AddRecipe Add recipe
​ AddRecipeElement Add recipe ingredient
​ AddRecipeItem Add recipe item
​ ExportRecipeToExcel Export the recipe to Excel
​ GetCurrentRecipeItem Get current recipe item
​ GetRecipeElementList Get recipe element list
​ GetRecipeItemList Get recipe item list
Get the value of ingredient which
GetRecipeItemValue
specified by the recipe item
​ GetRecipeNameList Get recipe name list
Export the excel to the specified
recipe,if the recipe do not
​ ImportRecipeFromExcel
exist,add a new recipe and
import
​ LoadRecipeItem Load the recipe item to variable
​ RemoveRecipe Remove recipe
​ RemoveRecipeElement Remove the ingredient of recipe
​ RemoveRecipeItem Remove the recipe item
​ SaveToRecipeItem Save the variable to recipe item
Set the ingredient value which
​ SetRecipeItemValue
specified by the recipe item
AddRecipe
Add recipe
Define
AddRecipe(recipeName ,description)
Parameter
Data
Name Required/Optional Description
Type
recipeName Required String Recipe name
description Required String Description
Example
Add two TextBox to window,"TextBox0" and "TextBox1",record the
recipe name and recipe description respectively.Add recipe,get the
content of "TextBox0" and "TextBox1" as recipe name and
description.
VBScript Example

Call RecipeCmd.AddRecipe(
"TextBox0.Text,TextBox1.Text")
AddRecipeElement
Add recipe ingredient
Define
AddRecipeElement(recipeName ,recipeElementName ,description)
Parameter

Data
Name Required/Optional Description
Type
recipeName Required String Recipe name
recipeElementName Required String Recipe ingredients name
description Required String Description of recipe ingredients
Example
Add three TextBox to window,"TextBox0" , "TextBox1" and "TextBox2",record the recipe
name,element name and recipe description respectively.Add recipe,get the content of
"TextBox0" , "TextBox1" and "TextBox2" as recipe name,element name and description.

VBScript Example

Call
RecipeCmd.AddRecipeElement(TextBox0.Text,TextBox1.Text,TextBox2.Text)
AddRecipeItem
Add recipe item
Define
AddRecipeItem(recipeName ,recipeItemName ,description)
Parameter

Data
Name Required/Optional Description
Type
recipeName Required String Recipe name
recipeItemName Required String Recipe item name
description Required String Description of recipe ingredients
Example
Add three TextBox to window,"TextBox0" , "TextBox1" and "TextBox2",record the recipe
name,recipe item name and recipe item description respectively.Add recipe item,get the
content of "TextBox0" , "TextBox1" and "TextBox2" as recipe name,recipe item name and
recipe item description.

VBScript Example

Call
RecipeCmd.AddRecipeItem(TextBox0.Text,TextBox1.Text,TextBox2.Text)
ExportRecipeToExcel
Export the recipe to Excel
Define
ExportRecipeToExcel(recipeName ,filePath ,excelVersion)
Parameter
Data
Name Required/Optional Description
Type
recipeName Required String Recipe name
filePath Required String The file path to export the Excel
Excel version,value range:Excel 97 to 2003,Excel
excelVersion Required String
2007,Excel2010,Excel2013
Return
If export success, it will return True
Example
Add three TextBox to window,"TextBox0" , "TextBox1" and "TextBox2",record the recipe
name,export file path and excel version respectively.Export the recipe to excel,get the content of
"TextBox0" , "TextBox1" and "TextBox2" as recipe name,export file path and excel version.

VBScript Example

Call
RecipeCmd.ExportRecipeToExcel(TextBox0.Text,TextBox1.Text,TextBox2.Text)
GetCurrentRecipeItem
Get current recipe item
Define
GetCurrentRecipeItem(recipeName)
Parameter
Data
Name Required/Optional Description
Type
recipeName Required String Recipe name

Return
The current recipe item,if does not exist,return an empty string
Example
Specify recipe name in "ComboBox0",get current recipe item.
VBScript Example

TextBox0.Text =
RecipeCmd.GetCurrentRecipeItem(ComboBox0.Text)
GetRecipeElementList
Get recipe element list
Define
GetRecipeElementList(recipeName)
Parameter
Data
Name Required/Optional Description
Type
recipeName Required String Recipe name

Return
Return recipe element list
Example Get recipe element list of "cake" and display through
ComboBox
VBScript Example

tt = RecipeCmd.GetRecipeElementList("cake")
ComboBox1.ClearItems()
ComboBox1.AddItems(tt)
GetRecipeItemList
Get recipe item list
Define
GetRecipeItemList(recipeName)
Parameter
Data
Name Required/Optional Description
Type
recipeName Required String Recipe name

Return
Recipe item list
Example
Get recipe item list of "cake" and display through ComboBox
VBScript Example

tt = RecipeCmd.GetRecipeItemList("cake")
ComboBox1.ClearItems()
ComboBox1.AddItems(tt)
GetRecipeItemValue
Get the ingredient value which specified by the recipe item
Define
GetRecipeItemValue(recipeName ,recipeItemName ,recipeElementName)
Parameter

Data
Name Required/Optional Description
Type
recipeName Required String Recipe name
recipeItemName Required String Recipe item name
recipeElementName Required String Recipe element name
Return
Return specified element values,if get fail,return null
Example
Get the value of specified element,ComboBox1,ComboBox2,ComboBox3 are used to specify recipe
name,recipe item name and recipe element name.

VBScript Example

Call
RecipeCmd.GetRecipeItemValue(ComboBox1.Text,ComboBox2.Text,ComboBox3.Text)
GetRecipeNameList
Get recipe name list
Define
GetRecipeNameList()
Return
Recipe name list
Example
Get recipe name list and display through ComboBox
VBScript Example

tt = RecipeCmd.GetRecipeNameList()
ComboBox1.ClearItems()
ComboBox1.AddItems(tt)
ImportRecipeFromExcel
Export the excel to the specified recipe, if the recipe do not exist, add a new recipe and import
Define
ImportRecipeFromExcel(filePath ,recipeName ,excelVersion)
Parameter

Data
Name Required/Optional Description
Type
filePath Required String The file path of Excel
recipeName Required String Recipe name
Excel version, value range:Excel97to2003,
excelVersion Required String
Excel2007,Excel2010,Excel2013
Return
If import success, it will return True, otherwise return False
Example
Add three TextBox to window,"TextBox0" , "TextBox1" and "TextBox2",record import file path,recipe
name and excel version respectively.Import recipe from excel,get the content of "TextBox0" ,
"TextBox1" and "TextBox2" as import file path,recipe name and excel version.
VBScript Example

Call
RecipeCmd.ImportRecipeFromExcel(TextBox0.Text,TextBox1.Text,TextBox2.Text)
LoadRecipeItem
Load the recipe item to variable
Define
LoadRecipeItem(recipeName ,recipeItemName)
Parameter
Data
Name Required/Optional Description
Type
recipeName Required String Recipe name
recipeItemName Required String Recipe items name

Example
Load recipe item to variable,"ComboBox1" and "ComboBox2" are used to
spesify recipe name and recipe item name.
VBScript Example

Call
RecipeCmd.LoadRecipeItem(ComboBox1.Text,ComboBox2.Text)
RemoveRecipe
Remove the recipe
Define
RemoveRecipe(recipeName)
Parameter
Data
Name Required/Optional Description
Type
recipeName Required String The recipe name

Example Delete recipe "cake"


VBScript Example

Call RecipeCmd.RemoveRecipe("cake")
RemoveRecipeElement
Remove the ingredient of recipe
Define
RemoveRecipeElement(recipeName ,recipeElementName)
Parameter
Data
Name Required/Optional Description
Type
recipeName Required String The recipe name
recipeElementName Required String The recipe element name

Example
Delete recipe element,"ComboBox1" and "ComboBox2" are used to spesify
recipe name and recipe element name.
VBScript Example

Call
RecipeCmd.RemoveRecipeElement(ComboBox1.Text,ComboBox2.Text)
RemoveRecipeItem
Delete the recipe item
Define
RemoveRecipeItem(recipeName ,recipeItemName)
Parameter
Data
Name Required/Optional Description
Type
recipeName Required String The recipe name
recipeItemName Required String The recipe item name

Example
Delete recipe item,"ComboBox1" and "ComboBox2" are used to spesify
recipe name and recipe item name.
VBScript Example

Call
RecipeCmd.RemoveRecipeItem(ComboBox1.Text,ComboBox2.Text)
SaveToRecipeItem
Save the variable to recipe item
Define
SaveToRecipeItem(recipeName ,recipeItemName)
Parameter
Data
Name Required/Optional Description
Type
recipeName Required String The recipe name
recipeItemName Required String The recipe item name
Example
Save to recipe item,"ComboBox1" and "ComboBox2" are used to spesify
recipe name and recipe item name.

VBScript Example

Call
RecipeCmd.SaveToRecipeItem(ComboBox1.Text,ComboBox2.Text)
SetRecipeItemValue
Set the ingredient value which specified by the recipe item
Define
SetRecipeItemValue(recipeName ,recipeItemName ,recipeElementName ,value)
Parameter

Name Required/Optional Data Type Description


recipeName Required String Recipe name
recipeItemName Required String Recipe items name
recipeElementName Required String Recipe ingredients name
value Required Object Setted value
Return
If set success, it will return True, otherwise return False
Example
Set the value of recipe element,"ComboBox1","ComboBox2","ComboBox3","TextBox1" are used to
specify recipe name,recipe item name,recipe element name,value.

VBScript Example

Call
RecipeCmd.SetRecipeItemValue(ComboBox1.Text,ComboBox2.Text,ComboBox3.Text,Text
RecipeElement
Recipe ingredient
Property list
Name Description
​ Description Description
​ Name The name of recipe ingredient
The absolute path of recipe ingredients
​ VariablePath
associated variables
Description
Description
Define
String Description
Description
Annotation
This property is read/write

Example Modify the description of the recipe ingredient


"RecipeElement1" to "NewRecipeElement"
VBScript Example

Recipe.Recipe.RecipeElement1.Description =
"NewRecipeElement"
Name
The name of new recipe ingredient
Define
String Name
Description
Annotation
This property is read-only

Example Get the name of recipe element "RecipeElement1"


VBScript Example

TextBox0.Text = Recipe.Recipe.RecipeElement1.Name
VariablePath
The absolute path of recipe ingredients associated variables
Define
String VariablePath
Description
​ nnotation
A
This property is read-write

Example
Modify the recipe element of "RecipeElement4" associated variables
to "Var.NewVariableGroup.NewVariable"
VBScript Example

Recipe.Recipe.RecipeElement4.VariablePath =
Var.NewVariableGroup.NewVariable
RecipeItem
The recipe ingredients value group
Property list
Name Description
Description Description
Name Recipe items name
Description
Description
Define
String Description
Description
Annotation
This property is read-write

Example
Modify the description of the recipe item "RecipeItem2" to
"NewRecipeItem"
VBScript Example

Recipe.Recipe.RecipeItem2.Description =
"NewRecipeItem"
Name
Recipe items name
Define
String Name
Description
Annotation
This property is read-only

Example Get the name of recipe item "RecipeItem2"


VBScript Example

TextBox0.Text = Recipe.Recipe.RecipeItem2.Name
DbAccess
Database access
Methods list
Name Description
Check whether there is a
CheckTableIsExisted specified name in the database
tables
Execute sql statement and
ExecuteDataTable
returns the query table
Execute sql statement and
ExecuteNonQuery
return the affected rows
Execute sql statement and
ExecuteScalar returns the query table, return
the first line in the first column
Access the number of rows in
GetDataSourceRowsCount
the table of data sources
GetEmptyTable Get empty tables
GetPageNum Get the number of pages
Get the table(If the paging,
GetTable access the table of the last
page)
Get the table according to the
GetTable
number of pages
SaveTable Save the table
Save the table(Save the
SaveTable
specified column)
TestConnection Test the database connection
Property list
Name Description
ConnectionString Database connection string
Description Description
IsPaging Whether to paging
MaxPagingCount Display the maximum rows of the table
Name Name of the database access
Show the Provider of database
Provider
connection, that is, the database type
TableName The name of the data table
UniqueIdentifier The unique identification ID
CheckTableIsExisted
Check whether there is a specified table in the database
Define
CheckTableIsExisted(tableName)
Parameter
Data
Name Required/Optional Description
Type
Name of the database
tableName Required String
access

Example
Check whether there is a database table named "newtable"
VBScript Example

TextBox0.Text =
DbAccess.DatabaseAccess.CheckTableIsExisted("newtable")
ExecuteDataTable
Execute sql statement and returns the query table
Define
ExecuteDataTable(sql)
Parameter
Name Required/Optional Data Type Description
sql Required String sql statement
Example
Executing SQL statements to get the data of "DatabaseAccess" with
ID 1,returns the query table and display in the Report0 control
VBScript Example

dim sql
sql = "SELECT * FROM " +
DbAccess.DatabaseAccess.TableName + " where "+
DbAccess.DatabaseAccess.TableName +".Id = 1"
dt = DbAccess.DatabaseAccess.ExecuteDataTable(sql)
Call Report0.ClearCellContent()
Call Report0.ShowDataTableForReport(1,1,dt)
ExecuteNonQuery
Execute sql statement and return the affected rows
Define
ExecuteNonQuery(sql)
Parameter
Name Required/Optional Data Type Description
sql Required String sql statement
Example
Execute sql statement to modify the name of
"DatabaseAccess",return the affected rows
VBScript Example

dim sql
sql = "UPDATE " +
DbAccess.DatabaseAccess.TableName +" SET
[name]='titi' where Id = 1"
TextBox0.Text =
DbAccess.DatabaseAccess.ExecuteNonQuery(sql)
ExecuteScalar
Execute sql statement , return the first line in the first column of table
Define
ExecuteScalar(sql)
Parameter
Name Required/Optional Data Type Description
sql Required String sql statement
Example
Execute sql statement to query the data of the top 50 lines in
"DatabaseAccess",return the first line in the first column
VBScript Example

dim sql
sql = "Select NAME,AGE From " +
DbAccess.DatabaseAccess.TableName
TextBox0.Text =
DbAccess.DatabaseAccess.ExecuteScalar(sql)
GetDataSourceRowsCount
Get the number of rows in the table of data sources
Define
GetDataSourceRowsCount()
Example
Get the number of rows in the table of data sources
VBScript Example

TextBox0.Text =
DbAccess.DatabaseAccess.GetDataSourceRowsCount()
GetEmptyTable
Get empty tables
Define
GetEmptyTable()
Example
Get the table headers of "DatabaseAccess",and display it in the
report control
VBScript Example

dt = DbAccess.DatabaseAccess.GetEmptyTable()
Call Report0.ClearCellContent()
Call Report0.ShowDataTableForReport(1,1,dt)
GetPageNum
Get the number of pages
Define
GetPageNum()
Example
Get the number of pages
VBScript Example

Button0.Content =
DbAccess.DatabaseAccess.GetPageNum()
GetTable
Get the table(If the paging, access the table of the last page)
Define
GetTable()
Example
Get the table
VBScript Example

dt = DbAccess.DatabaseAccess.GetTable()
Call Report0.ClearCellContent()
Call Report0.ShowDataTableForReport(1,1,dt)
GetTable
Get the table according to the number of pages
Define
GetTable(pageNum)
Parameter
Name Required/Optional Data Type Description
pageNum Required Int The number of pages

Example
Read the data of the second page
VBScript Example

dt = DbAccess.DatabaseAccess.GetTable(2)
Call Report0.ClearCellContent()
Call Report0.ShowDataTableForReport(1,1,dt)
SaveTable
Save the table
Define
SaveTable(dt)
Parameter
Name Required/Optional Data Type Description
dt Required DataTable The data source

Example
Save the table
VBScript Example

dt = DbAccess.DatabaseAccess.GetTable()
row = dt.NewRow()
row("name") = "Lucy"
row("age") = 21
Call dt.Rows.Add(row)
DbAccess.DatabaseAccess.SaveTable(dt)
SaveTable
Save the table
Define
SaveTable(dt , columnStr)
Parameter

Name Required/Optional Data Type Description


dt Required DataTable The data source
Select a few columns to
save, separated by
columnStr Required String
commas, must include the
primary key
Example

Save the table

VBScript Example

dt = Report0.GetReportDataTable(0)
dt.TableName = DbAccess.DatabaseAccess.TableName
Text0.Text =
DbAccess.DatabaseAccess.SaveTable(dt,"Id,name")'Update
the specified column and return the number of rows
that have been updated
TestConnection
Test the database connection
Define
TestConnection()
Example
Test the database connection,True is connected, false is not
connected
VBScript Example

Text0.Text =
DbAccess.DatabaseAccess.TestConnection()
ConnectionString
Database connection string
Define
String ConnectionString
Description
Annotation
This property is read-only

Example
Display the string of the "DatabaseAccess"
VBScript Example

Text0.Text =
DbAccess.DatabaseAccess.ConnectionString
Description
Description
Define
String Description
Description
Annotation
This property is read/write

Example
Modify the description of the "DatabaseAccess"
VBScript Example

DbAccess.DatabaseAccess.Description = "Custom
database tables"
IsPaging
Whether to paging
Define
String IsPaging
Description
Annotation
This property is read/write

Example
Modify the "DatabaseAccess" to paging
VBScript Example

DbAccess.DatabaseAccess.IsPaging = True
MaxPagingCount
Display the maximum rows of the table
Define
String MaxPagingCount
Description
Annotation
This property is read/write,the default value is 50

Example
Modify the maximum rows of the "DatabaseAccess"
VBScript Example

DbAccess.DatabaseAccess.MaxPagingCount = 20
Name
Name of the database access
Define
String Name
Description
Annotation
This property is read-only

Example
Display the name of “DatabaseAccess”
VBScript Example

Text0.Text = DbAccess.DatabaseAccess.Name
Provider
Show the Provider of database connection, that is, the database type
Define
String Provider
Description
Annotation
This property is read-only

Example
Display the database type of "DatabaseAccess"
VBScript Example

Text0.Text = DbAccess.DatabaseAccess.Provider
TableName
The name of the data table
Define
String TableName
Description
Annotation
This property is read-only

Example
Pop-up a dialog to display the data table name of the
"DatabaseAccess"
VBScript Example

MsgBox DbAccess.DatabaseAccess.TableName
UniqueIdentifier
The unique identification ID
Define
String UniqueIdentifier
Description
Annotation
This property is read-only

Example
Display the ID of the "DatabaseAccess"
VBScript Example

Text0.Text =
DbAccess.DatabaseAccess.UniqueIdentifier
DbAccessCmd
Database access command
Methods list
Name Description
AddColumn Add column
CreateTable Create table
ExecuteBatchInsertData Insert to the data table
Check whether there is a
specified name of the
ExecuteCheckTableIsExisted
database table in the
database
Created the same structure
tables in the database table
ExecuteCreateDatabaseTable
according to the table
provided
Return the number of
ExecuteCreateSave
affected rows
Execute commands,return
ExecuteDataTable
the queried data table
Delete the specified data
ExecuteDropDatabaseTable
from the database
Read the first "count" lines of
ExecuteGetTable
data
Execute commands,return
ExecuteNonQuery
the number of affected rows
Extract data from the
DataTable to perform
ExecuteNonQueryDT
operations according to the
parameters (@ as markup)
Select column to save,
ExecuteSave return the number of
affected rows
Execute commands,return
ExecuteScalar
the number of affected rows
SelectDT Select according to the
specified order
SetPrimary Set the primary key
AddColumn
Add columns
Define
AddColumn(dt , name , caption , dataType , maxLength , isAllowNull , isAutoIncrement , isUnique)
Parameter

Name Required/Optional Data Type Description


dt Required DataTable Data source
name Required String The field name
caption Required String The title
Data types (0: switch type, 1: integer, 4 bytes, 2:
dataType Required Int
real Numbers, 3: date/time, 4: text)
maxLength Required Int The maximum length of the field
isAllowNull Required Bool Whether to allow null
isAutoIncrement Required Bool Whether to growth by self
isUnique Required Bool Whether is the unique
Example
Create a database and add new columns,then pop-up to show whether create success
VBScript Example

dim dt
dt = DbAccessCmd.CreateTable("newtable") 'Create the database table" newtable"
Call DbAccessCmd.AddColumn(dt,"Id","id",1,500,false,true,true) 'Add columns
Call DbAccessCmd.AddColumn(dt,"name",name",4,500,false,false,false)
Call DbAccessCmd.AddColumn(dt,"age","age",1,500,false,false,false)
Call DbAccessCmd.SetPrimary(dt,"Id") 'Set primary key
cc =
DbAccessCmd.ExecuteCreateDatabaseTable("DbAccess.DatabaseAccess","sqlservercom
MsgBox cc 'whether created successfully
CreateTable
Create table
Define
CreateTable(tableName)
Parameter

Name Required/Optional Data Type Description


tableName Required String The table name
Example
Create a database,then pop-up to show whether create success
VBScript Example

dim dt
dt = DbAccessCmd.CreateTable("newtable") 'Create the database table" newtable"
Call DbAccessCmd.AddColumn(dt,"Id","id",1,500,false,true,true) 'Add columns
Call DbAccessCmd.AddColumn(dt,"name",name",4,500,false,false,false)
Call DbAccessCmd.AddColumn(dt,"age","age",1,500,false,false,false)
Call DbAccessCmd.SetPrimary(dt,"Id") 'Set primary key
cc =
DbAccessCmd.ExecuteCreateDatabaseTable("DbAccess.DatabaseAccess","sqlservercom
MsgBox cc 'whether created successfully
ExecuteBatchInsertData
Insert to the data table
Define
ExecuteBatchInsertData(connInfo , providerName , dt)
Parameter

Name Required/Optional Data Type Description


connInfo Required String Database access table
Database type(sqlserver,sqlservercompact,
providerName Required String
oracle)
dt Required DataTable The data source
Example

Insert to the data table

VBScript Example

dim dt dt = DbAccess.DatabaseAccess.GetTable()
dt(0)("name") = "mary"
dt(0)("age") = 18
Call
DbAccessCmd.ExecuteBatchInsertData("DbAccess.DatabaseAccess","sqlservercompact
Call Report0.ShowDataTableForReport(1,1,dt)
ExecuteCheckTableIsExisted
Check whether there is a specified name of the database table in the database
Define
ExecuteCheckTableIsExisted(connInfo , providerName , tableName)
Parameter

Data
Name Required/Optional Description
Type
connInfo Required String Database Access Table
Database type(sqlserver,sqlservercompact,
providerName Required String
oracle)
tableName Required String Table name
Example
Check whether there is a database table called "newtable" in the database
VBScript Example

Text0.Text =
DbAccessCmd.ExecuteCheckTableIsExisted("DbAccess.DatabaseAccess","sqlservercom
ExecuteCreateDatabaseTable
Create the same structure tables in the database table according to the table provided
Define
ExecuteCreateDatabaseTable(connInfo , providerName , dt , otherParameter)
Parameter

Name Required/Optional Data Type Description


connInfo Required String Database Access Table
Database type(sqlserver,sqlservercompact,
providerName Required String
oracle)
dt Required DataTable Data source
Mainly used for the Oracle database, on behalf of
otherParameter Required String Oracle table space(Is empty, select the default
table space)
Example
Create the same structure tables in the database table as the table called "newtable",and return whether
success
VBScript Example

dim dt
dt = DbAccessCmd.CreateTable("newtable") 'Create the database table" newtable"
Call DbAccessCmd.AddColumn(dt,"Id","id",1,500,false,true,true) 'Add columns
Call DbAccessCmd.AddColumn(dt,"name",name",4,500,false,false,false)
Call DbAccessCmd.AddColumn(dt,"age","age",1,500,false,false,false)
Call DbAccessCmd.SetPrimary(dt,"Id") 'Set primary key
cc =
DbAccessCmd.ExecuteCreateDatabaseTable("DbAccess.DatabaseAccess","sqlservercom
MsgBox cc 'whether created successfully
ExecuteCreateSave
Return the number of affected rows(If there is not exist in the database,create the same structure
tables in the database table according to the table provided,save it)
Define
ExecuteCreateSave(connInfo , providerName , dt)
Parameter

Name Required/Optional Data Type Description


connInfo Required String Database Access Table
Database type(sqlserver,sqlservercompact,
providerName Required String
oracle)
dt Required DataTable Data source
Example
Get data of the report controls,create the same structure tables in the database,return the number of
affected rows
VBScript Example

Dim dt
dt = Report0.GetReportDataTable(Id)
dt.tableName = DbAccess.DatabaseAccess.TableName
tt =
DbAccessCmd.ExecuteCreateSave("DbAccess.DatabaseAccess","sqlservercompact",dt
MsgBox tt
ExecuteDataTable
Execute commands, return the queried data table
Define
ExecuteDataTable(connInfo , providerName , sql)
Parameter

Data
Name Required/Optional Description
Type
connInfo Required String Database Access Table
Database type(sqlserver,sqlservercompact,
providerName Required String
oracle)
sql Required String sql statements
Example
SQL statement to query the same ID 1 data in the "DatabaseAccess" and " DatabaseAccess1 ", and
returns, shown in the report controls

VBScript Example

dim sql
sql = "SELECT * FROM " + DbAccess.DatabaseAccess.TableName + " where "+
DbAccess.DatabaseAccess.TableName +".Id = 1"
dt =
DbAccessCmd.ExecuteDataTable("DbAccess.DatabaseAccess","sqlservercompact",sql
Call Report0.ShowDataTableForReport(1,1,dt)
ExecuteDropDatabaseTable
Delete the specified data from the database
Define
ExecuteDropDatabaseTable(connInfo , providerName , tableName)
Parameter

Data
Name Required/Optional Description
Type
connInfo Required String Database Access Table
Database type(sqlserver,sqlservercompact,
providerName Required String
oracle)
tableName Required String Table name
Example
Delete the corresponding database table in“DatabaseAccess”
VBScript Example

Text0.Text =
DbAccessCmd.ExecuteDropDatabaseTable("DbAccess.DatabaseAccess","sqlservercompa
ExecuteGetTable
Read the first "count" rows of data
Define
ExecuteGetTable(connInfo , providerName , tableName , count)
Parameter

Data
Name Required/Optional Description
Type
connInfo Required String Database Access Table
providerName Required String Database type(sqlserver,sqlservercompact,oracle)
tableName Required String Table name
The number of rows(If negative, read the latest count the
count Required String
data, if is zero, read the empty table)
Example
Read the first 3 rows of data in the database,and shown in the report controls
VBScript Example

dt =
DbAccessCmd.ExecuteGetTable("DbAccess.DatabaseAccess","sqlservercompact","newt
Call Report0.ShowDataTableForReport(1,1,dt)
ExecuteNonQuery
Execute commands, return the number of affected rows
Define
ExecuteNonQuery(connInfo , providerName , sql)
Parameter

Data
Name Required/Optional Description
Type
connInfo Required String Database Access Table
Database type(sqlserver,sqlservercompact,
providerName Required String
oracle)
sql Required String sql statements
Example
SQL statements update the ID 1 name to "titi" in the "DatabaseAccess",return and shown it in the report
controls
VBScript Example

dim sql
sql = "UPDATE " + DbAccess.DatabaseAccess.TableName +" SET NAME = 'titi'
where Id = 1"
Call
DbAccessCmd.ExecuteNonQuery("DbAccess.DatabaseAccess","sqlservercompact",sql)
dt = DbAccess.DatabaseAccess.GetTable()
Call Report0.ClearCellContent()
Call Report0.ShowDataTableForReport(1,1,dt)
ExecuteNonQueryDT
Extract data from the DataTable to perform operations according to the parameters (@ as markup),for
example:update table set Name=@Name,Age=@Age where Id=@Id
Define
ExecuteNonQueryDT(connInfo , providerName , sql)
Parameter

Data
Name Required/Optional Description
Type
connInfo Required String Database Access Table
Database type(sqlserver,sqlservercompact,
providerName Required String
oracle)
sql Required String sql statements
Example

SQL statements are asynchronous operations

VBScript Example

dt = Report0.GetReportDataTable(0)
sql = "update NewTable set Name=@Name,Age=@Age where Id=@Id"
Call
DbAccessCmd.ExecuteNonQueryDT("DbAccess.DatabaseAccess","sqlservercompact",dt
dt1 = DbAccess.DatabaseAccess.GetTable("NewTable")
Call Report0.ShowDataTableForReport(1,1,dt1)
ExecuteSave
Select column to save, return the number of affected rows
Define
ExecuteSave(connInfo , providerName , dt , columnNames)
Parameter

Name Required/Optional Data Type Description


connInfo Required String Database Access Table
Database type(sqlserver,sqlservercompact,
providerName Required String
oracle)
dt Required DataTable Data source
The name of columns(separated by comma, and
columnNames Required String
must include the primary key)
Example
Get the data of report controls,and return the number of affected rows
VBScript Example

dt = Report0.GetReportDataTable(0)
dt.tableName = DbAccess.DatabaseAccess.TableName
tt =
DbAccessCmd.ExecuteSave("DbAccess.DatabaseAccess","sqlservercompact",dt,"Id,na
MsgBox tt
ExecuteScalar
Execute commands, return the number of affected rows
Define
ExecuteScalar(connInfo , providerName , sql)
Parameter
Data
Name Required/Optional Description
Type
connInfo Required String Database Access Table
Database type(sqlserver,sqlservercompact,
providerName Required String
oracle)
sql Required String sql statements
Example
Execute sql statement to query the data of the top 50 lines in "DatabaseAccess",return and show the
first line in the first column in the report controls
VBScript Example

dim sql
sql = "Select Top 50 [name],[age] From " +
DbAccess.DatabaseAccess.TableName
tt =
DbAccessCmd.ExecuteScalar("DbAccess.DatabaseAccess","sqlservercompact",sql)
Call Report0.SetCellValue(tt,1,1)
SelectDT
Select according to the specified order
Define
SelectDT(dt , filter , sort)
Parameter
Name Required/Optional Data Type Description
dt Required DataTable Data source
Filter condition(for
filter Required String
example:id<10)
Sorting conditions(for
example:desc is
sort Required String
descending, the default is
ascending)
Example
Obtain the data in "DatabaseAccess", and show in report controls
after sorted according to the requirements
VBScript Example

dt = DbAccess.DatabaseAccess.GetTable()
cc = DbAccessCmd.SelectDT(dt,"Id<=10","Id desc")
Call Report0.ShowDataTableForReport(1,1,cc)
SetPrimary
Set the primary key
Define
SetPrimary(dt , key)
Parameter

Name Required/Optional Data Type Description


dt Required DataTable Data source
key Required String The primary key(If multiple, separate by comma)
Example
Create a new database and set the primary key,pop-up to display whether success
VBScript Example

dim dt
dt = DbAccessCmd.CreateTable("newtable") 'Create the database table" newtable"
Call DbAccessCmd.AddColumn(dt,"Id","id",1,500,false,true,true) 'Add columns
Call DbAccessCmd.AddColumn(dt,"name",name",4,500,false,false,false)
Call DbAccessCmd.AddColumn(dt,"age","age",1,500,false,false,false)
Call DbAccessCmd.SetPrimary(dt,"Id") 'Set primary key
cc =
DbAccessCmd.ExecuteCreateDatabaseTable("DbAccess.DatabaseAccess","sqlservercom
MsgBox cc 'whether created successfully
Colors
Color commands
Methods list
Name Description
​ ColorSelectionBox Color selector
​ ImageColor Image brush
​ LinearGradientColor Linear color
LinearGradientColor Linear color
LinearGradientColor Linear color
​ RadialGradientColor Radial color
​ RadialGradientColor Radial color
SolidColor Solid color
ColorSelectionBox
Color selector
Description
In the tree directory on the right side of the script editor, click the
"ColorSelectionBox" script node, and the "Color Choices" window
will appear, as shown in the figure below:
ImageColor
Image brush
Define
ImageColor(source , location)
Parameter
Data
Name Required/Optional Description
type
source Required String Image source path
Image location(0:Default;
location Optional Int
1:Tiled; 2: Middle; 3:Stretch)
Example
Rectangle0 is filled with a picture, and the image source path is
"\Image\Penguins.jpg",the filled method is tiled.
VBScript Example

Rectangle0.Fill =
Colors.ImageColor("\Image\Penguins.jpg",1)

User can also use the script "ColorSelectionBox" to call out the“Color
Choices” to achieve Image filling.
LinearGradientColor
Linear color
Define
LinearGradientColor(colorstring)
Parameter

Data
Name Required/Optional Description
type
A string concatendated by a combination of
colorstring Required String
groups of color and offset values
Example
Rectangle0 is filled with linear color.
VBScript Example

Rectangle0.Fill =
Colors.LinearGradientColor("#FFFF8080,0;#FFC1FFFF,0.5;#FFFF8080,1;")

User can also use the script "ColorSelectionBox" to call out the“Color Choices” to achieve
linear color filling.
LinearGradientColor
Linear color
Define
LinearGradientColor(startcolor , endcolor , angle)
Parameter

Data
Name Required/Optional Description
type
startcolor Required Brush Start color
endcolor Required Brush End color
angle Required Double Gradient angle
Example
Rectangle0 is filled with linear color.
VBScript Example

Rectangle0.Fill =
Colors.LinearGradientColor(Colors.Violet,Colors.LightGreen,45)

User can also use the script "ColorSelectionBox" to call out the“Color Choices” to
achieve linear color filling.
LinearGradientColor
Linear color
Define
LinearGradientColor(startcolorstring , endcolorstring , angle)
Parameter

Data
Name Required/Optional Description
type
startcolorstring Required String Start color string
endcolorstring Required String End color string
angle Required Double Gradient angle
Example
Rectangle0 is filled with linear color.
VBScript Example

Rectangle0.Fill =
Colors.LinearGradientColor("#FFFF80FF","#FF80FFFF",45)

User can also use the script "ColorSelectionBox" to call out the“Color
Choices” to achieve linear color filling.
RadialGradientColor
Radial color
Define
RadialGradientColor(colorstring)
Parameter

Data
Name Required/Optional Description
type
A string concatendated by a combination of
colorstring Required String
groups of color and offset values
Example
Rectangle0 is filled with radial color.
VBScript Example

Rectangle0.Fill =
Colors.RadialGradientColor("#FFFFFFFF,0;#FFFFFFFF,0;#FF000000,1;")

User can also use the script "ColorSelectionBox" to call out the“Color Choices” to achieve
radial color filling.
RadialGradientColor
Radial color
Define
RadialGradientColor(startcolorstring , endcolorstring)
Parameter
Data
Name Required/Optional Description
type
startcolorstring Required String Start color string
endcolorstring Required String End color string
Example
Rectangle0 is filled with radial color.
VBScript Example

Rectangle0.Fill =
Colors.RadialGradientColor("#FFFF0000","#FF00FF00")

User can also use the script "ColorSelectionBox" to call out the“Color
Choices” to achieve radial color filling.
SolidColor
Solid color
Define
SolidColor(colorstring)
Parameter
Data
Name Required/Optional Description
type
colorstring Required String Color string

Example
Rectangle0 is filled with solid color.
VBScript Example

Rectangle0.Fill = Colors.SolidColor("#FFFF0000")

User can also use the script "ColorSelectionBox" to call out the“Color
Choices” to achieve solid color filling.
LanguageCmd
LanguageCmd
Methods list
Name Description
Get the name of the current
GetCurrentLanguageName
language
Get the names of all
​ GetLanguageNames
configured languages
Get the value of the resource
​ GetValueByResourceName
by the resource name
Switch the current language
​ SwitchLanguageTo
to the specified language
GetCurrentLanguageName
Get the name of the current language
Define
GetCurrentLanguageName()
Example
Get the name of the current language
VBScript Example

Label0.Text = Languagecmd.GetCurrentLanguageName()
GetLanguageNames
Get the names of all configured languages
Define
GetLanguageNames()
Example
Get the names of all configured languages
VBScript Example

Label1.Text = LanguageCmd.GetLanguageNames()
GetValueByResourceName
Get the value of the resource by the resource name
Define
GetValueByResourceName(resname , lang)
Parameter
Data
Name Required/Optional Description
type
resname Required String Resource name
Specify the system
language name(empty
lang Optional String
string automatically uses
the current language)
Example
Query “String1” repository to display the corresponding text in the
current language
VBScript Example

Label1.Text =
LanguageCmd.GetValueByResourceName("String1","")
SwitchLanguageTo
Switch the current language to the specified language
Define
SwitchLanguageTo(language)
Parameter
Data
Name Required/Optional Description
type
Specify the
language Required String
language name

Example
Switch the current language to English
VBScript Example

LanguageCmd.SwitchLanguageTo("en")

You might also like