ICP DAS USA | KingView HVAC Monitoring Kit | User manual | ICP DAS USA KingView HVAC Monitoring Kit User Manual

ICP DAS USA KingView HVAC Monitoring Kit User Manual
General HMI Software for Automation Industry
Kingview
Version 6.53
User’s Guide
Designed for Microsoft Windows 2000 or Windows XP
WellinControl Technology Development Co.,Ltd
Important notice
1
Important Notice
The information in this documentation is subject to change without
notice and does not represent a commitment on the part of WellinControl
Company. The software described in this documentation is supplied under
a license or agreement. This software may be used or copied only in
accordance with the terms of these agreements. No part of this
documentation could be reproduced, or transmitted by any means,
electronic, mechanical, photocopying, recording, or otherwise, without the
prewritten permission of WellinControl Company, except buyer using it.
Since deviations cannot be precluded entirely, we cannot guarantee full
correction. Suggestions for improvement are welcomed. Although every
precaution has been taken in the preparation of this documentation, the
publisher and the author assume no responsibility for errors or omissions.
Neither is any liability assumed for damages resulting from the use of the
information contained herein.
KingView is registered trademark of WellinControl Company.
Oracle is registered trademark of Oracle Corporation.
Windows 98, Windows NT, Windows 2000, Windows XP, Excel,
ODBC are registered trademarks of Microsoft Corporation
All other products and names in the guide may be trademarks of their
respective owners.
KingView 6.53 User’s Guide
2007 WellinControl Company
Edition: 6.5.3.1
All Rights Reserved.
WellinControl Technology Development Co.,Ltd
2
Important notice
Tel: (86)010-82616619
Fax: (86)010-62638166
E-Mail:support@asiacontrol.com.cn sales@asiacontrol.com.cn
Website: http://www.kingview.com
http://www.kingview.com/english
BBS: http://www.kingview.com/newBBS
WellinControl Technology Development Co.,Ltd
Chapter 1 Welcome to KingView
1-1
Chapter 1 Welcome to KingView
1.1 System Requirements
To run KingView, we recommend the following:
 CPU: P4 1G processor or higher
 Memory: At least 128MB of random-access memory (RAM), we recommend
256MB of RAM. To use the WEB function or more than two thousand points,
we recommend 512MB
 VGA, SVGA display adapter. At least 256 colors
 Any compatible mouse.
 RS-232C for communication
 LPT or USB for the KingView Key
 Microsoft Windows 2000 Professional with Service Pack 4 or Windows XP
professional with Service Pack 2 operating systems
Note:
PC prevailing on the market at present satisfy fully system requirement of
KingView.
WellinControl Technology Development Co.,Ltd
1-2
Chapter 1 Welcome to KingView
1.2 Installing KingView
The KingView installation program is saved in a CD. After you insert it, the
installation program—Install.exe auto runs to start KingView Installation Wizard.
To install KingView (Take Microsoft Windows 2000 Professional for example,
Windows XP professional are the same),
Step 1: Start up your computer.
Step 2: Insert the installation CD to CD Driver, then the installation program—
Install.exe auto runs (User can start installation by running Install.exe as well). The
installation program appears as below:
Figure 1.1 Start installation of KingView
WellinControl Technology Development Co.,Ltd
Chapter 1 Welcome to KingView
1-3
The installation interface has a list of headings on the left. When you move the
cursor over each heading, the relevant installation information will appear in the
picture on the right. Each heading has different functions:
 “Read this first”: Read before installation, users can obtain information
about Edition updates, licenses, services, support etc.
 “Install KingView”: Install KingView .
 “Install IO Drivers” : Install KingView’s IO Drivers
 “Install Key Driver” : Install KingView’s Key Driver
 “Contact us”: Link to our website for help.
 “Multimedia Tutorial”: View KingView introduces a multimedia tutorial
and function presentation.
 “Browse CD Content”: Browse the CD and view typical technological
information and documents.
 “Exit”: Exit installation.
Step 3: Start installation. Clicking “Install KingView” will automatically install
KingView to the hard drive and create an application group. The popup dialog box
appears as below:
WellinControl Technology Development Co.,Ltd
1-4
Chapter 1 Welcome to KingView
Figure 1.2 Install KingView
Click “Next” to continue with installation, the “Software license agreement”
appears as below. This is a binding contract between KingView users and Beijing
WellinControl Technology Development CO. LTD please read it carefully. If you
agree to the terms of the agreement, click “Yes” to continue; if you do not agree, click
“No” to exit. Click “Back” to return last dialog box.
WellinControl Technology Development Co.,Ltd
Chapter 1 Welcome to KingView
Figure 1.3 Software license agreement
Click “Yes” to open the “User Information” dialog box, as shown below:
Figure 1.4 Enter register information
WellinControl Technology Development Co.,Ltd
1-5
1-6
Chapter 1 Welcome to KingView
Insert “Name” and “Company Name”. Click “Back” to return last dialog box,
click “Cancel” to exit installation, click “Next” to open the “Confirm user
information” dialog box as shown below:
Figure 1.5 Confirm register information
If an error occurs, click “No” to return to the “User Information” dialog box. If it
is correct, click “Yes” to begin installation.
Step 4: Select the installation path .
Confirm the user information in the “Select Target Directory” dialog box and
select installation path.
WellinControl Technology Development Co.,Ltd
Chapter 1 Welcome to KingView
1-7
Figure 1.6 Choose location
The default directory is C:\Program Files\KingView. If you want to install it in
another directory, please click “Browse” to open the dialog box shown below:
Figure 1.7 Re-choose destination location
WellinControl Technology Development Co.,Ltd
1-8
Chapter 1 Welcome to KingView
Select the new directory in the “Path” dialog box, like C:\KingView. Click “OK”
to confirm:
Figure 1.8 Confirm destination location
The installation program will create a target directory as users request to change
to the assigned directory.
Step 5: Select the installation method.
Click “Next”, the confirmation dialog box appears as below:
WellinControl Technology Development Co.,Ltd
Chapter 1 Welcome to KingView
1-9
Figure 1.9 Select setup type
There are three installation methods: Standard Installation, Simple Compressed
Installation, and Custom Installation.
 Standard Installation
Installs most KingView components including:
1. KingView system files
WindowMaker and TouchView.
2. OPC files
The files necessary to support KingView as an OPC server.
3. Wizard files
There are many practical and fancy wizards (Details in “Chapter 13
Wizards”), which can be used to make projects more professional.
4. KingView components
 KingView and Driver online help.
 KingView e-book Edition documents.
 KingView demo projects.
WellinControl Technology Development Co.,Ltd
1-10 Chapter 1 Welcome to KingView
 Compression Installation
Installs KingView’s minimum required components. Help files, demo files
and wizards will not be installed.
 Custom Installation
Installs customer-required components. If you select custom installation,
please click “Next”, the following dialog box will appear:
Figure 1.10 Custom Installation
Please select the item you need (All items are selected at the beginning).
Example:
If you only need “running files” and “system files”, you can de-select
items as below:
WellinControl Technology Development Co.,Ltd
Chapter 1 Welcome to KingView
1-11
Figure 1.11 Custom Installation – Select components
Step 6: Create a program group. Click “Next” to continue installation. A dialog
box appears as below:
WellinControl Technology Development Co.,Ltd
1-12 Chapter 1 Welcome to KingView
Figure 1.12 Create program group
If there are errors click “Back” to correct them. If everything is ok, click “Next”
to start installation. If you remember that something is wrong in the previous step
during installation, click “Cancel” to stop.
Step 7: Start installation. The installation program decompresses the compressed files
from the CD and copies them to the default or assigned directory. There is a gauge to
display the decompression process.
Step 8: When Installation finishes the following dialog box appears:
WellinControl Technology Development Co.,Ltd
Chapter 1 Welcome to KingView
1-13
Figure 1.13 Finish installation
The dialog box has the following options:
Install KingView drivers: Select this option then click Finish, the system will
automatically install KingView IO device driver to the KingView installation
directory. For more information see “1.3 Install KingView IO drivers”.
Install key drivers: Select this option then click Finish; the system will
automatically install the key driver. More details can be found in the “1.4 Install key
driver” section. Should you select finish without selecting this option you can install it
at a later date. The following “Restart computer” dialog box will then appear:
WellinControl Technology Development Co.,Ltd
1-14 Chapter 1 Welcome to KingView
Figure 1.14 Restart
Select “Yes” then click “Finish”, to restart the computer.
Select “No” then click “Finish”, to restart later .
Note:
It is recommended that you restart your computer in order for the system to run
properly, however, you can restart after driver instalation.
Click finish to complete installation. The Windows Start Menu will appear as
below:
WellinControl Technology Development Co.,Ltd
Chapter 1 Welcome to KingView
1-15
Figure 1.15 KingView program group members
Four shortcuts and three folders are created in the KingView 6.53 folder from
“Start” — “Program Groups”, more details can be found in section “2.1 KingView
Program Group members Instruction”.
Note:
Once installation has been completed, please send the user registration card to
us so that we can provide you with continuous and up to date service and
technology support.
1.3 Install KingView IO driver
Windows NT 4.0 user notes:
WellinControl Technology Development Co.,Ltd
1-16 Chapter 1 Welcome to KingView
Please install Windows NT 4.0 patch pack 6. If you have any question, please
contact you nearest Technical branch of WellinControl Ltd.
If you chose not to install KingView IO driver whilst installing KingView, you
can install using the following steps.
The IO driver installation is simple,
Step 1: Run the file Install.exe form the KingView CD
Figure 1.16 Startup Kingview drivers installation
Step 2: Begin installing the IO driver. Click “Install KingView IO driver”. The
following dialog box will appear after driver installation:
WellinControl Technology Development Co.,Ltd
Chapter 1 Welcome to KingView
1-17
Figure 1.17 Install driver
Click “Next” to continue with installation, the “Driver license agreement”
appears as below. This is a binding contract between KingView users and Beijing
WellinControl Technology Development CO. LTD. Please read it carefully. If
you agree to the terms of the agreement, click “Yes” to continue; if you do not
agree, click “No” to exit. Click “Back” to return last dialog box.
WellinControl Technology Development Co.,Ltd
1-18 Chapter 1 Welcome to KingView
Step 3: Creating the path. Click “Next” to open the “Select destination location”
dialog box, as shown below:
WellinControl Technology Development Co.,Ltd
Chapter 1 Welcome to KingView
1-19
Figure 1.18 Choose destination location
Insert the KingView installation path. The system automatically displays the
required path for the IO driver relative to KingView’s installation path. Generally,
users do not need to change the path, however, should you need to please click
“Browse” to open the following dialog box.
WellinControl Technology Development Co.,Ltd
1-20 Chapter 1 Welcome to KingView
Figure 1.19 Change installation folder
Enter a new installation directory in the dialog box “path”, such as C:\Program
files\KingView\Driver. Then, click “OK” to open the following dialog box:
WellinControl Technology Development Co.,Ltd
Chapter 1 Welcome to KingView
1-21
Figure 1.20 Confirm installation folder
Change the directory path, and then click “Next” to open the dialog box shown
below:
WellinControl Technology Development Co.,Ltd
1-22 Chapter 1 Welcome to KingView
Figure 1.21 Driver components
Please select required items (All items are selected to begin with). Then click
“Next”.
WellinControl Technology Development Co.,Ltd
Chapter 1 Welcome to KingView
1-23
Figure 1.22 Driver installation information
Step 4: Start installation. If an error occurs, click “Back” to fix any mistakes. If
everything is correct, click “Next” to commence installation. During the
installation process you can click “Cancel” to stop the process and rectify any
problems. The installation program decompresses the compressed files from the
CD and copies them to the default or assigned directory. A decompression
progress window will popup.
Step 5: When installation finishes the following dialog box will appear:
WellinControl Technology Development Co.,Ltd
1-24 Chapter 1 Welcome to KingView
Figure 1.23 Restart computer
Select “Yes” then click “Finish”, to restart the computer.
Select “No” then click “Finish”, to restart later
Click finish to complete the IO driver installation.
Note:
It is recommended that you restart your computer in order to make the system
run properly, however you can restart after installing the driver.
1.4 Install key driver
Advantages of installing key driver:
1.Better printer compatibility.
2.Better key protection.
WellinControl Technology Development Co.,Ltd
Chapter 1 Welcome to KingView
1-25
Before you can install the Key, you must first install its driver.
The installation program automatically installs the key driverafter KingView
installation has been completed; However should the need arise; you can also install
the key driver manually.
Ste 1: Start. Run the Install.exe file from the KingView CD,.
Figure 1.24 Startup key drivers installation
Click “Install key driver” to start key driver installation. As shown below:
WellinControl Technology Development Co.,Ltd
1-26 Chapter 1 Welcome to KingView
Figure 1.25 Install key driver
Click “Next” and the license agreement dialog appears.
WellinControl Technology Development Co.,Ltd
Chapter 1 Welcome to KingView
1-27
The key driver installation wizard follows the same method as general installation.
After the driver is completely installed, take keys from the package and plug
them into the computer’s parallel port (LPT1) and fix it with a screw. If you need a
printer, simply connect the printer cable to the key. The key should not interfere with
the printer, if something goes wrong, please contact your local WellinControl
technical branch.
To use USB interface key drivers, simply insert the drivers into the computer
interface. These drivers support Plug and Play.
The Key driver and KingView software are put on the same CD. The program
can be located in the “Sentinel” directory.
Note:
You can install it directly from the CD:
Double-click SetUp.exe in the “Sentinel\SPI730” directory
1.5 Uninstalling KingView system files and drivers
Please follow these steps to uninstall KingView and KingView IO drivers:
Firstly: Click the “Start” menu from windows and select “Settings”—“Control
Panel” to enter the “Control Panel” interface, click “Add/Remove Programs”, which
appears as shown below:
WellinControl Technology Development Co.,Ltd
1-28 Chapter 1 Welcome to KingView
Figure 1.26 Remove program
Secondly: Before uninstalling KingView user must uninstall all KingView
drivers. Select KingView 6.53 or KingView IO driver, click the “Add/Remove”
button, the system will then automatically remove the installation or KingView IO
driver.
WellinControl Technology Development Co.,Ltd
Chapter 1 Welcome to KingView
1-29
Figure 1.27 InstallSheild wizard
Note:
Once you have removed KingView, we recommend that you restart the computer
in order to fully remove the application.
1.6 Repairing or modifying installated components
When removing or re-installing KingView from the computer’s control panel the
installation program automatically shows “Modify, repair or remove” dialog box
below. For example, to modify the KingView driver. Click Next, the Modify driver
components dialog box will appear and you can select the content which you want to
modify.
WellinControl Technology Development Co.,Ltd
1-30 Chapter 1 Welcome to KingView
Figure 1.28 Modify wizard
1.7 Additional Software packages from the CD
Acrobat Reader: Application needed for viewing PDF formatted documents.
Sentinel: Lock Driver Encryption.
Value Pack: Includes support libraries for Kingview drivers and other
applications.
1.8 KingView 6.53 Edition Types

Development
There are six standards: 64 points, 128 points, 256 points, 512 points, 1024
points and unlimited points.
Built-in program language
WellinControl Technology Development Co.,Ltd
Chapter 1 Welcome to KingView




1-31
Network support functions
Embedded high-speed historical database
Embedded WEB browser function
Supports an online TouchView running time of 8 hours.
Runtime
There are six standards: 64 points, 128 points, 256 points, 512 points, 1024
points and unlimited points.
Network support functions
Communication driver is available.
NetView
There are two standards: 512 points and unlimited points.
Network support functions
Communication drivers are unavailable.
For Internet Application
There are five standards: 5 users, 10 users, 20 users, 50 users and unlimited
users.
This function is not available in KingView’s general Edition.
Demo
Support 64 points.
Built-in programming language
Support an online TouchExplorer running time of 2 hours.
Communication drivers are available.
Support the WEB function for one user and browses the WEB every 10 minutes.
1.9 How to get our help
If you have any questions regarding KingView or any other WellinControl
product, please contact our technical support or sale engineers via email, fax, phone or
WEB (Technology BBS). We will do our best to get back to you as soon as possible.
A list of WellinControl branches and contact information can be found below.
WellinControl Technology Development Co.,Ltd
1-32 Chapter 1 Welcome to KingView
WellinControl Beijing Head Office:
Address: e-Wing Centre A6, No. 113 Zhichun Road, Beijing, P. R. China
Post Code: 100086
Tel: (86)010-82616619
Fax: (86)010-62638166
Email: support@asiacontrol.com.cn
sales@asiacontrol.com.cn
Website: www.kingview.com
www.kingview.com/english
WellinControl Technology Development Co.,Ltd
Chapter 2 Introduction to KingView
2-1
Chapter 2 Introduction to KingView
2.1 Understand KingView Program group members
After installing KingView, a program group named “KingView 6.53” is created
in system “Start” —”Programs”. It contains three folders and four shortcuts:
 KingView 6.53: The shortcut of ProjectManager which is used to create
projects and manage projects.
 TouchExplorer: The shortcut of KingView project managing program which
is embedded KingView TouchExplorer, namely WindowMaker.
 TouchView: The shortcut of TouchView. TouchExplorer and TouchView
are separated Windows applications, both of them can be used separately;
meanwhile, they are interdependent—applications built in TouchExplorer
must run in TouchView.
 KingMessage: The shortcut of KingMessage.
 Help: The shortcut of KingView Help Documents.
 E-books: The shortcut of KingView User Guide E-book.
 Installation tool\Install New Driver: The shortcut of installing New Driver.
 KingView Document\Help: The shortcut of KingView Help Documents.
 KingView Document\IO Driver Help: The shortcut of KingView IO Driver
Help Documents.
WellinControl Technology Development Co.,Ltd
2-2
Chapter 2 Introduction to KingView


KingView Document\User Guide: The shortcut of KingView User Guide.
KingView Document\Functions Manual: The shortcut of KingView
Functions Manual.
 KingView Online\Register Members Online: Register member online on
WellinControl Web Site.
 KingView Online\Technology BBS: Technology BBS page on
WellinControl Web Site.
 KingView Online\IO Driver Online: IO Driver download page on
WellinControl Web Site.
Besides open KingView program from program groups, a shortcut of
ProjectManager named “KingView 6.5” generate on system desktop after KingView
installation.
2.2 Steps to create a project
To create a new project, you must follow these steps as below:
1. Design a graphical interface (Define Picture)
2. Define device
3. Build database (Define tags)
4. Create animation links
5. Running and debug
The five steps above are not separated. In fact, these processes are usually
interlaced. When you create a project using WindowMaker, you must consider
following three aspects:
 Graph: What kind of pictures users wish to see? That is to say how to use
abstract pictures to simulate practical industry field and corresponding
industry-control devices.
 Data: How to use data to express various properties of objects? That is to
say, you need to build a concrete database in which tags reflect various
properties of objects, such as temperature, pressure, etc.
WellinControl Technology Development Co.,Ltd
Chapter 2 Introduction to KingView

2-3
Connection: What is the relationship between data and symbols in pictures?
That is to say, Symbols on the pictures simulate local devices running using
what kind of animations and how to make operator input device command
code.
2.2.1 Create a new KingView project
In order to create a new KingView project, please specify a work directory for
project first (or “Project Path”). KingView identifies projects by work directory that
different projects are put in different directories. And KingView manages all the files
on the work directory automatically.
Have a try:
Create project directory
Startup ProjectManager, select menu “File\New Project” or click “New”
button. A dialog box popup as below:
WellinControl Technology Development Co.,Ltd
2-4
Chapter 2 Introduction to KingView
Figure 2.1 New project wizard 1
Click “Next” button to continue and a dialog box “New Project Wizard 2” popup.
It appears as below:
WellinControl Technology Development Co.,Ltd
Chapter 2 Introduction to KingView
2-5
Figure 2.2 New project wizard 2
Please input a valid project path in project path textbox or click “Browse…”
button to popup a selecting path dialog box for selecting a valid path. Click “Next” to
continue. A dialog box “New Project Wizard 3” popup which appears as below:
WellinControl Technology Development Co.,Ltd
2-6
Chapter 2 Introduction to KingView
Figure 2.3 New project wizard 3
Input project name in project name textbox which would be set as current project
path name as well.
And input project comment in project comment textbox. The project name
should be less than 32 characters and project comment should be less than 40
characters. Click “Finish” to finish creating a new project. Then a dialog box popup to
ask you if you want to set new project as current project. It appears as below:
Figure 2.4 Set new project as current project
If you click “No” button, new project is not the current project of
WellinControl Technology Development Co.,Ltd
Chapter 2 Introduction to KingView
2-7
ProjectManager. If you want to set this project to current project, you still need to
execute “File\Set to current project”; if you click “Yes” button, new project would be
set to KingView current project. Defined project information would appear in
message table of ProjectManager. Double-click the message bar or click
“Development” button or select menu “Tools\Switch to WindowMaker” to enter
WindowMaker. The project path is: C:\WINDOWS\Desktop\demo WindowMaker
creates a directory for the project which is C:\WINDOWS\Desktop\demo and
generate a necessary initial data file. These files are all different from each other in
different project. So, different projects should be set to different directories. All the
data files list in Appendix AX). If you want to get the details about how to use
ProjectManager, please refer to “Chapter 3 Startup KingView---ProjectManager”.
Note:
Each project must be created in respective directory. It is not allowed to edit
these initial data files expect special declaration.
2.2.2 Create KingView Picture
You can create numbers of pictures for each project and generate correlated static
or dynamic graphic objects on each picture by WindowMaker. KingView system
provides these pictures made up of various graphic objects which contain simple
objects such as rectangle (rounded-rectangle), line, ellipse (circle), pie (arc), bitmap,
polygon (polyline), text, etc. and complex objects such as button, trend, alarm, report,
etc. System provides variety of operations to graphic objects such as random move,
zoom, reshape, copy, delete, align, etc. System supports keyboard, mouse and
operation tools which can edit color, line type and fill attributes.
KingView is an object oriented programming software, user can create graphic
interface of the picture easily. User can generate a picture by using system-provided
graphic objects just like putting up toy bricks, at the same time, user can copy graphic
WellinControl Technology Development Co.,Ltd
2-8
Chapter 2 Introduction to KingView
objects between pictures and use previous pictures.
Have a try:
Create a simple picture
Continue to last section.
Step 1: Define a new picture
Enter a new project, select “File\Picture” on the left side of TouchExplorer and
double-click “New” icon on the right side of TouchExplorer, a dialog box popup and
appears as below:
Figure 2.5 New picture
Input the name of new picture in the text box named “Picture Name”, like Test,
and don’t make any other changes on other properties now (Details about other
properties setting in “Chapter 4 KingView Development Environment-TouchExplorer”). Click “OK” button to enter embedded WindowMaker. It appears as
below:
WellinControl Technology Development Co.,Ltd
Chapter 2 Introduction to KingView
2-9
Figure 2.6 WindowMaker
Step 2 : Select “Rectangle” and “Text” icons from “Toolbox” to draw a rectangle
object and a text object in WindowMaker. It appears as below:
Figure 2.7 Setup picture
WellinControl Technology Development Co.,Ltd
2-10 Chapter 2 Introduction to KingView
Select “Rounded-rectangle” from toolbox and draw a rectangle like the figure
above. Click “Display brush types” and “Display pallette” in the toolbox, then click
forth transition color type on the second row on popup window “Transition color
type”, click second “fill color” button on the first row on popup window “Pallette”,
and select red as fill color; click third “background color” button on the first row on
popup window “Pallette”, and select black as background color. Finally a rectangle
graphic object filled with transition color is created.
Select “Text” from toolbox then the cursor of mouse becomes “|”, click right on
the picture and input “####” on that position.
Select menu “File\ Save All” to save current picture.
2.2.3 Define IO device
KingView regards all the devices or programs which need to exchange data with
it as peripheral devices. It contains: Lower devices (PLC, meter, module, IO board,
and transducer) which exchange data with computer by serial port; other Windows
applications which exchange data by DDE; other computers on the network.
Only if peripheral devices are defined, KingView can exchange data with them
by IO tags. In order to define peripheral devices expediently, KingView designs a
“Device Configuration Wizard” to lead users to connect devices step by step.
We use simulation PLC to communicate with KingView in the example.
Simulation PLC can simulate PLC to provide data for KingView. Suppose simulation
PLC connected to COM1 of computer.
Have a try:
Define IO device
Continue to last section. Select “Device\COM1” on the left side of
TouchExplorer and double-click “New” icon on the right side of TouchExplorer to
run “Device Configuration Wizard”, it appears as below:
WellinControl Technology Development Co.,Ltd
Chapter 2 Introduction to KingView
2-11
Figure 2.8 Device configuration wizard
Select “COM” item of “Simulate PLC”, click “Next” to popup a dialog box
“Device Configuration Wizard 1” which appears as below:
WellinControl Technology Development Co.,Ltd
2-12 Chapter 2 Introduction to KingView
Figure 2.9 Device configuration wizard 1
Input a name for peripheral device, like “PLC”, click “Next” to popup a dialog
box “Device Configuration Wizard 2” appears as below:
Figure 2.10 Device configuration wizard 2
WellinControl Technology Development Co.,Ltd
Chapter 2 Introduction to KingView
2-13
Select a serial port for device, like “COM1”, click “Next” to popup a dialog box
“Device Configuration Wizard 3” appears as below:
Figure 2.11 Device configuration wizard 3
Input the device address, like “1”, click “Next” to popup a dialog box “Device
Configuration Wizard 4” appears as below:
WellinControl Technology Development Co.,Ltd
2-14 Chapter 2 Introduction to KingView
Figure 2.12 Device configuration wizard 4
Configure communication parameter (generally use system default settings),
click “Next” to popup a dialog box “Device Configuration Wizard 5” appears as
below:
WellinControl Technology Development Co.,Ltd
Chapter 2 Introduction to KingView
2-15
Figure 2.13 Device configuration wizard 5
Please check all the settings, if there is no problem, click “Finish”.
The new peripheral device “PLC” will display on the right side of TouchExplorer
after device definition. If only you connect IO tags to this device, it can exchange data
with KingView while you define tags.
Click “VIEW” button in the toolbar and switch system to running state. If it
prompts that adding agreement components fail, information window will list that
which components fail to add, which is convenient for the user to position and solve
problem, as Figure 2.14 shows.
WellinControl Technology Development Co.,Ltd
2-16 Chapter 2 Introduction to KingView
If fail to load drive components, the “Log Windows” will receive a hint message
as shown in the figure 2.14.
Figure 2.14 Create failure of Agreement Information Group, message one
If it’s the OCX control, it will list the name of the control that failed to load in the
“Log Windows”. As shown in the figure 2.15.
WellinControl Technology Development Co.,Ltd
Chapter 2 Introduction to KingView
2-17
Figure 2.15 Create failure of Agreement Information Group, message two
You can get details on how to define and manage IO device in the section
“Chapter 6 IO Device Management”.
2.2.4 Build database
Database is the heart of KingView. Working status of practical industry field need
to reflect on the screen by means of animation, instructions released by operator need
to send to field of production quickly, runtime database is the middle of them.
Therefore, database is the bridge to connect IO devices and computer. At TouchView
runtime, the database contains the current value of all of the items in the database. In
order to create the runtime database, KingView requires information about all of the
tags being created. Each tag must be assigned a tag name and type. KingView also
requires additional information for some tag types. The gather of all of the tags is
called “Tagname Dictionary” which records all of the available tags information.
Have a try:
Build database
WellinControl Technology Development Co.,Ltd
2-18 Chapter 2 Introduction to KingView
Continue last section. Select “Database\Tagname Dictionary” on the left side of
TouchExplorer and double-click “New” icon on the right side of TouchExplorer to
popup a dialog box “Tag properties” which appears as below:
Figure 2.16 Create memory tag
You can define and edit tags and manage database in this dialog box, details can
be seen in section “Chapter 5 Tag definition and management”. Input a tag name in
textbox “Tagname”, like “a”. Select tag types in textbox “Tag types”, like “Memory
Real”. Don’t make any other changes on other properties now. Click “OK” then
define an IO tag as below:
WellinControl Technology Development Co.,Ltd
Chapter 2 Introduction to KingView
2-19
Figure 2.17 Create IO tag
Input tag name in textbox “Tagname”, like “b”; select tag types in “tag types”,
like IO Integer; select predefined IO device in “Linked device”, like PLC; define
“register”: INCREA100; define “data types”: Short. Other properties don’t need to
change now, click “OK”.
2.2.5 Create animation links
Define animation links is to build a relationship between graphic objects of
picture and tags. When the value of tag altered, the change would appear in form of
WellinControl Technology Development Co.,Ltd
2-20 Chapter 2 Introduction to KingView
graphic object animations; or let users change the value of tag by graphic objects
(details in section “Chapter 7 Animation Links”). “KingView” has 21 kinds of
animation link modes:
Change properties: line properties, fill properties, text color properties
Change position and size: fill, zoom, flip, horizontal shift, vertical shift
Value output: analog value output, discrete value output, string output
Value input: analog value input, discrete value input, string input
Special: blink, hide, flow (Only applies to solid pipelines)
Slider input: horizontal, vertical
Script: on key down, on key up, while down
A graphic object can define several links at one time and combine to a complex
object to satisfy random animation display needs practically.
Have a try:
Create Animation Links
Continue last section. Double-click graphic object----rectangle, a dialog box
“Animation links” popup as below:
WellinControl Technology Development Co.,Ltd
Chapter 2 Introduction to KingView
2-21
Figure 2.18 Animation link
(You can get details about settings of each property in section “Chapter 7
Animation Links”). Click “Fill” button to popup a dialog box which appears as below:
WellinControl Technology Development Co.,Ltd
2-22 Chapter 2 Introduction to KingView
Figure 2.19 Fill link
Input “a” in the textbox “Expression”, and the color in “Default filling brush”
sets to yellow, don’t make any other changes on the properties, it appears as below:
Figure2.20 Change Fill Link properties
WellinControl Technology Development Co.,Ltd
Chapter 2 Introduction to KingView
2-23
Click “OK” and “OK” again to return to WindowMaker. In order to animate
rectangle, you should make variable “a” change dynamically. Click “Edit\Picture
Properties” to popup a dialog box which appears as below:
Figure 2.21 Picture properties
Click “Scripts…” button to popup scripts dialog box which appears as below:
WellinControl Technology Development Co.,Ltd
2-24 Chapter 2 Introduction to KingView
Figure 2.22 Picture scripts
Input scripts in the edit box:
If (a<100)
a=a+10;
Else
a=0;
You can change “Every 3000 MSEL” to “Every 500 MSEL” which is the process
period of the scripts. Click “OK” and “OK” again to return to WindowMaker. Doubleclick textbox “####” to popup “Animation Links” dialog box. It appears as below:
WellinControl Technology Development Co.,Ltd
Chapter 2 Introduction to KingView
2-25
Figure 2.23 Animation link
Click “Analog output” button to popup a dialog box which appears as below:
Figure 2.24 Analog output link
Input “b” in the “Expression” and don’t make any other changes on the
WellinControl Technology Development Co.,Ltd
2-26 Chapter 2 Introduction to KingView
properties. Click “OK” and “OK” again to return to KingView WindowMaker.
Select “File\Save all” in the menu.
2.2.6 Run and debug
The KingView project has been built primarily, so you can come into next step
which is Run and Debug. Select “File\Switch to View” in the menu from
WindowMaker to enter into TouchView. Select “Picture\Open” from TouchView and
select “Test” picture from “Open Picture”. You could see rectangle and text changing
dynamically after TouchView displayed. It appears as below:
Figure 2.25 Result in TouchView
2.3 Update KingView and convert dynamic resolution
KingView edition update
Update KingView project in low edition, such as updating Kingdemo of
KingView 6.5.
WellinControl Technology Development Co.,Ltd
Chapter 2 Introduction to KingView
2-27
Have a try:
Open created project (For example, install a demo project of KingView 6.5 to the
folder c:\kingdemo).
Select “File\ Add project” from ProjectManger to popup a path selecting dialog
box in which the directory is C;\kingdemo. Click “OK” button, system will add the
information of this project to ProjectManager, then click “Development” button to
enter into WindowMaker while system will ask user if you want to update. If you
confirm to update, click “OK” to make system update automatically. If you click “No”,
system wouldn’t update the project, meanwhile, the low edition project couldn’t be
opened by current KingView.
Note:
All the editions of KingView have upward compatibility. The high edition
KingView can open low edition projects, but in case you open a low edition project
by updating it, you wouldn’t open it with low edition software any more. So you
need backup projects before you update them.
Convert KingView Dynamic Resolution
The display size of the picture graphic objects has some relations with the
resolution of computer, so different resolution can generate different display for the
objects. In order to make projects in different resolution display properly, KingView
supplies the function of dynamic resolution conversion.
Have a try:
Copy a project (named Demo) created with the resolution of 1024*768 to a
computer with the resolution of 800*600 (or convert computer resolution). After you
add the project from ProjectManager (details about how to use “Add project” in the
section “Chapter 3 Startup KingView---- ProjectManager”), you can see the resolution
displayed in the list of “Resolution” is 1024*768 which is shown as below:
WellinControl Technology Development Co.,Ltd
2-28 Chapter 2 Introduction to KingView
Figure 2.26 Resolution display in ProjectManager
Double-click blue message bar or click “Development” button or select
“Tools\Switch to WindowMaker” from the menu to enter into WindowMaker. An
enquiry window popup to ask if you want to convert resolution which appears as
below:
Figure 2.27 Resolution conversion prompt
If you click “No”, system wouldn’t convert the resolution, but enter into
TouchExpolorer, and graphic objects of the picture will display with the resolution of
1024*768. If you click “Yes”, the system would convert resolution automatically. The
graphic objects of picture will zoom in proportion and make them display properly.
If you want to be familiar with KingView quickly, please read “KingView
Training Tutorial” or come to our company to join a termly training course and you
can master KingView quicker and more comprehensive with the help of experienced
engineers.
WellinControl Technology Development Co.,Ltd
Chapter 3 Startup KingView--- ProjectManager
Chapter 3
Startup
ProjectManager
3-1
KingView---
To system-integrated dealers and users a system developer might have a number
of KingView projects. It’s a big problem to manage them centralized and backup a
new project. ProjectManager can realize central management of all editions of
KingView, furthermore, it can bring users convenient when they develop, backup
projects and manage Tagname Dictionary. The key purpose of it is to manage all the
projects on local computer for users.
ProjectManager has several main functions which contains create a new project,
delete a project, find all the projects under assigned directory, edit project properties,
backup and resume a project, import and export Tags, switch to
TouchView\WindowMaker and so on. We will introduce each menu item of
ProjectManager in this chapter first, and then we will give a detail expression about
how to realize each function.
3.1 Introduction to ProjectManager
ProjectManager is very easy to learn and use. Its simple interface has three parts
from the top down. It appears as below:
WellinControl Technology Development Co.,Ltd
3-2
Chapter 3 Startup KingView--- ProjectManager
Figure 3.1 ProjectManager

Menu bar\ Toolbar

Project information display area

Status bar
It will introduce the functions of menu bar items below:
3.1.1 File menu
Click “File (F)” menu or depress {ALT}+{F} key to popup dropdown menu
which appears as below:
WellinControl Technology Development Co.,Ltd
Chapter 3 Startup KingView--- ProjectManager
3-3
Figure 3.2 File menu




File(F)\New Project(N)
This command is to create a new project, but this new project is not a real
project, it’s only a massage set on the assigned directory. When users set this
project as current project and switch to WindowMaker, a new project is really
created now. You can get details in the section “3.2 How to create a new project”.
File(F)\Find Project(S)
This command is to search all the projects on the assigned directory
(contains all the projects in every editions and every resolutions), and add all the
information to ProjectManager which contains the project name, project path,
resolution, KingView edition, Project description. Details about finding projects
in the section “3.4 How to find some created KingView projects”.
File(F)\Add Project(A)
This command is to add a created KingView project and add it to the
ProjectManager (unlike finding project: Finding project is to add all the
KingView projects on the assigned directory). You can get details in the section
“3.3 How to find a created KingView project”.
File(F)\Set To Current Project(C)
This command is to set a selected highlight project to current project in the
ProjectManager. Since then system would open this default project whenever
WellinControl Technology Development Co.,Ltd
3-4
Chapter 3 Startup KingView--- ProjectManager


entered into WindowMaker or TouchView. The project set to current project is
labeled on the first column of ProjectManager message by an icon (a small red
flag). You can get details in the section “3.5 How to set a project to current
project”.
File(F)\Delete Project(D)
This command is to delete the project which is selected highlight in the
message display area of ProjectManager but not set to current project. You can
get details in the section “3.10 How to delete a project.”
File(F)\Rename Project(R)
This command is to edit the name of selected highlight project, you can see
a dialog box “Rename Project” below:
Figure 3.3 Rename project


The old name of project displays in the textbox “Old Name” and it is
unchangeable. Input new name of project in the textbox “New Name” and click
“OK” to confirm change, or click “Cancel” to exit this operation.
File(F)\ Project Properties(P)
This command is to edit the properties of the selected highlight project.
Details about how to edit project properties can be seen in the section “3.6 How
to edit current project properties”.
File(F)\Erase Project Message(S)
This command is to erase the project message about the selected highlight
project in ProjectManager, at the same time, this command won’t delete or
WellinControl Technology Development Co.,Ltd
Chapter 3 Startup KingView--- ProjectManager

3-5
change the project. These project messages can display in ProjectManager over
again by using “Find Project” or “Add Project”.
Detail s about how to erase project message can be seen in the section “3.7
How to erase the project needn’t be shown”.
File(F)\Exit(X)
Exit ProjectManager.
3.1.2 View menu
Click “View (V)” menu or depress {ALT}+{V} key to popup dropdown menu
which appears as below:
Figure 3.4 View menu



Toolbar(T):Whether to display toolbar. Toolbar displays when
“Toolbar” was checked, otherwise, toolbar doesn’t display.
Status bar(S): Whether to display status bar. Status bar displays when
“Status Bar” was checked, otherwise, status bar doesn’t display.
Refresh(R): Refresh ProjectManager wndow.
3.1.3 Tools menu
Click “Tools(T)” menu or depress {ALT}+{T} key to popup dropdown menu
which appears as below:
WellinControl Technology Development Co.,Ltd
3-6
Chapter 3 Startup KingView--- ProjectManager
Figure 3.5 Tool menu





Tools(T)\Backup Project(B)
This command is to compress and backup the selected highlight project in
terms of assigned format in ProjectManager, you can get details in the section
“3.8 How to backup and resume project”.
Tools\Resume Project (R)
This command is to resume project to the one before backup. You can get
details in the section “3.8 How to backup and resume project”.
Tools\ Tag Import (I)
In order to make users use, view, define or print variables conveniently,
KingView supplies functions of Tag Import\Export. Tag Import command is to
import tags which are defined by Excel or imported by KingView exported tags
to KingView project. Normally this command is used together with Tag Export
command. You can get details in the section “3.8 How to Import\Export Tags”.
Tools\ Tag Export (X)
This command is to export tags to files in Excel format. Users can view or
edit tag properties in Excel files, or create new tag and define its properties and
import to project. Normally this command is used together with Tag Import
command. You can get details in the section “3.8 How to Import\Export Tags”.
Tools\Switch to WindowMaker (E)
Run this command is to enter into WindowMaker, meanwhile close
ProjectManager automatically. Opened project is the assigned current project in
ProjectManager (Labeled current project).
WellinControl Technology Development Co.,Ltd
Chapter 3 Startup KingView--- ProjectManager

3-7
Tools\Switch to TouchView (V)
Run this command is to enter into TouchView, meanwhile close
ProjectManager automatically. Opened project is the assigned current project in
ProjectManager (Labeled current project).
3.1.4 Help menu

Help (H)\About ProjectManager (A)…
Run this command is to popup the version number and copyright
information of ProjectManager.
3.1.5 ProjectManager Toolbar
ProjectManager appears as below:
Toolbar button has same functions as menus’. You can get details in the last
three sections.
Figure 3.6 ProjectManager toolbar
search project
create project
delete project
change project property
WellinControl Technology Development Co.,Ltd
3-8
Chapter 3 Startup KingView--- ProjectManager
backup project
restore project
dump data from DB
load data into DB
switch to Maker
switch to TouchView
3.1.6 Shortcut menu
Right-click mouse on any project message in ProjectManger, popup a shortcut
menu which appears as below:
WellinControl Technology Development Co.,Ltd
Chapter 3 Startup KingView--- ProjectManager
3-9
Figure 3.7 Shortcut menu
Shortcut menu has same functions as general menus’. You can get details in the
last three sections.
3.2 How to create a new project
KingView supplies New Project Wizard to create new project which make users
operate simpler and faster. Click “File\New Project” in the menu or “New” button on
the toolbar or “New Project” in shortcut menu to popup a dialog box “New Project
Wizard 1”. It appears as below:
WellinControl Technology Development Co.,Ltd
3-10 Chapter 3 Startup KingView--- ProjectManager
Figure 3.8 New project wizard 1


Click “Cancel” to exit New Project Wizard.
Click “Next” to continue new project, popup a dialog box “New
Project Wizard 2”. It appears as below:
WellinControl Technology Development Co.,Ltd
Chapter 3 Startup KingView--- ProjectManager
3-11
Figure 3.9 New project wizard 2
Input the path of new project in the textbox of dialog box. If the path
doesn’t exist, system will inform users automatically. Or you can click “Browse”
button to select project path from popup path selecting dialog box (You can input
path directly in the popup path selecting dialog box).

Click “Back” to return previous page of wizard dialog box.

Click “Cancel” to exit New Project Wizard.

Click “Next” to continue new project, popup a dialog box “New
Project Wizard 3”. It appears as below:
WellinControl Technology Development Co.,Ltd
3-12 Chapter 3 Startup KingView--- ProjectManager
Figure 3.10 New project wizard 3
Input name of the new project in the textbox “Name” which is less than 32
characters. Input comment of the new project in the textbox “Description” which is
less than 40 characters.

Click “Back” to return previous page of wizard.

Click “Cancel” to exit New Project Wizard.

Click “Finish” to confirm new project, then a new project is created.
The path of a new project is an assigned path in wizard 2 in which a folder
named as project name will be created. Finally a dialog box “Do you want to make
new project as current” popup and appears as below:
WellinControl Technology Development Co.,Ltd
Chapter 3 Startup KingView--- ProjectManager
3-13
Figure 3.11 Make project as current
Click “Yes” to set new project as current project; click “No” to make current
setting standing.
A new project message is created after foregoing operation. These new projects
are not real created, just the setup project information on the user-assigned project
path. When user set it as current project and switch to KingView Development
Environment, the project was actually created.
3.3 How to find a created project
You can use “Add Project” to find a created KingView Project in
ProjectManager and display project information in the message display area of
ProjectManager. Click “File\Add Project” on the menu bar or “Add Project” in the
shortcut menu to popup a path selecting dialog box which appears as below:
WellinControl Technology Development Co.,Ltd
3-14 Chapter 3 Startup KingView--- ProjectManager
Figure 3.12 Select path for adding project
Select the directory of necessary project.

OK: Add the project to ProjectManager in the selected directory. If the
directory is not the project path of KingView, you can’t add project.

Cancel: Cancel Add Project operation.
Click “OK” to add assigned project to ProjectManager display area. It appears as
below:
WellinControl Technology Development Co.,Ltd
Chapter 3 Startup KingView--- ProjectManager
3-15
Figure 3.13 Add project
If added project name was different with the created project name in current
message display area, this project would generate a project name dynamically and add
a serial number behind the project name. When some projects with same name existed,
names would generate by rule until no repeating name created.
3.4 How to find a created KingView project
Add Project can only add one created KingView project. If you want to find
more projects, you need to use “Find Project”. Click “File\Find Project” on the menu
bar or “Find Project” in the shortcut menu to popup a path selecting dialog box which
appears as below:
WellinControl Technology Development Co.,Ltd
3-16 Chapter 3 Startup KingView--- ProjectManager
Figure 3.14 Select path for searching project
You can have the same method to select path as Windows explorer. After that
click “OK” button, ProjectManager begins to search projects that would search all the
projects in the assigned directory and its subdirectory. The searching result will
display in the message display area automatically after searching, then path selecting
dialog box closes. Click “Cancel” to cancel searching operation.
If found project name was different with the created project name in current
message display area, or there are repeated names in found projects, this message
added to ProjectManager would generate a project name dynamically and add a serial
number behind the project name. When some projects with same name existed, names
would generate by rule until no repeating name created.
3.5 How to set a project to current project
Select highlight needed project in the message display area of ProjectManager
and click “File\Set to current project” on the menu bar or “Set to current project” in
the shortcut menu to set it to current project. Since then this project would be default
WellinControl Technology Development Co.,Ltd
Chapter 3 Startup KingView--- ProjectManager
3-17
opened whenever you enter TouchView or WindowMaker. The project set to current
project is labeled on the first column of ProjectManager message by an icon (a small
red flag). It appears as below:
Figure 3.15 Set to current project
Note:
The option is valid only when TouchView or WindowMaker are closed.
3.6 How to edit current project properties
Editing current project properties contains tow parts: project name and project
comment. Select highlight project need to edit, click “File\Project Properties” in the
menu bar or “Properties” button on the toolbar or “Project Properties” in the shortcut
menu to popup a dialog box “Project Properties” as below:
WellinControl Technology Development Co.,Ltd
3-18 Chapter 3 Startup KingView--- ProjectManager
Figure 3.16 Edit project properties




“Project Name” textbox displays old project name which users can edit
directly.
“Version”, “Resolution” textbox displays the version of KingView and
project resolution separately.
“Project Path” displays the path of the project..
“Comment” displays project description which allows users edit directly.
3.7 How to erase projects which needn’t display
Select highlight the necessary project, click “File\Erase project message” on the
menu bar or “Erase project message” in shortcut menu, and then erase selected project
message from ProjectManager. This command won’t delete or change the project.
These project messages can display in ProjectManager over again by using “Find
Project” or “Add Project”.
Note:
WellinControl Technology Development Co.,Ltd
Chapter 3 Startup KingView--- ProjectManager
3-19
Erase Project Message command can only delete message which is not current
project messages in ProjectManager and it is useless for current project.
3.8 How to backup and restore project
Backup project is to compress and backup the selected highlight project in terms
of assigned format in ProjectManager. Resume project is to resume project to the one
before backup. You can get details about both below.
3.8.1 Backup Project
Select project need to backup and highlight it. Click “File\Backup project” on the
menu bar or “Backup” button on the toolbar or “Backup project” in shortcut menu to
popup “Backup Project” dialog box. It appears as below:
Figure 3.17 Backup project dialog box
Project backup files have two forms: bundling and unbundling. Unbundling is to
compress project to a backup file no matter how large it is. Bundling is to backup
WellinControl Technology Development Co.,Ltd
3-20 Chapter 3 Startup KingView--- ProjectManager
project to some size-assigned compressed files. Unbundling is the system default form.

Default (Unbundling): System will compress the whole project to one
backup file if you select it. Click “Browse” button and select directory of backup
file and the file name which appears as below. Project is saved as file which
extension name is .cmp. Such as filename.cmp, means generating a file named
filename.cmp after backup.
Figure 3.18 Backup project path

Custom (Bundling): System will compress the project to some size-assigned
files according to assigned bundling size if you select it. “Bundling size” textbox
changes to available. Input bundling size in the textbox, that is to rule the size of
backup file. Unit is mega. Bundling size can’t be null, otherwise system will
remind user to input bundling size. Click “Browse” button to select directory of
backup file and file name. When you save bundling files, a series of files
generate that file name of the first file is defined filename.cmp. Others generate
in turn: filename.c01, filename.c02…. For example, defined filename is
“filename”, so the files generated by backup are: filename.cmp, filename.c01,
filename.c02….
WellinControl Technology Development Co.,Ltd
Chapter 3 Startup KingView--- ProjectManager
3-21
If assigned saving path is floppy drive, system will remind user to change disk
when disk is full. In this situation, “Custom” backup project is a good choice. There
are text message on the left side of ProjectManager status bar and progress bar on the
right side to tag current progress while backup processing.
Note: Backup filename can’t set to null.
3.8.2 Restore Project
Select project need to restore and highlight it. Click “File\Restore project” on the
menu bar or “Restore” button on the toolbar or “Restore project” in shortcut menu to
popup “Select project to restore” dialog box. It appears as below:
Figure 3.19 Select project to restore
Select a backup file---extension name is .cmp. Click “Open” button to popup
“Restore Project” dialog box. It appears as below:
WellinControl Technology Development Co.,Ltd
3-22 Chapter 3 Startup KingView--- ProjectManager
Figure 3.20 Restore project option

Click “Yes” button to cover current project by backup project. If resume
failed, system will recover project to the one before resume automatically.
ProjectManager status bar will have text messages and progress bar to display
resume progress while resume processing.
Note:
1. Resume project would lose new project information obtained before backup.
Need to operate carefully.
2. If selected backup project didn’t belong to original project, system would prompt
project failed while resuming.


Click “Cancel” button to cancel resuming.
Click “No” button to select another directory and restore project to that directory.
Click button to popup a dialog box appears as below:
WellinControl Technology Development Co.,Ltd
Chapter 3 Startup KingView--- ProjectManager
3-23
Figure 3.21 Restore project path

Input a new directory to resume project in textbox “Restore to this directory”. Or
click “Browse…” button to select from popup window--Selecting path dialog
box. If the directory didn’t exist, system would ask user whether to create the
directory automatically. Click “OK” to restore project after finishing inputting.
ProjectManager status bar will have text messages and progress bar while restore
processing. A dialog box which informs resume information popup after project
restore completely. It appears as below:
Figure 3.22 Restore project prompt
Click “Yes” to set restored project as current project, click “No” to return
ProjectManager. If restored project had a same name as a created project in current
project message area, this restored project would generate a project name dynamically
and add a number behind name when it was added to project message area. For
example, the original project name is “Demo”, so restored project name is “Demo (2)”.
WellinControl Technology Development Co.,Ltd
3-24 Chapter 3 Startup KingView--- ProjectManager
Restored project path is an assigned path which subdirectory named by backup file
name.
3.9 How to delete a project
Select highlight the project need to delete which is not current project. After click
“File\Delete project” on the menu bar or “Delete” button on the toolbar or “Delete
project” in shortcut menu, “Confirm Deleting Project” dialog box popup to ask user if
you confirm deleting in order to avoid misoperation. It appears as below. Click “Yes”
to delete project and click “No” to cancel delete operation. Delete project will delete
all the information of the project in ProjectManager and the project directory and
subdirectories will be deleted as well.
Figure 3.23 Confirm to delete project
Note:
Delete project will delete all the contents of project and can’t restore. Please
operate carefully.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-1
Chapter 4 KingView Development
Environment----TouchExplorer
TouchExplorer is an important part of KingView which manages a number of
project components such as picture, scripts, driver, recipe, alarm, network and so on.
Engineers can easily view any parts of projects. TouchExplorer is very simple and
similar with Windows Explorer on interface. So it is a convenient and efficient tool to
manage projects.
WindowMaker is embedded in TouchExplorer. It is an integrated development
environment of application for which engineers can develop system in it.
4.1 Introduction to TouchExplorer
4.1.1 TouchExplorer summary
On the left side of TouchExplorer is “Project list display area” which mainly
shows all the components of project. It has four parts: “System”, “Tags” and “Station”
and “Picture”, they can be switched by clicking Tab labels on the leftmost side of
TouchExplorer.
 “System” part has six items which are “Web”, “File”, “Tagname dictionary”,
WellinControl Technology Development Co.,Ltd
4-2
Chapter 4 KingView Development ----TouchExplorer
“Device”, “System configuration”, “SQL Access Manager”.
 “Web” is KingView tool to publish pictures for Internet.
 “File” contains: “Picture”, “Scripts”, “Recipe” and “Nonlinear table”.
Especially, scripts contain “Application scripts”, “Data change scripts”,
“Condition scripts”, “Key scripts” and “Custom scripts”.
 “Database” contains: “Structure tags”, “Tagname dictionary” and “Alarm
group”.
 “Device” contains: “COM1”, “COM2”, “DDE”, “Board”, “OPC Server” and
“Network Node”.
 “System configuration” contains: “Set WindowMaker”, “Set TouchView”,
“Alarm configuration”, “Historical Logging”, “Network configuration”,
“User configuration” and “Print configuration”
 “SQL Access Manager” contains: “Table Template” and “Bind list”.
 “Tags” part is to manage tags, which contains tag group.


“Station” part shows details about defined remote node.
“Picture” part is to manage pictures by group, to create and to manage picture
group.
On the right side of TouchExplorer is “List content display area” which mainly
shows details of every project components, meanwhile, it can edit project as required.
TouchExplorer structure can be showed as below:
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-3
Figure 4.1 TouchExplorer
TouchExplorer composes of “Tab label”, “Menu bar”, “Toolbar”, “Project list
display area”, “List content display area”, “Status bar”. Project list display area shows
function node in forms of tree structure chart in which users can extend or contract
function items.
 List display area operation as below:
1. Open Function Config dialog box:
Double-click function item node so that TouchExplorer extends members of
this item and shows them. When you choose a certain node (for example,
“Application Scripts”), an icon shown “Please double-click here to enter…”
displays in list content display area. You can double-click this node to open
Function Config dialog box, or you can double-click the icon “Please doubleclick here to enter…” in list content display area to open Function Config dialog
box.
WellinControl Technology Development Co.,Ltd
4-4
Chapter 4 KingView Development ----TouchExplorer
2. Extend outline nodes
Click “+” on the front of outline so that TouchExplorer can extend members
of this item and show them.
3. Contract outline nodes
Click “-” on the front of outline so that TouchExplorer can contract
members of this item and show them.
 List content display area operation as below:
KingView supports right key operation, which can highly improve your
working efficiency if you use it reasonably. When you choose a member name in
the project list display area (for example, “picture” member name), a “New” icon
displays in list content display area. Click-right on any positions in list content
display area to popup related floating menu for operation, or double-click “New”
icon in list content display area to popup related dialog box.
Then you can get details about how to use TouchExplorer menu commands.
4.1.2 Project menu
Click “Project” menu on menu bar to popup dropdown menu as below:
Figure 4.2 Project menu
4.1.2.1 Project\ Startup ProjectManager
This
command
is
to
open
ProjectManager.
WellinControl Technology Development Co.,Ltd
Click
“Project\Startup
Chapter 4 KingView Development ----TouchExplorer
4-5
ProjectManager” menu to popup “ProjectManager” which appears as below.
Figure 4.3 ProjectManager
You can manage all the KingView projects in local computer by ProjectManager.
The main functions of ProjectManager contain: new project, delete project, rename
project, find project, edit project properties, backup\resume project, import\export
tagname dictionary, and switch to TouchView\WindowMaker etc.
You can get details in the section “Chapter 3 Startup KingView--ProjectManager”.
4.1.2.2 Project\Import
This command is to import pictures and scripts of another KingView project to
current project. Click “Project\Import” menu to popup “Picture and scripts importing
wizard” picture as below:
WellinControl Technology Development Co.,Ltd
4-6
Chapter 4 KingView Development ----TouchExplorer
Figure 4.4 Picture and scripts importing wizard
Click “Cancel” button to exit picture and scripts import wizard.
Click “Next” button to enter “First step: Choose path” picture which appears as
below.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-7
Figure 4.5 First step – choose path for importing
Input the directory including KingView pictures and scripts in the textbox. If you
want to select directory, please click “Browse” button to popup “Open” dialog box as
below:
Figure 4.6 Open dialog box
WellinControl Technology Development Co.,Ltd
4-8
Chapter 4 KingView Development ----TouchExplorer
Select correct directory in the dialog box, such as, E:\Example\Kingdemo1, click
“Open” button to return to “First step: Choose path” dialog box where selected
directory shown in directory textbox.
Figure 4.7 Finish first step – choose path
Click “Back” button to return “Picture and scripts import wizard”,
Click “Next” button to enter “Second step: Select picture and scripts” picture
which appears as below:
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-9
Figure 4.8 Second step – select picture and scripts
Click “Details…” on the back of “Picture” and “Scripts”, you can select certain
items from both of them.
Click “Picture”---“Details…” button to popup “Select pictures” dialog box which
appears as below:
WellinControl Technology Development Co.,Ltd
4-10 Chapter 4 KingView Development ----TouchExplorer
Figure 4.9 Selected picture
System default is importing all the pictures. Select pictures need to import in
dialog box: you can select pictures one by one by mouse, or click “Select All” button
to select all the pictures. Click “Clear” button to erase all selected pictures. Click
“OK” to return to “Second step: Select pictures and scripts” dialog box.
Click “Scripts”---“Details…” button to popup “Scripts items” dialog box which
appears as below:
Figure 4.10 Scripts option
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-11
Select scripts need to import in the dialog box and click “OK” to return to
“Second step: Select pictures and scripts” dialog box.
Click “Finish” button in “Second step: Select pictures and scripts” dialog box.
Pictures import completed firstly and then “Function import” dialog box popup as
below:
Figure 4.11 Function Import
The rules about how to deal with same names (same types) during importing
application scripts are defined in this dialog box.

“Skip”: Don’t import when same names (same types) functions appear.

“Replace current functions”: Replace current functions by imported
functions with same names (same types) when the same names (same types)
functions appear.

“Unite functions contents”: Unite the content of current function with
imported function with same names (same types) when same names (same types)
functions appear.

“Apply to all”: Check this checkbox, the rules can be applied to all scripts,
WellinControl Technology Development Co.,Ltd
4-12 Chapter 4 KingView Development ----TouchExplorer
like data change scripts, condition scripts, key scripts and custom scripts.
Otherwise, all of other scripts dialog box shown “Function import” would popup
one by one.
Click “OK” to import scripts.
After importing, the pictures and scripts in other KingView projects are imported
in current project.
4.1.2.3 Project\Export
This command is to export pictures and scripts in current project to assigned folder.
Click “Project\Export” menu to popup “Pictures and scripts exporting wizard” picture
as below:
Figure 4.12 Picture and scripts exporting wizard
Click “Cancel” button to exit picture and scripts export wizard.
Click “Next” button to enter “First step: Choose path” picture which appears as
below.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-13
Figure 4.13 First step – choose path for exporting
Input the directory including KingView pictures and scripts in the textbox. If you
want to select directory, please click “Browse” button to popup “Open” dialog box
using the same method as pictures and scripts import wizard. Click “Next” button to
enter “Second step: Select picture and scripts” picture which appears as below:
WellinControl Technology Development Co.,Ltd
4-14 Chapter 4 KingView Development ----TouchExplorer
Figure 4.14 Second step – select pictures and scripts
Click “Details…” on the back of “Picture” and “Scripts”, you can select certain
items from both of them by using the same method as pictures and scripts import
wizard.
Click “Finish” button to finish pictures and scripts export. You can get exported
files in related directory. There are three kinds of files in the folder: *.pic (the info files
of all the symbols in the picture), *.cfg (the info files of all the scripts), *.dat (the info
files of the picture properties). If you want to know the details about how to use project
files, you can see “Appendix A KingView data files”
Note:
By using Project Import\Export menu command, you can reuse pictures and
scripts in old project to reduce workload and make KingView project reusable.
4.1.2.4 Project\Exit
This command is to exit TouchExplorer. Click “Project\Exit” menu to exit
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-15
TouchExplorer. If some pictures in WindowMaker had been changed without saving,
program would remind you to save it or not. It appears as below:
Figure 4.15 Exit prompt
If you want to save changed picture, please click “Yes” or letter key “Y”. If you
click “No” or letter key “N”, you can exit TouchExplorer directly. If you click “Cancel”
to cancel this operation, you wouldn’t exit TouchExplorer.
4.1.3 Configure menu
Click “Configure” menu on the menu bar to popup dropdown menu as below:
Figure 4.16 Configure menu
WellinControl Technology Development Co.,Ltd
4-16 Chapter 4 KingView Development ----TouchExplorer
4.1.3.1 Configure\Maker
This command is to configure WindowMaker appearance. Click
“Configure\Maker” menu to popup “TouchExplore Appearance” picture which appears
as below:
Figure 4.17 TouchExplorer appearance configuration
Title bar text: This edit-box is to input the title on the title bar of WindowMaker.
Display project path: Check the item to display current path on the title bar of
WindowMaker.
4.1.3.2 Configure\View
This command is to configure settings like TouchView appearance, TouchView
basic frequency definition, the main picture opened automatically when TouchView
startup. Click “TouchView setting” picture which appears as below:
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-17
Figure 4.18 TouchView appearance setting
“TouchView setting” dialog box composes of three properties pages:

“TouchView appearance” properties page
You can get the definition and introduction of each item in this properties
page as below:

Maximum when startup: TouchView displays full-screen when it
startup.

Minimum when startup: TouchView contracts to an icon when it
startup.

Title bar text: This textbox is to input title on the title bar when
TouchView is running. If it were empty, TouchView would hide title
bar and display full-screen.

System menu: Check it to make title bar show system menu while
TouchView is running.
WellinControl Technology Development Co.,Ltd
4-18 Chapter 4 KingView Development ----TouchExplorer


Minimize button: Check it to make title bar show minimize button
while TouchView is running.

Maximize button: Check it to make title bar show maximize
button while TouchView is running.

Zoom-able frame: Check it to make windows zoom-able while
TouchView is running.

Display project path on title bar: Check it to make title bar show
current project directory.

Menu: select each item in this menu to show while TouchView is
running.
“Main window setting” properties page
Click “Main window setting” properties page to popup this page where
picture list dialog box shows all of available pictures in current project in
which selected pictures highlight. It appears as below. This page is to decide
which pictures need to load automatically when TouchView startup. If some
pictures overlap, the last loading picture displays on the top.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-19
Figure 4.19 Main window setting

“Special” properties page
This properties page dialog box is to configure some special properties like
basic frequency of TouchView. Click “Special” properties page to popup a page
as below.
WellinControl Technology Development Co.,Ltd
4-20 Chapter 4 KingView Development ----TouchExplorer
Figure 4.20 Special




Basic frequency of TouchView: It is a time value. All of the other items
related to time (for example, blink frequency of graphic object have “Blink”
animation link, update frequency of trend curve, running frequency of
scripts) are measured by it. The highest basic frequency is 55 milliseconds.
Time tags update frequency: It is to control frequency to update time
tags ($second, $minute, $hour and so on) while TouchView is running.
Display last available value when communication failed. It is to control
IO tags in KingView how to display on pictures when communication failed.
If user checked it, picture would show the last collected data value for
“Value output” link of IO tags in KingView pictures. Otherwise, it would
show “???”.
Disable Exit TouchView: Check it to make user cannot exit program by
using “Close” button or menu after TouchView startup. However, user can
use EXIT() function to exit in KingView.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer


4-21
Disable task switching (CTRL+ESC): Check it to disable
“CTRL+ESC” key so that user can’t switch tasks.
Disable ALT key: Check it to disable “ALT” key so that user can’t use
ALT key to import menu commands.
Note:
If all of above items are checked, only inner functions “Exit(Option)” supplied
by KingView can realize exit.





Use Virtual keyboard: After TouchView startup, when operator need
keyboard (such as inputting analog values), virtual keyboard window popup
to make operator input by clicking corresponding characters on the virtual
keyboard.
Buzzer sounds when clicking touch-sensitive objects: Buzzer sounds
when user click operable symbols like button while system running.
Support multi-screens display: Check it to support multi graphic cards
which make multi-monitors connect to one computer and display KingView
pictures on multi-monitors.
The Write function is triggered by a change in tag value: Select this
item when the acquisition frequency is zero and Kingview has to write the
tag value. This function will ONLY Write when there is a change in tag
value.
This function Writes when write-only tag start up: Select this item
when KingView is running, and it will write the initial value, otherwise it
does not write.
4.1.3.3 Configure\Alarm
This command is to output alarm and event messages to files, database and
printer. You can get the details about how to use each properties page in the section
“9.5 How to record and display alarm”.
WellinControl Technology Development Co.,Ltd
4-22 Chapter 4 KingView Development ----TouchExplorer
4.1.3.4 Configure\Historical logging
This command is relating to historical data which is used to configure historical
log file saving path and other parameters (such as holding time). Therefore, you can
show historical data in historical trend or configure distributed historical data to make
KingView in local node access to historical data in remote node. You can get details
about how to use historical trend in the section “8.3 Historical trend” and in the
chapter “KingView History”.
4.1.3.5 Configure\Network
This command is to configure KingView network. You can get details about how
to use each properties page in the section “21.2 How to configure network”.
4.1.3.6 Configure\User
This command is to build KingView user group and configure security zone. And
you can get details about how to use it in chapter 16-- “WindowMaker security
management”.
4.1.3.7 Configure\Print
This command is to configure printer for printing “Picture”, “Real-time alarm”,
“Report”. Click “Configure\Print” menu to popup “Print setting” picture as below:
Figure 4.21 Printer setting
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-23
“Picture print” assigns the print port used by function PrintWindow().“Real-time
alarm” assigns the print port used by real-time alarm print. “Report print” assigns the
print port used by report print function like ReportPrint (). Each list-box shows userdefined printer name in local computer for selecting by user.
4.1.3.8 Configure\COM configuration
This command is to configure COM communication parameters and setup dialup Modem. Click “COM1” or “COM2” of “Device” in project list display area of
TouchExplorer. After that click “Configure\COM configuration” or double-click
“COM1” or “COM2” directly to popup “Set serial port COM 1” which appears as
below:
Figure 4.22 Set COM
You can get details about how to configure various parameters in the chapter 6
“I/O device management”
4.1.4 View menu
WellinControl Technology Development Co.,Ltd
4-24 Chapter 4 KingView Development ----TouchExplorer
Click “View” menu on the menu bar to popup dropdown menu as below:
Figure 4.23 View menu
4.1.4.1 View\Toolbar
This command is to show\close toolbar of TouchExplorer. If you check “Toolbar”,
it shows toolbar, and if you uncheck “Toolbar”, it disappears.
4.1.4.2 View\Status bar
This command is to show\close status bar of TouchExplorer. If you check “Status
bar”, it shows status bar, and if you uncheck “Status bar”, it disappears.
4.1.4.3 View\Big icon
This command is to display content in list content display area as big icon. When
you check “Big icon”, it shows big icon.
4.1.4.4 View\Small icon
This command is to display content in list content display area as small icon.
When you check “Small icon”, it shows small icon.
4.1.4.5 View\Details
This command is to display all the details about every item in list content display
area.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-25
4.1.5 Tools menu
Click “Tools” menu on the menu bar to popup dropdown menu as below:
Figure 4.24 Tool menu
4.1.5.1 Tools\Find tags
This command is to find assigned tags and display details about it for editing.
When you click “Tagname dictionary” in project list display area of TouchExplorer,
this command would change from grey (unavailable) to black (available). A dialog
box “Find tags” popup as below:
Figure 4.25 Find tag
WellinControl Technology Development Co.,Ltd
4-26 Chapter 4 KingView Development ----TouchExplorer
Details in the section “5.7.3”
4.1.5.2 Tool\Tag logging
This command is to stat usage of KingView tags, namely, pictures tag located
and coordinates of symbols using the tag and scripts types using the tag. Click
“Tool\tag logging” menu to make system stat tags and popup “Loading picture”,
“Stating picture” alternately until finish. “Tags using log” picture popup which
appears as below.
Figure 4.26 Tag using log
Click “Find” button to quick search position of a certain tag and coordinates of
symbols using the tag and scripts types using the tag. It appears as below:
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-27
Details in the section “5.7.3”
4.1.5.3 Tools\Update use counts
Database counts tag quotation to indicate if tag was quoted. If “tag quotation
count” set to 0, which means tag hasn’t been used after definition. Database doesn’t
update count value when you delete, edit certain expression or delete pictures result in
tag quotation count changed. So you need update tag count command to stat and
update tag usage.
Generally, engineers don’t need to choose this command. It is used in last
cleaning work when application design completed. Details in the section “5.7.3 Tag
manage tools 2”
4.1.5.4 Tools\Delete unused tags
Database maintenances are mostly finished by system, but designer need to
“Delete unused tags” in the end. In order to confirm if tags have animation links or
WellinControl Technology Development Co.,Ltd
4-28 Chapter 4 KingView Development ----TouchExplorer
used in scripts, tag count need to update before deleting unused tags because only
unused tags (Tag count =0) can be deleted. All of pictures must be closed before
update tag count. Details in the section “5.7.3 Tag manage tools 2”
4.1.5.5 Tool\Tag Name Substitute
This command used to replace old tag name by a new tag name. Click “Tool\Tag
Name Substitute” to popup the submenu “Single Tag Substitute, Batch Tag Substitute”.
As shown in Figure 4.27.
Figure 4.27 Tag substitute
Details in the section “5.7.4”
4.1.5.6 Tools\Encryption
In order to prevent other engineers edit your project, you can encrypt developing
project. And you can cancel project password protection as well. Details in the section
“16.1 WindowMaker security management”
4.1.6 Help menu
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-29
Click “Help” menu on the menu bar to popup dropdown menu as below:
Figure 4.28 Help menu
This menu is to popup message box to display KingView version and help
information.
4.1.7 TouchExplorer toolbar buttons
Toolbar button is the shortcut of menu command in TouchExplorer. A message
box shown the function of this button appears immediately as you put the cursor over
any buttons on the toolbar. Toolbar button appears as below:
Figure 4.29 TouchExplorer Toolbar
Every button on the toolbar has its own menu command which introduced as
below:
This button is to open “ProjectManager” dialog box. It is the shortcut of
“Project\Startup ProjectManager” menu command.
This button is to set list content display mode to “Big icon”. It is the shortcut of
“View\Big icon” menu command.
WellinControl Technology Development Co.,Ltd
4-30 Chapter 4 KingView Development ----TouchExplorer
This button is to set list content display mode to “Small icon”. It is the shortcut
of “View\Small icon” menu command.
This button is to set list content display mode to “Details”. It is the shortcut of
“View\Details” menu command.
This button is to configure appearance of WindowMaker. It is the shortcut of
“Configure\Maker” menu command.
This button is to configure appearance of TouchView. It is the shortcut of
“Configure\View” menu command.
This button is to configure alarm. Click it to popup “Alarm config sheet” dialog
box which is shortcut of “Configure\Alarm” menu command.
This button is to configure historical logging. Click it to popup “Historical log
config” dialog box which is shortcut of “Configure\Historical logging” menu
command.
This button is to configure network. Click it to popup “Network config” dialog
box which is shortcut of “Configure\Network” menu command.
This button is to configure user and security zone. Click it to popup “User and
security zone manager” dialog box which is shortcut of “Configure\User” menu
command.
This button is to “Switch to Make”, namely switch to WindowMaker.
This button is to “Switch to View”, namely switch to TouchView.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-31
This button is to get KingView help information. It is the shortcut of
“Help\About” menu command.
4.2 New\Manage picture
4.2.1 How to create a picture
After create a new project by ProjectManager, user can enter TouchExplorer to
create pictures that has three methods.
First, click “Picture” in project list display area on the left side of TouchExplorer
so that “New” icon displays in list content display area on the right side of
TouchExplorer. Double-click the icon to popup “New picture” dialog box as below, or
right click “New”, it open the shortcut menu shown in Figure 4.31, select “New
Window” and the “New Window” dialog box opens.
WellinControl Technology Development Co.,Ltd
4-32 Chapter 4 KingView Development ----TouchExplorer
Figure 4.30 New picture
Figure 4.31 Shortcut menu of New picture
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-33
Second, Create picture in label “Picture”, refer to the section 4.2.3.2 for details.
Third, click “Make” button on the toolbar or right-click blank in TouchExplorer
to show a shortcut menu and select “Switch to Make” command from it to enter
WindowMaker. Then select “File\New picture” menu command to popup “New
picture” dialog box as below. Details about picture properties meanings in the section
“4.5.1.1 File\New picture”.
4.2.2 How to find picture
There are three tools to control picture display style (“Big picture”, “Small
picture” and “Details”) in the toolbar of TouchExplore. Pictures are displayed by order
of their names in content display area no matter the selected style. So you can find the
needed picture among ordered pictures.
In addition, KingView provides tools to find picture. Click “Picture” in project
list display area on the left side of TouchExplorer and right-click blank in
TouchExplorer to show a shortcut menu and select “Find” command from it to popup
find dialog box as below. Input the needed picture name and select search mode--fuzzy search and exact search, and then choose if editing it directly after finding. At
last, click “Ok” button to start searching. If it was found, the first qualified picture
would display highlight. If not, system would show a message that no picture found.
WellinControl Technology Development Co.,Ltd
4-34 Chapter 4 KingView Development ----TouchExplorer
Figure 4.32 Find picture
Items explanation:

Edit after find: If qualified picture were found, it would be opened and
enter WindowMaker.

Exact search: Search match whole words pictures according to picture
name characters.

Fuzzy search: Search picture contain certain characters in picture name
according to supplied characters. If found it, the picture name would be
highlight in picture list. If selected to edit, picture would be opened directly.
4.2.3 Manage pictures by group
When there are many pictures in project, developers find a certain picture with
some difficulty, and often need some picture with similar contents like IO acquiring
nodes pictures. If nodes have same work condition, pictures contain similar symbols.
Developers create pictures for each acquiring node from scratch, which increases
workload and wastes time. So KingView provides picture management by group to
solving the problem. Developers may put pictures into different group as requested,
which is convenient for modifying and selecting pictures. In addition, Kingview
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-35
provides Copy/Cut picture function to help developers Copy/Paste picture between/in
group, so may save time and avoid repetitious work. And developers may move
pictures from a group to other group via KingView Cut-Paste function.
4.2.3.1 Create picture group
There are four labels: “System”, “Tags” and “Station” and “Picture” on
TouchExplorer. Select “Picture” to enter Picture label page as below. “Picture” folder
is shown at the left of label page, pictures are shown at the right.
Figure 4.33 Picture label
Right click “Picture” folder and select “New picture group” in the popup menu,
so a new picture group is created in “Picture” folder and named with default group
name automatically. You can use the default name or rename.
You can create sub- picture group in picture group. Right click a picture group
WellinControl Technology Development Co.,Ltd
4-36 Chapter 4 KingView Development ----TouchExplorer
and select “New picture group” in the popup menu, so a sub-picture group is created
in the picture group. Note, allow creating 9-class sub-picture group in root picture
group at most, 256 sub-picture group in same class at most and total number of picture
groups doesn’t exceed 1000. As below, KingView interface contains picture group and
sub- picture group.
Figure 4.34 Create picture group
Name of picture group and sub- picture group must comply the name rule. If
inputting the error name, system popup “Invalid name” dialog box to prompt. The
name rule of groups:
New group name doesn’t exceed 31 characters.
First character of group name must be Chinese or standard characters, but illegal
characters like digit. The name cannot contain space, functor.
Don’t allow same group names under same class Group names match case.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-37
4.2.3.2 Create picture in picture group
You can create picture in picture group. Two ways to create picture in group: first,
select a picture group and right click “New” at the right picture view area, select
“New picture” in popup menu to show “New picture” dialog box. Input the picture
name then click OK to crate picture. Second, select a picture group and right click any
picture at the right picture view area, select “New picture” in popup menu. Refer to
the section 4.2.1 for the details of “New picture” dialog box. It has the similar method
to create picture in sub-picture group or “Picture” folder to above. Pictures created in
“Picture” label page may be displayed at picture display area of “System” label page.
Select “Picture” folder at “Picture” label page, you can see pictures without
groups at right picture view area. Pictures created at “System” label page are
displayed at right picture view area of “Picture” folder. As below, KingView interface
displays picture group with pictures.
Figure 4.35 Picture in picture group
WellinControl Technology Development Co.,Ltd
4-38 Chapter 4 KingView Development ----TouchExplorer
4.2.3.3 Copy/Paste pictures in picture group
Select one or more pictures to copy in “Picture” label page. Right-click to popup
the menu and select “Copy”. Select target picture group, right click at any position of
right view area and select “Paste” in popup menu, so copy a picture to target picture
group. The name of picture pasted is generated automatically,
4.2.3.4 Cut/Paste pictures in picture group
Select one or more pictures to cut in “Picture” label page. Right-click to popup
the menu and select “Cut”. Select target picture group, right click at any position of
right view area and select “Paste” in popup menu, so copy a picture to target picture
group.
4.2.3.5 Delete pictures in picture group
Select picture in Picture group. Right-click to popup the menu and select “Delete
**” (** stands for picture name). So the picture in the group is deleted.
4.2.3.6 Delete picture group
You can delete picture group not containing pictures.
When there are sub-picture groups in picture group, if you delete the picture
group, system will prompt you “Fail to delete picture group containing sub-picture
group”. So you must first delete those sub-picture groups then delete the picture group.
When picture group contains pictures, system popup the dialog box as below to
prompt confirming when you delete the picture group.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-39
Click “Yes” to delete picture group and contained pictures. Click “No” to delete
the picture group and to move pictures to higher class picture group.
Note:
1 Cannot rename and delete “Picture” folder in “Picture” label page.
2 Can do the copy, cut to pictures only in “Picture” label page but in “System”
label page.
3 Cannot copy and cut pictures between different projects.
4.3 Simple symbols
The graphic objects in WindowMaker are called symbols as well. KingView has
a number of simple symbols such as rectangle (rounded-rectangle), line, polyline,
ellipse (circle), pie (arc), bitmap, polygon, solid pipe, text and so on. Complex
symbols can be built by these simple symbols as well.
4.4 Complex symbols
Besides complex symbols made up of above simple symbols, KingView supplies
various special complex symbols such as button, real-time (historical) trend window,
alarm window, report window and so on. These special complex symbols let designers
free from repeat graph programming and concentrate to object control. Details about
special complex symbols will be highlight introduced in the following sections.
4.5 WindowMaker menu
WindowMaker is embedded in TouchExplorer which is the integrated
development environment of application. Engineers develop projects in this
WellinControl Technology Development Co.,Ltd
4-40 Chapter 4 KingView Development ----TouchExplorer
environment.
Click “Make” button on the toolbar in TouchExplorer or right-click blank in
TouchExplorer to show a shortcut menu and select “Switch to Make” command from
it to enter WindowMaker. It appears as below.
Figure 4.36 WindowMaker
WindowMaker hasn’t opened a picture at this moment, so only “File” and “Help”
shown in menu bar. When a picture was opened or created, WindowMaker menu
changed as below.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-41
Figure 4.37 WindowMaker menu
4.5.1 File menu
File menu is used to create, open, save and delete pictures. Certain menu bar is
grey means this menu command is invalid. Click “File” menu to popup dropdown
menu as below.
Figure 4.38 File menu
WellinControl Technology Development Co.,Ltd
4-42 Chapter 4 KingView Development ----TouchExplorer
4.5.1.1 File\New picture
This command is to create a new picture. Click “File\New picture” menu to
popup “New Picture” dialog box as below.
Figure 4.39 New picture
You can define many picture properties like name, picture size, position, style
and filename of picture which generated by KingView and can be changed according
to engineers needs.

Name: In the edit box, type the name of new picture which can be up to
20 characters long. If you check “Title bar” item in picture style, the name
would appear in the new picture's title bar.

Related: In the edit box, type the filename corresponding to the picture
or generate a default filename by KingView. The name can be up to 8
characters long. The extend name of picture file must be “.pic”.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer

4-43
Comment: In the edit box, type the comment of new picture which can
be up to 49 characters long.

Dimension: Input six numbers to decide the position and size of
windows and size of pictures.
Left, top: Left and top positions stand for coordinate of picture top left corner.
Width and height: It stands for displaying width and height of windows
counted by pixel.
Window width and height: It stands for picture size which is the whole
picture’s width and height and always bigger than or equal to window width and
height.
Large picture cruise function should be realized by setting window display size
and picture size in picture properties. Large picture cruise function makes KingView
picture out of screen-size limit and draw picture of any size. You can view picture by
dragging scroll bar and obtain picture moving and navigation functions in both
WindowMaker and TouchView.
The maximum and minimum a picture height and width are 8000×8000 and
50×50 respectively. If the assigned height and width is less than that of the display
picture, then the size of the assigned picture is automatically adjusted to the size of the
display picture. The displayed picture height and width must be no greater than its
assigned height and width.
If assigned picture size was less than or equal to window display size, scroll bar
didn’t appear; if assigned picture width was bigger than window width, horizontal
scroll bar appeared; if assigned picture height was bigger than window height, vertical
scroll bar appeared. When you drag scroll bar, the picture rolls as well. When picture
is rolling, if “Tools\Display navigation” was selected, a small window would appear
on the top right corner of picture called Navigation. When picture is rolling, the
rectangle moves following it which indicates the position of current window
appearing in the whole picture. It appears as below.
WellinControl Technology Development Co.,Ltd
4-44 Chapter 4 KingView Development ----TouchExplorer
Figure 4.40 Navigation function
WindowMaker can record the scroll bar position, that is to say, the picture would keep
last status when switching to this picture next time. When you reopen project, picture
will keep the status before close.
You can set window display size by dragging bottom right corner of the
picture and set window position by dragging top left corner of the picture.
When window display size is bigger than picture size after dragging, picture
size changes to window display size automatically.
Drag the right corner of picture by mouse, at the same time press down Ctrl key
to set picture display size equal to picture actual size on window display size.

Picture style title bar This item is to decide whether picture has title bar.
Check this item, WindowMaker title bar will show picture name.

Picture style size-control This item is to decide whether engineers can
change picture size in TouchExplorer. Change picture size is the same as change
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-45
WINDOWS window display size.
Note:
When you change picture size, picture would change display size without
changing actual size if you don’t press down <Ctrl> key. Picture display size keeps
in line with dragged picture size if you press down <Ctrl> key.

Picture Style: There are three picture styles available in Touchview.
“Overlap Mode”: when a new window pops up, it overlaps the current window.
Closing the new window will display the original windowagain.
“Substitute Mode”: when a new window pops up, all windows interacting with will
be closed without being saved. The “Substitute Mode” is recommended for saving
memory.
“Popup Mode”: In the “Popup Mode” when a window pops up, it is always the
current window. To carry out further actions in Kingview this window has to be
closed.
“Popup Mode” notices
1. When using the “Popup Mode”, the item “Title Bar” from “Window Style” can only
be used as WindowMaker. That is to say, TouchView will only display the Title Bar
no matter which window style is selected.
2. A Kingview project may contain multiple “Popup Mode” Windows. But when
WindowMaker is running, only one “Popup Mode” picture can be selected and
activated from the configuration page in the Touchview main screen.
3. If the windows in TouchView include a “Popup Mode” window, the “Popup Mode”
picture should always be the current picture.
4. If you open a “Popup Mode” picture in TouchView, all system menus will be
deactivated and you will not be able to close, open or hide other Kingview Picture s
pictures. Select the “Popup Mode” picture by clicking the relevant button in the tit
“Popup Mode” picture title bar or using script commands. The system will recover to
its original state when the “Popup Mode” picture is closed. Note that HideWindow
WellinControl Technology Development Co.,Ltd
4-46 Chapter 4 KingView Development ----TouchExplorer
function for hiding the pictures is invalid in the “Popup Mode” picture.
5. If you open a “Popup Mode” picture in TouchView, the TouchView Close button is
unavailable. If you want to exit the system, you have to close the “Popup Mode”
picture, use the shortcut key “Alt + F4” or use the script command “Exit (0)”.
 Picture style frame Picture frame has three kinds. Only if “size-changeable”
item was not selected, it would be available, otherwise it was invalid in grey.
 Picture style background color This button is to change background color of
window which color at the middle of button is the default background color.
Click this button to appear a floating palette window for choosing color.
 Scripts Scripts can execute on startup, on shutdown or while running timely
according to designer’s need. If you want to execute timely, you need indicate
interval. Click “Scripts” button to popup “Scripts” dialog box as below.
Figure 4.41 Picture scripts
There are three kinds of modes to execute scripts: on startup, on shutdown, while
running.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-47
On startup: When pictures change from on shutdown to on startup, scripts in “On
startup” edit-box will execute once.
While running: If only the picture exists, namely picture is opened, scripts in
“While running” edit-box will execute time after time on setup frequency.
On shutdown: When pictures change from on startup to on shutdown, scripts in
“On shutdown” edit-box will execute once.
Detail about scripts in the chapter 10 “Scripts”
Example:
Create a KingView picture by “New picture” command. The dialog box
“Picture properties” appears as below.
Figure 4.42 Create new picture
Click “Ok” button to finish new picture and enter WindowMaker as below.
WellinControl Technology Development Co.,Ltd
4-48 Chapter 4 KingView Development ----TouchExplorer
Figure 4.43 Open New picture
Because Defined picture size is 1024*768, while picture display size is 800*600, scroll
bar appears on the picture. Other parts of the picture can be shown by drag
horizontal\vertical scroll bar.
4.5.1.2 File\Open
This command is to open picture. Click “File\Open” menu to popup “Open
picture” as below.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-49
Figure 4.44 Open picture
All of unopened pictures in current path are shown in the picture. Select one or
more picture by mouse or space, or click “Select all” button to select all the pictures
which need to highlight displayed. “Clear” button is used to cancel all selected
pictures. Click “OK” to open all selected pictures and click “Cancel” to quit.
4.5.1.3 File\Close
This command is to close picture. Click “File\Close” menu to popup “Close
picture” as below.
WellinControl Technology Development Co.,Ltd
4-50 Chapter 4 KingView Development ----TouchExplorer
Figure 4.45 Close picture
All of opened pictures in current path are shown in the picture. Select one or
more picture by mouse or space, or click “All” button to select all the pictures which
need to highlight displayed. “Clear” button is used to cancel all selected pictures.
Click “OK” to close all selected pictures and click “Cancel” to quit.
If engineer has changed picture without saving, a dialog box popup which makes
engineer choose whether saving picture while picture is closed. It appears as below.
Figure 4.46 Save picture prompt
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-51
4.5.1.4 File\Save
This command is to save picture. Click “File\Save” menu to popup “Save
picture” as below.
Figure 4.47 Save picture
All of opened and changed pictures in current path are shown in the picture.
Select one or more picture by mouse or space, or click “Select all” button to select all
the pictures which need to highlight displayed. “Clear” button is used to cancel all
selected pictures. Click “OK” to save all selected pictures and click “Cancel” to quit.
4.5.1.5 File\Save all
This command is to save all pictures. Click “File\Save all” menu, KingView will
save all of the opened and changed pictures to corresponding files.
4.5.1.6 File\Delete
This command is to delete picture. Click “File\Delete” menu to popup “Delete
picture” as below.
WellinControl Technology Development Co.,Ltd
4-52 Chapter 4 KingView Development ----TouchExplorer
Figure 4.48 Delete picture
All of pictures in current path are shown in the picture. Select one or more
picture by mouse or space, or click “Select all” button to select all the pictures which
need to highlight displayed. “Clear” button is used to cancel all selected pictures.
Click “OK” to delete all selected pictures and click “Cancel” to quit.
KingView could popup a dialog box before deleting each picture to confirm whether
engineer want to delete it. It appears as below.
Figure 4.49 Confirm to delete picture
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-53
Click “Yes” or letter key “Y” to execute operation. And click “No” or letter key
“N” to quit operation.
4.5.1.7 File\Switch to View
This command is to enter TouchView directly from WindowMaker.
4.5.1.8 File\Switch to Explorer
This command is to enter TouchExplorer directly from WindowMaker.
4.5.1.9 File\Exit
This command is to minimize KingView WindowMaker and return to TouchExplorer
4.5.2 Edit menu
Edit menu command is to edit graphic objects. Click “Edit” menu to appear
dropdown menu as below.
WellinControl Technology Development Co.,Ltd
4-54 Chapter 4 KingView Development ----TouchExplorer
Figure 4.50 Edit menu
In order to use these commands, you should select graphic object need to edit
first (8 small rectangles appear around object), and select proper command from edit
menu. Grey menu command means this command is invalid to current graphic object.
4.5.2.1 Edit\Undo
This menu command is to cancel executed command and restart from last
operation.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-55
4.5.2.2 Edit\Redo
This menu command is to resume cancelled command and restart from last operation.
4.5.2.3 Edit\Cut
This menu command is to delete one or some selected graphic objects from
picture and copy to paste buffer. Cut command copies one or some selected graphic
objects to paste buffer which is the same as copy command. However, Cut command
deletes one or some selected graphic objects of current picture; on the contrary, copy
command keeps them.
4.5.2.4 Edit\Copy
This menu command copies one or some selected graphic objects to paste buffer.
When you select one or some graphic objects (8 small rectangles appear around
object), grey copy command will turn to normal color which indicates all of selected
graphic objects can be copied by this command. And this command will copy selected
graphic objects to paste buffer.
Example:
Click ellipse graphic object which has 8 small rectangles around it. Click
edit menu, some grey menu commands turn to normal color on shown dropdown
menu as below. Copy command is available on the edit menu.
WellinControl Technology Development Co.,Ltd
4-56 Chapter 4 KingView Development ----TouchExplorer
Figure 4.51 Copy object
Note:
This paste buffer used by WindowMaker isn’t clipboard of WINDOWS system,
therefore copy of graphic object only can be processed in WindowMaker.
4.5.2.5 Edit\Paste
This menu command is to copy one or more graphic objects in current paste
buffer to assigned position. This command is available only if copy or cut command
executed when “Paste” turns from grey to normal color as below.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-57
Figure 4.52 Paste object
Mouse cursor changes to “ Γ ” after “paste” executes. Move it to assigned
position and click mouse to paste ellipse to the position.
4.5.2.6 Edit\Delete
This command is to delete one or more selected graphic objects from picture.
Only if graphic objects are selected, delete command turns from grey to normal color
which is available.
4.5.2.7 Edit\Duplicate
This menu command is to copy one or more selected graphic objects from picture
directly rather than keep in paste buffer. When you select one or more graphic objects,
grey “Duplicate” command will turn to normal color which indicates this command
WellinControl Technology Development Co.,Ltd
4-58 Chapter 4 KingView Development ----TouchExplorer
can copy current one or more selected graphic objects. A new copied graphic object
appears beside original graphic object after “Copy” command executes.
4.5.2.8 Edit\Lock item
It is to lock and unlock symbol. When symbol is locked, cannot change symbol
position and size, but doesn’t affect the operations: Copy, Paste, Delete, Bring to front
and Send to back.
Two methods to lock symbol:
Method 1
Open WindowMaker. Select symbol to lock then click “Edit\Lock item”
menu as below.
Method 2
Open WindowMaker. Select symbol to lock then right click to popup
shortcut menu. Select “Lock” as below.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-59
Can not change position and size of locked symbol.
Unlock symbol
“Lock” menu is checked when symbol is locked. If you want to unlock the
symbol, click “Lock”.
4.5.2.9 Edit\Paste bitmap
This command is to copy bitmap in clipboard to selected bitmap object and zoom
it to suit bitmap object. KingView can supply various formats of images: like Bmp,
Jpeg, Gif and so on. There are two methods to load images to KingView bitmap:
 Open image file and select the part need to load. Copy selected part to
WINDOWS clipboard by using “Copy” command or hotkey <Ctrl>+<C>.
Click “Bitmap” button in toolbox entering WindowMaker and draw an area
in the picture, and then paste image to KingView picture by using “Paste
bitmap” command. (Details in section 4.5.2.11)
 Click “Bitmap” in toolbox to draw an area in the picture in WindowMaker.
Right-click to popup a shortcut menu in the area which appears as below.
WellinControl Technology Development Co.,Ltd
4-60 Chapter 4 KingView Development ----TouchExplorer
Figure 4.53 Load picture file
Select “Load from file” from the popup menu to show selecting file dialog box as
below. User can select an image file need to load from the dialog box and click
“Open” button so that the whole image could load to KingView bitmap object.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-61
Figure 4.54 Open picture file
These two methods of loading images have their own disadvantages:
 Second method can only load whole image, but easy to realize.
User can choose based on practical situation.
You can get example about how to operate bitmap in the section
“4.5.2.12Edit\Bitmap transparent”.
4.5.2.10 Edit\Bitmap-Original size
This menu command is to resume bitmap in selected bitmap object to image
original size without considering frame size of bitmap object. Bitmaps resume to
original size for avoiding image distortion caused by zooming. You can get example
about bitmap operation in the section “4.5.2.12 Edit\Bitmap transparent”.
4.5.2.11 Edit\Copy bitmap
This menu command is to copy bitmap in current selected bitmap object to
clipboard. Only if bitmap object is selected, Copy bitmap command is available. You
can get example about bitmap operation in the section “4.5.2.12 Edit\Bitmap
WellinControl Technology Development Co.,Ltd
4-62 Chapter 4 KingView Development ----TouchExplorer
transparent”.
4.5.2.12 Edit\ Bitmap transparent
This menu command is to switch bitmap from transparent to nontransparent.
When you paste bitmap from WINDOWS clipboard in WindowMaker, setup bitmap
transparent color which uses menu command “Bitmap transparent” so that color set in
bitmap is transparent which makes background covered by bitmap display
transparently.
Example: Bitmap operation
First step: Prepare bitmap
Draw a bitmap by painting tool (Such as Windows painting) as below.
Figure 4.55 Prepare a bitmap
Select part or all of image, press <Ctrl>+<C> or click “Edit\Copy” command.
Second step: Prepare paste bitmap
Click “Bitmap” icon in toolbox of WindowMaker, move mouse cursor to draw a
rectangle frame on the picture as below.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
Figure 4.56 Draw bitmap object
Select this bitmap object and right-click mouse to popup floating menu as below.
Figure 4.57Bitmap paste
WellinControl Technology Development Co.,Ltd
4-63
4-64 Chapter 4 KingView Development ----TouchExplorer
Select “Paste bitmap” to paste painted image as below.
Figure 4.58 Bitmap picture
Bitmap transparentized (optional operation)
Method 1: Select bitmap object before pasting, and click “Edit\Bitmap
transparent” or right-click to execute “transparentized”, then assign color need to
transparentize in the palette (take blue for example), finally paste bitmap. It
appears as below.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-65
Figure 4.59 Transparentize bitmap 1
Blue color in bitmap transparentizes to grey which is background color.
Method 2: Execute “Paste bitmap” first, and click “Edit\Bitmap transparent” or
right-click to execute “transparentized”, then assign color need to transparentize
in the palette (take red for example). It appears as below.
Figure 4.60 Transparentize bitmap 2
WellinControl Technology Development Co.,Ltd
4-66 Chapter 4 KingView Development ----TouchExplorer
Method 3: Absorb background color of bitmap as background color of window
by using blotter tool in palette to realize transparency.
Figure 4.61 Transparentize bitmap 3
Bitmap original size (Optional operation)
Execute “Paste bitmap” first, and click “Edit\Bitmap original size” or right-click
to execute “Resume original size”, namely bitmap object can be zoomed to the same
size as image original size which appears as below.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-67
Figure 4.62 Bitmap of Original size
4.5.2.13 Edit\Select all
This command is to select all the graphic objects on the picture.
Note:
Select symbols on the picture at the same time press <Ctrl> key to select several
symbols randomly.
4.5.2.14 Edit\Picture properties
This command is to edit picture properties. Click “Edit\Picture properties” to
popup “Picture properties” dialog box as below. This dialog box is the same as new
picture dialog box. Details in the section “4.5.1.1 File\New picture”.
WellinControl Technology Development Co.,Ltd
4-68 Chapter 4 KingView Development ----TouchExplorer
Figure 4.63 Picture properties
4.5.2.15 Edit\Animation links
This menu command is to show animation links of selected symbols. Click
“Edit\Animation links” after graphic object selected on the picture. “Animation links”
dialog box popup. You can double-click graphic object to popup it as well. Details
about how to build animation link for objects can be seen in the chapter 7 “Picture and
Animation links”.
4.5.2.16 Edit\Horizontal shift wizard
This command is to define animation links of symbols horizontal shift by
visualization wizard. After choosing a symbol, click this command to make mouse
cursor turn to “+”. Select the starting position for horizontal shift and click mouse to
make mouse cursor turn to arrow head to left which stands for distance to left symbol
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-69
moved while running. While you move mouse, arrow follows and draw a moving
track. After cursor moves left to left boundary, click mouse to make mouse cursor turn
to arrow head to right which stands for distance to right symbol moved while running.
While you move mouse, arrow follows and draw another moving track. After cursor
moves to right boundary, click mouse to popup horizontal shift animation links dialog
box. Details about how to build animation link for objects can be seen in the chapter 7
“Picture and Animation links”.
4.5.2.17 Edit\Vertical shift wizard
This command is to define animation links of symbols vertical shift by
visualization wizard. After choosing a symbol, click this command to make mouse
cursor turn to “+”. Select the starting position for vertical shift and click mouse to
make mouse cursor turn to arrow head to upper which stands for distance to top
symbol moved while running. While you move mouse, arrow follows and draw a
moving track. After cursor moves up to top, click mouse to make mouse cursor turn to
arrow head to lower which stands for distance to bottom symbol moved while running.
While you move mouse, arrow follows and draw another moving track. After cursor
moves down to bottom, click mouse to popup vertical shift animation links dialog box.
Details about how to build animation link for objects can be seen in the chapter 7
“Picture and Animation links”.
4.5.2.18 Edit\Slider horizontal input wizard
This command is to define animation links of symbols slider horizontal input by
visualization wizard. After choosing a symbol, click this command to make mouse
cursor turn to “+”. Select the starting position for horizontal shift and click mouse to
make mouse cursor turn to arrow head to left which stands for distance to left symbol
moved while running. While you move mouse, arrow follows and draw a moving
track. After cursor moves left to left boundary, click mouse to make mouse cursor turn
to arrow head to right which stands for distance to right symbol moved while running.
While you move mouse, arrow follows and draw another moving track. After cursor
WellinControl Technology Development Co.,Ltd
4-70 Chapter 4 KingView Development ----TouchExplorer
moves to right boundary, click mouse to popup slider horizontal input animation links
dialog box. Details about how to build animation link for objects can be seen in the
chapter 7 “Picture and Animation links”.
4.5.2.19 Edit\Slider vertical input wizard
This command is to define animation links of symbols slider vertical input by
visualization wizard. After choosing a symbol, click this command to make mouse
cursor turn to “+”. Select the starting position for vertical shift and click mouse to
make mouse cursor turn to arrow head to upper which stands for distance to top
symbol moved while running. While you move mouse, arrow follows and draw a
moving track. After cursor moves up to top, click mouse to make mouse cursor turn to
arrow head to lower which stands for distance to bottom symbol moved while running.
While you move mouse, arrow follows and draw another moving track. After cursor
moves down to bottom, click mouse to popup slider vertical input animation links
dialog box. Details about how to build animation link for objects can be seen in the
chapter 7 “Picture and Animation links”.
4.5.2.20 Edit\Rotation wizard
This command is to define animation links of rotating symbols by visualization
wizard. After choosing a symbol, click this command to make mouse cursor turn to
“+”. Select a proper position and click mouse to choose centre point for rotating, then
mouse cursor turns to arrow rotating counterclockwise which defines the starting
position and angle of rotation for symbol rotating counterclockwise. While you move
mouse around centre point, a dotted rectangle in symbol shape will rotate following
mouse cursor. After the starting position of rotating counterclockwise is defined, click
mouse to make mouse cursor turn to arrow rotating clockwise which defines the
starting position and angle of rotation for symbol rotating clockwise in the same way
as rotating counterclockwise. After the position of rotating clockwise is defined, click
mouse to popup rotation animation links dialog box. Details about how to build
animation link for objects can be seen in the chapter 7 “Picture and Animation links”.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-71
4.5.2.21 Edit\Tag substitute
This menu command is to substitute quoted tag name in the picture which
substitutes this tag to existed tag name in same type from “Tagname Dictionary”.
Click it to appear “Tag substitute” dialog box as below.
Figure 4.64 Tag substitute

“Old tag”: Input old tag name need to be substituted. Click the following
“?” button to popup “Select tag” picture for choosing tag name.
 “New tag”: Input new tag name. Click the following “?” button to popup
“Select tag” picture for choosing tag name.
 “Range\Selected symbol”: Only substitute old tag name of selected symbol
in current picture to new tag name.
 “Range\Current picture”: Only substitute old tag name in current picture to
new tag name.
 “Substitute way”: to select the tag substitute ways.
Refer to Chapter 5 Tag definition and management for details.
Note:
Tags in report and control can’t be substituted automatically. You have to do it
WellinControl Technology Development Co.,Ltd
4-72 Chapter 4 KingView Development ----TouchExplorer
manually.
4.5.2.22 Edit\String substitute
This menu command is to substitute text in the picture. Select a text object or a
button in the picture, then click “Edit\String substitute” to popup “String substitute”
dialog box or “Button properties” dialog box to change content of text object or button
label. It appears as below.
Figure 4.65 String substitute, Button properties
4.5.2.23 Edit\Insert control
This command is to open Control selecting window for creating control. Click
“Edit\Insert control” menu to popup “Create control” dialog box as below.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-73
Figure 4.66 Create control
Control is an important feature of KingView. It is developed by KingView which
is different from ActiveX control. KingView supplies a number of powerful and
convenient controls and they are becoming more and more. You can select needed
controls and insert them to the picture in “Create control” dialog box. Details can be
seen in the chapter 14 “Control”.
4.5.2.24 Edit\Insert general control
This command is to open General control selecting window for creating control.
Click “Edit\Insert general control” menu to popup “Create control” dialog box as
below.
KingView supplies ActiveX control. List box in “Insert control” dialog box lists
all of the ActiveX control names in local computer in details for selecting. ActiveX
control contains standard Microsoft control, custom ActiveX control registered on
Windows and expert ActiveX control. Details can be seen in the chapter 14 “Control”.
WellinControl Technology Development Co.,Ltd
4-74 Chapter 4 KingView Development ----TouchExplorer
Figure 4.67 Insert control
4.5.3 Arrange menu
Arrange menu is to adjust the list of graphic objects in the picture. Click
“Arrange” menu to popup dropdown menu as below.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-75
Figure 4.68 Arrange menu
Before using this command, you should select two or more graphic objects need
to adjust, and then select certain command from dropdown menu of “Arrange” to
execute related operation.
4.5.3.1 Arrange\Send to back
This command is to send one or more selected graphic objects to the back of all
other intersected graphic objects as background. This command is the opposite
operation of “Bring to front” which has exactly the same usages as it.
For example,
The following two symbols are intersected which rectangle is on the front of
ellipse. If you want to send rectangle to the back of ellipse, you should select
rectangle symbol first and execute “Arrange\Send to back” which result appears
WellinControl Technology Development Co.,Ltd
4-76 Chapter 4 KingView Development ----TouchExplorer
as below.
Before
After(Execute “Send to back”)
4.5.3.2 Arrange\Bring to front
This command is to bring one or more selected graphic objects to the back of all
other intersected graphic objects as foreground.
For example,
The following two symbols are intersected which rectangle is on the back of
ellipse. If you want to bring rectangle to the front of ellipse, you should select
rectangle symbol first and execute “Arrange\Bring to front” which result appears as
below.
Before
After (Execute “Bring to front”)
4.5.3.3 Arrange\Make cell
This command is to compose all of graphic cells or complex objects which can
setup animation links. The composed new graphic objects can’t setup animation links.
For example,
The following symbols are rectangle and ellipse. The left figure shows the status
that chooses both symbols before executing “Make cell” command. The right figure
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-77
shows the status after executing “Make cell” command.
Before
After (Execute “Make cell”)
4.5.3.4 Arrange\Break cell
The command is the converse operation of “Make cell” operation which breaks
composed graphic object by “Make cell” command to cells at one time holds their
previous properties in line.
4.5.3.5 Arrange\Make symbol
This command is to compose two or more selected basic symbols (without any
animation links) to one unit as a complex symbol. Some symbols can’t be used to
compose complex symbol as a basic symbol such as button, trend, alarm window,
linked object, another cell and so on.
For example,
There are two symbols as below. Select two symbols and execute “Make
symbol” command to compose them to a complex symbol.
WellinControl Technology Development Co.,Ltd
4-78 Chapter 4 KingView Development ----TouchExplorer
Figure 4.69 Make symbol
4.5.3.6 Arrange\Break symbol
The command is the converse operation of “Make symbol” operation which
breaks selected symbol to two or more basic symbols used before making symbol.
After executing “Break symbol”, animation links in previous symbols would
disappear and resume to the status without animation link before making symbol.
4.5.3.7 Arrange\Align
4.5.3.7.1 Arrange\Align\Align top
This command is to make the upper boundary of some selected graphic objects
align with the top one. Select some graphic objects and click “Arrange\Align\Align
top” menu.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
Before
4-79
After(Execute “Align top”)
4.5.3.7.2 Arrange\Align\Align middle
This command is to make the center of two or more selected graphic objects in
the horizontal line. Select some graphic objects and click “Arrange\Align\Align
horizontal” menu.
Before
After(Execute “Align horizontal”)
4.5.3.7.3 Arrange\Align\Align bottom
This command is to make the lower boundary of some selected graphic objects
align with the bottom one. Select some graphic objects and click
“Arrange\Align\Align bottom” menu.
Before
After (Execute “Align bottom”)
WellinControl Technology Development Co.,Ltd
4-80 Chapter 4 KingView Development ----TouchExplorer
4.5.3.7.4 Arrange\Align\Align left
This command is to make the left boundary of some selected graphic objects
align with the leftmost one. Select some graphic objects and click
“Arrange\Align\Align left” menu.
Before
After (Execute “Align left”)
4.5.3.7.5 Arrange\Align\Align center
This command is to make the center of two or more selected graphic objects in
the vertical line. Select some graphic objects and click “Arrange\Align\Align certer”
menu.
Before
After (Execute “Align center”)
4.5.3.7.6 Arrange\Align\Align right
This command is to make the right boundary of some selected graphic objects
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
align with the rightmost one.
“Arrange\Align\Align right” menu.
Before
Select
some
graphic
4-81
objects
and
click
After (Execute “Align right”)
4.5.3.8 Arrange\Space horizontal
This command is to make some selected graphic objects space horizontal. Select
some graphic objects first, then click “Arrange\Space horizontal” menu.
Before executing Space horizontal
After executing Space horizontal
4.5.3.9 Arrange\Space vertical
This command is to make some selected graphic objects space vertical. Select
some graphic objects first, then click “Arrange\Space vertical” menu.
WellinControl Technology Development Co.,Ltd
4-82 Chapter 4 KingView Development ----TouchExplorer
Before
After (Execute Space horizontal)
Note:
Space horizontal and space vertical can only operate single symbol.
4.5.3.10 Arrange\Flip horizontal
This command is to flip one or complex symbol composed by some graphic
objects horizontal. The flipping axis is the vertical axis of rectangle frame around
symbol or complex symbol. Some symbols can’t be flipped in one time.
4.5.3.11 Arrange\Flip vertical
This command is to flip one or complex symbol composed by some graphic
objects vertical. The flipping axis is the horizontal axis of rectangle frame around
symbol or complex symbol. Some symbols can’t be flipped in one time.
4.5.3.12 Arrange\90 degrees rotate clockwise
Rotate selected single symbol clockwise 90 degrees centered at symbol centre.
Complex symbol composed by some simple symbols can be rotated as well, but some
symbols can’t rotate at one time.
4.5.3.13 Arrange\90 degrees rotate counterclockwise
Rotate selected single symbol counterclockwise 90 degrees centered at symbol
centre. Complex symbol composed by some simple symbols can be rotated as well,
but some symbols can’t rotate at one time.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-83
4.5.3.14 Arrange\Snap to grid
This menu command is to show\hide grids on the picture and decide whether the
boundary of graphic object align with gridline. After snapping to grid, symbol shift
would be counted by gridline.
4.5.3.15 Arrange\Define grid
This menu command is to decide whether to display grid, grid size and whether
to snap to grid. Click “Arrange\Snap to grid” to popup a dialog box as below.
Figure 4.70 Define grid
When you check “Grid display”, grids show on the background of picture. After
checking “Snap to grid”, the boundary of each symbol would align with grid and
symbol shift would be counted by gridline.
4.5.4 Tools menu
Commands in tools menu are to activate drawing symbol status. Symbols contain
three kinds of simple symbols (which are line, fill shape and text) and some special
complex symbols (which are button, trend, alarm window) and so on. Each symbol
has its appearance properties such as line color, fill color, text color which can be
defined while drawing. If you want to choose a certain command in the tools menu,
click “Tools” menu to popup dropdown menu and check it. It appears as below.
WellinControl Technology Development Co.,Ltd
4-84 Chapter 4 KingView Development ----TouchExplorer
Figure 4.71 Tool menu
4.5.4.1 Tools\Select symbol
This command is to select, move and resize graphic objects. It is a default
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-85
operation mode and an auto-return mode after operating with other painting tools.
There are two ways to select object as below:
1. Click left mouse button among object to select a single object. At this point if you
press <Ctrl> key and click to select other objects, you can select some objects in one
time.
2. Move the cursor to a blank area of the picture. Depress the mouse button and drag
the mouse. A dotted selection rectangle with a small cursor appears. Drag the mouse
until you have completely surrounded all of the objects that you want to select.
Release the mouse button. All the objects that were completely within the rectangle
will be selected.
There are eight grey small rectangles around selected graphic objects located on
four tops and middle points of four sides on the dotted rectangle. If you selected some
objects, every object has eight rectangles around it.
Select one object
Select some objects
Move mouse to selected object, it turns to “+”. Hold mouse left button down to
move all selected objects to new position. Release the mouse button. When you move
mouse cursor on the eight small rectangles around objects, it would turn to doublearrow. Drag mouse to resize the object.
4.5.4.2 Tools\Reshape symbol
This command is to adjust the corner radius of rounded-rectangle, angle of arc or
pie, locations of each point on polygon, line or polyline. Select object which takes
small rectangle as each point in which the bigger one is the dragging focus. Dragging
the focus can reshape symbol. Switch focuses by TAB key and drag them by cursor.
WellinControl Technology Development Co.,Ltd
4-86 Chapter 4 KingView Development ----TouchExplorer



Click “Reshape symbol” menu command. Mouse cursor turns to arrow head
to bottom, “Tools\Reshape symbol” command is checked in one time.
Select object which takes small rectangle as each point in which the bigger
one is the dragging focus. It appears as below.
Switch and drag focuses to reshape symbol or you can switch focuses by
TAB key and drag them by cursor till satisfied to engineers.
4.5.4.3 Tools\Rounded-rectangle
This command is to draw rectangle or rounded-rectangle. Click “Tools\ Roundedrectangle” so mouse cursor turn to “+”.
1. Move mouse cursor to a starting position which is the top left corner of rectangle.
2. Depress the mouse left button and drag mouse to get another diagonal point of
rectangle. And the rectangle appears in dotted frame during dragging. If you need
a rounded-rectangle, you should use “Tools\Reshape symbol” menu as well which
appears as below.
4.5.4.4 Tools\Line
This command is to draw line. Click “Tools\Line” menu and draw two points of
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-87
the line.
1. Move mouse cursor to a starting position which is the starting point of the line.
2. Depress the mouse left button and drag mouse to get another point. Release the
mouse. The line appears between two points.
4.5.4.5 Tools\Ellipse (Circle)
This command is to draw ellipse (circle). Click “Tools\Ellipse (Circle)” menu.
Drag mouse to draw diagonal points of rectangle to get the tangent ellipse (circle).
1. Move mouse cursor to a starting position which is the top left corner of rectangle.
Notes: The rectangle is invisible. The ellipse (circle) is tangent to it.
2. Depress the mouse left button and drag mouse to get another diagonal point of
rectangle. And the ellipse (circle) appears in dotted frame during dragging.
4.5.4.6 Tools\Sector (Arc)
This command is to draw pie (arc). Click “Tools\Sector (Arc)” menu.
1. Move mouse cursor to a starting position which is the top left corner of pie
(arc).
2. Depress the mouse left button and drag mouse to get the tangent pie (arc).
3. If you want to draw arc, click “Tools\Fill properties” menu and select second
filling mode.
4. Select “Reshape symbol” menu command to adjust the inclination of arc.
4.5.4.7 Tools\Bitmap
This menu command is to draw bitmap object. Click “Tools\ Bitmap” which
makes mouse cursor turn to “+”.
1. Move mouse cursor to a starting position which is the top left corner of
bitmap rectangle.
2. Depress the mouse left button and drag mouse to get another diagonal point
of bitmap rectangle. And the bitmap rectangle appears in dotted frame during
dragging.
WellinControl Technology Development Co.,Ltd
4-88 Chapter 4 KingView Development ----TouchExplorer
3. Draw the bitmap by painting tool (like WINDOWS paint). Copy this bitmap
to WINDOWS clipboard. Then paste it to bitmap rectangle by “Edit\Paste
bitmap” command of KingView. Details in the section “4.5.2.12 Edit\Bitmap
transparent”.
Note:
The bitmap rectangle drawn by “Bitmap” command is different from rectangle
drawn by “Rounded-rectangle” command. The sorting method is:
Select bitmap rectangle. “Edit\Paste bitmap” command appears from grey
(unavailable) to bright (available). However, after selecting rectangle, “Edit\Paste
bitmap” command keeps in grey color (unavailable).
4.5.4.8 Tools \Polyshape
This command is to draw polygon. Click “Tools\Polyshape” menu which makes
mouse cursor turn to “+”.
1. Move mouse cursor to a starting position which is the starting point of the
polygon.
2. Depress the mouse left button and drag mouse to get one side of polygon.
Click mouse to fix this side.
3. Following above method to confirm other sides of polygon.
4. Finally double-click to finish the last point of polygon.
This command can not only draw every side of polygon, but also fill color to
the area among polygon.
4.5.4.9 Tools\Polyline
This command is to draw polyline. Click “Tools\Polyline” menu which makes
mouse cursor turn to “+”.
1. Move mouse cursor to a starting position which is the starting point of the
polyline.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-89
2.
Depress the mouse left button and drag mouse to get one side of polyline.
Click mouse to fix this side.
3. Following above method to confirm other sides of polyline.
4. Finally double-click to finish the last point of polyline.
This command can not only draw every side of polyline, but also fill color to the area
among polylines.
4.5.4.10 Tools\Text
This command is to input characters. Click “Tools\Text” menu which makes
mouse cursor turn to “I”. The method to input text shows as below:
1. Move mouse cursor to a starting position, click left key of mouse to confirm
this position which is the starting position for inputting text.
2. Input characters and click left key of mouse to finish.
If you want to change font and size, you need click “Tools\Font” command or
“Change font” button in the toolbox where you can choose any font Windows system
supports. Click “Text color” button in “Palette” tool to change color of text object.
4.5.4.11 Tools\Pipe
This command is to add pipe in the picture. Click “Tools\Pipe” and the mouse
cursor turns to “+”.
1. Move mouse cursor to a starting position which is the starting point of the
pipe.
2. Depress the mouse left key and drag mouse to get one side of pipe. Click
mouse to fix this side.
1. Following above method to confirm other sides of pipe.
4. Finally double-click to finish. And the polyline changes to pipe.
4.5.4.12 Tools\Pipe width
This command is to change width of selected pipe in the picture. Select needed
pipe to make menu command “Tools\Pipe width” turn bright. Click “Tools\Pipe
WellinControl Technology Development Co.,Ltd
4-90 Chapter 4 KingView Development ----TouchExplorer
width” menu to popup “Pipe Width” dialog box which appears as below.
Figure 4.72 Pipe width
Set the Width of pipeline, Color of the inner walls and the fluid flow Effect in the
dialog box. Once the “Flow” property has been set in the animation link pipeline (See
Ch7.3.17 Animation Link), you will see the flow effect in TouchView.
4.5.4.13 Tools\Fill attributes
Fill attributes is to fill assigned close area in some drawing mode. There are eight
fill attributes. If you want to change the fill attributes of a graphic object, please select
it first and choose one mode from “Tools\Fill properties” menu command. It includes:
The first one is solid filling which will fill all the graphic object with fill color except
sideline.
The second one is transparent mode in which fill color is unavailable. Graphic
object is whole transparent only with sideline in this mode. For example, rectangle
only has frame shown in this mode. Pie only has arc shown.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-91
Other fill properties could fill selected graphic objects with corresponding patterns.
Eight fill types
Rectangles with type 1, 2, 3, 4
4.5.4.14 Tools\Line attributes
Line attributes contain line type and line width. It has six kinds of line type and
five kinds of line width. If you want to change the line properties of a line or polyline,
please select it first and click “Tools\Line” menu. Select one kind from them.
WellinControl Technology Development Co.,Ltd
4-92 Chapter 4 KingView Development ----TouchExplorer
4.5.4.15 Tools\Font
This command is to change font default setting which follows these steps:
1. Select the object after text input. Click “Tools\Font” menu to popup “Font”
dialog box which appears as below.
2. Select needed font from “Font” check box, select needed font style from “Font
style” check box, select needed font size from “Size” check box. Then click
“OK” button to finish font changing in text object.
Figure 4.73 Font
4.5.4.16 Tools\Button
This command is to add button. Click “Tools\Button” menu, the mouse cursor
turns to “+”. The operation method is:
1. Move mouse cursor to a starting position which is the top left of the button.
2. Depress the mouse left key and drag mouse to get the opposite angle point.
The button size displays as dotted rectangle frame during dragging. Release
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-93
the mouse, the button appears and fixes.
Button has three types which are “Standard”, “Ellipse”, “Diamond”, meanwhile
three styles which are “Transparent”, “Floating”, “Bitmap”.
1. Setup button type: Right-click button, select “Button type” and choose one
type from it as below.
Figure 4.74 Setup button type
System default button type is rectangle.
2. Setup button style: Right-click button, select “Button style” and choose one
kind from it.
WellinControl Technology Development Co.,Ltd
4-94 Chapter 4 KingView Development ----TouchExplorer
Figure 4.75 Setup button style



Transparent: Button transparent which makes button color keep in line
with window color.
Float: It only appears while running. Only when you moved mouse
cursor on the button position, button would appear.
Bitmap: Select it to make “Load button bitmap” command available.
You can select three button types in the same time or select them randomly.
3. Load button bitmap: Right-click button, select “Load button bitmap” as below.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-95
Figure 4.76 Load button bitmap




Load normal bitmap: It is the bitmap in normal status while running.
Load focus bitmap: It is the bitmap in focus status, namely, when you move
the mouse cursor to button position, it appears.
Load down bitmap: It is the bitmap which appears while depress the mouse
left key.
Load disable bitmap: It is the bitmap which appears when users haven’t
obtained the access level of this button.
For example: Load button bitmap
1. Select “Button” from toolbox and draw a button on the picture.
2. Define the scripts for button operation while running: Double-click “Button” in
the picture, popup “Animation links” picture. Click “Scripts”—“On key up”
button. Input on the “Scripts” window: “ShowPicture (“Historical trend”);”
WellinControl Technology Development Co.,Ltd
4-96 Chapter 4 KingView Development ----TouchExplorer
command (“Historical trend” is a defined picture). Click “OK” to finish definition.
3. Right-click “Button” on the picture, select “Bitmap” of “Button style” from
shortcut menu.
4. Right-click “Button” on the picture, select “Load normal bitmap” of “Load button
bitmap” from shortcut menu to popup “Bitmap file” select window for selecting
needed image.
5. Following the operation in step 4, load “Load focus status bitmap”, “Load
depressing status bitmap”, “Load forbidden status bitmap” separately.
Save picture, switch to TouchView, the display condition of each status of button
bitmap can be seen.
Note:
Only if button defined animation links (like button script), button style and
button bitmap could be available whiling system running.
4.5.4.17 Tools\Menu
This command allows users to make frequently used functions to menu mode
which is easy to manage. And users can setup access level for this menu to improve
system security. Click “Tools\Menu” menu, the mouse cursor turns to “+”. The
operation method is:
1. Move mouse cursor to a starting position which is the top left of the menu button.
2. Depress the mouse left key and drag mouse to get the opposite angle point of the
menu button. The button size displays as dotted rectangle frame during dragging.
Release the mouse left key, the menu appears and fixes as below.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-97
Figure 4.77 Draw menu
3.
Menu definition. After drawing a menu, the more important thing is to
define functions of menu. Namely, define every item and its functions in the
menu. Double-click drawn menu button or right-click on the menu button.
Select “Animation links” to popup “Menu definition” dialog box as below.
Figure 4.78 Menu definition
WellinControl Technology Development Co.,Ltd
4-98 Chapter 4 KingView Development ----TouchExplorer
4.

Menu text: Define the name of main menu. User can input any text
including space. The text can’t be over 31 characters.
5. Items: Define the name of each submenu. Item definition is tree structure.
Users can make each function to dropdown menu mode.. Users can obtain
needed function by clicking the dropdown menu while running.
Custom menu supports secondary menu. Each menu can define 255 items or
sub-items at most. All items can input any text including space. The text can’t be
over 31 characters. The method of define secondary menu is:
Primary menu: Click the check box under “Items”. It appears shortcut command
as below.
Figure 4.79 Define primary submenu
Select “New item” command, it appears input submenu name status in the menu
item, namely, it creates a new primary submenu. After one item finished, press enter
key or click mouse left key to complete. Or you can use shortcut key <Ctrl>+N
directly to display input primary submenu name. Create a “Picture” menu button.
Create “Print” primary menu item as below.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-99
Figure 4.80 Menu

Secondary menu: Click the primary menu which needs to create submenu. Rightclick mouse to appear shortcut command as below.
Figure 4.81 Define secondary submenu
Select “New item” command, it appears input submenu name status in the menu
item, namely, it creates a new secondary submenu. After one item finished, press enter
key or click mouse left key to complete. Or you can use shortcut key <Ctrl>+U
WellinControl Technology Development Co.,Ltd
4-100 Chapter 4 KingView Development ----TouchExplorer
directly to display input secondary submenu name. Create two secondary menus in
“Print” primary menu: “Print real-time report” and “Print historical report” which
appears as below.
Figure 4.82 Menu
You can edit already created menus. Select the menu need to edit. Click mouse
left key to appear shortcut menu which contains “Edit (E)” and “Delete (D)”
commands. KingView supplies using shortcut key to edit menu as below.
<Ctrl>+N: New item
<Ctrl>+U: New subitem
<Ctrl>+E: Edit current selected item (subitem)
<Ctrl>+D: Delete current selected item (subitem)
Define a custom menu. It has two primary menus which are “Print” and “Page
setup”. “Print” menu has two secondary menus which are “Print real-time report” and
“Print historical report”.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-101
Figure 4.83 Menu

Scripts: Custom menu allows users click items to execute defined functions
whiling running. Click “Scripts” menu to appear “Scripts” window in which you
can write scripts in the edit box to finish functions need to be executed by menu
items.
This command is to execute a system function—void OnMenuClick (LONG
MenuIndex, LONG ChildMenuIndex). The parameters of the function are:
MenuIndex: Primary item index number,
ChildMenuIndex: Secondary item index number. If there is no secondary item, the
condition in the scripts should be ChildMenuIndex==-1.
In the edit box of scripts, define different functions on different values of MenuIndex
and ChildMenuIndex according to project need. MenuIndex and ChildMenuIndex are
both start from 0. MenuIndex==0 means the first menu in primary menu.
ChildMenuIndex==0 means the first secondary menu in the primary menu which
belongs to. It appears as below.
WellinControl Technology Development Co.,Ltd
4-102 Chapter 4 KingView Development ----TouchExplorer
Figure 4.84 Define menu function by scripts
The meaning of scripts is:
 Click the first item of dropdown menu—“Print”, appears next level submenu.
Click the first item of submenu—“Print real-time report” to execute function
ReportPrint2 (“Print real-time report”), namely print real-time data report.
 Click the second item of submenu—“Print historical report” to execute function
ReportPrint2 (“Print historical report”), namely print historical data report.
 Click the second item of dropdown menu—“Page setup” to execute function
ReportPageSetup (“Historical report”), namely setup historical data report page.
 Security: Define the access level while menu button running. Namely, users
without authorization can’t operate this button and execute functions of the menu.
 Access level: Input the priority of menu button in the access level text box. The
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer

4-103
range is 1~999.
Security zone: Click button on the right side, popup “Select security zone”
picture for selecting operating security zone of the menu button. Security zone
only allows choosing, input is unavailable for forbidding input error.
4.5.4.18 Tools\Button text
This menu command is to edit text on the button. Select the button object,
“Button text” command turns from grey (unavailable) to bright (available), which
means this command is available. The operation method is:
1. Click “Tools\Button text” menu to popup a dialog box as below.
Figure 4.85 Edit button text
2. Input text in the “Button text” edit box in dialog box. Click “Ok” button.
Note:
In KingView 6.5, button and all of basic symbols support button message text.
The text definition can be defined in animation links dialog box. Details in the
section 7.1.2.
4.5.4.19 Tools\Historical trend
This command is to draw historical trend. Historical trend can display historical
data on a formatted coordinate axis visibly. A historical trend object can draw graph
for eight variables at one time, and unlimited historical trend objects can be drawn in
WellinControl Technology Development Co.,Ltd
4-104 Chapter 4 KingView Development ----TouchExplorer
every picture.
The operation method is:
1. Click “Tools\Historical trend” menu. The mouse cursor turns to “+” and the
menu was checked.
2. Move mouse cursor to a starting position which is the top left of the
rectangle of historical trend.
3. Depress the mouse left key and drag mouse to get a rectangle. The historical
trend is drawn in the rectangle. Select the object can move or change size.
Double-click object to popup “Historical trend” dialog box to define the main
properties of historical trend. Details in the chapter 8 “Trend curve and other curves”.
Note:
These historical trends are the custom historical trends which are different with
the historical trend supplied in system symbol wizards.
4.5.4.20 Tools\Real-time trend
This command is to draw real-time trend. Real-time trend can display data
changing condition on a formatted coordinate axis visibly. A real-time trend object can
draw graph for four variables at one time, and unlimited real-time trend objects can be
drawn in every picture.
The operation method is:
1. Click “Tools\ Real-time trend” menu. The mouse cursor turns to “+” and the
menu was checked.
2. Move mouse cursor to a starting position which is the top left of the
rectangle of real-time trend.
3. Depress the mouse left key and drag mouse to get a rectangle. The real-time
trend is drawn in the rectangle. Select the object can move or change size.
Double-click object to popup “Real-time trend” dialog box to define the main
properties of real-time trend. Details in the chapter 8 “Trend curve and other curves”
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-105
4.5.4.21 Tools\Alarms
This menu command is to create alarm window. The operation method is:
1. Click “Tools\Alarm” menu. The mouse cursor turns to “+” and the menu was
checked.
2. Move mouse cursor to a starting position which is the top left of the
rectangle of alarm window.
3. Depress the mouse left key and drag mouse to get a rectangle. This dotted
rectangle defines the position and size of alarm window object. Select the
object can move or change size.
Double-click object to popup “Alarm window config properties page” dialog box
to define the main properties of alarm window. Details in the chapter 9 “Alarm and
event system”.
4.5.4.22 Tools\Report
This menu command is to create report window. The operation method is:
1. Click “Tools\Report window” menu. The mouse cursor turns to “+” and the
menu was checked.
2. Move mouse cursor to a starting position which is the top left of the
rectangle of report window. Depress the mouse left key and drag mouse to
get a rectangle. Release the mouse key to finish creating report. Details in the
chapter 17 “Report system”.
4.5.4.23 Tools\Display toolbox
This menu command is to switch floating toolbox from visible to invisible. The
default setting is visible when the menu is checked. Click “Tools\Display toolbox”
menu, the floating toolbox disappears in the picture and the check of menu is
cancelled. Click it once more to make toolbox visible again.
4.5.4.24 Tools\Display navigation
This menu command is to switch floating navigation from visible to invisible.
WellinControl Technology Development Co.,Ltd
4-106 Chapter 4 KingView Development ----TouchExplorer
The default setting is invisible when the menu is unchecked. This command is only
available when picture width (height) is bigger than display picture width (height).
Namely, it is available when large picture function is defined. You can get how to
setup picture size and display picture size in the section “4.5.1.1 File\New picture”.
Click “Tools\Display navigation” menu, the floating navigation appears in the
picture and the menu is checked. Click it once more to make toolbox invisible again.
It appears as below.
Figure 4.86 Navigation chart
Editing picture always appears in the navigation. The position of display picture
in the whole picture is a symbol rectangle in the navigation. The symbols in the
picture are zoom-in symbols. However, alarm window, report, KingView Control,
ActiveX Control are not really zoom-in symbols, they are just labels.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-107
The navigation size is fixed. When the length-width proportion of picture size is
not uniform with navigation proportion, the left side or the top is available area. Click
the blue title bar of navigation, drag the navigation to any position on the screen.
You can operate picture and navigation interactively:
1. The content of navigation is editing picture while navigation displaying.
2. You can switch in current opened pictures by Ctrl+Tab key except defined
but unopened pictures. If navigation was in display status, the content of
navigation would change followed picture change.
3. When you edit picture (draw, edit, delete, drag symbols and so on), the
content of picture would change if navigation was in display status.
4. When the picture is rolling, the symbol rectangle will move as well which
label display content in the navigation.
5. When you click a position in the navigation, the editing picture will move to
the position centered by the coordinate of that position. The symbol rectangle
will move without change which label display content in the navigation.
6. Click a position inside the symbol rectangle in the navigation. Depress the
mouse left key and drag mouse cursor to assigned position. Release the
mouse key. The editing picture moves to corresponding position
automatically.
7. If there is no roll bar existed, display navigation is unavailable.
8. When the navigation is in display status, the following operation will hide
navigation:
 Change picture size in picture properties which makes it equal to
display window size.
 Drag the mouse to change display window size which makes the
display window equal to picture size or bigger than picture size.
Deal with symbols in large pictures to make picture operation easier:
1. When you draw large symbol, picture will roll automatically if it goes
beyond picture display area. But symbol size is limited by picture size.
2. When you move symbol, picture will roll automatically if it goes beyond
WellinControl Technology Development Co.,Ltd
4-108 Chapter 4 KingView Development ----TouchExplorer
picture display area. But moving range is limited by picture size.
3. When you select symbol, picture will roll automatically if it goes beyond
picture display area. But selected symbol is limited by picture size.
4. The navigation would respond the operation if navigation was in display
status while executing above operations.
5. “Symbol” appears in above expression is a generalized concept which
contains simple symbol, complex symbol, wizards, KingView control,
standard ActiveX control.
4.5.4.25 Tools\Display palette
This menu command is to switch floating palette from visible to invisible. The
default setting is visible when the menu is checked. Click “Tools\Display palette”
menu, the floating palette disappears in the picture and the check of menu is cancelled.
Click it once more to make palette visible again.
4.5.4.26 Tools\Display brush type
This menu command is to switch floating brush type from visible to invisible.
The default setting is invisible when the menu is unchecked. Click “Tools\Display
brush type” menu, the floating brush type appears in the picture and the menu is
checked. Click it once more to make brush type invisible again.
4.5.4.27 Tools\Display line
This menu command is to switch floating line type from visible to invisible. The
default setting is invisible when the menu is unchecked. Click “Tools\Display line
type” menu, the floating line type appears in the picture and the menu is checked.
Click it once more to make line type invisible again.
Note:
You can get how to select and use tools in the section 7.2.1 of “Chapter 7
Pictures and animation links”.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-109
4.5.4.28 Tools\Full screen
The function of this menu command is the same as “Full screen” button in the
toolbox which displays WindowMaker in full screen. Click “Tools\Full screen”. Title
bar and menu bar of WindowMaker disappear. Click Full screen” button in the
toolbox. Title bar and menu bar of WindowMaker recur.
4.5.5 Wizards menu
Wizards menu is to open wizards, use wizards, create a new symbol wizard,
convert symbol and so on. Click “Wizards” menu to popup dropdown menu as below.
Figure 4.87 Wizards menu
4.5.5.1 Wizards\Create symbol wizard
This menu command is to convert simple symbols, complex symbols, cells or
combination of them to a symbol wizard. Select all of the graphic objects need to
convert to symbol wizard in the picture, execute this command. Input the name of
symbol wizard in the popup dialog box. Details in the section “13.3 How to create a
symbol wizard”.
4.5.5.2 Wizards\Convert to general symbols
This command is opposite to “Create a symbol wizard”. It is used to break up
WellinControl Technology Development Co.,Ltd
4-110 Chapter 4 KingView Development ----TouchExplorer
symbol wizard in the picture to graphic objects which composed to wizard. Details in
the section “13.5 How to convert symbol wizard to simple symbols”.
4.5.5.3 Wizards\Open wizards
This menu command is to open wizards manager where you can load various
symbol wizards to the picture. Click “Wizards\Open wizards” menu to popup
“Wizards manager” window as below.
Figure 4.88 Wizards manager
Select needed symbol wizard from wizards manager. Double-click the symbol
wizard. Wizards manager window disappears and WindowMaker appears. The mouse
cursor turns to “┍”. Move the mouse cursor to needed position and click mouse
left key to put symbol wizard to assigned position.
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
4-111
Most symbol wizards have link wizards or appearance setting which can make
symbol wizard have a link with tags in Tagname Dictionary. However, some symbol
wizards don’t have animation links and only can be used as images. After loading
symbol wizard to the picture, you can double-click symbol wizard to popup link
wizard. Every symbol wizard has its own link wizard. Generally, it is to link tags with
symbol wizard, and setup its appearance.
4.5.5.4 Wizards\Generate symbol wizard log
This menu command is to generate a log file based on C program for selected
symbol which need to create a symbol wizard. This log is helpful for creating
KingView symbol wizard by programming. You can get details in the section “13.7
About wizards development pack”.
4.5.6 Picture menu
The names of opened pictures are listed under picture menu. Select each item to
activate corresponding picture and make it show on the screen. Current picture is
checked as below.
Figure 4.89 Windows menu
4.5.7 Help menu
This menu command is to view KingView help file which appears as below.
WellinControl Technology Development Co.,Ltd
4-112 Chapter 4 KingView Development ----TouchExplorer
Figure 4.90 Help menu
4.5.7.1 Help\Contents
View KingView help content including TouchView menu help.
4.5.7.2 Help\Find
Popup “Searching Keyword” dialog box in KingView help. Engineers can search
help according to keyword.
4.5.7.3 Help\Index
Popup “Index Keyword” dialog box in KingView help. Engineers can search
help according to keyword.
4.5.8 Summary of KingView WindowMaker menu command
and shortcut key
4.5.8.1 File menu ALT+F
New picture
Open
Save
Delete
Exit
Ctrl+N
Ctrl+O
Ctrl+S
Ctrl+D
Ctrl+X
4.5.8.2 Edit menu ALT+E
WellinControl Technology Development Co.,Ltd
Chapter 4 KingView Development ----TouchExplorer
Cut
Copy
Paste
Delete
Select all
Picture properties
Ctrl+X
Ctrl+C
Ctrl+V
Del
F3
Ctrl+W
4.5.8.3 Arrange menu ALT+L
Send to back
Bring to front
Make symbol
Break symbol
Align top
Align middle
Align bottom
Align left
Align vertical
Align right
Space horizontal
Space vertical
Shift+F9
F9
F5
Shift+F5
Ctrl+F3
Ctrl+F7
Ctrl+F4
Ctrl+F5
Ctrl+F8
Ctrl+F6
Ctrl+F9
Ctrl+F10
4.5.8.4 Tools menu ALT+T
Display toolbox
Display navigation
F10
F11
4.5.8.5 Wizards
Open wizards
F2
4.5.8.6 Picture ALT+W
WellinControl Technology Development Co.,Ltd
4-113
4-114 Chapter 4 KingView Development ----TouchExplorer
4.5.8.7 Help ALT+H
Content
F1
WellinControl Technology Development Co.,Ltd
5-1
Chapter 5 Tag definition and management
Chapter 5
management
Tag definition and
Database is the heart of KingView. Working status of practical industry field
need to reflect on the screen by means of animation, instructions released by operator
need to send to field of production quickly, runtime database is the middle of them.
Therefore, database is the bridge to connect IO devices and computer.
The database contains the current value of tags including system tags and userdefined tags. The gather of all of the tags is called “Tagname Dictionary” which
records all of the available tags information.
5.1 Tag type
Tag defined in KingView system is totally different from variable defined in
general programming language such as BASIC, PASCAL, C which not only satisfy
the general need of programming, but also consider the special need of industry
control software.
5.1.1 Basic tag type
Tag basic type has two types: Memory tag and I/O tag. I/O tag is which can
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-2
exchange data directly with peripheral data collecting program, such as data collecting
devices (PLC, meter, etc) or other applications (DDE, OPC server, etc.). This kind of
data exchange is bidirectional and dynamic. Namely, whenever the value of I/O tag
changed during KingView running, the value would write to devices or other
applications. Whenever the value in devices or applications changed, the tag value in
KingView would update automatically. Therefore, data collected from devices and
commands sent to devices, such as “Reaction pot”, “Power switch”, etc, should be set
to “I/O tag”.
Memory tag is the tag which needn’t exchange data with other applications and
obtain data from devices, but it is necessary in KingView, such as intermediate
variables during computing process, can be set to “Memory Tag”.
5.1.2 Data type of tags
Data types of tags in KingView are similar with variables which general
programming languages mainly contain:
 Real Tag
It’s similar with float variable in general programming language which
is used to denote float data, the range of value is 10E-38~10E+38 and the
virtual value is 7 bits.
 Discrete Tag
It’s similar with BOOL variable in general programming language. It
has only two values 0 and 1 used to denote some switch values.
 String Tag
It’s similar with string variable in general programming language
which is used to record some strings with special meanings, like name,
password, etc. This tag supports compare and evaluation operation. The max
value of string length is 128 characters.
 Integer Tag
It’s similar with signed long integer variable in general programming
WellinControl Technology Development Co.,Ltd
5-3
Chapter 5 Tag definition and management
language which is used to denote signed long data, the range of value is (2147483648)~2147483647.
 Structure Tag
When structure tags are defined in project (details about defining a structure tag
in the section 5.5), dropdown list box of tag type will list defined structure tags
automatically. A structure tag is a kind of tag type which can contain many members;
each of them is a basic tag. Member type could be: memory discrete, memory integer,
memory real, memory string, IO discrete, IO integer, IO real, IO string.
Note:
Tag type of structure tag member must be defined before structure tag member
(details in the section 5.5). It includes discrete, integer, real, string and defined
structure tag. You can only adjust the tag by memory type or IO type in tag
definition window.
5.1.3 Special tag type
Special Tag type has alarm window tag, historical trend tag and system
predefined tag. These special tags realize KingView to open on industry control
software and generate man-machine interface.
 Alarm window tag
It’s created by defining alarm window while make picture. It has one
option in alarm window definition dialog box which is Alarm window name.
The content inputted here is Alarm window tag. This tag can’t be found in
Tagname Dictionary. It’s a special tag defined by KingView. Some
characters of alarm window can be setup or edited by scripts, such as
changing alarm group name or priority, turning pages among the window,
etc.
 Historical trend tag
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-4
It’s created by defining Historical Trend while make picture. It has one
option in Historical trend definition dialog box which is Historical trend
name. The content inputted here is Historical Trend tag. This tag can’t be
found in Tagname Dictionary. It’s a special tag defined by KingView. Some
characters of Historical trend can be setup or edited by scripts, such as
changing the starting time and displaying interval and so on.
 System predefined tag
There are 8 time tags defined in the system database which can be used
directly:
 $Year: Return year in system current date.
 $Month: Return an integer among 1 to 12 which stands for month of
current date.
 $Day: Return an integer among 1 to 31 which stands for day of current
date.
 $Hour: Return an integer among 0 to 23 which stands for hour of
current time.
 $Minute: Return an integer among 0 to 59 which stands for minute of
current time.
 $Second: Return an integer among 0 to 59 which stands for second of
current time.
 $Date: Return string standing for current date.
 $Time: Return string standing for current time.
Tags above are updated automatically. Engineers can only read the
time, but can’t edit them.
Other predefined tags:
 $Username: Record the name of current login user while running.
 $Accesslevel: Record the access level of current login user while
running.
The usages of above tags can be seen “Access level and password
setting”.
WellinControl Technology Development Co.,Ltd
5-5
Chapter 5 Tag definition and management


 $Runninghistoricallog: Label whether history record started.
(1=started, 0=not started)
Engineers can set the tag to 1 by on key up command while
programming. When program running, users can control it by pressing
down button to startup history record.
$Runningalarmlog: Label whether alarm record started. (1=started,
0=not started)
Engineers can set the tag to 1 by on key up command while
programming. When program running, users can control it by pressing
down button to startup alarm record.
$Newalarm: Whenever alarm occurs, “$Newalarm” will be set to 1
automatically. And then engineers resume the value to 0.
Engineers can configure by data change scripts while
programming. When alarm occurs, will sound alarm generate (use
PlaySound( ) function). When program running, users can control the
tag. After alarm, it should be set to 0 to confirm alarm. It appears as
below.
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-6
Figure 5.1 System tag citing
 $Runningbackscripts: Label whether back scripts started. (1=started,
0=not started)
Engineers can set the tag to 1 by on key up command while
programming. When program running, users can control it by pressing
down button to startup back scripts.
 $Hotstandbystatus: Label the host and standby computers status.
Integer (1=host computer works in order, 2=host computer doesn’t
work properly, -1=standby computer works in order, -2=standby
computer doesn’t work properly, 0= no hot-standby). Host and standby
computers initial states are decided by network configuration of
KingView. It only can be edited in host computer. Standby computer
only can monitor it.
 $Millisecond: Return the millisecond number of current system. (It
hasn’t been supported in this version yet.)
WellinControl Technology Development Co.,Ltd
5-7
Chapter 5 Tag definition and management
 $Networkstatus: Users obtain the network communication
status by importing the $ Network status tag from the net node. Display
data is from 0 to 5 in which 0 stands for halting network. 1 to 4 stand
for network communicates with any one from potential four network
cards. 5 stands for communication failed. When it is the number
between 1 and 5, users can only change the number to interrupt the
communication. No other numbers can be used for the tag. But when
the number is 0, no matter what data users inputted, the number of
register turns to 5 and the network communication attempts to recover.
(It hasn’t been supported in this version yet.)
5.2 Basic tag definition
Memory discrete, memory integer, memory real, memory string, IO discrete, IO
integer, IO real, IO string, these eight kinds of basic tags are defined by “Tag
properties” dialog box. Meanwhile you can set parts of tag properties in the properties
page of it.
5.2.1 Define tag and tag properties
Select “Tagname dictionary” from left side of the TouchExplorer. All of the
defined tags of current project would display in the content display area on the right
side. Double-click “New” icon to popup “Define tag” dialog box. Tag properties have
three properties pages which contain basic properties, alarm configuration, logging
configuration. Click the properties label on the top of page to make page available.
You can define corresponding properties. The “Tag properties” dialog box appears as
below:
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-8
Figure 5.2 Tag basic properties
Click “OK”. Save new tag name to Tagname Dictionary while defined tag is
available. If the tag name was illegal, a dialog box would popup to remind you to edit
tag name. Click “Cancel”. The defined tag is invalid and return to “Tagname
Dictionary”.
5.2.2.1 Basic properties definition
Each item of the basic properties page in “Tag properties” dialog box is to define
the basic characters of tag.
 Tag name: It labels the name of tag in an application. Tag name can’t be repeated
in the same application. Tag name need match case and can’t be over 31
characters. Click any position in the edit box to enter edit status. Engineers can
input tag name whose first character can’t be number. For example, temperature,
pressure, liquid level, var1 and so on. The tag name can’t be over 31 characters.
WellinControl Technology Development Co.,Ltd
5-9
Chapter 5 Tag definition and management
KingView tag name rules:
Tag name can’t be the same as existed tag names, function names, keyword,
component names and so on. The first character of name only can be a letter. It
can’t be a number and other illegal characters. It can’t have illegal characters like
space, math operators. The tag name can’t be over 31 characters.





Tag type: There are eight kinds of basic types in the dialog box. Click tag type
dropdown list box to list all of data types. When a structure template is defined, it
is just a kind of tag type.
Description: for inputting the comment of tags. For example, if you want to
display the comment of a certain tag in alarm window, you need add some
comment in the description edit box while defining the tag, meanwhile you need
add a description item in the alarm window. Therefore, the comment of the tag
can be seen in the alarm window of TouchView (can’t be over 39 characters).
Changing precision: It’s available when data type is analog value or integer type.
Only if the changing range of the variable is bigger than “Changing precision”,
KingView updates the linked pictures (the default value is 0).
Min value: The lower limit of the tag in the database.
Max value: The upper limit of the tag in the database.
Note:
The max precision of KingView is float type which is four bytes. Don’t
overrange while defining max value.



Min original value: When tag is IO analog type, it is the lower limit of the input
original analog value from the driver. (Refer to the KingView driver online help)
Max original value: When tag is IO analog type, it is the upper limit of the input
original analog value from the driver. (Refer to the KingView driver online help)
Four items above is necessary for auto-exchanging project values to IO analog.
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management




5-10
The acquired data can be auto-exchanged to project value according to the
relation between four items.
Save parameters: When KingView is running , changes to the tag fields (which
are set to read/write ) will automatically be saved on exiting .KingView will
show the changes as the present tag fields when the system starts up again.
Save values: When KingView is running, changes to tag values will
automatically be saved on exiting the system. KingView will show the changes
as the present tag values when the system starts up again.
Initial value: It’s related to defined tag type. You can input a number in the edit
box during analog definition. You can select on and off during discrete definition.
You can input a string in the edit box during string definition. All of them define
the initial value of tags while system running.
Device: It’s only available to I/O tags. Engineers only need to select
corresponding device from “Connect device” dropdown list box. The device
name listed in the list box is installed logic device name in KingView device
manager. If users want to user the I/O device, click “Connect device” button.
“Tag properties” dialog box minimizes to a small icon and appears on the bottom
left corner of the screen. Meanwhile “Device configuration wizard” dialog box
popup. Engineers can install the corresponding device according to wizard. Close
“Device configuration wizard” dialog box after installing, “Tag properties”
dialog box popup again. Engineers can define their own logic device names from
device manager directly.
Note:
If the connected device is the Windows DDE service program, the option name
of “Connect device” is “Item name”. If the connected device is PLC, the option
name of “Connect device” is “Register”. If the connected device is IO board, the
option name of “Connect device” is “Channel”.

Item name: If the connected device is DDE device, the item names of DDE
WellinControl Technology Development Co.,Ltd
5-11 Chapter 5 Tag definition and management





conversation can refer to Windows DDE exchange protocol data.
Register: It assigns the tag name of the register communicated with KingView
defined tag. The register is related to assigned connected devices.
Conversion mode: It defines the mode of converting I/O analog input original
value to the database value. It contains linear conversion, extraction conversion,
non-linear table, add up and so on. You can get details about conversion in the
section “5.5 IO tag conversion mode”.
Data type: It’s only available to I/O tags. It’s used to define the data type of
register which contains 9 types for using. The 9 kinds of data type are:
BIT: 1 bit the range is 0 or 1.
BYTE: 8 bits, 1 byte the range is 0~255
SHORT: 2 bytes
the range is -32768~32767
UNSHORT: 16 bits, 2 bytes the range is 0~65535
BCD: 16 bits, 2 bytes the range is 0~9999
LONG: 32 bits, 4 bytes the range is -2147483648~2147483647
LONGBCD: 32 bits, 4 bytes the range is 0~4294967295
FLOAT: 32 bits, 4 bytes
the range is 10e-38~10e38, the effective bit is
7 bits.
STRING: 128 characters long.
Data type of each register can be seen in the device help of KingView driver help.
Acquire frequency: It’s used to define the sampling frequency of tags and
relevant with KingView reference frequency.
RW properties: It’s to define the RW properties of tags. Engineers can define
tags to “Read-only”, “Write-only”, “Read-write” properties according to project
need.
Read-only: assign generally Read-only to tags only acquired but changed
manually, and exported to lower devices.
Write-only: The tags which need output but don’t need read back are
defined to
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-12
Note:
While acquire frequency is 0, if only the tag value of KingView changed, it
would appear write operation. While acquire frequency is not 0, it would export
value to devices periodically according to acquire frequency.

Read-Write: The tags which need output and read back are defined to
Read-write
Permit DDE access: KingView exchanges data with peripheral device with
build-in driver. In order to make engineers access tags by other applications,
check “Permit DDE access”, so KingView, as DDE server, can exchange data
with DDE client program. The detail is in the chapter 18 DDE between
KingView and other applications.
You can get details about alarm properties definition in the chapter 9 “Alarm
and event system” and historical record properties in the chapter 24 “KingView
history”.
5.3 Structure tag
Generally, an object has various parameters. Meanwhile, there are many objects
which have the same parameters. Like a deposit pot, might has many parameters such
as pressure, liquid level, temperature, upper/lower limit alarm, etc, which appears a lot
times in one project. If users defined a tag for every parameter in every object, it
would be very difficult to find a certain tag. Meanwhile, it will take a long time to
define a tag and most defined tags have duplicate properties. If you set all of these
parameters as the properties of an object tag and define it directly while using, it will
reduce a great amount work and improve the efficiency. Therefore, KingView
introduces the concept of structure tag.
5.3.1 What’s structure tag
WellinControl Technology Development Co.,Ltd
5-13 Chapter 5 Tag definition and management
In order to make users define tags quickly and in batches, KingView
supports structure type and use it to define structure tag. Structure tag is to use defined
template to define tag. The template contains several members. If the defined tag type
is the template data type, all the members of the template become the basic tag of
KingView. One structure template can define 64 members at most. The template in
structure tag permits two level nesting. Namely, you can nest other template data type
to the data type of a member of a template after defining many templates.
5.3.2 Structure tag definition
Firstly, template and members and their properties need to define for using
structure tag.
Select the structure tag from the database in TouchExplorer which appears as
below.
Figure 5.3 Select to define structure tag
Double-click the icon on the right side to enter the structure tag definition dialog
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-14
box. It appears as below.
Figure 5.4 Structure tags definition
It has “New structure”, “Add member”, “Edit”, “Delete” functions in the
structure tag definition dialog box. Like a deposit pot, it has some parameters such as
pressure, liquid level, temperature, upper/lower limit alarm, etc. Let’s take an example
to explain the definition and use of structure tags.
 New structure: Add a new structure. Click “New structure” button to popup
structure tag name input dialog box. Input structure tag name. Click “OK” and
show user-defined template in the structure tag tree content.
WellinControl Technology Development Co.,Ltd
5-15 Chapter 5 Tag definition and management
Figure 5.5 Input structure tag name
Note:
The first letter of template name and member name can’t be a number. No
space allowed among the name. Naming must observe the KingView tag naming
rules.
For example, input “DepositPot” in the structure tag name input dialog box.
Click “OK” button. Close the dialog box. Therefore, a new structure is added on the
structure tag definition interface as below.
Figure 5.6 New structure

Following the above method, you can create many structures.
Add member: Select a template appearing as below. Click <Add member> button
to popup “New structure member” dialog box as below.
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-16
Figure 5.7 Structure tag definition

The dialog box is the same as basic tag definition properties dialog box. Users
can define various properties of structure member directly, like basic properties,
IO properties, alarm properties, record properties, etc. Input member name in the
member name edit box. Click member type list box and select the data type of
this member. Otherwise, if users define other templates and define structure
members in them, the name of other template will appear in the data type. Users
can select template as data type and embed it to current template which appears
as below.
WellinControl Technology Development Co.,Ltd
5-17 Chapter 5 Tag definition and management
Figure 5.8 Structure tag definition
All of properties definitions are all the same as basic tag properties definition.
After definition, click <OK> button to close dialog box.
Following the above method, you can add other members into the member list. It
appears as below. Click “OK” button in the dialog box to confirm completing.
Figure 5.9 Complete definition

Edit: It can be used to edit template and members.
Edit template: Select a template, click <Edit> button. You can edit template name.
Edit template member: Select a member, click <Edit> button. You can edit
template member name and member type. After editing member properties, a message
popup to prompt whether applies the change of current member properties to defined
structure tag and the structure using this tag. If you want to confirm changing all of
the related properties, please select “Yes”. If you only want to change current member
properties, please select “No”.
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-18
Click <OK> button to close the dialog box after definition finished.
Note: Template or member can’t be edited in the following situations.
1.Needed template is cited by other template members, and the citing template has
defined structure tags.
2.Needed template has defined structure tags, and the structure tag has been used
(Picture, Script).
3.Needed template member corresponding template is cited by other template
members and the citing template has defined structure tags.
4.Needed template member corresponding template has defined structure tags, and
the structure tag has been used (Picture, Script).
5.Template member with nesting structure.
6.When the template member type belongs to other templates, the type of template
member can’t be edited.

Delete template or member: Select a template or member. Click <Delete> button.
Note: Template or member can’t be deleted in the following situations.
1. Needed template is cited by other template members.
2. Needed template has defined structure tags.
3. Needed template member corresponding template is cited by other template
members.
WellinControl Technology Development Co.,Ltd
5-19 Chapter 5 Tag definition and management
5.3.3 Use structure tag

Define tag of structure tag type
If structure tag and members are defined, when you define tag and select tag
type in Tagname Dictionary, all of template names will appear in the dropdown
list box besides eight basic types in which one template is one tag type. Click
Tagname Dictionary in TouchExplorer. Click “New” on the right side to popup
tag properties dialog box which appears as below.
Figure 5.10 Select structure tag type
Input the object name (or basic tag name) in the tag name. Select data type
for “Deposit pot” just defined in “Tag type” list which appears as below.
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-20
Figure 5.11 Structure tag
Select every member for the structure in structure members. Select the tag
type for the member in the member type (Because the data type has been defined
while defining structure tag, it is just select from memory type or I/O type).
Other items definitions are the same as basic tag definition. Click <OK> to finish
after definition is complete. In this way, define a tag in the Tagname Dictionary,
by using structure tag, this tag stands for many tags (Because one structure has a
lot of members). The ID number of structure tag displayed in Tagname
Dictionary list is the ID number of last member, each of which can be distributed
an ID number automatically.
 Using structure tag in the project, tag expression format is tag
name.structure member name in KingView tag properties dialog box.
Select a tag in the tag explorer as below.
WellinControl Technology Development Co.,Ltd
5-21 Chapter 5 Tag definition and management
Figure 5.12 Structure tags in TouchExplorer
Select structure tag name “Deposit pot 1” in the index of node name “Root
node”. Therefore, all member tags show in the tag list on the right side. It appears
as below.
Figure 5.13 Use structure tag
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-22
Nesting structure tags also can be defined. Firstly, create a structure in
structure tag definition dialog box, or select defined structure. Select “Add
member”.
Figure 5.14 Define nesting structure
Select defined structure while defining the tag type of member as below. For
example, select defined template “Deposit pot” to the data type of new structure.
WellinControl Technology Development Co.,Ltd
5-23 Chapter 5 Tag definition and management
Figure 5.15 Select nesting structure tag
The format of nesting structure tag is Tag.Template.Member which appears
as below.
Figure 5.16 Nesting structure tag
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-24
5.4 Tag properties—Tag field
Tag properties are an important concept for satisfying the needs of industry
control software. It reflects parameters status, alarm status and historical record status
of tags. Like float tag “Reaction pot temp”, it has two properties which are “Upper
alarm limit” and “Lower alarm limit”. When the temperature is higher than “Upper
alarm limit” or lower than “Lower alarm limit”, the alarm shows in alarm window.
And most of them are open, engineers can set parts of properties while defining tags.
Scripts also can be used to read or set tag properties. For example, when the situation
changed, the “Upper/lower alarm limit” of “Reaction pot” needs to be reset. It’s
noteworthy that some properties can be read or setup called “Read-write” type. Some
properties can be read, but can’t be setup called “Read-only”. Some properties can be
setup, but can’t be read called “Write-only”. Therefore, KingView functions are highly
improved.
5.4.1 What is tag field
Tag properties are called “Tag field” in professional glossary. Citing tag field is
to connect tag name and field name with “.” which similar with the “Structure” in
advanced language (C++). For example, the alarm group name field of tag “Reaction
pot temp” should be “Reaction pot temp.Group”.
5.4.2 Various tag fields
More tag fields means more abundant properties. Different kinds of tags have
different fields.
1. Basic Tag field
Basic attribute fields include: name, comment, quality relevant field, relevant
WellinControl Technology Development Co.,Ltd
5-25 Chapter 5 Tag definition and management
time field.
Name: stands for the tag name, string, read-only.
Comment: stands for the comment of tag, string, read-write.
Quality relevant field: represents the good/bad quality of tag data which includes:
Quality:
QualityString:
stands for the value of tag quality stamp, integer, read-only
stands for the value of tag quality stamp string, string, read-only
Time relevant field: represents the tag data acquisition time which includes:
TimeYear:
TimeMonth:
TimeDay:
TimeHour:
stands for the year value of tag time stamp, integer, read-only
stands for the month value of tag time stamp, integer, read-only
stands for the day value of tag time stamp, integer, read-only
stands for the hour value of tag time stamp, integer, read-only
stands for the minute value of tag time stamp, integer, read-only
TimeMinute:
stands for the second value of tag time stamp, integer, read-only
TimeSecond:
TimeMsec:
TimeZone:
stands for the millisecond value of tag time stamp, integer, readonly
stands for the time zone value of tag time stamp, integer, readonly
stands for the string of tag time stamp date part, string, read-only
TimeDateString:
stands for the string of tag time stamp time part, string, read-only
TimeTimeString:
All KingView tags (except alarm and historical curve tags) have the 14 fields
mentioned above.
In addition, IO integral and IO real tags have the 4 fields shown below:
MaxEU: Maximum: analog type, read-write
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-26
MinEU: Minimum : analog type, read-write
MaxRAW: Max original tag value, analog, read-write
MinRAW: Min original tag value, analog, read-write
EMS memory integral and EMS memory real tags also have MaxEU and MinEU
fields
For example:
Figure 5.17 Tag field definition
The value of Test.Name is “test”. The value of Test.Comment is “This is a test”.
The value of Test.MaxRAW is 100. The value of Test.MinRAW is 0.
2. Tag alarm fields
Dispersed tag alarm fields include:
Ack:
stands for whether alarm is responded, discrete,
read-only
Alarm:
stands for whether alarm is existed, discrete,
read-only
AlarmEnable
stands for the alarm enabling status of alarm,
discrete, read-write.
WellinControl Technology Development Co.,Ltd
5-27 Chapter 5 Tag definition and management
DataChanged
DataUpDate
Group:
Priority:
It shows the changeable state of the tag, when a
tag changes, the value is 1, users can manually
assign to 0, discrete type, with read-write
available.
It shows the changes of tag’s state, discrete
type, read-only. The default state was “false”.
When collected data from the device, filled with
real-time database (regardless of the change),
the value was set to “true”, need to manually
reset.
stands for the alarm group ID tag belongs to,
analog, read-write
stands for the alarm priority of tag, analog,
read-write
ExtendFieldString1: stands for the extend field 1 of alarm tag, string,
read-write
ExtendFieldString2: stands for the extend field 2 of alarm tag, string,
read-write
Tip: The value of Group field (alarm group) can be only edited by scripts.
Integral and Real tags include the same fields as the dispersed tag as well as the
following:
HiHiLimit:
HiHi alarm limit, analog, read-write
HiHiStatus:
HiHi alarm status, discrete, read-only
HiLimit:
Hi alarm limit, analog, read-write
HiStatus:
Hi alarm status, discrete, read-only
LoLimit:
Lo alarm limit, analog, read-write
LoStatus:
Lo alarm status, discrete, read-only
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
LoLoLimit:
LoLo alarm limit, analog, read-write
LoLoStatus:
LoLo alarm status, discrete, read-only
MajorDevPct:
Major deviation alarm limit, analog, read-write
MajorDevStatus:
Major deviation alarm status, discrete, read-only
MinorDevPct:
Minor deviation alarm limit, analog, read-write
5-28
MinorDevStatus: Minor deviation alarm status, discrete, read-only
DevTarget:
Target value of deviation alarm limit, analog, read-write
RocPct:
Rate of change alarm limit, analog, read-write
RocStatus:
Rate of change alarm status, discrete, read-only
Example:
Here is an I/O discrete tag “Power off protection” in the database. The command
statement below can be used for adding one level of alarm priority:
Power off protection.Priority= Power off protection.Priority-1 (The smaller the
number, the higher the priority.)
Example:
Define an I/O float tag “Reaction pot temp” in the database which contains above
22 fields. If the minor deviation alarm status of “Reaction pot temp” is needed, the
expression should be: Reaction pot temp. MinorDevStatus.
3. Historical tag records can control the field
Historical tag records can control the field RecLogEnable, which represents the
status of the historical tag records. Read-write: 0 stops the recording of historical data;
1 records historical data, and sets it as the default data. Character strings do not have
the RecLogEnable field.
Example:
WellinControl Technology Development Co.,Ltd
5-29 Chapter 5 Tag definition and management
When defining an I/O Real Tag as “retort temperature” in the database, if
stop the tag historical data, the following script can be used:
Retort temperature RecLogEnable=0
4. Alarm Window Field
Includes:
stands for the alarm group name tag belongs to, analog, readGroup:
write
Priority: stands for the alarm priority of tag, analog, read-write
For example:
Define an alarm group name “First workshop”. In order to make alarm window
tag “Plant alarm window” display the alarm of first workshop, the scripts should be:
Plant alarm window.Group=First workshop
For example:
The following script can be used to show the priority of the 10 alarms (shown
above) in the alarm window tag “chemical plant alarm window”:
Chemical plant alarm window Priority=10
5. Historical curve fields
Includes:
ChartLength
The time length of historical trend, long, read-write, measured by
second
ChartStart
ValueStart
The starting time of historical trend, long, read-write, measured
by second
The starting value of vertical axis in historical trend, analog, readwrite
ValueSize
The range of vertical axis in historical trend, analog, read-write
ValueEnd
The ending value of vertical axis in historical trend, analog, readwrite
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
ScooterPosLeft
5-30
The position of left indicator, analog, read-write
ScooterPosRight The position of right indicator, analog, read-write
Pen1 to Pen8
The ID numbers of tags shown in historical trend, read-write,
tags are used to change drawing curves.
Details about using the field of historical trend can be seen in chapter 8 “Trend
curves and other curves”.
5.4.3 Use tag field
It has introduced how to use some tag fields in the section 5.4.2. Tag field can be
shown on the picture and used in the scripts. A tag field can be inputted by hand or
selected from tag explorer. Select related tag from tag explorer. Click “Tag field” list
box to popup the list of all the fields of current selected tags. Move the cursor of
mouse in the list box. A message displays the data type of the tag field in current
position automatically.
WellinControl Technology Development Co.,Ltd
5-31 Chapter 5 Tag definition and management
Figure 5.18 Select tag field
Figure 5.19 Use tag field
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-32
5.5 IO tag conversion mode
For IO tag---IO analog tag, it should be converted in different modes according
to different input need in practical scene. For example, general signal and project
value are linear corresponding so that you can select linear conversion. Some tags
need add-up calculation that add-up conversion should be selected.
KingView has various conversion modes such as linearity, extraction, non-linear
table, direct add-up, dev add-up and so on.
5.5.1 Linear conversion mode
Convert by the linear difference between original value and database value. It
appears as below. Linear conversion is to convert device value and project value
according to a fixed proportional coefficient. Input the range of tag project value to
the “Max value” and “Min value” edit box in the tag basic properties definition dialog
box. Input the range of converted number value of the device in the “Max original
value” and “Min original value” edit box (You can refer to the introduction to
KingView driver help). While system is running, current practical project value can be
obtained according to assigned range. Linear conversion mode is the most direct and
simple IO conversion mode.
WellinControl Technology Development Co.,Ltd
5-33 Chapter 5 Tag definition and management
Figure 5.20 Define linear conversion
Example 1: Flux sensor connected to PLC resistor generates 0 while the current
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-34
is null and generates 9999 while the current is maximum. When you input the values
below:
Min original value=0
Min value=0
Max original value=9999
Max value=100
The conversion proportion=(100-0)/(9999-0)=0.01
Therefore, if the original value is 5000, the project value is 5000*0.01=50.
Example 2: Flux sensor connected to PLC resistor generates 6400 while the
current is null and generates 32000 while the current is 300GPM. When you input the
values below:
Min original value=6400
Min value=0
Max original value=32000
Max value=300
The conversion proportion=(300-0)/(32000-6400)=3/256
Therefore, if the original value is 19200, the project value is (192006400)*3/256=150. If the original value is 6400, the project value is 0. If the
original value is less than 6400, the project value is 0.
5.5.2 Evolution conversion mode
Convert by the square root of the original value. Namely, extract the acquired
original value during converting to get the practical project value the range of which is
among the tag basic properties defined “Max value” and “Min value”. It appears as
below.
WellinControl Technology Development Co.,Ltd
5-35 Chapter 5 Tag definition and management
Figure 5.21 Define evolution conversion
5.5.3 Non-linear table conversion mode
In practical application, the acquired signal and project value are not the linear
proportional relations, but non-linear curve relations. If you count by the linear
proportion, the error of project value will be very big. It appears as below. When you
acquire some analog values, like hot resistance, thermocouple, which signals are
nonlinear signals, you not only need to do a great amount of program operation, but
also find big error if a general divided linearization method is used to convert.
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-36
KingView supplies nonlinear table to help users to get exact data. Original value
and project value, could be negative, have the nonlinear relations of direct proportion
or inverse proportion.
5.5.3.1 Nonlinear table definition
KingView supplies general table lookup method to do nonlinear converting.
Users can import data converting standard table. After Kingview make the device
original value of required data and tag original value linear corresponded (“Device
original value” is the device-acquired raw data. “Tag original value” is the value
converted by the max/min value and max/min original value of KingView which
contains extraction and linearity. “Tag original value” is generally called “Original
value”), you can create animation links with project values obtained by table lookup.
Nonlinear table is a user-predefined table with corresponding original value and
project value. When the converted original value can’t find the corresponding items in
the nonlinear table, you should calculate according to assigned formula. Nonlinear
table lookup conversion should follow these steps:
1 Tags should be converted following max value, min value, max original value,
min original value in the tag definition picture. Namely, the original data
acquired from device need preliminary conversion with KingView. Details can be
seen in the section “I/O float tag conversion mode and proportion”.
WellinControl Technology Development Co.,Ltd
5-37 Chapter 5 Tag definition and management
2 Convert the above results to get the project values according to nonlinear
table. They are used to display and save data and link animation while running.
The details about how to use nonlinear table conversion mode as below:
(1) Build nonlinear table: Select “Nonlinear table” from “File” in the list display
area of ProjectManager. Double-click “New…” icon to popup “Sectional
linearity definition” dialog box as below.
Figure 5.22 Sectional linearity definition
There are three columns in the table. The first column is the number which
adds a point-time system auto-generation. The second column is the original
value which is the value converted from device-acquired raw data with the
max/min value and max/min original value in the tag definition interface of
KingView. The third column is the project value related to the original value.
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-38
Nonlinear table name: Input nonlinear table name in the edit box. The name
of nonlinear table is unique which can be number or letter.
Add point: Add the relation point of original value corresponding to project
value. Click the button to add a row in the “Sectional linearity definition” dialog
box. The number will add automatically. The value is null or value in last row.
Input the value in the table according to the data relationship. For example, users
can build ten pairs of relationship for a nonlinear table—“Linear convert table”
as below.
Figure 5.23 Define nonlinear table
Delete point: Delete the needless linear relationship in the table. Select any
case in the row need to be deleted. Click this button to delete it.
(2) Define tag linear conversion: Select the I/O tag need to table lookup
WellinControl Technology Development Co.,Ltd
5-39 Chapter 5 Tag definition and management
conversion in the Tagname Dictionary. Double-click the tag name to popup
“Tag properties” dialog box. Click “Advance” button in the “Conversion mode”
of the “Tag definition” interface to popup “Data conversion” dialog box which
appears as below. The default option is “Null”. Select “Table lookup” when users
need to do linear conversion to acquired values. The “+” button and the
dropdown list box on the right side of dialog box become available.
Figure 5.24 “Data conversion” dialog box
Click the arrow on the right side of dropdown list box. System will list all of
the created nonlinear tables automatically. Users can select one from it directly.
Click “+” button to popup “Sectional linear definition” dialog box if no proper
nonlinear table existed. Users can create nonlinear table according to needs. The use
method is in section (1).
Displaying a tag and building animation links both operate the converted
project value while running. The computational formula to lookup nonlinear
table is:
(Next project value-Previous project value)*(Current original valuePrevious original)/(Next original value-Previous original value)+ Previous
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-40
project value.
 Current original value: The tag original value of current tag.
 Next project value: The project value related to the next value which
locates on the position of original value in the original table.
 Previous project value: The project value related to the previous
value which locates on the position of original value in the
original table.
 Next original value: The original value related to the next value
which locates on the position of original value in the original table.
 Previous original value: The original value related to the previous
value which locates on the position of original value in the
original table.
For example
The relationship in the created nonlinear table should be:
No.
1
2
Original
value
4
6
Project
value
8
14
When the original value is 5, the project value should be:
Project value=((14-8)*(5-4)/(6-4))+8, namely, 11.
The tag value displayed in the picture should be 11.
5.5.3.2 Import/Export nonlinear table
If the nonlinear table is very big and has so many segments, it is very difficult to
define it directly. Therefore, KingView supplies nonlinear table import/export
functions. The nonlinear table can be exported to a file in .csv format. The userdefined proper file in .csv format can be imported to current nonlinear table. It is
WellinControl Technology Development Co.,Ltd
5-41 Chapter 5 Tag definition and management
convenient for user operation. Open defined nonlinear table. Click “Export”
button to popup “Save as” dialog box. Select saving path and save file name. Click
“Save” button to save the nonlinear table to a file.
Figure 5.25 Export nonlinear table
The content of exported file can be seen as below:
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-42
Figure 5.26 Exported nonlinear table
Users can create nonlinear table in the form of method shown in the graph above.
Then import it to the project. There are two ways to import nonlinear table: import
from other projects and import from the file in .csv format. Click “Import” button in
the “Sectional linear definition” dialog box to popup “nonlinear table” dialog box. It
has two parts in the dialog box. The upper part is the project list of current
ProjectManager. Select the project nonlinear table belongs to. The names of all the
nonlinear tables in this project will be listed in the “Nonlinear table” list box. Select
the name of needed table. Click “Import” button to import the nonlinear table to
current project.
WellinControl Technology Development Co.,Ltd
5-43 Chapter 5 Tag definition and management
Figure 5.27 Import nonlinear table
Otherwise, file import can be selected. Click “Import from comma separation
file” button to popup file selection dialog box. Select the file need to import.
In brief, the import/export functions for nonlinear table make users use and edit
nonlinear table more convenient and advance the working efficiency.
5.5.4 Add-up conversion mode
Add-up is a common working mode in the project which is usually used in
calculating flow rate and electrical voltage and so on. Tags can be defined as add-up
values automatically. It has two kinds of add-up arithmetic in KingView: direct add-up
and deviation add-up. Add-up time is the same as tag acquiring frequency. Both of
them need to define the ranges of max value and min value after add-uping. It appear
as below:
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-44
Figure 5.28 Add-up conversion dialog box
When the tag value is over the range after add-uping, the tag value will resume to
the minimize value defined in the dialog box.
 Direct add-up: After converting the values acquired from devices, add-up to
the previous value of the tag directly.
The computational formula is:
Tag value=tag value+ acquired value

For example: Pipe flow rate S, the acquire frequency is 1000ms. After
converting acquired values in five seconds, the project values take turns as
below: S1=100, S2=200, S3=100, S4=50, S5=200, the result of direct addup flow rate in five seconds is: S=S1+S2+S3+S4+S5, the number is 650.
Deviation add-up:
Every time when tag is add-uping, differencing the tag acquired value
with last acquired value and then add-up the deviation. When current
acquired value is less than last value, namely, the difference is negative,
max value and min value of tag definition picture will be used to convert.
Deviation add-up computational formula is:
WellinControl Technology Development Co.,Ltd
5-45 Chapter 5 Tag definition and management
Display value=Display old value+(Acquire new value-Acquire old value)
(Formula 1)
When the new value is less than the old value, the formula should be:
Display value=Display old value+(Acquire new value-Acquire old
value)+(Tag max value-Tag min value)
(Formula
2)
Tag max value is the max value defined in the Max/Min value item of
tag definition picture.
For example: It’s required the tag initial value defined in the tag
definition picture is 0, the max value is 300. The deviation add-up flow rate
calculation in five seconds should be:
The first time: S(1)=S(0)+(100-0)=100
(use formula 1)
The second time: S(2)=S(1)+(200-100)=200
(use formula 1)
The third time: S(3)=S(2)+(100-200)+(300-0)=400 (use formula 2)
The forth time: S(4)=S(3)+(50-100)+(300-0)=650 (use formula 2)
The five time: S(5)=S(4)+(200-50)=800
(use formula 1)
Therefore, the deviation add-up flow rate calculation in five seconds is 800.
5.6 Tag management tool---Tag group
When a great many tags exist in the project, it will be difficult to find tag for
engineers. KingView supplies tag grouping management. Put tags in different groups
according to different purposes. Thus, engineers only need to find in proper group
when they edit and select tags. It reduces the searching range and saves the time, and
it has no effect on the general tag using.
5.6.1 How to create a tag group
There are three labels in TouchExplorer window: “System”, “Tags”, “Nodes” and
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-46
“Pictures” which appears as below. Select “Tags” label, “Tag group” shows on the left
side of window. Click “Tag group”, all of the tags in the project shows in the right side
of window.
Figure 5.29 Tag group
Right-click mouse on in the “Tag group” content to popup the shortcut menu.
Select “New tag group”.
WellinControl Technology Development Co.,Ltd
5-47 Chapter 5 Tag definition and management
Figure 5.30 Create tag group
An edit box appears in the “Tag group” content which appears as below. Input
the tag group name in the edit box.
Figure 5.31 Name tag group
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-48
According to the default items, names are generated with numbers automatically.
The name of tag group is unique and it should observe the tag naming rules.
Figure 5.32 Complete creating
After creating a new tag name, you can create a new tag directly in the tag group
in which the created tag belongs to this tag group. All the tags created in tag group can
be seen in Tagname Dictionary. You can create sub-tag group in the tag group. The
sub-tag group tags belong to the upper tag group as well.
WellinControl Technology Development Co.,Ltd
5-49 Chapter 5 Tag definition and management
Figure 5.33 Create sub tag group
Select a created tag group. Click the right key of mouse, select “Edit tag group”
in the appearing shortcut menu. The tag name can be changed here.
Note:
The name of root tag group---“Tag group” can’t be edited or deleted.
5.6.2 How to add tags in tag group
After creating a new tag group, you can add tags in it. You can create new tag
directly. Double-click “New…” icon to create new tag which appears as below. You
can move defined tags which contain tags belong to other tag group to current tag
group. It will mainly introduce the later one below.
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-50
Figure 5.34 Select tag group to move
Select a tag need to move from a tag group. Click the right key of mouse. Select
“Move tag” from the popup shortcut menu. Select target tag group. Click the right key
of mouse on the right side area. Select “Obtain tag group” in the popup menu.
Therefore, the selected tag is moved to target tag group. In Tagname Dictionary, the
tag icons belong to tag group are different from other icons.
After grouping tags, you only need to select proper tag group content in the tags
explorer. Tag group has no effect on the use of tag. So tag can be put into any tag
group.
WellinControl Technology Development Co.,Ltd
5-51 Chapter 5 Tag definition and management
Figure 5.35 Select tag by tag group
5.6.3 Tag ordering in tag group
Tags can be ordered in different modes in any tag groups. You can order in “Tag
name”, “Tag type”. “ID”, “Access device”, “Register”, “Alarm group” except “Tag
expression”.
5.6.4 How to delete a tag in tag group
If you don’t need a certain tag in the tag group, you can delete it from tag group
directly or move it to other tag groups. Deleted tag from tag group doesn’t belong to
any tag groups but it still exists in Tagname Dictionary.
Enter the tag group content. Select the tag. Click the right key of mouse. Select
“Delete from tag group” in the popup shortcut menu. Then the tag disappears from
current tag group. If you select “Move tag”, you can move it to other tag groups.
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-52
Figure 5.36 Move tag
5.6.5 How to delete tag group
If you don’t need the tag group any more, you can delete it. Before you delete tag
group, you need ensure no tags existed in the tag group, meanwhile, the sub-tag group
need to be deleted as well before.
Click the right key of mouse on the tag group need to be deleted. Select “Delete
tag group” in the shortcut menu. A system message about confirm deleting popup. If
you confirm it, the current tag group will be deleted forever.
5.7 Tag management tool 2
KingView supplies many tools and methods for managing and using tags. Like
import/export Tagname Dictionary, update/substitute tags, obtain the using condition
of tags, etc.
5.7.1 Tagname Dictionary Imports/Exports to Excel
WellinControl Technology Development Co.,Ltd
5-53 Chapter 5 Tag definition and management
5.7.1.1 Tagname Dictionary Exports to Excel
In order to make users use, view, define, print KingView tags more convenient,
KingView supplies DB import/export functions. KingView tags are exported to a file
in Excel format. Users can view and edit some properties of tags in the Excel file, or
create tags and their define properties in the file directly. Then import them to project.
This function is in ProjectManager.
Open ProjectManager and close TouchView and WindowMaker. Select the
project need to export Tagname Dictionary from the project list in ProjectManager.
Click “DB export” button in the toolbar of ProjectManager, or select “Tools\Tagname
Dictionary export” menu command. Therefore, selecting file dialog box will popup as
below.
Figure 5.37 Input file name to export Tagname dictionary
Select the file path of saving exported Tagname Dictionary. Input the file name
and click “Save”. The process reminder and progress bar display in the status bar of
ProjectManager. The exported file will be shown as below.
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-54
Figure 5.38 File exported from Tagname dictionary
Tagname Dictionary Export rules:
The Excel file exported by Tagname Dictionary has four pages: introduction page,
template page, structure tag page and basic tag page.
Introduction page: It’s the user guide of import/export Tagname Dictionary. Users
should follow the introduction while importing or exporting Tagname Dictionary. The
content of this page can’t be edited.
Template: It’s all the information of templates defined in project. For example,
[Template] Template ID Template name Using counter
Comment
1 Discrete structure
1
[Member] Member ID Member name Member type
1
Discrete member 1 Discrete
2
Discrete member 2 Discrete
………..
Template ID Template name Using counter
Comment
2
Integer structure
1
WellinControl Technology Development Co.,Ltd
5-55 Chapter 5 Tag definition and management
[Member] Member ID Member name Member type
1
Integer member 1 Integer
2
Integer member 2 Integer
………..
Template: Template ID is the serial number of defined template in structure
template. Template name is the name of defined template in structure template.
Template counter is the using times of defined template in structure template.
Member: Member ID is the serial number of defined template in structure
template. Member name is the serial number of defined template in structure template.
Member type is the type of defined template in structure template.
Note:
Users must follow the format above to create a new structure template.
Otherwise, error will occur while Tagname Dictionary importing. System will refuse
to import. Template nesting can have two levels at most.
Structure tag page: It’s about the user-defined structure tag. If the name of userdefined structure tag is: discrete structure tag, the information in this page is as below:
[Structure Tag] Tag ID Tag name Tag type Using counter Comment
1 Discrete structure tag Discrete 1
[Member] Member ID Member name Member type
1
Discrete member 1 Discrete
2
Discrete member 2 Discrete
………..
Tag ID Tag name Using counter
Comment
2
Integer structure
1
[Member] Member ID Member basic tag ID
Discrete tag, discrete member is 41.
Discrete tag 1
Discrete tag, discrete member is 42.
Discrete tag 2
Discrete tag, discrete member is 43.
Discrete tag 3
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-56
Tag ID is the serial number of defined tag in structure tag.
Tag name is the name of structure tag. Namely, it is the name of basic tag when
the basic tag is defined to structure tag.
Tag type is the type of defined tag when the basic tag is defined to structure tag.
Tag counter is the using times of basic tags of this structure tag type..
Member name is the name of every basic tag in this structure tag type.
Basic tag ID is the serial number of every basic tag in this structure tag type.
Comment is the comment of templates and every member of basic tags.
Note:
Users must follow the format above to create a new structure tag. Otherwise,
error will occur while Tagname Dictionary importing. System will refuse to import.
Tag ID number can’t be repeated. And the ID number is continued for the structure
tags in the same template.
Basic tag page: List all of the KingView basic tags according to different types.
The content of every exported tag is tag name and ID number, the situation if
recording the parameters, the values of all the tag fields, description and so on.
When a basic tag id created, every valid property should observe the rules below:
 Template member type valid value: memory I/O integer, memory I/O float,
memory I/O discrete, memory I/O string, alarm window, historical trend,
other template types.
 Tag name: composes of letters and numbers. But it can’t be started with
number. The valid length is less than 32.
 Whether to save value: The valid value is yes or no.
 Whether to save parameter: The valid value is yes or no.
 Alarm group: The name of alarm group in KingView.
 Priority: 1-999.
 Alarm text (LoLo, Lo, Hi, HiHi, Off, On, Off to On, On to Off): The valid
WellinControl Technology Development Co.,Ltd
5-57 Chapter 5 Tag definition and management
















length of text is less than 16.
Rate of change unit: The valid value is hour, minute, second.
Extend field 1, extend field 2: The valid length of text is less than 16.
History mode: Valid value is no record, change record, timing record.
Whether to generate operating event: The valid value is yes or no.
Security zone: The name of security zone defined in user configuration
(choose one).
Comment: The valid length of text is less than 40.
Whether to generate alarm: The valid value is yes or no.
Alarm type: The valid value is On, Off or Change site.
Device name: is the device name defined in KingView. The valid length of
text is less than 32.
Read/write properties: The valid value is read-write, read-only or write-only.
Whether to allow DDE access: The valid value is yes or no.
Conversion mode: The valid value is linearity or extraction.
Advanced conversion mode: Table lookup, direct add-up, deviation add-up.
Linear table name: The name of linear table in table lookup mode.
Min add-up value: Define the min value of add-up value by using add-up
conversion mode.
Max add-up value: Define the max value of add-up value by using add-up
conversion mode.
……
Other items are the same as KingView tag definition.
5.7.1.2 Import Tagname Dictionary from Excel
Importing Tagname Dictionary is to import defined data from Excel or Exported
Tagname Dictionary in other KingView projects to the project. Open ProjectManager.
Close TouchView and WindowMaker. Select the project need to import to Tagname
Dictionary from the project list in ProjectManager. Click “DB import” button in the
toolbar of ProjectManager, or select “Tools\Tagname Dictionary import” menu
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-58
command. Therefore, an “Import Tagname Dictionary” message popup to remind
users if they need to backup the project before users import Tagname Dictionary.
Note:
In order to prevent error occurring during project importing, it is suggested to
backup project first.
Figure 5.39 Import prompt



Click “Yes” button to backup project.
Click “Cancel” button to cancel the Tagname Dictionary Importing Operation.
Click “No” button to import Tagname Dictionary. File selecting dialog box
popup as below.
Figure 5.40 Select file to import
WellinControl Technology Development Co.,Ltd
5-59 Chapter 5 Tag definition and management
The database dictionary used in one project can be used in all other projects. The
system automatically compares the excel document with the imported project database
dictionary. After this comparison, the system opens the “Check-out report for
importing tags”, shown in Figure 5.41.
Figure 5.41 Check-out report for importing tags
The “check-out report” shows the differences between the excel documents and
the imported database dictionary, including tag IDs, alarm group names, defined
equipment, registers, etc. Users should check the result carefully then click “OK” in
the dialog box to confirm any changes. Click “Cancel” to automatically return to the
current project’s data dictionary.
Should any problems occur after the dictionary is imported; the original
historical data dictionary can be recovered by selecting “OldTagFileCopy” from the
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-60
project list.
After importation to avoid any unnecessary problems, users should amend all
relevant tags according to the hints provided by the “check-out report” and reset
KingView.
Note:
Read check result, if import is confirmed, then after importing, the problem
referred during checking should be checked, and correlative link should be
modified (such as deleted tags, undefined device), so that project can run normally;
otherwise, unknown problems perhaps happen.
Project file relating to tags will be backup in the folder “OldTagFileCopy”,
which is used to recover the project that can’t be imported normally, the check file
(Validate.txt) is saved under the project path.
5.7.2 Import/export the data dictionary via Access
5.7.2.1 Export the data dictionary to Access
Open the Project Browser and click exported tags, as shown in Figure 5.4.2.
WellinControl Technology Development Co.,Ltd
5-61 Chapter 5 Tag definition and management
Figure 5.42 Select the exported tags
Right click once to open the pop up window, select “Exported Tag”.
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-62
Figure 5.43 Exported tags
Selecting this command, opens the document dialog box shown in Figure 5.44.
Figure 5.44 Name the exported file
Select the file path for the exported data dictionary and enter a name for the
WellinControl Technology Development Co.,Ltd
5-63 Chapter 5 Tag definition and management
saved file, as shown in Figure 5.44. Put the exported file in the Kingview folder
and name it “exported data”. The tag information bar will pop up after clicking “Save”,
as shown in Figure 5.45.
Figure 5.45 Tag exporting status
After the tag has been exported the following hint message will pop up.
Figure 5.46 Export tag successfully
At the same time, a.mdb export data file will be created under the previously
appointed path.
Upon opening the access database, the tag types will be displayed as Figure 5.47
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-64
Figure 5.47 Exporting the access file from the database dictionary
The data details can be displayed by clicking on any data type. For example a
design page IO integral is shown in Figure 5.48.
WellinControl Technology Development Co.,Ltd
5-65 Chapter 5 Tag definition and management
Figure 5.48 The relationship between the tag name and the data exported from KingView
Kingview also supports the tag export which set tag group as its unit. Selected
the root variable group or variable group under the “tag” label in the window of
Kingview TouchExplorer that needed to be exported, then right-click in the content
display area, it will pop-up the window as shown in the figure.
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-66
Figure 5.49 Export tags from the variable group
Please refer to specific operations of the exports from tagname dictionary.
5.7.2.2 Importing a data dictionary from Access
To import a data dictionary, firstly export the data dictionary from one KingView
project and import it to another project. The data dictionary can then be exported from
all projects. These two methods are discussed in details below.
5.7.2.3 Import Tagname Dictionary to original project
Open the project manager data dictionary; right click in tag selection region,
from the pop up menu select “Import Tag”, as shown in Figure 5.49
WellinControl Technology Development Co.,Ltd
5-67 Chapter 5 Tag definition and management
Figure 5.50 Importing tags
Selecting this function opens the following dialog box as shown in Figure 5.51.
Figure 5.51 Select the imported database
Select the imported database file as shown in the figure above, click “Open” with
the imported database named “Exported data. mdb”. The imported tag list will be
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-68
shown as below.
Figure 5.52 Imported tag data list
From this table, the name and relevant equipment of the imported tag can be
amended.
 Modify device: replace the relevant tag equipment by project defined
equipment
 Modify tag name: change the imported tag names individually or in
batches.

Modify the tag name individually: select a tag; then click “Rename
Tag Name”, the following dialog box will pop up.
WellinControl Technology Development Co.,Ltd
5-69 Chapter 5 Tag definition and management
Enter the new name click “Ok” to confirm, and the tag is renamed. The rules of
rename should comply with those of tag name.
 Amend Tag names in batches: press “’Shift”, select all the tags you
wish to rename, click “Rename Tag Name”, the following dialog box
will be pop up.


Prefixion: The addition of characters before the previous tag name
should comply with the rules of re-naming a tag.
Suffixion: The addition of characters after the previous tag name
should comply with the rules of re-naming a tag.

Set to importable: the selected tags can be imported to the project.

Set to non-importable: the selected tags cannot be imported.An “

will is shown in front of the tag name.
Change Group Name: Select the variables; click “Change Group Name”,
WellinControl Technology Development Co.,Ltd
”
Chapter 5 Tag definition and management
5-70
then pop-up the dialog box of it, as shown in figure 5.53. Input the name of
the variable group. When import variables from root variable group or
tagname dictionary, you can specify the name of the group. The variable
will import to root variable group directly if the information of the variable
group is empty.
Fig. 5.53 change group name





Import: import the importable tag to this project.
Import option:
 Import the selected tags: Select one or more tags from the tag list and
import them into this project.
 Import the importable tag: Imports all importable tag into this project.
Substitute options
 Non-replace: importable tags with the same name as tags already in
the project will not be imported
 Replace: importable tags with the same name as tags already in the
project will replace the existing ones.
Stop: Imports can be stopped at any time.
Close: Close the importing tag dialog box.
For example
Import the tag (which was exported in chapter 5.7.2.1) to this project as shown in
Figure5.42. Rename the tag “Age” “age”, set “salt” to non-importable, change the
“temperature” tag name to the the same as in this project, and click “Same name
prohibited” as shown in Figure 5.54 .
WellinControl Technology Development Co.,Ltd
5-71 Chapter 5 Tag definition and management
Figure 5.54 Amend the imported tags
Click “importing” once and the following dialog box will pop up.
Figure 5.55 Complete tag Importing
Click “OK” to close the “Imported Tag” dialog box. Open the project data
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-72
dictionary as shown in Figure 5.56.
Figure 5.56 The database dictionary after importing tags
Kingview also supports the tag export which set tag group as its unit. Selected
the root variable group or variable group under the “tag” label in the window of
Kingview TouchExplorer that needed to be export, then right-click in the content
display area, it will pop-up the window as shown in figure 5.57.
WellinControl Technology Development Co.,Ltd
5-73 Chapter 5 Tag definition and management
Figure 5.57 Import variables to variable group
Please refer to specific operations of the exports from tagnane dictionary.
To import variables which set variable group as its unit, you can configurate the
name of variable group before the import according to real needs. First, the system
imports the variable, and then moves it to correspondent variable group automatically
according to the configuration of each variable. To those nonexistent variable groups,
the variable will move to it automatically after the establishment of it. There are two
methods to configurate the information of variable groups: the first one is to input it
directly in Access database.
Open the export file of Access database, and corresponding tables of all types of
variables, you can configure the information of variable group through configure the
field content of “GroupPath” in corresponding tables.
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-74
Fig. 5.58 The information of variable group, configuration one
The second method is by configuring the interface when importing.
Select the Access file that to be imported, enter the “variable import” window
under it. The “information of variable group” in the list displays as variable group’s
paths.
WellinControl Technology Development Co.,Ltd
5-75 Chapter 5 Tag definition and management
Fig. 5.59 The information of variable group, configuration two
Select one or several variables in the list of variables, click the “Change Group
Name” button, then pop-up the window as shown.
Fig. 5.60 The information of variable group, configuration three
Input the integrated path of variable group that needed to set, click “confirm” to
finish the configuration.
After configure all the variables, click the “import” button to import all the
variables to tagname dictionary, and distribute to each variable group automatically.
5.7.2.4 Import Tagname Dictionary to other projects
For more information regarding how to use this function please refer to chapter
5.7.2.3.
Note:
1. Tags imported from Access database are not checked in this version, so it
only fit to import database exported before to the original project, or to another
project, if users themselves edit Access database, and then, import it, maybe it will
cause accidental problems, be careful!
2. This function can’t support structure tags.
5.7.3 How to obtain the information of using tags and delete tags
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-76
Engineers need to know the using conditions in the project, such as where the tag
is used, which tag hasn’t been used yet, etc. KingView supplies proper tools for all of
them.
5.7.3.1 How to obtain the information of using tags
Tags could be used many times in a project. KingView supplies “Tag using log”
function to help users get the using conditions exactly. Select “Tools\Tag using log”
from TouchExplorer to popup a message box which indicates the picture is calling in,
etc. Find the using of tags. After that, a dialog box “Tag using log” popup as below.
Figure 5.61 Tag using log
List the using and disusing conditions of all the tags by tree structure in “Tag
using log”, like which script tag is used, where the picture is called in. If the tag isn’t
called in, there will be no sign of sub-node appear on the node of tag.
WellinControl Technology Development Co.,Ltd
5-77 Chapter 5 Tag definition and management
In the status bar of tag using log, it displays “Usable point numbers” (the
KingView Key point numbers) and “Used point numbers” (used tag number). Users
can judge usable point numbers by it.
Click “Save” button to popup file saving dialog box. Save the tag using log as a
file in .csv format.
Click “Find” button to popup “Find” dialog box as below.
Figure 5.62 Find
There are two methods to find tags: “Exact search” and “Fuzzy search”. If you
select exact search, please input exact tag name in the tag name edit box. Click “OK”
to start searching. If you select fuzzy search, please input several characters of tag
name in the tag name edit box. Click “OK” to start searching. After confirming, the
tag using information locates on the tag directly in the tag using log dialog box. Thus,
users can find the condition of a certain tag conveniently (“Edit after find” is not
available).
5.7.3.2 Tag using update
By using tag using update, you can ensure the exact information of tag using
conditions after adding or editing tags.
Select “Tools\Update tag counter” menu in TouchExplorer. An update message
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-78
bar appears to auto-update tag using conditions. It can make logging exact while
viewing tag using log.
5.7.3.3 Delete Unused Tag
If some tags are unused in the project, they could be deleted. There are two ways
to delete it. One is deleting it directly from Tagname Dictionary. Another is deleting it
from unused tag list in KingView.
If you ensure a certain tag unused in Tagname Dictionary, you can select it
directly from Tagname Dictionary. Click the right key of mouse. Select “Delete” in the
shortcut menu. A message reminds if you want to confirm. After confirming, the tag
will be deleted forever.
If you can’t ensure, you can select “Tools\Delete unused tag” menu in
TouchExplorer. A dialog box “Delete unused tag” popup as below. List unused tags
defined in current project. Click the tags need to be deleted. Click “OK” to delete
selected tag for ever. If you ensure to delete all the tags from the list, click “Select all”
button directly so that all the tags in the list will be selected. Click “OK” button to
delete.
WellinControl Technology Development Co.,Ltd
5-79 Chapter 5 Tag definition and management
Figure 5.63 Delete unused tags
Note:
1. It is suggested users don’t delete tags from Tagname Dictionary directly, but use
the second method for deleting.
2. Before deleting unused tag, use “Update tag counter” to refresh the tag using
conditions.
5.7.4 Edit tag properties and tag substitute
5.7.4.1 Find tag
Enter the Tagname Dictionary of TouchExplorer. Select “Tools\Find tag” menu
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-80
or click the right key of mouse in Tagname Dictionary directly. Select “Find tag” in
the shortcut menu to popup “Find tag” dialog box which appears as below. There are
two methods to find tags: “Exact search” and “Fuzzy search”. If you select exact
search, please input exact tag name in the tag name edit box. Click “OK” to start
searching. If you select fuzzy search, please input several characters of tag name in
the tag name edit box. Click “OK” button to start searching. If you select “Edit after
find” option, system will search the tag matching needed characters from the first.
After finding, the tag properties dialog box will be open automatically. Users can edit
the tag properties.
Figure 5.64 Find tag
5.7.4.2 multi-edit tag properties
KingView supplies the function which allows users to select several tags at one
time (not include structure tag) for editing tag properties. Select the tags need to edit
properties in Tagname Dictionary. Press down <Ctrl> key to multi-select and press
down <Shift> key to select adjacent several tags while selecting. Click the right key of
mouse, select “Edit selected tag” command in the shortcut menu. The tag properties
dialog box popup as below. Same tag properties allow users to edit, but different tag
properties don’t allow. If the properties parameters of every tag have same definition,
WellinControl Technology Development Co.,Ltd
5-81 Chapter 5 Tag definition and management
they will appear in the corresponding options. If the properties parameters of
every tag have same properties but different definition, the option will show nothing.
If users didn’t edit it, system would keep the old values for these options after
confirming. If users edited it, all the corresponding properties of selected tags would
change to the needed values.
Figure 5.65 Select some tags
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-82
Figure5.66 Change properties of selected tags
5.7.4.3 Tag substitute
KingView provides the tag substitute which can make not only tag name
substitute, tag using substitute for tags in current project, but also station name
substitute, identifier substitute for tags in remote station or non current project. You
can make tag substitute within the project by different ways.
Kingview has the function to substitute Single Tag Substitute and Batch Tag
Substitute.
WellinControl Technology Development Co.,Ltd
5-83 Chapter 5 Tag definition and management
Single Tag Substitute:
1. Substitute range
Tag substitute have 4 kinds according to the substitute range:
 The whole project, including all pictures and scripts
 All pictures and scripts in assigned picture group
 Current picture and scripts
 Selected symbol in current picture
2. Substitute way
Tag substitute has the following ways: tag name substitute, tag substitute,
station name substitute, identifier substitute to tag. Next take substitute range of
the whole project for example to explain various substitute ways. Other substitute
range is similar to it.
Tag substitute has two kinds: Tag name substitute, using substitute.
5.7.4.3.1 Tag substitute of the whole project
Tag substitute of the whole project contains 4 kinds of substitute ways.
 Tag name substitute (Change Tagname Dictionary)
Select “Tools\Tag name substitute” menu in TouchExplorer or click the
right key of mouse in Tagname Dictionary directly then select “Tag name
substitute” in the shortcut menu to popup “Tag name substitute” dialog box
which appears as below. Substitute tag name for defined and used tags, and
system changes corresponding tag name in Tagname Dictionary
automatically.
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-84
Figure 5.67 Tag name substitute in whole project
“Old tag” must be existing in the project, namely defined tag, you can
click “?” button to select tag. Input the new tag name in “New tag” edit box
(Note: The tag name can’t be the same as tag name in current and must
satisfy the name rule)
After substituting, click “Substitute” button to start substituting the
selected tag name with the new tag name. So “Old tag” vanished from the
project.
This substitute way only can be applied in the whole project or picture
group.
1. Tag substitute
As below, select “Tag substitute” in the “substitute way” dialog
box. This way can finish substitute used “Old tag” in the pictures and
scripts of the project with assigned “New tag’. “Old tag” and “New tag’
must be existing in the current project and have the same data type. Or
it fails to finish substitute.
WellinControl Technology Development Co.,Ltd
5-85 Chapter 5 Tag definition and management
Figure 5.68 Tag substitute in whole project

Station name substitute
KingView network provides remote tag reference. If you want to see the
same picture in the server and the client, you can load the picture in the server
into the project in the client, then use “Station name substitute” in the client to
modify the tag need name to remote server name automatically in order to reduce
the engineering workload greatly.
As below, input the station name in “Old name” that you want to substitute
and target name in “New name”, then select “Substitute” button, so system may
finish station name substitute automatically.
Figure 5.69 Station name substitute in whole project
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management

5-86
Identifier substitute to tag
KingView provides the Import/Export of pictures and scripts. After these
operations, there might be some tags in imported pictures or scripts of target
project which have not existed before importing. KingView takes these tags as
identifiers. If not substituting these tags, you cannot refresh the corresponding
point data in the picture in runtime, cannot run scripts, so you should use
“Identifier substitute to tag” to substitute.
As below, input the identifier in “Old name” that you want to substitute and
local defined tag name in “New name” or click “?’ button to select a tag, then
select “Substitute” button, to finish substitute.
Figure 5.70 Identifier substitute to tag in whole project
Next introduce the methods of tag substitute of other ranges simply.
5.7.4.3.2 Tag substitute for select picture group
Click the “Picture” label in TouchExplorer and. Right click to popup the float
menu as below.
WellinControl Technology Development Co.,Ltd
5-87 Chapter 5 Tag definition and management
Figure 5.71 Select the picture group for tag substitute
Click “Tag substitute” to popup “Tag substitute” dialog box as below.
Figure 5.72 Tag substitute in picture group
It has the same substitute way and using method as the whole project. The
substitute range is current picture group, all pictures and scripts in its sub-picture.
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-88
5.7.4.3.3 Tag using substitute for current pictures and scripts
Open a picture in WindowMaker without any symbol, select “Edit/Tag
substitute” menu to popup “Tag substitute” dialog box as below.
Figure 5.73 Tag substitute in current picture
Select “Current picture” in “Substitute range” in dialog box.
It has the same substitute way and using method as the whole project. The
substitute range is all pictures and scripts in current selected picture.
5.7.4.3.4 Tag using substitute for current selected symbol
Select the symbol in the picture that you want to make tag substitute for, then
select “tag substitute” in right click shortcut menu to popup “Tag substitute” dialog
box as below.
WellinControl Technology Development Co.,Ltd
5-89 Chapter 5 Tag definition and management
Figure 5.74 Tag substitute in selected symbol
Select “Selected symbol” in “Substitute range” in dialog box.
It has the same substitute way and using method as the whole project. The
substitute range is all pictures and scripts in current selected picture.
Batch Tag Substitute:
1、Variable substitute: To realize the substitute of old tag to target tag. Using
extent: memory tag, IO tag, system tag, structure tag.
2、Change the name of tags: Change the name of old tags. Including name
Substitute、add prefixed and suffixes.
Select “Tool/Tag Name Substitute/Batch Tag Substitute” menu in TouchExplorer,
or right-click in data dictionary and select the “Sing Tag Substitute/Batch Tag
Substitute”, then pop-up a dialog box as shown in figure 5.75. When change the name
of defined and used variables, the system will modify the corresponding name of the
tag automatically in Tagname dictionary.
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-90
Figure 5.75 Batch Tag Substitute
 Add variables
Click the “Add” button, and choose the variable need to be added, then pop-up the
dialog box of “add variables”, as shown in figure 5.76. Click “confirm”, finish the
addition of the variables.
WellinControl Technology Development Co.,Ltd
5-91 Chapter 5 Tag definition and management
Figure 5.76 Add variable
Configuration substitute selection:
Choose a particular or several variables, click “edit” button or button “enter” on
the keyboard, and open “editorial options” window. Or double-click one of them, and
then open the dialog box of “editorial options”, as shown in figure 5.77.
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-92
Figure 5.77 The dialog box of substitute tags
If the selected variable contains system variable or structural variable, only
variable substitute function can be used in variable edit selection dialog box.
Click the variable list button on the right side of “substitute” display box under
“variable name”, pop-up variable list, and then choose the substituted variable.
If the selected variable has no system variable or structure variable, then you can
use variable substitute function in variable edit selection dialog box.
Select a variable in the column of “Batch substitute”, pop-up an “editorial
selection” box, choose “rename the variable” in substitute mode, and choose the mode
that needed in “rename the variable selection”. Operate in the new name display
column, and then click “confirm” button, the system will finish name substitute
automatically.
WellinControl Technology Development Co.,Ltd
5-93 Chapter 5 Tag definition and management
Figure 5.78 Dialog box of rename the variables—name substitute
When choose more than one variable in the column of “group substitute”, you
can only “add prefix” and “add suffix” to variable’s name. As shown in figure 5.79.
Figure 5.79 Dialog box of rename the variables—add prefix
The information of each variable after configured can be seen in the main dialog
box of “Batch substitute”, as shown in figure 5.80.
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-94
Figure 5.80 The dialog box of group substitute after edit
If the variable hadn’t edit and modify, when you click “confirm”, it will pop-up
the windows as shown:
WellinControl Technology Development Co.,Ltd
5-95 Chapter 5 Tag definition and management
Figure 5.81 Continue batch substituteor not
Click “yes”, operate the variable that had been edited and modified, those hadn’t
been edited and modified will maintain the original state.
Click “no”, continue to operate the “group substitute” window.
Delete variables: Select one or more record, click “delete” or button “Delete” on
the keyboard, to delete the selected variable.
After all the variables have been configured, click “confirm”, to substitute or
rename the variables in variable list.
5.8 About custom tag
KingView supplies custom tag function in the scripts. Uses declare tag type and
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-96
tag name in the scripts. Then users can calculate and evaluate in the scripts directly the
same as KingView tag. The action area of custom tag is using scripts mode. After the
scripts execute completely, the custom tags in the scripts will be released
automatically. Custom tags have two kinds which are custom basic tag and custom
structure tag.
5.8.1 Custom tag
KingView has four kinds of data types: BOOL, LONG, FLOAT and STRING. So
data types of custom tag have these kinds. Before using the custom tag in the scripts,
it need be defined first. Custom tag only has value without concept of tag field so that
custom tag can’t use tag field. Custom tag can exchange data and evaluation with tag.
It can be used as the parameter of custom function. It can be used as the parameter of
KingView function as well. Custom tag name need match case while using.
WellinControl Technology Development Co.,Ltd
5-97 Chapter 5 Tag definition and management
Figure 5.82 Custom tag
Custom tag can be defined and used at any moment without occupying system
point numbers. It is simple and convenient. The graph below is an application of
custom tag in custom function.
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-98
Figure 5.83 Use custom tag
5.8.2 Custom structure tag
If it has defined template in the project, custom structure tag can be used in the
scripts which action field is the using scripts mode. The difference to custom tag is,
custom structure tag doesn’t need define data type before using. Because the data type
of structure member in cited structure has been defined while structure tag is created.
For example, create a structure—Astru in the project which has members:
Member1, Member2, Member3, so that the method should be used while using scripts
is:
Astru a;
a. Member1=10;
WellinControl Technology Development Co.,Ltd
5-99 Chapter 5 Tag definition and management
a.
Member2=20;
………..
Take the structure tag created in section 5.3 for example to explain how to use
custom structure tag. The created structure tag appears as below.
Figure 5.84 Create structure tag
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-100
Figure 5.85 Use custom structure tag
Custom structure tag can be used as the parameter of custom function. Same
structures can be evaluated as a whole.
Note:
1. Both custom tag and custom structure tag have no concept of field so that you
can’t use field of custom tag while using.
2. Custom structure tag doesn’t support remote structure.
Besides various tags introduced above, there are still some special tags in
KingView:
 Alarm window name: Whenever a new alarm window is defined, its name
WellinControl Technology Development Co.,Ltd
5-101 Chapter 5 Tag definition and management

becomes a tag in KingView.
Historical trend name: Whenever a new historical trend is defined, its name
becomes a tag in KingView as well.
These two special kinds of tags can’t be seen in KingView Tagname Dictionary,
but can be seen in tag explorer. The tag also has properties for users to edit parameters
of alarm window and historical trend. You can see details in the section 5.4.
5.9 Tag refers to pointer
In practical scene, a project might have several same devices and acquired tag
values are the same as well. For example, in electronic monitor system, many motors
or transformers need to be acquired for their voltages, currents, powers, etc. But these
electric devices have the same types and parameters while tag definition. If you want
to monitor tags in groups respectively, it would be a big job and it would make the
whole monitor picture more complex. The concept of tag citation is imported to solve
this problem. By tag citing, you can use a group of memory tags to timesharing
monitor many groups of I/O tags which can reduce the workload, improve the work
efficiency and make the whole monitor picture tidy and easy.
5.9.1 General tag reference
Citing general tag must satisfy that there are many cited tags with same tag types.
Take integer type tag for example to explain the citing process for general tag.
Suppose there are three cited I/O tags which are P1_CITED, P2_CITED,
P3_CITED. And you need create a memory tag P_CITE with the same tag type as IO
tag which is used as citing tag in tag citing function. It appears as below.
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-102
Figure 5.86 Citing tag and cited tag of basic tag
After citing tag is created, you need create a new picture. Create three buttons
respectively in the picture. Add these sentences on the button “On key up” scripts
separately:
VarRefAddress (“\\Root node\P_CITE”, “\\Root node\P1_CITED”);
VarRefAddress (“\\Root node\P_CITE”, “\\Root node\P2_CITED”);
VarRefAddress (“\\Root node\P_CITE”, “\\Root node\P3_CITED”);
After the citing process for general tag, you can then test the tag citing. Connect
values for all the tags. Startup TouchView and click three buttons respectively, you
can cite different tags by clicking different buttons.
Note:
Citing tag only can be memory tag. Cited tag can’t be citing tag. Citing tag and
cited tag have the same max/min value. Citing tag doesn’t need define properties
like alarm, historical record and so on.
WellinControl Technology Development Co.,Ltd
5-103 Chapter 5 Tag definition and management
On web, it uses tags to cite VarRefAddress function, the usage of the function is
basically the same of the operating system of Kingview, but the tags and the cited tags
can’t be structural tag.
The domain of the cited remote tags must have connection on the picture;
otherwise it’s unable to completely quote.
e.g.
When the domain of the cited remote tag TimeTimeString, this domain must
establish a connection in the released picture, then can be cited into the cited tags.
5.9.2 Structure tag citing
Structure tag citing and general tag citing are very similar. It must satisfy that
there are many groups of cited tags, and then create a group of memory tags. It is
suggested citing structure tag and cited structure tag have the same member types and
member numbers. Take integer type tag for example to explain the citing process for
structure tag.
Suppose you need monitor the current (I), Voltage (V), power (P) of three
transformers. Firstly, create a group of structure tag Transformer which including
three member tags I, V, P. Then, create three tags in Transformer type in Tagname
Dictionary which are Transformer1, Transformer2, Transformer3. The data type of I, V,
P are all I/O integer. Finally, create a tag in Transformer type called Transformer_cite.
The data type of I, V, P are all I/O integer which is used to cite I/O structure tag. It
appears as below.
WellinControl Technology Development Co.,Ltd
Chapter 5 Tag definition and management
5-104
Figure 5.87 Citing tag and cited tag of structure tag
After citing tag is created, you need create a new picture. Create three buttons
respectively in the picture. Add these sentences on the button “On key up” scripts
separately:
StructVarRefAddress
(“\\Root
node\Transformer_Cite”,
“\\Root
node\Transformer1”);
StructVarRefAddress
(“\\Root
node\
Transformer_Cite”,
“\\Root
node\Transformer2”);
StructVarRefAddress
(“\\Root
node\
Transformer_Cite”,
“\\Root
node\Transformer3”);
After the citing process for general tag, you can then test the tag citing. Connect
values for all the tags. Startup TouchView and click three buttons respectively, you
can cite different tags by clicking different buttons.
Note:
Citing structure tag and cited structure tag have the same member types and
WellinControl Technology Development Co.,Ltd
5-105 Chapter 5 Tag definition and management
member numbers. The limiting conditions of member tag are the same as
general tag as well.
5.9.3 Citing between structure tag and general tag
Because general tag is single tag but structure tag is a gather of several tags,
general tag can only build citing relation with members of structure tag. Take the tag
P_CITE in last example and tag I in Transformer1 for example. If you want to realize
citing between them, P_CITE should be citing tag and Transformer1.I should be cited
tag which can be expressed in the following sentences:
VarRefAddress (“\\Root node\P_CITE”, “\\Root node\Transformer1.I”);
But it still need satisfy some conditions: citing tag only can be memory tag. Cited
tag can’t be citing tag. Citing tag and cited tag have the same max/min value.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-1
Chapter 6 I/O device management
KingView software has no relation with the selected PLC or devices. It only
needs to configure the proper communication drivers for various kinds of hardware.
KingView drivers use up-to-date software technology which makes driver and
KingView form an integrated system. This mode not only ensures the high efficiency
of TouchView, but also enlarges the system scale.
The hardware KingView supported contains: PLC, intelligent module, board,
intelligent meter, transducer, etc. Engineers can regard every hypogyny machine as a
kind of device. They don’t need to care the protocol, but select the device type from
KingView device library and follow “Device config wizard” to finish installation step
by step. It makes the driver configuration more convenient.
KingView supports the following communication modes:
 Serial port
 Data acquiring board
 DDE
 Human-computer interface card
 Network module
 OPC
WellinControl Technology Development Co.,Ltd
6-2
Chapter 6 I/O device management
6.1 Device management
KingView device management structure lists various configured I/O devices
which communicate with KingView. Each device name is actually the logic name of
the actual device (It’s called logic device name for short to distinguish the actual
device name supplied by I/O device manufacturers). Each logic device name has a
corresponding driver to tone with actual device. KingView device management adds
the configuration wizard for device driver. Engineers only need configure parameters
according to configuration wizard. Select the manufacturer, device name,
communication mode of I/O device. Assign the logic name and address of device.
Then KingView startup and communicate with driver automatically without any help
of engineers.
KingView manages hardware devices in TouchExplorer. Configured devices list
in the device item under TouchExplorer interface uniformly. It appears as below.
Figure 6.1 I/O device
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-3
6.1.1 Concept of KingView logic device
KingView device management is realized by managing logic device name.
Namely, each actual I/O device must have a unique logic name in KingView which
corresponds with the information of I/O device like manufacturer, device name,
device communication mode, device address, etc. (The manage mode of logic device
name is just like manage the area code of cities. Each city has its own area code which
can be regarded as the logic name of city. For example, the area code of Beijing is 010
so that 010 stand for Beijing when you view the area code).
In KingView, certain I/O device name and logic device name are one to one
correspondence. One I/O device must have a unique logic device name, especially
many I/O devices with the same device model. The relation of tag, logic device and
actual device can be seen as below:
Figure 6.2 Relation of tag, logic device and actual device
WellinControl Technology Development Co.,Ltd
6-4
Chapter 6 I/O device management
For example, there are two FX2-60MR PLC produced by Mitsubishi Company
working as hypogyny machines to control industry producing scene. Meanwhile, two
PLC need communicate with epigyny machines. So two FX2-60MR PLC must have
different logic names as below.
Therein, PLC1 and PLC2 are logic device names defined by KingView (defined
by engineers), it might be not a actual device name.
Figure 6.3 Logical devices and actual devices
Otherwise, I/O tag and data exchange with I/O device are realized by logic
device name. When engineers define I/O tag properties in KingView, it needs to
assign the logic device name via which exchanges data with I/O tag. The relation of
I/O tag and logic device name is as below.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-5
Figure 6.4 Relation of I/O tag and logic device
A logic device can be related to many I/O tags.
6.1.2 KingView logic device classification
The logic device of KingView device management contains DDE device, Board
device (Bus device), serial port device, human-machine interface card, network
module. Engineers define and configure these logic devices by KingView device
management functions according to practical situations.
1. DDE device
DDE device is an independent Windows application exchanging DDE data.
Therefore, DDE device usually stands for an independent Windows application
which extend name is generally .EXE file. KingView and DDE device exchange
data through DDE protocol. For example, EXCEL is an independent Windows
WellinControl Technology Development Co.,Ltd
6-6
Chapter 6 I/O device management
application. KingView and EXCEL exchange data through DDE communication
mode. MODICON MICRO37 PLC service application explored by Beijing
WellinControl is an independent Windows application which is used to exchange
data between KingView and MODICON MICRO37 PLC. It can define a logic
name to service application as the DDE device of KingView. The relation of
KingView and DDE device is as below.
Figure 6.5 Relation of KingView and DDE device
You can know the means of DDE device by the structure diagram in
advance. Obviously, KingView, Excel, Micro37 are all independent Windows
applications and in running status. By assign a logic name to Excel, Micro37 and
DDE respectively, KingView can exchange data with corresponding applications.
The communication and operation method for DDE can be seen in Chapter
18 “DDE”.
2. Board device
Board logic device is actually the logic name of KingView embedded board
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-7
driver. Embedded board driver is not an independent Windows application, but a
DLL file can be imported by KingView. This kind of embedded board driver is
actually corresponded with the real I/O device inserted in computer bus extended
slot. Therefore, a board logic device stands for a real I/O board inserted in
computer bus extended slot. The relation of KingView and Board device is as
below.
Figure 6.6 Relation of KingView and Board device
Obviously, KingView calls in proper embedded board driver according to
assigned board logic device automatically. Therefore, you only need define board
logic device in logic device and KingView can finish others automatically.
3. Serial port device
Serial port device is actually the logic name of KingView embedded serial
WellinControl Technology Development Co.,Ltd
6-8
Chapter 6 I/O device management
port driver. Embedded serial port driver is not an independent Windows
application, but a DLL file can be imported by KingView. This kind of embedded
serial port driver is actually corresponded with the real I/O device inserted in
computer bus extended slot. Therefore, a serial port logic device stands for a real
I/O serial port inserted in computer bus extended slot. The relation of KingView
and serial port device is as below.
Figure 6.7 Relation of KingView and serial port device
4. Human-computer interface card
Human-computer interface card is also called high-speed communication
card. It not only differs from board, but also differs from serial port
communication. It is usually supplied by hardware producer, like MPI card from
Siemens S7-300, SA85 card from MODICON. The operating principle and
communication diagram appear as below.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-9
Figure 6.8 Relation of KingView and board
Device and computer can do high-speed communication by humancomputer interface card without occupying RS232 serial port because this kind of
human-computer interface card is mostly inserted in the ISA slot of computer.
5. Network module
KingView can connect with special network module through Ethernet and
TCP/IP protocol. For example, select Panasonic ET-LAN network
communication unit to connect with epigyny machine through Ethernet which
uses TCP/TP protocol with KingView applications in other computers. It appears
as below.
WellinControl Technology Development Co.,Ltd
6-10 Chapter 6 I/O device management
Figure 6.9 Relation of KingView and network module
Details about OPC device can be seen in Chapter 12 “OPC Device”.
6.1.3 How to define I/O device
After you know the concept of KingView logic device, you can define needed
devices easily in KingView. When you configure I/O device, a corresponding
configuration wizard will popup in which you can add, set, edit devices conveniently.
KingView supplies a great amount of kinds of drivers. You can select proper driver
according to installed I/O device.
6.1.3.1 How to define DDE device
Engineers can finish DDE device configuration according to Device configuration
wizard. The operation is:
1. Click DDE option under Device outline, “New” icon appears in the list content
display area as below.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-11
Figure 6.10 DDE device configuration
Double-click “New” icon to popup “Device configuration wizard” dialog box. Or
click right key to popup a floating menu. Select “New DDE node” menu command to
popup “Device configuration wizard” dialog box as well. It appears as below.
WellinControl Technology Development Co.,Ltd
6-12 Chapter 6 I/O device management
Figure 6.11 Device configuration wizard
Engineers select DDE node from tree device list box.
2. Click “Next” button to popup “Device configuration wizard---Select name”
dialog box as below.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-13
Figure 6.12 Input logical device name
Assign a logic name for DDE device in the edit box of dialog box, like
“ExcelToView”. Click “Previous” button to return to the last dialog box.
3. Click “Next” button to popup configuration wizard dialog box. It appears as
below.
WellinControl Technology Development Co.,Ltd
6-14 Chapter 6 I/O device management
Figure 6.13 Input DDE server information
Engineers need assign DDE service program name, topic name and data
exchange mode. If you want to edit logic name of DDE device, please click “Back”
button to return to the last dialog box. The means of each item in dialog box is:
 Service program name: It is the DDE service program name exchanging
data with KingView. It’s an I/O service program or a Windows application.
For example, Excel.exe.
 Topic name: It’s the topic name for DDE connecting this program to service
program. Sheet1 is the table name of Excel program.
 Data exchange mode: It’s the two kinds of conversation mode of DDE.
“High-speed block exchange” is a kind of mode for communication
programs explored by our company which exchange speed is very fast. If
engineers develop DDE service programs according to standard Windows
DDE exchange protocol, or exchange data between KingView and general
Windows application, should choose “Standard Windows items exchange”
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-15
option.
4. Click “Next” button to popup device configuration wizard---“Information
summary” dialog box as below.
Figure 6.14 All the information of configured DDE device
This wizard page shows all the information of configured DDE device. If you
need edit, click “Back” button to return to the last dialog box to edit. If don’t need edit,
click “Finish” button. Added DDE devices show on the DDE nodes under device node
of TouchExplorer.
5. After DDE device configuration, startup DDE service program and TouchView
6.1.3.2 How to define board device
Engineers can finish DDE device configuration according to Device
WellinControl Technology Development Co.,Ltd
6-16 Chapter 6 I/O device management
configuration wizard. The operation is:
Click Board in the outline item-Device in the list display area of TouchExplorer,
“New” icon appears in the list content display area which appears as below.
Figure 6.15 Board configuration
Take Advantech PCL_724 (24 channels digital input/output, using 8255 control
mode) for example to introduce board configuration.
1. Double-click “New” icon to popup “Device configuration wizard” list dialog box,
or click the right key of mouse to popup floating menu. Select “New Board”
menu command to popup “Device configuration wizard” list dialog box as below.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-17
Figure 6.16 Board configuration wizard
Select Board node from tree device list box and select the board producer
and device name. Like “Board/Yanhua/PCL724”.
2. Click “Next” button to popup device configuration wizard---“Logic name” which
appears as below.
WellinControl Technology Development Co.,Ltd
6-18 Chapter 6 I/O device management
Figure 6.17 Specify board name
Engineers need assign a logic name to board need to configure. Click “Back”
button to return to the last dialog box.
3. Click “Next” to popup device configuration wizard---“Board address”. It appears
as below.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-19
Figure 6.18 Board configuration information
Engineers need assign board address, initialization character (initialization
characters are inputted in form of port, dat, port, dat…… port is the dev value of chip
initialization address, dat is the initialization character), inputting mode of AD
transducer (single end or duplex end).
Note:
Initialization character is supplied for some boards need special control, like
board with 8255 chip, users need obtain the input/output status of each channel by
initialization character. In addition, some boards with counter need corresponding
initialization character configuration.
It is the initialization table of 8255 chip as below.
WellinControl Technology Development Co.,Ltd
6-20 Chapter 6 I/O device management
Cw
80H
81H
82H
83H
88H
89H
8AH
8BH
90H
91H
92H
93H
98H
99H
9AH
9BH
D4
Pa0-pa7
Output
Output
Output
Output
Output
Output
Output
Output
Input
Input
Input
Input
Input
Input
Input
Input
D3
Pc4-pc7
Output
Output
Output
Output
Input
Input
Input
Input
Output
Output
Output
Output
Input
Input
Input
Input
D1
Pb0-pb7
Output
Output
Input
Input
Output
Output
Input
Input
Output
Output
Input
Input
Output
Output
Input
Input
D0
Pc0-pc3
Output
Input
Output
Input
Output
Input
Output
Input
Output
Input
Output
Input
Output
Input
Output
Input
Note:
Single end and duplex end are just aim to input analog signal. Select different
input modes according to different analog signal amplifiers. Details can be seen in
user guide of board.
If you want to edit the logic name of board, click “Back” button to return to last
dialog box.
4. Click “Next” button to popup the device configuration wizard---“Information All”
dialog box for summarizing all the information of defined devices. It appears as
below.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-21
Figure 6.19 All the information of information of configured board
This wizard page shows the device information of configured board. If you want
to edit it, please click “Back” button to return to the last dialog box. If there is no need
to edit, click “Finish”. The board node displays added boards under device node of
TouchExplorer.
Note:
Explain for every register of board can be seen in Appendix CX.
6.1.3.3 How to define serial port devices and setup serial port parameters
6.3.3.3.1 How to define serial port devices
WellinControl Technology Development Co.,Ltd
6-22 Chapter 6 I/O device management
Engineers can configure serial port devices according to device configuration
wizard. KingView supports 128 serial ports at most. The operation method is:
1. Click COM1 or COM2 in the outline item-Device in the list display area of
TouchExplorer, “New” icon appears in the list content display area as below.
Figure 6.20 New serial port device
Double-click “New” icon to popup “Device configuration wizard” dialog
box. Or click the right key of mouse to popup floating menu. Select “New logic
device” menu command to popup “Device configuration wizard” dialog box. It
appears as below.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-23
Figure 6.21 Serial port configuration wizard
Select one node from PLC, Intelligence meter, Intelligence module, Board,
transducer in tree-shape device list box. Select the producer, device name and
communication mode of serial port device need to configure. Devices like PLC,
Intelligence meter, Intelligence module, Board, transducer always connect to
computer by serial port for communication.
4. Click “Next” button to popup device configuration wizard---“Logic name” dialog
box. It appears as below.
WellinControl Technology Development Co.,Ltd
6-24 Chapter 6 I/O device management
Figure 6.22 Assign a logic name to serial device
Engineers need assign a logic name to serial device need to configure. Click
“Back” button to return to the last dialog box.
3. Click “Next” button to popup device configuration wizard---“Select COM number”
dialog box.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-25
Figure 6.23 Assign serial port for device
Engineers assign the serial port number for configured serial port device. This
dropdown serial port list box has 128 numbers for choosing.
4. Click “Next” button to popup device configuration wizard---“Device address
setting guide” dialog box which appears as below.
WellinControl Technology Development Co.,Ltd
6-26 Chapter 6 I/O device management
Figure 6.24 Specify device address
Engineers assign device address for serial port device. This address should
respond actual device address. You can get details in KingView Device Help. If you
want to change the device name of serial port device, click “Back” button to return to
the last dialog box.
5. Click “Next” button to popup device configuration wizard---“Communication
parameters” dialog box as below.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-27
Figure 6.25 Configures tactic parameters
This wizard page configures the tactic parameters of system try to recover
communication when the device communication failed.
a) Interval to try too recovery: During KingView running, a device like PLC1
failed, KingView can diagnose automatically and stop acquiring the relating
data with this device. However, KingView would try to recover the
communication with this device every some times. The time try to recover is
30 seconds as follow.
b) Longest recovery time: If KingView can’t recover the communication with
PLC1 in some time, it will never try to recover communication. The interval
is the longest recover time. When it is set to 0, the parameter - longest
recover time is invalid, namely, system keeps trying to recover
WellinControl Technology Development Co.,Ltd
6-28 Chapter 6 I/O device management
communication with failed device without time limit.
c) Use dynamic optimize: KingView uses dynamic management to all the
communication process. Only if computer need data, they can be acquired.
These tags can be called active tags. It contains:
Tags used in displaying picture.
Tags used in History.
Tags used in Alarm record.
Tags used in scripts (Application scripts, condition scripts, data change scripts,
hotkey scripts, picture scripts in current displaying picture).
Meanwhile, KingView doesn’t communicate the data needn’t update temporarily.
This method can reduce the conflict largely that serial port communicating speed is
slow. It’s propitious to improve the efficiency and performance of system.
For example, Engineers define thousands of I/O tags for an OMRON PLC. But in
a certain time, dynamic links, historical record, alarm, scripts in displaying picture
maybe only use pars of I/O tags. KingView only acquires these active tags through
dynamic optimization in this situation.
When the number of I/O tags increases obviously, this communication mode
ensures data acquiring period unchangeable.
If communication parameters need to edit, click “Back” button to return to the
last dialog box. If there is no need to edit, click “Next”.
6. Click “Next” button to popup device configuration wizard---“Information all”
dialog box which appears as below.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-29
Figure 6.26 All the information of configured device
This wizard page shows the device information of configured serial port device.
If you need edit, click “Back” button to return to the last dialog box. If there is no
need to edit, click “Finish” button to display added serial port device under device
node of TouchExplorer.
6.1.3.3.2 How to setup serial port parameters
For different serial port device, the parameters of its communication are different,
like baud rate, data bit, parity bit and so on. Therefore, you still need to setup the
parameters of serial port during computer communication after defining device. Like
it mentions in last section, select COM1. Double click “COM1” icon from Device in
the list display area of TouchExplorer to popup “Setup serial port COM1” dialog box
as below.
WellinControl Technology Development Co.,Ltd
6-30 Chapter 6 I/O device management
Figure 6.27 Set communication parameters
In “Communication parameter” frame, select proper baud rate, data bit, parity bit,
stop bit, etc which can be selected according to correlative device help of KingView
or communication parameters of device. “Communication overtime” is a default value.
Generally it don’t need edit except special explain. “Communication mode” is the
communication mode of computer serial port which is RS232 or RS485. Generally it
should be RS232, you can select the type according to practical situation.
6.1.3.4 How to define OPC server device
You can get details in chapter 20 “OPC device”.
6.1.3.5 How to define device with network module
The communication modules of some devices like PLC are network modules.
They support TCP/IP protocol. They exchange data with computer by these modules.
For example, S7-300 Series Ethernet communication device of SIEMENS PLC.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-31
Figure 6.28 Select Ethernet device
1. Double-click “Device/New” icon in TouchExplorer to popup device configuration
wizard. Select node “PLC/SIEMENS/S7-300 Series/TCP/IP” which appears as
below.
2. Click “Next” to popup device configuration wizard---“Logic name” dialog box as
below. Input the logic name of device into the edit box, like “SIEMENS_PLC”.
WellinControl Technology Development Co.,Ltd
6-32 Chapter 6 I/O device management
Figure 6.29 Logical name of device
3. Click “Back” to edit the device parameters. Click “Next” to popup device
configuration wizard---“Device address configuration”. As Figure 6.30 shows,
type 172.16.2.72:3 in the address EditBox (Please refer to KingView Drivers help
guide).
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-33
Figure 6.30 Device address
4. Click “Back” to edit the device parameters. Click “Next” to popup device
configuration wizard---“Communication parameters” which appears as below.
Edit the recover static while device communication failed. Details can be seen in
the section 6.1.3.3.1.
WellinControl Technology Development Co.,Ltd
6-34 Chapter 6 I/O device management
Figure 6.31 Set communication parameters
5. Click “Back” to edit the device parameters. Click “Next” to popup device
configuration wizard---“Information All”. It appears as below.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-35
Figure 6.32 All configuration information
6. Click “Back” to edit configuration. Click “Finish” to complete.
6.1.3.6 How to setup KingView as a network device
KingView distributed in control system can communicate through network to
access real-time data. The real-time data of remote access KingView has two kinds of
modes: One is to define a server as a net node. Define the connection between tags
created in client and tags in net node to access real-time data. Another is to quote tags
in remote node directly by network functions of KingView. You can get details about
the second method in chapter 23 “Network”. The characters of two methods are:
1. All the clients can access the real-time data on the server.
2. The first method is to define tags on the client. If there are so many data need to
access, workload is heavy and the points of client system would increase. But
WellinControl Technology Development Co.,Ltd
6-36 Chapter 6 I/O device management
some operations can be processed on the local computer as well like historical
record, generating alarm and so on.
3. The second method doesn’t need define tags on the client. It quotes tags from
server directly. The points of client system wouldn’t increase, but accessing data
only can be obtained from history server.
Hereby explain the configuration of the first method.
6.1.3.6.1 Define a net node device
The function is used in way of KingView “NET VIEW”. Select outline item
“Device/Net node” in the list display area of TouchExplorer. “New…” icon appears in
the list content display area on the right of screen. It appears as below.
Figure 6.33 Network note
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-37
Double-click “New…” to popup net node dialog box as below.
Figure 6.34 Create Network node
Input the computer name or IP address of remote station into “Computer name”
text box, like “Data-acquire station”. If the remote station has a backup computer,
please check “Local node has backup computer” and input the name of backup
computer in “Backup computer name” text box. Therefore, local node could also
switch to backup computer and communicate with it automatically to keep data
perfectly when the remote node failed and switched to backup computer. Click “OK”
button after input complete. Then a net node device is done. A net node device called
“Data-acquire station” appears under “Device/Net node” of TouchExplorer.
6.1.3.6.2 Use net node device:
1. Define network mode
Before using the net node device, you should configure the network
functions of clients and servers. Define both sides to “Network” mode.
WellinControl Technology Development Co.,Ltd
6-38 Chapter 6 I/O device management
Double-click the outline item “System config/Network config” of
TouchExplorer to popup network configuration dialog box as below.
Figure 6.35 Network configuration
Select “Network” option. Input the computer name or IP address of local
computer into “Local node name”, such as client is “Client”. Select all items of
“Node type” properties page. Operation on other items in the dialog box can be
seen in chapter 21 “Network”.
2. Define tag
Details about how to define tag can be seen in chapter 5 “Tag definition and
management”. Select net node device in the “Connect device” list. Input the tag
name of corresponding remote tag in “Remote tag” edit box, like remote tag is
“DataAquire_MaterialLevel”. It appears as below.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-39
Figure 6.36 Tag definition
Real-time data in the remote node can be acquired to client like this. It
realizes the communication between KingViews on the network.
6.1.4 Define the advanced search function of IO device
6.1.4.1 Select driver
There is a button of “Advanced Search” at the left side of Device Configuration
Wizard, as shown in the Figure 6.37.
WellinControl Technology Development Co.,Ltd
6-40 Chapter 6 I/O device management
Figure 6.37 Device configuration wizard
Click “Advanced Search” button and pop-up a dialogue box as shown in the
Figure 6.38. The tree of device kind and factory information is on the left side of the
page, and the right side is the corresponding driver information. The dialogue box can
be maximized and dragged freely to any size.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-41
Figure 6.38 Advanced search
Select the directory in the tree on the left, then corresponding device driver
information will be listed on the right of the page, it including device type, sub kind,
factory, device name and so on, and driver can be selected from list, which can be
positioned with the driver selected in the wizard tree each other.
6.1.4.2 Driver search
Click “Search” button and pop-up driver search picture. The driver information
listed is the device driver information of current selected folder and its sub-folder as
shown in Figure 6.39. Or Right-click anyone in the directory tree select “Search” can
also pop-up driver search picture.
WellinControl Technology Development Co.,Ltd
6-42 Chapter 6 I/O device management
Figure 6.39 Driver search
After inputting Key Word, you can search according to “Factory”, “Device
Name”, “Description”, “Driver File”, “Version”, “File Needed” and so on.
Only after a record in the drivers list is selected, “OK” button is available.
6.1.4.3 Display local information
Use the mouse to select one or more driver, and then right-click to “Display
Local Information” as Figure 6.38, 6.39 shows. Read driver information from local
computer and fill it to the column “Local Information” in the list.
Note:
1. The column “Local Information” in the list is read from local by program,
the others are all read from list file, which is requested to fill by programmer during
developing.
2. The position selected by mouse can also be selected by keyboard. The up or
down selecting operation can be done through pressing upward symbol or
downward symbol key on the keyboard, similar to the tree, pressing leftward symbol
or rightward symbol key can fold and unfold it.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-43
6.2 Simulative PLC
Programs exchange data with hypogyny machines through I/O device while
system running. When program is debugging, simulative device can be used to
simulate hypogyny machines to provide data for picture program. It makes the picture
program debugging easier.
KingView supplies a simulative PLC device to simulate actual device to provide
data for program.
6.2.1 Define a simulative PLC
Before using a simulative PLC device, please define it first. Actual PLC devices
usually provide data by serial port for KingView so that simulative PLC is simulating
installed to COM. The definition operation is:
1. Click COM1 or COM2 in the outline item-Device in the list display area of
TouchExplorer, “New” icon appears in the list content display area. Double-click
“New” icon to popup “Device configuration wizard” dialog box. It appears as
below.
WellinControl Technology Development Co.,Ltd
6-44 Chapter 6 I/O device management
Figure 6.40 Device configuration wizard
Select PLC in the I/O device list display area. Click “+” to extend the node.
Click “KingView” and click “+” to extend the node. Click “Simulate PLC”
device and click “+” to extend the node. Finally, select “Serial”.
2. Click “Next” button to popup “Device configuration wizard---Logic name” dialog
box as below.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-45
Figure 6.41 Specify logical name
Input the logic name of a simulative PLC device in the edit box. For
example, set as “simu”.
3. Click “Next” button to popup “Device configuration wizard---Select COM”
dialog box as below.
WellinControl Technology Development Co.,Ltd
6-46 Chapter 6 I/O device management
Figure 6.42 Select COM
There are 32 serial port devices (COM1-COM32) listed in dropdown list
box for choosing. For example, select COM2 from dropdown list box.
Notes: The defined serial port is virtual. Actual simulative PLC device
doesn’t use COM port of computer and it needn’t configure as well.
4. Click “Next” button to popup “Device configuration wizard---Device address
setting guide” dialog box as below.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-47
Figure 6.43 Specify device address
Input the device address of simulative PLC into the edit box.
5. Click “Next” button to popup “Device configuration wizard---Communication
parameters” dialog box as below.
WellinControl Technology Development Co.,Ltd
6-48 Chapter 6 I/O device management
Figure 6.44 Set communication parameters
6. Click “Next” button to popup “Device configuration wizard---Information All”
dialog box as below.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-49
Figure 6.45 All configuration information
Click “Finish” button to finish installing. Click “Back” button to return to the last
operation to edit.
After installing simulative PLC device, it can be viewed in TouchExplorer. Select
COM2 from outline item-Device. The installed devices will appear in the list content
display area on the right of screen.
WellinControl Technology Development Co.,Ltd
6-50 Chapter 6 I/O device management
Figure 6.46 Define simulative PLC device
6.2.2 Register of simulative PLC
The simulation PLC provides 6 types of internal register tags, INCREA,
DECREA, RADOM, STATIC, STRING and CommErr. From which INCREA,
DECREA, RADOM, and STATIC register variables are Short data type labeled from 1
to 1000; STRING register tags are labeled from 1 to 2. The register tags are explained
as follows:
6.2.2.1 INCREA register
The variation range of the register tag is 0-1000. The numeration rule of the
register tag is to add integer value to the back of register name. Meanwhile, the integer
value stands for the ascending range of the register tag. For example, INCREA100
stands for the register tag starts from 0 and adds 1 for every change. The variation
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-51
range is 0 to 100. The number and the range of this register tag can be seen in the
following table:
Register tag
INCREA1
INCREA2
INCREA3
…
INCREA1000
Variation range
0-1
0-2
0-3
…
0-1000
6.2.2.2 DECREA register
The variation range of the register tag is 0-1000. The numeration rule of the
register tag is to decrease integer value to the back of register name. Meanwhile, the
integer value stands for the descending range of the register tag. For example,
DECREA100 stands for the register tag starts from 0 and decreases 1 for every change.
The variation range is 0 to 100. The number and the range of this register tag can be
seen in the following table:
Register tag
DECREA1
DECREA2
DECREA3
…
DECREA1000
Variation range
0-1
0-2
0-3
…
0-1000
6.2.2.3 STATIC register
The register tag is a static tag for saving data sent out by users. Users write in
data and save them which can be read by users until new data are written in. The
numeration rule of the register tag is to add integer value to the back of register name.
Meanwhile, the integer value stands for the ascending range of the register tag. For
example, STATIC100 stands for the register tag only can receive one integer from 0 to
100. The number and the range of this register tag can be seen in the following table:
WellinControl Technology Development Co.,Ltd
6-52 Chapter 6 I/O device management
STATIC 1
STATIC 2
STATIC 3
…
STATIC 1000
0-1
0-2
0-3
…
0-1000
6.2.2.4 RADOM register
The value of the register tag is a random value for user reading. The tag is a readonly tag. Users can’t write data in it. The numeration rule of the register tag is to add
integer value to the back of register name. Meanwhile, the integer value stands for the
ascending range of the register tag. For example, STATIC100 stands for the register
tag only can receive one integer from 0 to 100. The number and the range of this
register tag can be seen in the following table:
RADOM 1
RADOM 2
RADOM 3
…
RADOM 1000
0-1
0-2
0-3
…
0-1000
6.2.2.5 STRING Register
The value of a STRING Register variable is a read-only string. STRING
registers labeled from 1 to 2. The format of which is “hello: number – number”, plus
“number” and then add by 1.
6.2.2.6 CommErr register
The register tag is a read-write discrete tag which stands for communication
status between KingView and devices. CommErr=0 stands for normal status.
CommErr=1 stands for fault status. Users can control system to communicate with
simulative PLC by changing the status of CommErr register. Set CommErr register to
open status to interrupt communication. Set CommErr register to close status to
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-53
resume communication.
6.2.3 Example of simulative PLC
Take constant register STATIC100 operation as example to explain how to use
simulative PLC device.
6.2.3.1 Define a Simulative PLC
Details can be seen in section 6.2.1. Suppose defined device appears as below.
Figure 6.47 Device information
6.2.3.2 Define I/O tag
Define an I/O tag old_static which is used to read/write the data in constant
register STATIC100. The diagram is:
WellinControl Technology Development Co.,Ltd
6-54 Chapter 6 I/O device management
The process of defining a tag old_static is:
Select “Tagname Dictionary” under the outline item-Database in the list
display area on the left of screen. Double-click “New” icon in the list content
display area on the right of screen to popup “Tag properties” dialog box. It
appears as below.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-55
Figure 6.48 Tag definition
In the dialog box, tag name is defined as old_static. Tag type is I/O float.
Connection device is simu. Register is STATIC100. The data type of register is
INT. Read/write property is RW (According to the register type.) Other
definitions can be seen in the diagram above. Click “OK” to finish old_static tag
definition.
Note:
Different devises have different register types. Register type has three properties:
read-only, write-only, read/write. Details can be seen in appendix.
WellinControl Technology Development Co.,Ltd
6-56 Chapter 6 I/O device management
6.2.3.3 Make picture
In TouchExplorer, click “Project\Switch to Maker” menu command to enter into
WindowMaker. Made picture is as below:
Figure 6.49 Make animation links
Make animation links for two output texts “###” which are read data and write
data.
The output text of write data “###” need connect to “Analog input”. Expression
is tag old_static as below.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-57
The output text of read data “###” need connect to “Analog output”. Expression
is tag old_static as below.
6.2.3.4 Run picture program
Run KingView picture program to open pictures. It appears as below.
WellinControl Technology Development Co.,Ltd
6-58 Chapter 6 I/O device management
Write a value 80 to constant register STATIC100. The output value in read data is
80 as well.
6.3 Other special functions of communication in
KingView
6.3.1 Communication test in development environment
In order to ensure users to use hardware conveniently, users can test hardware in
KingView development environment after configuring and connecting device. Tested
register can be added to tag list directly. Select a certain device, click right key of
mouse to popup floating menu. All the devices except DDE have the menu item
“Test\Device name”. Take KingView simulate PLC device for example, click the right
key of mouse on the device name to popup a shortcut menu. It appears as below.
Figure 6.50 Test device
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-59
Click “Test…” to popup different dialog boxes for different kinds of hardware
devices. For example, serial port device (Serial port device---KingView simulate PLC)
can popup a dialog box as below.
Figure 6.51 Test device – Communication parameters properties page
The dialog box has two properties pages: communication parameter and device
test. “Communication parameter” properties page mainly defines serial port
parameters and device definition and so on. You can get details about how to select
parameters referring to correlative chapters and device help.
WellinControl Technology Development Co.,Ltd
6-60 Chapter 6 I/O device management
Figure 6.52 Test device – Device test properties page
Device test page can be seen above. Select the register for device need to be tested.
 Register: Select register name from register list. Fill in the number of register
(details in KingView device help). Like “INCREA100” of “INCREA” register.
Then select the data type of register from “Data type” list box.
 Add: Click the button to add defined register to “Acquire list” to wait for
acquiring.
 Delete: If a certain register in acquire list doesn’t need test any more. Select it
from acquire list. Click the button to delete selected register.
 Read/Stop: When communication test is not running, “Read” button is visible.
Click the button to acquire data for defined register in acquire list. Meanwhile,
“Stop” button turns to visible. When communication test need to stop, click
“Stop” button to stop data acquire. Meanwhile, “Read” button turns to visible.
 Evaluate to register: If defined register is read/write type, double-click the name
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-61
of register in “acquire list” to popup “Data input” dialog box during testing. Input
data in “Data input” dialog box. Click “OK” button to write data to the register.
Figure 6.53 Data input dialog box

Add tag: Define a tag for selected register in current acquire list and add it to the
Tagname Dictionary of KingView. Click the button to popup tag name dialog box
as below.
Figure 6.54 Add tag – input tag name
WellinControl Technology Development Co.,Ltd
6-62 Chapter 6 I/O device management
Input the tag name of the register into the edit box. Click “OK” to add the
tag to tag list of KingView. The connection device and register is current device
and register.
 Add all: Add all the registers in current acquire list to tag list of KingView
according to assigned first tag name. The tag name of each tag is adding a
number behind the first tag name. If the tag name of defined first tag is “Tag”,
the following tags could be “Tag1”, “Tag2”…
 Acquire list: Acquire list mainly displays defined registers for communication
test and displays acquired data, time stamp, quality stamp, etc during
communication running.
The device communication test in development environment makes users
understand device communication ability easily. Users don’t need define many tags or
make a great number of animation links which saves many jobs.
Note:
Serial port device, board device and OPC device can be tested. Other devices
like DDE, some special communication cards, don’t support the function yet. If you
have some question, please contact with Asiacontrol technology support.
6.3.2 How to judge and control communication status in
TouchView
KingView drivers (except DDE) define CommErr register for every device. The
register stands for device communication status whether fail or normal. In addition,
users can control the on/off status of device communication by editing the value of
register.
Before you use this function, you should define an I/O discrete tag for the
register which is Read/Write type. When the value of the tag is 0 or set to 0, it stands
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-63
for communication is normal or recovering communication. When the value of the tag
is 1 or set to 1, it stands for communication failed or stopping communication.
In addition, when a device communication is failed, the output value of IO tag
corresponding to failed device in the picture turns to “???” to stand for communication
failing. After communication resumes to normal, “???” disappears and resume to
normal value displaying.
6.3.3 How to use modem to remote dial-up device for acquiring
data
KingView support standard 232 serial port devices to access by MODEM dial-up.
6.3.3.1 Dial-up configuration
Select the outline item-“Device” in TouchExplorer. Select the label of serial port
connecting to MODEM, like “COM2”. Double-click “COM2” to popup serial port
configuration dialog box as below.
Figure 6.55 Set serial port
WellinControl Technology Development Co.,Ltd
6-64 Chapter 6 I/O device management

Communication parameter: set baud rate, parity mode, data bit, stop bit,
communication mode with computer for serial port communicating. This setting
can be used to every device with serial port communication.
 MODEM: It means the serial port is in dial-up access device mode.
Main Modem AT control word: Setup the control word of Modem
connecting to PC. Write the control word to main Modem while system startup.
Secondary Modem AT control word: Setup the control word of Modem connecting to
devices.
Note:
It is advised to use special software (like Windows super terminal) setup the
control word of each Modem according to Modem user guide before system running.
Therefore, users don’t need to setup them.
Click “OK” button to return after setting. A Modem device appears in the device
list of KingView as below.
Figure 6.56 Define Modem device
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-65
6.3.3.2 Use device dial-up
6.3.3.2.1 Create Modem tag
Modem device has four registers.
1. IPC: Control on-off register
Data type: INT, read/write
Label: 1---Start dial-up, 99---stop
2. IPS: Dial through status register
Data type: INT, read-only
Label: 0---not dial through, 1---dial through
3. IPN: Needed telephone number
Data type: STRING, read/write
4. CommErr: Device communication status and controllable device communication
status
Data type: Bit, discrete, read/write
Label: 0---allow to communicate, 1---stop communicating
Create a new tag in Tagname Dictionary of KingView (the definition method can
be seen in chapter 5 Tag definition and management), for example, IPC1, IPS1, IPN1,
Cerr1 are defined as above four registers. Set the original value of Cerr1 to “Off”.
6.3.3.2.2 How to use Modem dial-up
Define data acquire device in KingView, like “WellinControl PLC”. The
connecting serial port is COM2. Define corresponding I/O data acquire tag. Define the
“CommErr” register tag of device “WellinControl PLC”, like “PLCCerr”. The original
value of it is “Open”.
Note:
When system startup, each connected device startup automatically. Data
WellinControl Technology Development Co.,Ltd
6-66 Chapter 6 I/O device management
acquire device “Asiacontrol PLC” doesn’t connect to PC so that generally devices
would fail. Therefore, when you define “CommErr” register tag of data acquire
device “Asiacontrol PLC”, the original value should be set to “On”, namely,
pausing the device.
Users input telephone number (Tag IPN1) to dial-up while system startup. When
you dial though, namely, the value of IPS1 is 1, set the value of CommErr register of
Modem (Tag Cerr1) to 1, namely, pausing Modem device. Set the value of CommErr
register of data acquire device (Tag PLCCerr) to 0, namely, recovering Modem device
to acquire data. After data acquiring, you could pause data acquire device first, then
resume the communication of Modem device, finally stop it.
It is easier for users to remotely debug, monitor and data acquire that users
acquire device data by Modem dial-up. But users must be careful: Modem dial-up is
only used to simple standard 232 serial port communication device. It doesn’t support
some special 232 serial ports like 232C link circuit, current ring and so on. If you have
some problem when you use them, please contact with WellinControl technology
support.
6.3.4 How to use GPRS to communicate with device remotely
Following CMCC set GPRS wireless data transmission aboard, more and more
users realize its advantages such as fast communication speed, low cost, easy to
connect to Internet and so on. GPRS data transmission terminal has TCP/IP protocol
conversion function which needn’t TCP/IP support. All of the terminals with serial
ports can realize wireless and transparent transmission if information through GPRS
network platform. And it provides GPRS communication ability for terminals without
TCP/IP process ability. Nowadays, GPRS data transmission terminal has been widely
used in data remote transmission and monitoring aspects in many fields like
environmental protection, water conservancy, oil field, electric power, industrial
control and so on.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-67
We currently support GPRS DTU equipment from the following manufacturers
(please refer to the GPRS section of KingView’s Hardware online Help for more
details): Xiamen Sangrong, Beijing Yineng, Beijing Hanzhitong, Tangshan Landi,
Taiwan Weipu, Beijing Ericsson, Shenzhen Hongdian UDP, Shenzhen Hongdian TCP,
Shenzhen Yitian, Beijing Outemu, Fujian Shida UDP, Shanghai Lanfeng, Guangzhou
Congxing, Hangtian Jinruan, Bokong ERA5200 Controller, Jiafuxin, Fujian Shida
TCP, Lantian Dingfeng (NETJET), Jiangyin Hongxin, Xiamen Yuneng, Shanghai
Yingshuo.
Figure 6.57 shows how a user communicates with Kingview via GPRS.
Figure 6.57 Communication between GPRS and KingView
6.3.4.1 Define GPRS---Virtual serial port device
Take an example to explain how to define GPRS DTU device in KingView.
Example:
A Modicon PLC can be used (MODBUS RTU Protocol) as an onsite data
collection device. Kingview communicates with a Modikang PLC via Sangrong’s
GPRS devices. Use the following steps to define a device in Kingview:
1. Select a serial port device and define an actual device (namely MODICON PLC)
as below.
WellinControl Technology Development Co.,Ltd
6-68 Chapter 6 I/O device management
Figure 6.58 Define serial port device
2. Assign the logic name of MODICON PLC as below.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
Figure 6.59 Define device name
3. Select a virtual serial port to MODICON PLC as below.
WellinControl Technology Development Co.,Ltd
6-69
6-70 Chapter 6 I/O device management
Figure 6.60 Select virtual serial port
Select virtual serial port (GPRS device): Check it which stands for
KingView communicates with serial port device through GPRS. If don’t check,
KingView will communicate with devices directly.
4. Define GPRS device on virtual serial port as below.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-71
Figure 6.61 Define virtual serial port device



Logic name: GPRS device name defined on virtual serial port can be custom
defined.
Select device: Select KingView support GPRS device from dropdown menu.
DTU device label and device port number: Two parameters need keep in
line with the correlative setting of GPRS hardware. KingView can find the
correlative GPRS device by this information.
Note:
You can get details about how to set GPRS hardware parameters in KingView
online help---GPRS help of KingView hardware help or correlative hardware
manual.

Select defined virtual device: When check “Select defined virtual device”
check box, defined virtual devices will appear in dropdown list box. Users
WellinControl Technology Development Co.,Ltd
6-72 Chapter 6 I/O device management
can select defined virtual device (The selection is used in the situation of
connecting several data acquire terminals with same protocol to a GPRS
DTU with 485 ports).
5. Define device address: The address of actual device under GPRS which appears
as below.
Figure 6.62 Define device address
6. Click “Next” button to popup “Device configuration wizard---Communication
parameter” dialog box as below.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-73
Figure 6.63 Define communication parameters
7. Click “Next” button to popup “Device configuration wizard---Information All”
dialog box as below.
WellinControl Technology Development Co.,Ltd
6-74 Chapter 6 I/O device management
Figure 6.64 All device information
Then system will generate two icons for two devices after definition complete:
Virtual serial port device (namely, GPRS DTU device) and actual device under
GPRS.
Note:
1. Define one virtual device on a virtual serial port.
2. Each virtual device can correspond to many actual devices (Device protocol
must be the same).
3. Actual device address related to every virtual device can’t repeat.
4. All of the logic names of virtual devices or actual devices in the project can’t
repeat.
5. DTU labels of different virtual devices can’t repeat.
6. Port numbers of virtual device in the same company should keep in line.
WellinControl Technology Development Co.,Ltd
Chapter 6 I/O device management
6-75
6.3.4.2 Define GPRS tag
GPRS device has two registers:
Register
name
V_S
RW
properties
Read-only
Data type
Expression
SHORT
V_C
Read-write
SHORT
Virtual device (GPRS DTU
device) status: 0 stands for no
connection with GPRS network. 1
stands for connecting to GPRS
network.
Virtual device controls register: 0
stands for stop virtual device
running. 1 stands for resume
virtual device running.
You also need define tags of terminal data acquiring device connected to GPRS
while communicating. This tag definition is all the same as definition without GPRS
device. Connect GPRS and tags of terminal data acquiring device in the picture.
KingView switch to run when communication is in normal status. Two registers V_S,
V_C of GPRS are both set to 1 stands for GPRS device has connected to GPRS
network and works properly. Data from terminal data acquiring device is real-time
refreshed. If users don’t want to communicate with device, users can set the value of
V_C to 0 to stop virtual device. It makes KingView stop communicating with device.
If you have some problem when you use them, please contact with WellinControl
technology support.
6.4 How to develop custom driver---driver development
pack
KingView drivers are supplied in form of DLL. When KingView has device
WellinControl Technology Development Co.,Ltd
6-76 Chapter 6 I/O device management
communicating, DLL program of the device is called in which is based on COM
technology to realize seamless connection between KingView and communication
program.
KingView supplies drivers for hundreds of devices. But if users want to develop
their own drivers, users can have a convenient driver development pack which
contains documentation and examples to help users develop their own drivers quickly
and effectively. If you want to know more about development pack, please contact
with WellinControl technology support.
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-1
Chapter 7 Picture and Animation links
7.1 Animation links summary
7.1.1 Animation links summary
The pictures made in WindowMaker are all static. How could they reflect the
condition of industrial scene? It need real-time database because only tags in database
can realize changing in step with the practical condition. How could the change of tag
lead to animation of picture? “Animation links”. “Animation links” is to build a
relation between symbols in the picture and tags. When the data from industrial scene
(like temperature, liquid level, etc) change, tag in real-time database will change as
well through I/O interface. If engineer defined a symbol, like pointer, connecting to
that tag, the pointer would deflect synchronously.
Animation link is a breakthrough for designing the human-computer interface. It
releases engineer from complex graphic program. It supplies standard industrial
control graphic interface for operator. And it can improve the functions of graphic
interface by programmable scripts links. Graphic objects and tags have various
connection types which provide great help for engineer to design graphic interface.
KingView also setups access level for some graphic objects with animation links
which is of far reaching importance for protecting system security.
WellinControl Technology Development Co.,Ltd
7-2
Chapter 7 Picture and Animation links
Graphic objects can edit color, size, position, filling percent, etc according to
animation links. A graphic object can define several links at one time as well. If you
compose of all the animation links, application will appear unbelievable animations.
7.1.2 Animation links dialog box
Define animation links to graphic objects in “Animation links” dialog box.
Double-click graphic objects (Can’t select several graphic objects at one time) in
WindowMaker to popup animation links dialog box.
Note:
The dialog boxes for different types of graphic objects are almost the same.
However, for some properties, they appear grey which stands for they can’t be used
in this graphic object or the graphic object defines other animation links which
can’t compatible with this animation link.
Take rounded-rectangle for example:
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-3
Figure 7.1 Animation link dialog box
The first line of dialog box labels the name of connected graphic object and the
coordinates of the top left of picture and the width/height of graphic object.
The second line of dialog box contains “Object name” and “Comment” edit box.
“Object name” is a unique name for symbol which can be used in later program
development. “Comment” means: startup system, if graphic object defines animation
links, defined comment will appear while the mouse cursor is put on the graphic
object.
Hereby explain all the kinds of animation links by groups.
 Change properties: It has three links (line properties, fill properties, text
color properties) which define how the properties like color, line type, fill
type of graphic object alter following the change of tag value or expression
value (“Expression” can be seen in section 10.2). Click a certain button to
WellinControl Technology Development Co.,Ltd
7-4
Chapter 7 Picture and Animation links






popup correlative linking dialog box. Graphic object in line type can define
line properties links. Graphic object in filled shape can define line properties
links and fill properties links. Text object can define text color links.
Change position and size: It has three links (fill, zoom, flip, horizontal shift,
vertical shift) which define how the graphic object changes position and size
following the change of tag value. Not all the graphic objects can define five
links. Click a certain button to popup correlative linking dialog box.
Value output: Only text object can define three kinds of output links (analog
value output, discrete value output, string output). It’s used to output the
value of expression of text graphic object on the picture. Text string will be
substituted by the value of expression while running. The size, font and text
of output string are all the same. Press any key to popup correlative output
link dialog box.
User input: All of the graphic objects can be defined as one kind of user
input links which makes linked object become a touch-sensitive object
while system running. An anti-shown rectangle appears around the touchsensitive object while TouchView running. The touch-sensitive object can
be selected by mouse or keyboard. Press SPACE, ENTER, or the left key of
mouse to popup input dialog box in which you can input data from keyboard
to change the values of tag in database.
Special: All of the graphic objects have blink, hide two kinds of links which
can define the visibility of graphic objects. Press any key to popup
correlative output link dialog box.
Slider input: All of the graphic objects can be defined as one kind of slider
input links (horizontal, vertical) which makes linked object become a touchsensitive object while system running. An anti-shown rectangle appears
around the touch-sensitive object while TouchView running. Drag the
graphic object with slider input link by the left key of mouse to change the
values of tag in database.
Script: All of the graphic objects can be defined as one kind of script links
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links



7-5
(on key down, on key up, while down) which makes linked object become a
touch-sensitive object while system running. An anti-shown rectangle
appears around the touch-sensitive object while TouchView running. The
touch-sensitive object can be selected by mouse or keyboard. Press SPACE,
ENTER, or the left key of mouse to execute user-inputted scripts which are
defined in script links. Press any key to popup correlative output link dialog
box.
Equivalent key: Configure the shortcut key having the same functions with
mouse operation when linked symbol is clicked to execute.
Priority: The edit box is to input the access level of linked graphic objects.
When Touchview is running, only the operators with higher access level can
access the symbol. This is an important function for KingView to guarantee
system security.
Security zone: The edit box is to configure the security zone for operating
linked symbols. When Touchview is running, only the operators put in the
security zone can access the symbol. This is an important function for
KingView to guarantee system security as well.
Note:
Only some graphic objects with special animation links can set priority and
security zone which are analog input link, discrete input link, string input link,
slider horizontal input link, slider vertical input link, script link (on key down, on
key up, while down).
7.2 General control items
7.2.1 Graphics edition tools
KingView toolbox concentrates commands using frequently to one control panel.
WellinControl Technology Development Co.,Ltd
7-6
Chapter 7 Picture and Animation links
It is easy to operate and saves screen space making you view the whole picture
conveniently. Every tool button has “Float hint” in toolbox to help you know the tool.
7.2.1.1 Introduction to toolbox
Graphics edition toolbox is the shortcut of painting menu commands. The menu
commands have been introduced in detail. It is only introduced typical graphics
edition toolbox and some other general tools in this section.
Every time when you open an old picture or create a new picture, graphics
edition toolbox appears automatically as below.
Figure 7.2 Toolbox
Check the menu “Tools/Display toolbar” to display toolbox. If it’s not checked,
the toolbox will disappear on the screen. You can also <F10> to switch between
toolbox Display/Hide. It appears as below.
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-7
Figure 7.3 Display toolbox
Toolbox has many general menu commands and some operations which aren’t
supplied in the menu. When you put mouse cursor on any button on the toolbox, a
float hint appears to explain the function of the tool button. It appears as below.
WellinControl Technology Development Co.,Ltd
7-8
Chapter 7 Picture and Animation links
Figure 7.4 Toolbox hit
Every time when users change the position of toolbox, KingView will record the
position automatically. When users enter into KingView next time, toolbox returns to
the last position.
Hint:
If toolbox can’t be found because of faulty operation, even from the menu,
please enter KingView installation path “kingview”, open the file toolbox.ini,
view the last item [Toolbox], see whether the coordinates of position are out of
display area of screen. Users can edit from the Tools directly. It’s noticed you
can’t edit other items.
7.2.1.2 Browse toolbox
Tools in the toolbox can be divided to four types:
 Picture: It supplies general operations to picture which contain new, open, close,
save, delete, all screen, etc.
 Edit: Draw various tools for symbols (rectangle, ellipse, line, polyline, polygon,
arc, text, bitmap, button, menu, report window, real-time trend, historical trend,
control, alarm window); typical edition tools like cut, paste, copy, undo, redo, etc;
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links


7-9
make, break symbol; make, break cell; the operation tools to symbols like bring
to front, send to back, rotate, duplicate and so on.
Align mode: It’s used to adjust the relative position between symbols. They can
align symbols in various modes like top, bottom, left, right, vertical, horizontal,
etc. You can space them vertically or horizontally as well.
Option: It supplies some other typical operations, like select all, display palette,
display brush type, display line type, grid display/hide, activate current wizards,
etc.
7.2.1.3 Toolbox details
Buttons in the toolbox are the shortcuts of painting menu commands. Details
about how to use these buttons can be seen in chapter 4 “KingView development
environment- WindowMaker”. You can know how to use graphics edition toolbox and
some other typical tools in this section.
New picture: It is the same as menu command “File\New picture” which is
used to define name, size, position, style of new picture and the file name for
saving picture.
Open picture: It is the same as menu command “File\Open picture” which is
used to open one or more created pictures.
Close picture: It is the same as menu command “File\Close picture” which is
used to close one or more created pictures.
Save picture: It is the same as menu command “File\Save picture” which is
used to save one or more created pictures.
Delete picture: It is the same as menu command “File\Delete picture” which
is used to delete one or more created pictures
WellinControl Technology Development Co.,Ltd
7-10 Chapter 7 Picture and Animation links
All screen: It is the same as menu command “Edit\All screen”
which is used to display current picture all screen.
Select symbol: It is the same as menu command “Tools\Select symbol” which is
used to select, move and resize symbols. It’s the default operation mode of mouse.
Most tools resume to this mode after operation. For example, draw a line with “Line”
tool, then “Line” button ejects and “Select symbol” button press down. It means
mouse resumes to “Select symbol” status.
Draw line: It is the same as menu command “Tools\Line” which is used to
draw a line in current line type.
Draw sector or arc: It is the same as menu command “Tools\Pie (arc)” which
is used to draw a pie in current line type and fill mode.
Draw ellipse: It is the same as menu command “Tools\Ellipse” which is used
to draw a internally tangent ellipse with dragged rectangle.
Draw rounded-rectangle: It is the same as menu command “Tools\Roundedrectangle”. If you select the tool, you can draw rectangle. If you need roundedrectangle, you need select “Reshape” tools to edit.
Draw polyline: It is the same as menu command “Tools\Ployline” which is
used to draw a polyline in current line type.
Draw pipe: It is the same as menu command “Tools\Pipe” which is used to
draw a line in current line type.
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-11
Draw polygon: It is the same as menu command “Tools\Polygon” which is
used to draw a polygon in current line type and fill mode.
Input text: It is the same as menu command “Tools\Text” which is used to
input text in current font.
Draw button: It is the same as menu command “Tools\Button”. If you want to
input button text, please select menu command “Tools\Button text”.
Draw menu: It is the same as menu command “Tools\Menu” which is used to
build menu on the picture.
Define alarm window: It is the same as menu command “Tools\Alarm
window” which is used to draw an alarm window in selected area.
Create Report: It is the same as menu command “Tools\Report window”
which is used to draw a report window in selected area.
Draw real-time trend: It is the same as menu command “Tools\Real-time
trend” which is used to draw a real-time trend in selected area.
Draw historical trend: It is the same as menu command “Tools\Historical
trend” which is used to draw a historical trend in selected area.
Draw bitmap: It is the same as menu command “Tools\Bitmap”. This tool
only can confirm the position and size of bitmap. If you want to input bitmap,
please select menu command “Edit\Paste bitmap”.
WellinControl Technology Development Co.,Ltd
7-12 Chapter 7 Picture and Animation links
Insert control: It is the same as menu command “Edit\Insert control”.
Insert general control: It is the same as menu command “Edit\Insert general
control”.
Open wizards: It is the same as menu command “Wizards\Open wizards” which
is used to activate wizards window.
Undo: The command is to cancel executed operation.
Redo: The command is to resume executed operation.
Cut: It is the same as menu command “Edit\Cut”. Please select one or more
symbols before cutting. The symbol is stored into memory temperately and
pasted to picture by “Paste” tool.
Copy: It is the same as menu command “Edit\Copy” which is used to copy
one or more selected objects.
Paste: It is the same as menu command “Edit\Paste” which is used to resume
one or more cut objects to picture.
Duplicate: It is the same as menu command “Edit\Duplicate” which is used to
duplicate one or more selected objects.
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-13
Make symbol: It is the same as menu command “List\Make symbol” which is
used to compose two or more selected objects to a whole symbol as a basic
symbol. Symbols with animation links, composed symbols, bitmaps or cells
can’t be the basic for making a new symbol.
Break symbol: It is the same as menu command “List\Break symbol” which
is used to break a complex symbol composed with some symbols to basic
symbols. If the complex symbol has animation link, delete the link
automatically.
Make cell: It is the same as menu command “List\Make cell” which is used to
compose all the selected objects to get a new cell. Animation links of each
component are kept the line.
Break cell: It is the same as menu command “List\Break cell” which is used
to break the cell to some basic symbols of original cells. If the cell has no
animation links, animation links of each component are keep the line.
Send to back: It is the same as menu command “List\Send to back” which is
to send one or more selected graphic objects to the back of all other intersected
graphic objects
Bring to front: It is the same as menu command “List\Bring to front” which is
to bring one or more selected graphic objects to the back of all other
intersected graphic objects
Reshape symbol: It is the same as menu command “Tools\Reshape symbol”
which is to change the radian of rounded-rectangle, angle of pie or arc, relative
position of each point of polygon/polyline.
WellinControl Technology Development Co.,Ltd
7-14 Chapter 7 Picture and Animation links
Change Font: It is the same as menu command “Tools\Font” which is to edit
the default setting of font.
Rotate symbol clockwise 90 degrees: It is the same as menu command
“List\Rotate clockwise 90 degrees” which is to rotate selected single symbol
clockwise 90 degrees centered at symbol centre. Complex symbol composed
by some simple symbols can be rotated as well, but some symbols can’t rotate at one
time. Cells can’t rotate.
Rotate symbol counterclockwise 90 degrees: It is the same as menu
command “List\Rotate counterclockwise 90 degrees” which is to rotate
selected single symbol counterclockwise 90 degrees centered at symbol centre.
Complex symbol composed by some simple symbols can be rotated as well, but some
symbols can’t rotate at one time. Cells can’t rotate.
Flip horizontal: It is the same as menu command “List\Flip horizontal”. This
command is to flip one or complex symbol composed by some graphic objects
horizontal. The flipping axis is the vertical axis of rectangle frame around
symbol or complex symbol. Some symbols can’t be flipped in one time. Cells can’t
flip.
Flip vertical: It is the same as menu command “List\Flip vertical”. This
command is to flip one or complex symbol composed by some graphic objects
vertical. The flipping axis is the vertical axis of rectangle frame around symbol
or complex symbol. Some symbols can’t be flipped in one time. Cells can’t flip.
Align top: It is the same as menu command “List\Align\Align top” which is to
make the upper boundary of some selected graphic objects align with the top
one. In every align mode, the boundary of selected object is the rectangle
frame composed with 8 small rectangles around object. The horizontal and vertical
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-15
coordinates of object are the horizontal and vertical coordinates of this rectangle
frame separately.
Align horizontal: It is the same as menu command “List\Align\Align
horizontal” which is to make the center of two or more selected graphic
objects in the horizontal line.
Align bottom: It is the same as menu command “List\Align\Align bottom”
which is to make the lower boundary of some selected graphic objects align
with the bottom one.
Align left: It is the same as menu command “List\Align\Align left” which is
to make the left boundary of some selected graphic objects align with the
leftmost one.
Align vertical: It is the same as menu command “List\Align\Align vertical”
which is to make the center of two or more selected graphic objects in the
vertical line.
Align right: It is the same as menu command “List\Align\Align right” which
is to make the right boundary of some selected graphic objects align with the
rightmost one.
Space horizontal: It is the same as menu command “List\Space horizontal”
which is to make some selected graphic objects space horizontal. The vertical
direction holds the line.
Space vertical: It is the same as menu command “List\Space vertical” which
is to make some selected graphic objects space horizontal. The horizontal
direction holds the line.
WellinControl Technology Development Co.,Ltd
7-16 Chapter 7 Picture and Animation links
Snap to grid: It is the same as menu command “List\Snap to grid” which is to
show/hide grids on the picture and decide whether the boundary of graphic
object align with gridline. After snapping to grid, symbol shift would be
counted by gridline.
Display palette: It is the same as menu command “Tools\Display palette”
which is to show/hide the palette window. Details about how to use palette can
be seen in the section 7.2.1.6.
Select all: It is the same as menu command “Edit\Select all” which is to make
all the symbols and cells in chosen status on the picture. Eight small rectangles
appear around all of objects.
Display brush type: It is the same as menu command “Tools\Display brush type”
which is used to show/hide brush and toolbar of transition color type. Details about
how to use brush type can be seen in the section 7.2.1.4.
Display line type: It is the same as menu command “Tools\Display line type”
which is used to show/hide the toolbar of selecting line type. Details about how to use
line type can be seen in the section 7.2.1.4.
The x, y coordinates and size of selected object can be displayed at the bottom of
toolbox as below.
Figure 7.5 Size and position of graphic object
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-17




The first text box shows the x coordinates (left boundary) of selected object.
The second text box shows the y coordinates (top boundary) of selected object.
The third text box shows the width of selected object.
The forth text box shows the height of selected object.
Users can edit any item of above text boxes to change position and size of object
for editing it easily.
7.2.1.4 Using brush type tools
KingView supplies eight kinds of brush type (fill) and 24 kinds of brush
transition color type. Show/hide brush type toolbar can be realized by selecting menu
command “Tools/Display brush type” or button “Display brush type” in the toolbox.
Brush type toolbar can make engineers select various brush filling types and transition
colors easily. It appears as below.
Figure 7.6 Brush type toolbar
Symbols supporting brush filling and transition color contain: rounded-rectangle,
ellipse, pie (arc) and polygon.
Brush filling types and using method
WellinControl Technology Development Co.,Ltd
7-18 Chapter 7 Picture and Animation links
1. Select symbols need to change brush filling type in the picture.
2. Click brush filling type button from brush type toolbar. Brush fill supports
eight types.
Fill all: It is the same as menu command “Tools\Fill properties\
” which
is to fill symbol solid by fill color.
Fill transparent: It is the same as menu command “Tools\Fill
properties\
”. The symbol is transparent only with the frame.
Bias fill: It is the same as menu command “Tools\Fill properties\
”.
Symbol is filled with bottom-left corner→top-right corner bias. The line color is
defined fill color.
Bias fill: It is the same as menu command “Tools\Fill properties\
”.
Symbol is filled with bottom-left corner→top-right corner bias. The line color is
defined fill color.
Grid fill: It is the same as menu command “Tools\Fill properties\
”.
Symbol is filled with horizontal-vertical grids. The line color is defined fill color.
Grid fill: It is the same as menu command “Tools\Fill properties\
Symbol is filled with bias grids. The line color is defined fill color.
WellinControl Technology Development Co.,Ltd
”.
Chapter 7 Picture and Animation links
7-19
Horizontal line fill: It is the same as menu command “Tools\Fill
properties\
”. Symbol is filled with horizontal lines. The line color is defined
fill color.
Vertical line fill: It is the same as menu command “Tools\Fill
properties\
”. Symbol is filled with vertical lines. The line color is defined fill
color.
Transition color types and using method
1. Select symbols need to change transition color type in the picture.
2. Click transition color brush type button from brush type toolbar. Brush fill
supports 24 types.
 Horizontal transition (from left to right)
A.
Color transition is: Fill color→Background color
B.
Color transition is: Background color→Fill color
C.
Color transition is: Fill color→Background color→Fill color
D.
Color transition is: Background color → Fill color →
Background color
 Vertical transition (from top to bottom)
A.
Color transition is: Fill color→Background color
B.
Color transition is: Background color→Fill color
WellinControl Technology Development Co.,Ltd
7-20 Chapter 7 Picture and Animation links

C.
Color transition is: Fill color→Background color→Fill color
D.
Color transition is: Background color→Fill color→Background
color
Diagonal transition
A.
Color transition is: Fill color→Background color. The direction is:
from top-left corner to bottom-right corner.
B.
Color transition is: Fill color→Background color. The direction is:
from top-right corner to bottom-left corner.
C.
Color transition is: Background color→Fill color. The direction is:
from top-left corner to bottom-right corner.
D.
Color transition is: Background color→Fill color. The direction is:
from top-right corner to bottom-left corner.
E.
Color transition is: Fill color→Background color→Fill color. The
direction is: from top-left corner to bottom-right corner.
F.
Color transition is: Fill color→Background color→Fill color. The
direction is: from top-right corner to bottom-left corner.
G.
Color transition is: Background color→Fill color→Background
color. The direction is: from top-left corner to bottom-right corner.
H.
Color transition is: Background color→Fill color→Background
color. The direction is: from top-right corner to bottom-left corner.
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links

7-21
Vertical angle transition
A.
Color transition is: Fill color→Background color. The direction is:
from top-left corner to bottom-right corner.
B.
Color transition is: Fill color→Background color. The direction is:
from top-right corner to bottom-left corner.
C.
Color transition is: Background color→Fill color. The direction is:
from top-left corner to bottom-right corner.
D.

Color transition is: Background color→Fill color. The direction is:
from top-right corner to bottom-left corner.
Cone-shaped transition
A.
Color transition is: Background color→Fill color. The direction is:
rectangle from inner to outer.
B.
Color transition is: Fill color→Background color. The direction is:
rectangle from inner to outer.
C.
Color transition is: Background color→Fill color. The direction is:
diamond from inner to outer.
D.
Color transition is: Fill color→Background color. The direction is:
diamond from inner to outer.
Adjust the fill color and background color of symbol transition color by executing
“Fill color” and “Background color” options on the palette. Background color and fill
color both support infinity color. Or select the fill color and background of symbol
transition color by palette first, and then select transition type.
WellinControl Technology Development Co.,Ltd
7-22 Chapter 7 Picture and Animation links
7.2.1.5 Use line type tools
KingView supports 11 kinds of line type. Line type window can make engineers
change line type easily. It appears as below.
Figure 7.7 Line type
Line type and using method
KingView supports 11 kinds of line type as below.
No line:
Dashed line (four kinds):
Real line (six kinds):
Select symbol need to edit line type in the picture. Click the correlative button on
“Line type selecting toolbar”, namely select symbol properties like line thickness
and dashed.
7.2.1.6 Use palette
“Palette” is actually paint box. It contains unlimited kinds of color. Show/hide
palette can be realized by selecting menu command “Tools/Display palette” or
clicking “Display palette” button in the toolbox. “Palette” can edit color for various
graphics, text and windows. Graphics contains: rounded-rectangle, ellipse, line,
polyline, pie, polygon, pipe, text, window background color and so on. “Palette” has
infinity color function. Namely besides “Basic color”, you can edit various colors by
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-23
“infinity color” and save or load information about mix colors. The appearance of
palette appears as below.
Figure 7.8 System palette
It is very easy to use “Palette”. The difficulty is to arrange colors in the picture.
Engineers need consider harmonious while selecting colors.
Palette toolbar
Palette supports infinity color and current palette displays basic color. It appears
as below. Every time when users edit the position of palette, KingView will memorize
it. When users use KingView next time, palette will return to last position.
WellinControl Technology Development Co.,Ltd
7-24 Chapter 7 Picture and Animation links
Figure 7.9 Palette
Object selecting button: Select the object need to fill color. They are line color,
fill color, background color, text color, window color, transparent color. When you
move mouse cursor to the button, corresponding name appears for operating easily.
Select basic color: Select needed color from current palette directly. The first one
is multi-color selection, others are single color selections.
Custom palette: Setup for users selecting infinity color. Its button definitions are:
display palette window, blotter tool, save current palette setting, load current palette
setting. Selecting color area is following.
It has six color properties selecting buttons on the top of “Palette”. You can select
any button to change correlative color properties. Six buttons stand for “line color
(line properties)”, “fill color (fill properties/foreground properties)”, “background
color (background properties)”, “text color (text color)”, “window color (window
background color)”, “transparent color (bitmap transparent color)”.
Six color properties selecting buttons can be seen as below.
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-25
Figure 7.10 Color properties selecting buttons
Line color button
Click the button. Select a color from palette as the line. Then the color is used to
draw line, polyline and the frames of closed graphics like rectangle and ellipse until a
new color is selected for “Line properties” in palette. If you want to change line
properties of a certain line, polyline or frames of closed graphics on the picture, please
select the object and click “Line properties” button to select needed color from palette.
The method can be used to complex symbols, but can’t be used to cells.
Fill color button
Click the button. Select a color from palette as the default color of closed
graphics. If you want to change fill properties of a certain line, polyline or frames of
closed graphics on the picture, please select the object and click “Fill properties”
button to select needed color from palette. The method can be used to complex
symbols, but can’t be used to cells.
Background color button
This property is mainly used to build transition color appearance. If you select
transition color appearance, the color selected from “Palette” will be the background
WellinControl Technology Development Co.,Ltd
7-26 Chapter 7 Picture and Animation links
color of transition color after clicking the button. The default color is black.
Text color button
Click the button. Select a color from palette as text color which is the default
color of various texts.
Window color button
Click the button. Select a color from palette as window color which is the default
background color of various objects.
Bitmap transparent color button
Click the button. Select a color from palette as bitmap transparent color which is
the default color of various bitmap transparent.
In WindowMaker, when you paste bitmap from WINDOWS clipboard, using
menu command “Bitmap transparent” to set bitmap transparent color. The set color in
bitmap is transparent so that picture background overlapped by bitmap displays
transparently.
For example, if bitmap transparent color is set to black, black color in the bitmap
will be transparent when the menu command “Bitmap transparent” is checked. It
appears as below.
Figure 7.11 Execute “Bitmap transparent”_ Before and After
How to use infinity color of palette
There are an infinity color area for mixing colors and saving/loading area under
palette selecting button as below.
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-27
Figure 7.12 Buttons to select infinity color and saving/loading area
The main functions include: mix colors, imbibe colors, save information of
mixing colors, load information of mixing colors.
System palette window
If users define custom color, a color cursor is selected from saving/loading area
first as below.
Click system palette window button (the first button of custom palette window)
to popup “True color palette” window as below.
WellinControl Technology Development Co.,Ltd
7-28 Chapter 7 Picture and Animation links
Figure 7.13 “True color palette”
“True color palette” supplies two kinds of mode: RGB, HSB. RGB is a three
color (red, green, blue) selecting mode and HSB is hue, saturation and brightness
selecting mode. Click “Color slip block” of window color display---a small block.
Press down it and drag mouse cursor to move color slip block. The numbers in the
number boxes under the color labels change following slipping. They stand for red,
green, blue, hue, saturation, brightness. Users can change the numbers in the number
boxes to change color. Selected color will be shown in “New color”. “Old color” is the
original color of selected object. A defined rose color appears as below.
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-29
Figure 7.14 Define new color
Selected color from palette displays in “New color”. Click “OK” button to add
defined color to selected color cursor in the palette saving/loading area. It appears as
below.
Blotter tool
Duplicate colors in different areas or objects. Select a color block in the palette
saving/loading area. Click blotter tool button to make mouse cursor become a blotter.
Click the left key to select the object color need to be duplicated so that the color is
copied to selected color block and the copied color can be used as basic colors. It
appears as below.
WellinControl Technology Development Co.,Ltd
7-30 Chapter 7 Picture and Animation links
Figure 7.15 Define color by blotter
Save/load information of mixing colors
Custom color is usually used in developing project. Palette can save custom color.
Users only need to load information of mixing colors while using.
Users can save 18 kinds of infinity color. Define the infinity color first: Click a
small color block in the custom palette saving/loading area. Click system palette
window button. Use “Add color window” to define infinity color. Finally click “OK”
to finish color definition.
Click “Save information of mixing colors” button to popup a dialog box as below.
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-31
Figure 7.16 Save information of mixing colors
You can save custom color as .CPF file.
If other objects need load the custom color, click “Load information of mixing
colors” button to open needed .CPF file which appears as below. Saved color will
appear on the custom palette window.
Figure 7.17 Load information of mixing colors
If check “Open in read-only mode” option, users can’t edit the custom palette
during using.
WellinControl Technology Development Co.,Ltd
7-32 Chapter 7 Picture and Animation links
7.2.2 Use tag browser
Tag browser is to select tag or tag field for defining animation links or writing
scripts. Click “?” button on the right side of input expression dialog box of animation
links to popup “Select tag name” window which is used to view and select defined
basic tags and structure tags and tag fields from local node or other nodes.
Figure 7.18 Select tag
Function expression of four buttons on the top left corner is:
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-33
Figure 7.19 Tag browser shortcut menu
Show/hide tag tree: Select the button to show/hide the tag tree on the left side. When
the button is sunken, tag tree displays. When the button is heaved, tag tree hides.
Show basic tag in small icon/report format: When the button is sunken, tags in
the tag display area show in small icon format without tag list in detail. When
“Display basic tag in report format/small icon” button is selected, this button turns to
heave.
Show basic tag in report format/small icon: When the button is sunken, tags in
the tag display area show in small icon format without tag list in detail, such as tag
type, alarm group, security zone, connection device, remark and so on. When
“Display basic tag in small icon/report format” button is selected, this button turns to
heave.
New tag: Click the button to popup “Define tag” window to create a new tag. The
method is the same as defining tags in Tag name Dictionary.
 Tag field: Click tag field list box button. All of available fields of current tag
appear in the dropdown list box, as figure below appears, select tag field or the
data type of tag field You can get the details about how to define tag field of each
tag in chapter 5 “Tag definition and management”.
WellinControl Technology Development Co.,Ltd
7-34 Chapter 7 Picture and Animation links

Filter: Filter functions contain: users can select filter condition to filter improper
tags. Click filter list box button. Defined filter condition can be seen in dropdown
list box. If users didn’t define filter condition, only “None” appears in dropdown
list box. Click “…” button on the right side to popup “Define filter condition”
which is to define, browse and select filter information.
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-35
Figure 7.20 Define filter condition dialog box
Input defined name of filter condition in “Tag name”. Input every filter condition
in “Filter condition”, such as tag type, alarm group, security zone, connection device,
remark and so on. Click “Add” button on the right side to save defined filter condition.
For example, define a filter condition: filter all of I/O integer tags in Tagname
Dictionary. Select “All of I/O integer tags” in “Tag name” option. Select “IO integer”
from “Tag type” in filter condition and no limit on other filter conditions. It appears as
below.
WellinControl Technology Development Co.,Ltd
7-36 Chapter 7 Picture and Animation links
Figure 7.21 Input condition
Click “Add” button to save defined IO integer filter condition. Click “OK” to
return to “Select tag name” window. Select “All of I/O integer tags” from “Filter”
dropdown list box. Only tags in IO integer type can display in tag list. Other improper
tags will be filtered.
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-37
Figure 7.22 Tag after filter
Defined filter condition can be edited and deleted. When you edit filter condition,
you need edit filter name and filter condition. And then click “Edit” button to save the
change. When you delete a filter condition, you need select filter name first. And then
click “Delete” button to delete the filter condition. Define filter condition. Click filter
list box button. Select filter condition from dropdown list box to filter improper tags
from the list. Tags shown on the right side of “Select tag name” window are just the
proper tags.
 Select structure tag: If structure tag is defined, a “+” symbol appears in front of
“Root node” on the left side of “Select tag name” window. Click “+” to display
defined structure tags as below.
WellinControl Technology Development Co.,Ltd
7-38 Chapter 7 Picture and Animation links
Figure 7.23 Select structure tag
Select structure member on the right side of list box. Click “OK” button.
 Select tags from other nodes: If other nodes are defined, their names and
their structure tag names appear in the list tree on the left side of tag browser.
You can use the same method to select tag as root node.
7.2.3 Expression and operators
Expression is a main part of defining animation links because the values of
expression define the animation of symbols on the picture. Expression is composed of
tag, tag field, alarm group, constant and various operators defined in Tagname
Dictionary which is similar with expressions of C language.
Evaluating sentences are not allowed in the expression. The value of expression
is calculated while KingView running. Tag name and alarm group name can be
selected from tag browser directly. They don’t need quotation marks, but need match
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-39
case. The field names of tag don’t need match case.
The operators used in expression are as below.
~
*
Get patch number, change integer tag to patch
number of “2”.
Multiply
/
Division
%
Modular arithmetic
+
Addition
-
Subtraction
&
Integral AND
|
Integral OR
^
Integral NOT OR
&&
Logic AND
||
Logic OR
<
Less than
>
Bigger than
<=
Less than or equal to
>=
Bigger than or equal to
==
Equal to
!=
Not equal to
Note:
Besides above operators, the following operators can be used to improve
operation functions:
get in reverse, change positive number to
negative number.
WellinControl Technology Development Co.,Ltd
7-40 Chapter 7 Picture and Animation links
!
( )
logic NOT
bracket, to ensure arithmetic in needed order
Operator priority:
The order operation appears as below. Firstly, calculate the operator with the
highest priority. Then calculate lower priorities in order. Operators in the same line
have the same priorities.
()
the highest priority
--, !, ~
*, /, %
+, <, >, <=, >=, ==, !=
&, |, ^
&&, ||
=
the lowest prority
Expression example:
Single tag or tag field: switch, liquid level.alarm
Complex expression: switch==1 liquid level >50&&liquid level<80
(Switch 1||Switch 2)&&(liquid level.alarm)
7.3 Animation links in detail
Click any connection mode in “Animation links” dialog box to popup setup
dialog box. This section will explain settings of various animation links. If you want
to use animation links wizard, please refer to “Use animation links wizard”.
7.3.1 Line properties link
Click “Line properties” button in “Animation links” dialog box to popup link
dialog box.
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-41
Line properties link is to make the color of frame or line of connected object
change following the value of link expression. Defining this kind of link need define
subsection points (threshold) and correlative line properties at one time. Many links
can be created by using variety of link expression.
For example: Line color can be used to stand for the alarm status of discrete tag
EXAM. Input EXAM.Alarm in link expression. Change the value of two pen colors to
0 (blue), 1 (red). KingView is running. When the alarm occurs (EXAM.Alarm==1),
line color changes from blue to red. When the alarm is released (EXAM.Alarm==0),
line color changes to blue again. Draw a rounded-rectangle on the picture. Doubleclick the graphic object to popup animation links dialog box as below.
Figure 7.24 Line link
Define settings of line properties link dialog box as below:
 Expression: It’s to input link expression. Click “?” button to view defined
tag names and tag fields.
 Add: Add new subsection points. Click “Add” to popup “Input new value”
dialog box. Input threshold and pen properties of the new subsection points
in the dialog box. Click “Pen properties-line type” button to popup float
WellinControl Technology Development Co.,Ltd
7-42 Chapter 7 Picture and Animation links
window and select proper type. You can make “Line properties” button
obtain input focus. Click space key to popup float window. Switch between
color and line type by TAB key. Use move key to select. Press space or
enter to confirm.
Figure 7.25 Specify threshold value


Edit: Edit selected subsection point. It has the same method as “Input new
value” dialog box.
Delete: Delete selected subsection point.
7.3.2 Fill properties links
Fill properties links make fill color and fill type of graphic object change
following change of the value of link expression. Define some subsection points
(contain threshold and correlative fill properties) which makes the fill properties of
graphic object as assigned among a certain section of values.
Take defining fill properties links of closed graphic object for example. Fill
property is white while threshold is 0. Fill property is yellow while threshold is 100.
Fill property is red while threshold is 200. Picture program is running. When the value
of tag “Temperature” is between 0 and 100, graphic object is white. When the value of
tag “Temperature” is between 100 and 200, graphic object is yellow. When the value
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-43
of tag “Temperature” is larger than 200, graphic object is red.
Figure 7.26 Fill property link
Set “Fill properties” animation links as below: Select “Fill properties” button in
“Animation links” dialog box to popup a dialog box which contains:
 Expression: It’s to input link expression. Click “?” button to view defined
tag names and tag fields.
 Add: Add new subsection points. Click “Add” to popup “Input new value”
dialog box.
WellinControl Technology Development Co.,Ltd
7-44 Chapter 7 Picture and Animation links
Figure 7.27 Input value for fill property
nput threshold and brush properties of the new subsection points in the dialog
box. Click “Brush properties-type” button to popup float window and select proper
type. You can make “Brush properties” button obtain input focus. Click space key to
popup float window. Switch between color and fill type by TAB key. Use move key to
select. Press space or enter to confirm. Click “Brush properties-color” button to popup
brush color float window which can follow the selection as above.
 Edit: Edit selected subsection point. It has the same method as “Input new
value” dialog box.
 Delete: Delete selected subsection point.
7.3.3 Text color links
Text color links make the color of graphic object change following change of the
value of link expression. Define some subsection points (contain color and correlative
value) which makes the text color of graphic object as assigned among a certain
section of values.
Take defining a certain subsection point for example. Text color is red while
threshold is 0. Text color is blue while threshold is 100. When the value of tag
“Pressure” is between 0 and 100 (contain 0), text color is red. When the value of tag
“Pressure” is equal to or larger than 100, text color is blue.
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-45
Figure 7.28 Text color link
Set text color links as below: Select “Text color” button in “Animation links”
dialog box to popup a dialog box which contains:
 Expression: It’s to input link expression. Click “?” button to view defined
tag names and tag fields.
 Add: Add new subsection points. Click “Add” to popup “Input new value”
dialog box.
Figure 7.29 Input value for text color link
Input threshold and color of the new subsection points in the dialog box. Click
WellinControl Technology Development Co.,Ltd
7-46 Chapter 7 Picture and Animation links
“Text color” button to popup float window and select proper color. You can make
“Color” button obtain input focus. Click space key to popup float window. Use move
key to select. Press space or enter to confirm.
 Edit: Edit selected subsection point. It has the same method as “Input new
value” dialog box.
 Delete: Delete selected subsection point.
7.3.4 Shift horizontal links
Shift horizontal links make the connected graphic object shift horizontal
following change of the value of link expression. The distance is counted by pixel and
based on original position of connected object in WindowMaker. Shift horizontal links
are usually used to stand for practical horizontal movement of graphic object.
Figure 7.30 Shift horizontal links example
Take an indicator for example. Draw a triangle on the picture (Setup “shift
horizontal” animation links) to stand for the actual size of shift value. Left figure is in
design status. Right figure is in running status.
Set shift horizontal links as below: Select “Shift horizontal” button in
“Animation links” dialog box to popup a dialog box which contains:
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-47
Figure 7.31 Shift horizontal links





Expression: It’s to input link expression. Click “?” button to view defined
tag names and tag fields.
To left: Input the distance symbol shifts to left horizontally (based on
original position of connected object on the picture).
Leftmost: Input the correlative tag value while symbol is located on leftmost.
When the value of link expression is the correlative value, the center of
connected object shifts left (based on original position) to defined leftmost
position.
To right: Input the distance symbol shifts to right horizontally (based on
original position of connected object on the picture).
Rightmost: Input the correlative tag value while symbol is located on
rightmost. When the value of link expression is the correlative value, the
center of connected object shifts right (based on original position) to defined
rightmost position.
7.3.5 Shift vertical links
Shift vertical links make the connected graphic object shift vertical following
change of the value of link expression. The distance is counted by pixel and based on
WellinControl Technology Development Co.,Ltd
7-48 Chapter 7 Picture and Animation links
original position of connected object in WindowMaker. Shift vertical links are usually
used to stand for practical vertical movement of graphic object. Select “Shift vertical”
button in “Animation links” dialog box to popup “Vertical shift links” dialog box
which contains:
Figure7.32 Shift vertical links





Expression: It’s to input link expression. Click “?” button to view defined
tag names and tag fields.
To top: Input the distance symbol shifts to top vertically (based on original
position of connected object on the picture).
Topmost: Input the correlative tag value while symbol is located on topmost.
When the value of link expression is the correlative value, the center of
connected object shifts top (based on original position) to defined topmost
position.
To bottom: Input the distance symbol shifts to bottom vertically (based on
original position of connected object on the picture).
Bottommost: Input the correlative tag value while symbol is located on
bottommost. When the value of link expression is the correlative value, the
center of connected object shifts bottom (based on original position) to
defined bottommost position.
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-49
7.3.6 Zoom links
Zoom links make the size of connected graphic change following change of the
value of link expression. Take a thermometer for example. Draw a rectangle to stand
for mercurial (Setup “Zoom links” of animation links) which is to response the change
of tag “Temperature”. Left figure is in design status. Right figure is in running status.
Figure 7.33 Zoom links example
Set zoom links as below: Select “Zoom links” button in “Animation links” dialog
box to popup a dialog box which contains:
Figure 7.34 Zoom links
WellinControl Technology Development Co.,Ltd
7-50 Chapter 7 Picture and Animation links




Expression: It’s to input link expression. Click “?” button to view defined
tag names and tag fields.
Minimum: Holden percentage of connected object and correlative value of
expression when input object is minimum. The object is invisible while
percentage is 0.
Maximum: Holden percentage of connected object and correlative value of
expression when input object is maximum. The size of object is the original
one while percentage is 100.
Change direction: Select the direction of zoom change. It has five directions
which can be denoted by the indicator beside “Select direction” button.
Arrow is the direction of change. Blue point is the reference point. Click
“Select direction” button to select one of change directions.
Down
Up
To center
To left
Figure 7.35 Zoom direction
To right
7.3.7 Rotate Links
Rotate links means rotate the position of object in the picture following the value
of link expression.
For example: Create a pointer meter which shows the change of tag “pump
speed” based on angle of pointer rotation. Left figure is in design status. Right figure
is in running status.
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-51
Figure 7.36 Rotate links example
Set rotate links as below: Select “Rotate links” button in “Animation links”
dialog box to popup a dialog box which contains:
Figure 7.37 Rotate links



Expression: It’s to input link expression. Click “?” button to view defined
tag names and tag fields.
Max counterclockwise angle: The max angle connected object can reach by
counterclockwise rotation and correlative value of expression. Angle is
between 0 degree and 360 degree. The positive direction of Y coordinate is
0 degree.
Max clockwise angle: The max angle connected object can reach by
clockwise rotation and correlative value of expression. Angle is between 0
WellinControl Technology Development Co.,Ltd
7-52 Chapter 7 Picture and Animation links

degree and 360 degree. The positive direction of Y coordinate is 0 degree.
Deviation from rotate centre to symbol center: The deviating value between
coordinate of encircled center and center of connected object while
connected object rotates which composes of horizontal deviated pixel from
circle center (positive value stands for deviation to right) and vertical
deviated pixel from circle center (positive value stands for deviation to
bottom). This value can be ensured by the help of coordinate position
window (Activate by Hotkey F8 in WindowMaker).
7.3.8 Fill links
Fill links means the occupied percentage of the color and fill type of connected
object changes following the change of link expression.
For example: Draw a rectangle to stand for the change of tag “Liquid level”. Left
figure is in design status. Right figure is in running status.
Figure 7.38 Fill links example
Set fill links as below: Select “Fill links” button in “Animation links” dialog box
to popup a dialog box which contains:
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-53
Figure 7.39 Fill links




Expression: It’s to input link expression. Click “?” button to view defined
tag names and tag fields.
Min fill height: Holden height percentage of connected object and
correlative value of expression when the height of input object is minimum.
Max fill height: Holden height percentage of connected object and
correlative value of expression when the height of input object is maximum.
Fill direction: Define the direction of filling. It contains “Fill direction”
button and fill direction diagram two parts. It has four directions which can
be selected by clicking “Fill button” button.
Up

Down
To left
Figure 7.40 Fill direction
To right
Default fill brush: If the connected object has no fill properties link, the
WellinControl Technology Development Co.,Ltd
7-54 Chapter 7 Picture and Animation links
default fill brush is checked while running. Click “Type” button to popup
float window and move mouse cursor to select. You can make “Type” button
obtain input focus. Click space key to popup float window. Switch between
color and fill type by TAB key. Use move key to select. Press space or enter
to confirm. Click “Color” button to popup brush color float window and
move mouse cursor to select.
Type
Color
Figure 7.41 Default fill brush
Note: Difference between fill and zoom:
Fill stands for filling the whole object from inner to outer with a certain color
and in a certain direction
Zoom stands for zooming in/out the graphic object to a certain direction.
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-55
Figure 7.42 Fill and zoom
The left diagram is fill links. The right diagram is zoom links.
7.3.9 Analog output links
Analog output link is to replace the content of text object to the value of link
expression while system running.
Figure 7.43 Analog output links example
For example: Create a text object to stand for system time. Tags connected to text
object are predefined tags $hour, $minute, $second. The left figure is in design status.
The right figure is in running status.
Set analog output links as below: Select “Analog output links” button in
WellinControl Technology Development Co.,Ltd
7-56 Chapter 7 Picture and Animation links
“Animation links” dialog box to popup a dialog box which contains:
Figure 7.44 Analog output links





Expression: It’s to input link expression. Click “?” button to view defined
tag names and tag fields.
Integral digit: digit of integral part of output value. If the value digit is less
than inputted value while practical outputting, add 0 to the high digit. For
example, the integral digit is 4. The practical value is 12. The display value
is 0012. If the value digit of practical outputting is larger than this value,
value outputs according to practical digit. The practical value is 12345. The
display value is 12345. If you don’t want to have 0 before the value, you can
set integral digit to 0.
Decimal digit: digit of decimal part of output value. If the value digit is less
than inputted value while practical outputting, add 0 to supply. For example,
the decimal digit is 4. The practical value is 0.12. The display value is
0.1200. If the value digit of practical outputting is larger than this value,
value outputs according to practical digit.
Scientific notation: Whether output value displays by scientific notation.
Align mode: Analog string outputted in running aligns with connected string
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-57
in left, middle, right mode.
7.3.10 Discrete output links
Discrete output link is to replace the content of text object to the value of link
expression while system running.
For example: Create a text object “Liquid level status”. Its content is “Liquid
level is normal” when the value of tag “Liquid level” is less than 180. Text object
turns to “Liquid level is over high” when the value is equal to or larger than 180. The
left figure is in design status. The right figure is in running status.
Figure 7.45 Discrete output links Example
Set discrete output links as below: Select “Discrete output links” button in
“Animation links” dialog box to popup a dialog box which contains:
WellinControl Technology Development Co.,Ltd
7-58 Chapter 7 Picture and Animation links
Figure 7.46 Discrete output links




Condition expression: It’s to input link expression. Click “?” button to view
defined tag names and tag fields.
When it is true, output is: Define the output contents of connected object
(text) when the expression is true.
When it is fault, output is: Define the output contents of connected object
(text) when the expression is false.
Align mode: Discrete string outputted in running aligns with connected
string in left, middle, right mode.
7.3.11 String output links
String output link is to replace the content of text object to the value of link
expression while system running.
For example: Create a text object “#####” and make it output the tag name of
curve 1, 2 in historical trend window while system is running. System function
HTGetPenName is used to get the tag name which using method can be seen in
chapter 10 “Scripts”. The left figure is in design status. The right figure is in running
status.
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-59
Figure 7.47 String output links example
Set string output links as below: Select “String output links” button in
“Animation links” dialog box to popup a dialog box which contains:
Figure 7.48 String output links


Expression: It’s to input link expression. Click “?” button to view defined
tag names and tag fields.
Align: Select the align mode for outputted string while running with current
connected string.
7.3.12 Analog input links
Analog input link is to make connected object become a touch-sensitive object.
Click it or press assigned hotkey to popup input value dialog box. Users can input a
new value for connecting tag in the dialog box to change the value of a certain analog
WellinControl Technology Development Co.,Ltd
7-60 Chapter 7 Picture and Animation links
tag in database.
For example: Create a rectangle. Setup “Analog input” links to change the value
of tag “Temperature”. The design status of WindowMaker appears as below.
Figure 7.49 Analog input links example
Click rectangle to popup input dialog box while system running.
Figure 7.50 Analog input links
Input the new value of tag in the dialog box. If you select “Use virtual keyboard”
option in “Special” properties page of “System config\Setup WindowMaker” in
TouchExplorer, input dialog box will popup and virtual keyboard window will display
while system running. Click button on the virtual keyboard is the same as inputting by
keyboard.
Setup analog input links: Click “Input analog” button in “Animation links”
dialog box to popup a dialog box as below:
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-61
Figure 7.51 Set Analog input links
It contains:
 Tag: It’s to input link expression. Click “?” button to view defined tag
names and tag fields.
 Message: The string used to input content appears in the popup dialog box
while system running.
 Value range: Define the range of inputted value. It should be the setup max
value and min value of tag need to be changed.
 Activate key: Define activate key which can be key or combined key
(combination of Ctrl, Shift and a key on keyboard). Use activate key to
popup input dialog box in TouchView for inputting new analog value.
When Ctrl and Shift texts are checked to stand for available of Ctrl key and Shift
key, click “Key” button to popup the dialog box as below.
WellinControl Technology Development Co.,Ltd
7-62 Chapter 7 Picture and Animation links
Figure 7.52 Select key
Users can select a key from the dialog box. And then click “Close” button to
finish key configuration.
7.3.13 Discrete input links
Discrete input link is to make connected object become a touch-sensitive object.
Click it to popup input value dialog box. Users can input a new value for connecting
tag in the dialog box to change the value of a certain discrete tag in database.
For example: Create a rectangle connected to DDE discrete tag “Power switch”.
The design status of WindowMaker appears as below.
Figure 7.53 Discrete input links example
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-63
Click rectangle to popup input dialog box while system running.
Click correlative button to change the value of discrete tag “Power switch”.
Setup discrete input links: Click “Input discrete” button in “Animation links”
dialog box to popup a dialog box as below:
Figure 7.53 Discrete input links
It contains:
 Tagname: It’s to input link expression. Click “?” button to view defined tag
names and tag fields.
 Comment: The string used to input content appears in the popup dialog box
while system running.
 Enactment Message: The text content of the first button on the popup dialog
box while system is running. It is used to set the value of discrete tag to 1.
 Clear Message: The text content of the first button on the popup dialog box
while system is running. It is used to set the value of discrete tag to 0.
 Key activation: Define activate key which can be key or combined key
(combination of Ctrl, Shift and a key on keyboard). Use activate key to
popup input dialog box in TouchView for inputting new discrete value.
When Ctrl and Shift texts are checked to stand for available of Ctrl key and Shift
WellinControl Technology Development Co.,Ltd
7-64 Chapter 7 Picture and Animation links
key, click “Key” button to popup the dialog box as below.
Figure 7.54 Define key
Users can select a key as hotkey from the dialog box. And then click “Close”
button to finish key configuration.
7.3.14 String input links
String input link is to make connected object become a touch-sensitive object.
Users can input a new value for connecting tag in the dialog box to change the value
of a certain string tag in database.
Figure 7.55 String input links example
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-65
For example: Create a rectangle which can input the value of memory string tag
“Record”. The design status of WindowMaker appears as below.
Click rectangle to popup input dialog box while system running.
Figure 7.56 String input links
Setup string input links: Click “Input string” button in “Animation links” dialog
box to popup a dialog box as below:
Figure 7.57 Set string input links
WellinControl Technology Development Co.,Ltd
7-66 Chapter 7 Picture and Animation links
It contains:
 Tagname: It’s to input link expression. Click “?” button to view defined tag
names and tag fields.
 Message: The string used to input content appears in the popup dialog box
while system running.
 Password form: Define if characters in the edit box display in password
format (******) when users input string content to the edit box of the dialog
box.
 Activate key: Define activate key which can be key or combined key
(combination of Ctrl, Shift and a key on keyboard). Use activate key to
popup input dialog box in TouchView for inputting new string value.
When Ctrl and Shift texts are checked to stand for available of Ctrl key and Shift
key, click “Key” button to popup the dialog box as below.
Figure 7.58 Define key
Users can select a key from the dialog box. And then click “Close” button to
finish key configuration.
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-67
7.3.15 Blink links
Blink link is to make connected object blinking when condition expression is true.
Blink is easy to get notice so that it’s use to alarm for abnormal status.
Figure 7.59 Blink links example
For example: Create a red circle to show alarm status which can blink when the
value of tag “Liquid level” is bigger than 180. The design status of WindowMaker
appears as below. When the value of tag “Liquid level” is bigger than 180, red object
blinks while system running.
Setup blink input links: Click “Blink” button in “Animation links” dialog box to
popup a dialog box as below:
Figure 7.60 Blink links
It contains:
WellinControl Technology Development Co.,Ltd
7-68 Chapter 7 Picture and Animation links


Blink when: Condition expression for inputting blink. When the value of the
condition expression is true, graphic object begins to blink. When the value
of the expression is false, graphic object stop blinking. Click “?” button to
view defined tag names and tag fields.
Blink speed: Define the blink frequency.
7.3.16 Hide links
Hide link is to make connected object show or hide according to the value of
condition expression. For example: Create a text object “Liquid level is too high” to
show alarm status which can display when the value of tag “Liquid level” is bigger
than 180. The design status of WindowMaker appears as below.
Figure 7.61 Hide links example
Setup Hide input links: Click “Hide” button in “Animation links” dialog box to
popup a dialog box as below:
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-69
Figure 7.62 Hide links
It contains:
 Expression: Input show/hide condition expression. Click “?” button to view
defined tag name and tag field.
 When it is true: When the value of condition expression is 1 (true),
connected object is shown or hidden. When the value of condition
expression is 0 (false), object defined “Show” status will auto-hide and
object defined “Hide” status will auto-show.
7.3.17 Flow links
Flow links are used for setting fluid streamlines states within solid pipelines.
The streamline state is based on the value of the “Flow Condition” expression.
To draw a solid pipeline in a picture (Please refer to “Chapter 4: Kingview
Developing Environment – TouchExplorer” for the properties of solid pipelines),
double-click on the pipeline, click “Flow” in the “Animation Link” dialog box, which
will open the Flow Links dialog box, as shown in Figure 7.63.
WellinControl Technology Development Co.,Ltd
7-70 Chapter 7 Picture and Animation links
Figure 7.63 Flow links
“Flow Condition”: Variables in Kingview that relate to the inputs of streamline
states should be Integers. Click “?” to select the names of defined variables. A pipe
streamline state is set by the following:
 When the value is 0, no internal lines or flow effects are shown .
 When the variable value is in the extent from 1 to 10, the direction of fluid
flow line in the pipes is from start to finsh of the pipe, the flow rate is setted,
and 10 is the maximum speed.
 When the variable value is between -10 to -1, the flow of fluid inside a
pipeline goes from finish to start, the flow rate is setted, and -10 is the
maximum speed.
 When the value is -255, the flow stops and only the static lines are shown.
The rate of the flowing in the pipe related to the base frequency of Kingview’s
operating system. When the setted value of the base frequency of Kingview’s
operating system is high, the display of the fluid rate in the pipe is low, otherwise it
will high.
7.3.18 Slider horizontal input links
When you drag the graphic object with slider horizontal input links by mouse,
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-71
the value of correlative tag will be changed. If the value of tag changes, the position of
graphic object changes as well.
For example: Create a horizontal slider to change tag “Pump speed”. Left figure
is in design status. Right figure is in running status in TouchView.
Figure 7.64 Slider horizontal input links Example
Setup slider horizontal input links: Click “Slider horizontal input” button in
“Animation links” dialog box to popup a dialog box as below:
Figure 7.65 Slider horizontal input links
It contains:
 Tagname: Input show/hide condition expression. Click “?” button to view
defined tag name and tag field.
 To left: The max distance for graphic object from designed position to
leftmost.
WellinControl Technology Development Co.,Ltd
7-72 Chapter 7 Picture and Animation links



To right: The max distance for graphic object from designed position to
rightmost.
At left end: the tag value while graphic object is located on leftmost.
At right end: the tag value while graphic object is located on rightmost.
7.3.19 Slider vertical input links
Slider vertical input link is actually the same as slider horizontal input, but the
different moving direction of graphic object.
Setup slider horizontal input links: Click “Slider vertical input” button in
“Animation links” dialog box to popup a dialog box as below:
Figure 7.66 Slider vertical input links
It contains:
 Tagname: Input show/hide condition expression. Click “?” button to view
defined tag name and tag field.
 Up: The max distance for graphic object from designed position to topmost.
 Down: The max distance for graphic object from designed position to
bottommost.
 Top: the tag value while graphic object is located on topmost.
 Bottom: the tag value while graphic object is located on bottommost.
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-73
7.3.20 Animation links scripts
Scripts can make connected object be a touch-sensitive object while system is
running. Opposite displayed rectangle frame appears around touch-sensitive object
while TouchView is running. Scripts have three kinds: “On key down”, “On key up”
and “While down” which stand for the script program executed when you press down,
hold down or release the left key of mouse on the touch-sensitive object. When you
define “While down” script, you can assign how often to execute script one time while
down. Input this time interval in the edit box. An equivalent key can be assigned by
engineers to replace mouse. “On key down”, “On key up” and “While down” of
equivalent key are exactly the same as mouse’s. Click any “Scripts links” button to
popup a dialog box which is used to input scripts link program.
Figure 7.67 Scripts
WellinControl Technology Development Co.,Ltd
7-74 Chapter 7 Picture and Animation links
There are some buttons can generate message on the right side of dialog box
which can be used to select defined tag name and tag field, predefined function name,
picture name, alarm group name, operator, keyword and so on. It also supplies edition
operations like cut, copy, paste, resume, etc which can make users copy edited scripts
from other scripts links. Details can be seen in chapter 10 “Scripts”.
7.4 Use animation links wizard
KingView supplies visual animation links wizard for users which contain: shift
horizontal, shift vertical, rotate, slider horizontal input and slider vertical input five
parts. You can locate the center of symbols, shift start/end position and range easily
and exactly by using visual animation links.
7.4.1 Shift horizontal links wizard
Use shift horizontal links wizard must follow:
 Draw a shift horizontal symbol on the picture, like rounded-rectangle.
 Select the symbol. Select menu command “Edit\ Shift horizontal link
wizard” or right-click on the rounded-rectangle to select “Animation link
wizard\ Shift horizontal link wizard” on the shortcut menu. Mouse cursor
turns to “+” shape.
 Select the start/end position for shifting horizontal links. Click the left key
of mouse. Mouse cursor turns to the arrow to the left which stands for the
distance from start position of symbol to leftmost. Move the mouse
horizontally. The arrow follows and draws a horizontal track.
 When the mouse cursor moves to the left boundary, click the left key of
mouse. Mouse cursor turns to the arrow to the right which stands for the
distance from start position of symbol to rightmost. Move the mouse
horizontally. The arrow follows and draws a horizontal track. When the
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-75
mouse cursor moves to the right boundary, click the left key of mouse to
popup the horizontal shift links dialog box as below.
Figure 7.68 Horizontal Shift links
Input tag in “Expression” text box or click “?” button to select tag. Values in “To
left” and “To right” text box are the data generated from animation links by wizard.
Users can edit them as they wish. Click “Ok” to finish animation links.
7.4.2 Shift vertical links wizard
Use shift vertical links wizard must follow:
 Draw a shift vertical symbol on the picture, like rounded-rectangle.
 Select the symbol. Select menu command “Edit\ Shift vertical link wizard”
or right-click on the rounded-rectangle to select “Animation link wizard\
WellinControl Technology Development Co.,Ltd
7-76 Chapter 7 Picture and Animation links


Shift vertical link wizard” on the shortcut menu. Mouse cursor turns to “+”
shape.
Select the start/end position for shifting vertical links. Click the left key of
mouse. Mouse cursor turns to the arrow to the top which stands for the
distance from start position of symbol to top. Move the mouse vertically.
The arrow follows and draws a vertical track.
When the mouse cursor moves to the upper boundary, click the left key of
mouse. Mouse cursor turns to the arrow to the bottom which stands for the
distance from start position of symbol to bottom. Move the mouse vertically.
The arrow follows and draws a vertical track. When the mouse cursor
moves to the lower boundary, click the left key of mouse to popup the
vertical shift links dialog box as below.
Figure 7.69 Vertical Shift links
WellinControl Technology Development Co.,Ltd
Chapter 7 Picture and Animation links
7-77
Input tag in “Expression” text box or click “?” button to select tag. Values in
“Up” and “Down” text box are the data generated from animation links by wizard.
Users can edit them as they wish. Click “Ok” to finish animation links.
7.4.3 Slider input links wizard
Using slider horizontal and vertical input links wizards is the same as using shift
horizontal and vertical input links wizards.
7.4.4 Rotate links wizard
Use rotate links wizard must follow:
 Draw a rotate symbol on the picture first, like ellipse.
 Select the symbol. Select menu command “Edit\Rotate link wizard” or
right-click on the ellipse to select “Animation link wizard\Rotate link
wizard” on the shortcut menu. Mouse cursor turns to “+” shape.
 Select the center for symbol rotation. Click the left key of mouse on the
corresponding position. Mouse cursor turns to counterclockwise rotation
arrow which stands for the start position and rotation angle for symbol
rotation counterclockwise. Move the mouse to enclose the selected center. A
dashed frame in symbol shape will rotate following the mouse cursor.
 When the start position of rotation counterclockwise is defined, click the left
key of mouse. Mouse cursor turns to clockwise rotation arrow which stands
for the start position and rotation angle for symbol rotation clockwise using
the same method as definition of counterclockwise rotation. After selecting
the position of clockwise rotation, please click the left key of mouse to
popup rotate links dialog box as below.
WellinControl Technology Development Co.,Ltd
7-78 Chapter 7 Picture and Animation links
Figure 7.70 Rotate links
Rotate links wizard solves the problem which is so difficult for users to find the
center of rotation when they define rotate symbol.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-1
Chapter 8 Trends and other curves
8.1 Introduction to curve
The real-time data and historical data of KingView can display in curve mode
besides in data-output mode and report mode. The curves of KingView contain trend,
temp-control curve and super X-Y curve.
Trend analysis is a necessary function of control software. KingView supplies
powerful support and simple control method for this function. Trend has two kinds
which are historical trend and real-time trend. Curves look like coordinates in which
X axis stands for time and Y axis stands for tag value. Real-time trend can show four
curves at most. Meanwhile historical trend can show sixteen curves at most. And
unlimited trend curves can be defined in a picture (historical trend and real-time trend).
In the trend, engineers can define interval, range of value, grid resolution, number of
time axis, number of value axis, color properties of “Pen” for painting curves. Realtime trend can auto-roll to respond the change of value following time while system is
running. Historical trend can’t auto-roll which generally work with function button to
view the historical data corporately. These buttons have many complex functions like
page turning, setup time parameter, start/stop record, printing curves.
Temp-control curve responds to the situation of which measured value change
according to set curve. In the temp-control curve, Y axis stands for temperature value,
and X axis stands for change of time. Meanwhile, display every sampling point in the
WellinControl Technology Development Co.,Ltd
8-2
Chapter 8 Trends and other curves
curve. It’s mainly used to control temperature and flow rate and so on.
The Super Curve X-Y is mainly used for illustrating the functional relationship
between two variables, like the Current-RPM curve. It supports multiple Y-axes.
8.2 Real-time trend
KingView provides two forms of real-time trend curves: the embedded control in
the KingView Toolbox and the Active X control.
8.2.1 The embedded real-time curve control in KingView
The embedded real-time curve control in KingView has draw commands in the
KingView Toolbox. It supports at most 4 curves.
8.2.1.1 Create a real-time trend curve
Select menu command “Tools\Real-time trend” or click “Draw real-time trend”
button in the toolbox. The mouse cursor turns to “+”. Draw a rectangle by mouse on
the picture. The real-time trend shows in the rectangle as below.
Figure 8.1 Real time trend curve
There is a painting area with grids in the middle of real-time trend object which
stands for curve will be drawn among the area. The leftmost and bottom of grid are
the labels of X and Y coordinates separately. Select the real-time trend object (8 small
rectangles appear around it), and then you can move the position and change size.
Real-time trend object updates automatically while picture is running.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-3
8.2.1.2 Real-time trend curve properties
Double-click anywhere on a real-time trend curve to open the Properties dialog
box for the curve, as shown below.
Figure 8.2 Define real-time trend curve
Descriptions for each item in the Properties dialog box:
 Options for Curve Definition Properties
 Axis: Select the Shape and Color of each Axis. Select “Axis” from the
check box, to activate the buttons for Shape and Color. Select the shape and
color of an axis by clicking the desired shape or color button from the dropdown list, as shown below.
WellinControl Technology Development Co.,Ltd
8-4
Chapter 8 Trends and other curves
A user can decide whether an axis should be displayed or not based on the graph
requirements. The pictures below show the difference between graphs with and
without Axis.
Without axis

With axis
Division line is short line: Select the type of division line. If you check it,
only short main-division line appears on the coordinates. The whole
diagram area is nearly blank and no grid exists. Meanwhile “Slave-division
line” option turns to grey.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
Regular division line

8-5
Division line is short line
Frame color, background color: Define frame color and background color
of defined painting area. You can use the same method to edit two buttons as
coordinates button. Popup floating dialog box almost keeps the same.
However, no line type option exists.
Figure 8.3 Palette

X direction, Y direction: Main-division lines in X and Y directions divide
the painting area to rectangle grids. Slave-division lines divide the
rectangles formed by main-division lines. Both of two kinds of lines can
change color and line type. The number of division line can be added or
subtracted by “Add/subtract” button on the right side or directly input by
edit box. Engineers can define the size of trend to define the number of
WellinControl Technology Development Co.,Ltd
8-6
Chapter 8 Trends and other curves


division line which is correlative to label definition.
Curve: Define correlative expressions of Y coordinate for four curves.
Real-time trend can count the value of expression in real-time so that it can
use expression. You can input valid tag name or expression in the edit box
of real-time trend name. Tags used in expression must be defined in
database. “?” button can list defined tag or tag field in database for selecting.
Each curve can change line type and color by the line type and color buttons
on the right side. When defining curve properties you have to define at least
one variable for this curve.
Solutions for depicting invalid data: when the system is running, collected
invalid data (ex. Quality Stamp
≠192) can be displayed in three forms:
Dashed Line, No Line and a Solid Line. When defining curve properties you
have to define at least one variable for this curve.
 Mark definition properties page items:
Figure 8.4 Mark configuration properties page
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves


8-7
Label X axis-Time axis, label Y axis-value axis: Select if you want to
label X or Y axis. Namely, labeling the values of coordinates outsides the
painting area. Check it to make the options defined corresponding labels
turn highlight.
Value axis (Y axis) definition area: Because a real-time trend can display
change of four tags at one time and range of each tag maybe far apart, in
order to express each tag clearly, tag on Y axis should be denoted in
percentage, namely the ratio of tag value and range of tag (difference
between max value and min value). Therefore, the range of Y axis is from 0
(0%) to 1 (100%).
 Label number: the number of value axis labels which space on the
value axis.
 Initial Value: the minimum value displayed on the Y-axis of a curve.
By setting “Data Format” as “Engineering Percentage”, the axes show
just percentage values with a minimum value of zero. By setting “Data
Format” as “Actual Value”, you are provided with the option to enter a
minimum value.
 Maximum Value: the maximum value displayed on the Y-axis of a
curve. By setting “Data Format” as “Engineering Percentage”, the axes
shows just percentage values with a maximum value of 100. By setting
the “Data Format” as “Actual Value”, you are provided with the option
to enter a maximum value.
 Integral Digits: the minimum number of displayed integral digits on
an axis.
 Decimal Digits: the maximum number of displayed decimal digits on
an axis.
 Scientific Notation: Values beyond the range of the preset integral
digits or decimal digits are displayed with scientific notations.
 Font: Define the font of value axis label. WINDOWS standard font
WellinControl Technology Development Co.,Ltd
8-8
Chapter 8 Trends and other curves

selecting dialog box popup. Users can refer to WINDOWS use guide
for detail operations.
 Data Format:
 Engineering Percentage: Data on an axis is displayed in
percentage format.
 Actual Value: Data on an axis is displayed in terms of their actual
values.
Time axis definition area:
 Label number: the number of value axis labels which space on the
value axis. Time in WindowMaker can be denoted in the form of
yy:mm:dd:hh:mm:ss. Actual time can be shown in TouchView.
 Format: format of time axis label which is to select time need to be
shown.
 Update Frequency: the frequency of data collection and the
development of curves. The minimum is 1 second; this cannot be
modified when the program is running.
 Time length: time span denoted by X axis. Time unit can be chosen
according to the need----second, minute, hour, minimum span is 1
second, maximum value of every type of unit is 8000.
 Font: Define the font of value axis label. Use the same selecting
method with font of value axis.
8.2.1.3 Create “Pen” for real-time trend
Draw the pen shape with symbol (generally use polygon) as below. Define shift
vertical animation links. You can select two points on Y axis direction of painting area
of real-time trend by animation link wizard. Define a vertical shift link by expression
used by correlative real-time trend tag.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-9
Figure 8.5 Create pen for real time trend
8.2.2 Real-time Trend Curve Control
Characteristics of real-time trend curve controls:
1. Receive real-time data through TCP/IP protocol, a data server can be any PC,
which runs KingView, there is no need for network configuration.
2. Displays a maximum of 16 curves.
3. Customizes the display of each curve and its corresponding curve.
4. Can move a curve to display any portion according to the collection time.
5. Save & import a curve.
6. Print a curve.
8.2.2.1 Create real-time trend curve controls
Open a picture in KingView, select “Insert General Controls” from the Toolbox
or “Edit” form the menu. Then select “CkvrealTimeCurves Control” from the list
inside the “Insert a Control” dialog box, click “OK” and the cursor will be change to a
cross. Put the cursor over the top left corner of the control, press and hold the left
mouse button, drag and form a dashed rectangle frame, which will contain the curve.
Release the left mouse button when you have your desired size, and a new real-time
trend control with the function to display a curve is created asFigure 8.6 shows.
WellinControl Technology Development Co.,Ltd
8-10 Chapter 8 Trends and other curves
Figure 8.6 Create a real-time trend control
8.2.2.2 Real-time trend control Properties
When a real-time trend control is created, right-click in the control, select
“Properties of Control” from the shortcut menu, and you can see the real-time trend
control’s properties dialog box as Figure 8.7 shows.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-11
Figure 8.7 Properties of Real-time Trend Control
The “Properties” page of a real-time trend control has two tabs: “General” and
“Curves”. More detailed information about each item can be found as follows:
 “General” Tab
As Figure 8.7 shows, the General tab includes:
 Dimensions
 Left: Distance from the left edge of the control to the drawing area.
Range: 0-200.
 Right: Distance from the right edge of the control to the drawing area.
Range: 0-200.
 Top: Distance from the top edge of the control to the drawing area.
Range: 25-200.
 Bottom: Distance from the bottom edge of the control above the
toolbar to the drawing area. Range: 25-200.
For the range above, unit is pixel.
 Fonts
WellinControl Technology Development Co.,Ltd
8-12 Chapter 8 Trends and other curves
Click “Select Fonts” to set the label font.
 Time Span
 Display Time: the length of the Time axis in the curve . Range: 1 –
100,000 in second.
 Collecting Time: the drawing period for a curve in a single run. Range:
1 – 100,000 in second.
It is recommended to set a longer collection time than a display
time. When the curve reaches the end of the drawing area, use the
navigator, such as left/right buttons to check different sections of the
curve.
 Solutions for when collection time ends
 Restart when collecting time ends: the end of collecting time is
considered as then end of each period of “Collecting Time”. When the
time is up, the system clears all data presented in the form of curve and
redraws a new curve from the start point.
 Stop when collecting time ends: When the time is up, the system stops
collecting new data for the curve and displays the current curve.
 IP Address
The IP address for the data server in which variables for drawing a
curve are located: if they are local, then use the local IP address. This
control can be used in the “stand-alone” version of KingView.
 “Curves” Tab
See Figure 8.8
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
Figure 8.8 “Curves” Tab
Add, Edit, Delete in “Curves” Tab:
1. Add a curve:
Click “Add” to open the “New Curve” dialog box, as Figure 8.9 shows.
WellinControl Technology Development Co.,Ltd
8-13
8-14 Chapter 8 Trends and other curves
Figure 8.9 The page of “New Curve” Properties

Points on a curve
 Points: Select how the curve is drawn; check which drawing points are
needed. The points are ones in the curve marked by each data point
with a defined color and shape, as shown below.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves





8-15
Simulated Time Stamp: By selecting this item more data points will be
added to the curve. The frequency for generating simulated data, also
known as the frequency of the Simulated Time Stamp, is the same as
the base frequency of TouchView. Which is recommended for drawing
curve with long run unchanging variables.
 Select Color: click this button to select the color of the points.
 Scale: Size of a Point. Range: 1 – 6.
Settings for drawing
 Drawing Methods: Select this only when drawing lines.
 Connection Type: simulated or staged type.
 Curve Color: click this button to select the curve color.
 Scale: the width of a curve. Range: 1 – 6.
Values on Y Axis
 Min, Max: set the minimum and maximum values for the Y-axis.
 Decimal Places: set the number of decimal places for values on the Yaxis.
Variable
 Name: the name of the variable associated with the curve.
 Unit: the unit name used by the variable. A Null value is accepted.
Corresponding Curve
Set the corresponding curve for each curve.
 Display: Select only when displaying a corresponding curve.
 Color: click this button to select the color of the corresponding curve.
 Scale: the width of a corresponding curve. Range: 1 – 6.
 Edit: click this button to display the settings of the corresponding
curve. See Figure 8.10.
WellinControl Technology Development Co.,Ltd
8-16 Chapter 8 Trends and other curves
Figure 8.10 Corresponding Curve Settings

Add: click “Add”, to add a data point to the list for a corresponding
curve. Input both the start time and the value of each point, asFigure
8.11 shows.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-17
Figure 8.11 Add data points for a corresponding curve



Delete: Select a point or a group of points from the corresponding
curve list, click “Delete” to remove those points.
Save As: Save the list of data points into a .CMP file. Click “Save
As” to open the “Save As” dialog box.
Import: import data from a saved CMP file.
8.2.2.3 Modifying the properties of a real-time curve in runtime
When a real-time curve is defined, TouchView can be used to display a picture
of the curve, as Figure 8.12 shows.
WellinControl Technology Development Co.,Ltd
8-18 Chapter 8 Trends and other curves
Figure 8.12 A real-time curve in TouchView
TouchView displays a real-time curve with its corresponding curve in the
drawing area; a maximum of 16 curves can be displayed at the same time. Mouse
actions in the drawing area are permitted; if you press and hold the left mouse button
and move the mouse left and right the curves also move left and right.
The list of variables shows information about the KingView variables associated
with each curve.
As every curve has its own Y-axis, selecting a certain variable will only show the
Y-axis corresponding to the variable in the drawing area. As shown in Figure 8.11,
WindowMaker requires the range of the Y-axis for a variable with index number 0 to
range from 0(min) to 20(max) and the range of the Y-axis for a variable with index
number 1 to range from 0(min) to 15(max). For example, when a variable with index
number 0 is selected from the list, the drawing area displays the Y-axis for the variable
curve with the range from 0 to 20.
The toolbar combines a variety of buttons for different functions. The
description of each button can be acquired from the text that pops up when the cursor
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-19
is moved along the Toolbar.
: Start curve drawing. By default, TouchView will not start to draw curves
after startup.
: Stop drawing a curve.
: Curve Properties: Once you have selected a variable from the variable list,
click this button to open the “Curve Properties” dialog box, shown in Figure 8.13.
Figure 8.13 “Properties of a curve”
The settings in this dialog box are the same as those in WindowMaker.
Please refer to “8.2.2.2 Properties of a real-time curve control”for more details.
: Add a New Curve: click this button, the dialog box shown in Figure 8.8.
WellinControl Technology Development Co.,Ltd
8-20 Chapter 8 Trends and other curves
Please refer to “8.2.2.2 Properties of a real-time curve control”for more details.
: Delete a Curve: Select a variable or a group of variables from the variable
list , click this button and to open the following dialog box :
Figure 8.14 Confirm “Delete a Curve”
If you confirm that the selected curves should be deleted, the curves will be
removed when you click “Yes(Y)”.
: Drawing Settings: click this button to open the dialog box as shown in
Figure 8.15.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-21
Figure 8.15 Drawing Settings
In this dialog box, you are able to set the dimensions of the drawing area,
time span, etc. All settings in this dialog box are the same as WindowMaker.
Please refer to “8.2.2.2 Properties of a real-time curve control”for more details.
: Clear all data in the drawing area. This should only be done at the end of
the data collection process.
: Display at the start of the data collection period. It will not start until
collecting process is done.
: Display at the end time of the data collection period .
: Enable or disable the hide variable list function .
: Print the curve.
WellinControl Technology Development Co.,Ltd
8-22 Chapter 8 Trends and other curves
: Save the curve to a .CRV file. Click this button to open the “Save As”
dialog box.
: Open an existing .CRV file, and import the saved data to the drawing area.
8.3 Historical trend
KingView supplies three kinds of historical trend:
The first one is to quote historical trend with defined buttons. For this kind of
historical trend, users only need define several correlative tags and adjust curve
appearance to realize complex functions of historical trend. It’s easy to use. This
control can draw eight curves at most but it can’t realize printing curve function.
The second one is to quote historical trend control. This kind of historical trend
has powerful functions and easy to use. You can not only realize curve drawing of
historical data, but realize curve drawing of historical data in KingHistorian, also
realize curve drawing of record in ODBC database by this control. Furthermore, you
can realize add/delete dynamic curve online, infinite zoom of curve diagram, dynamic
comparison of curve, curve printing and so on.
The third one is to quote historical trend from the toolbox. For this kind of
historical trend, users need define every operation buttons of the curve. Namely,
operating historical trend need build script link. Users can create individual historical
trend by using this kind. This control can draw eight curves at most but it can’t realize
printing curve function.
No matter which kind of historical trend is used, you need configure properly. It
contains configure tag properties and saving path of historical data file. You can get
details in section 8.3.1
8.3.1 Other configurations related to historical trend
Define the range of tag
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-23
Because data displayed on the value axis of historical trend is shown in
percentage, you must notice the range of tag for tag need to be shown in curve mode.
If the range of rag is very large, like -999999~+999999, but the actual range of change
is very small, like -0.0001~+0.0001. Therefore, the percentage of curve data will be
very small and the tag curve can’t be shown on the diagram. You can see the definition
of tag range as below. Details about meanings and notices can be seen in chapter 5
“Tag definition and management”.
Figure 8.16 Tag definition
Record a certain tag
Every tag shown in historical trend need record. In TouchExplorer, click
“database” and then “Tagname Dictionary” item. Double-click tag need record to
popup “Tag properties” dialog box as below.
WellinControl Technology Development Co.,Ltd
8-24 Chapter 8 Trends and other curves
Figure 8.17 Logs definition
Select “ Logs definition and security zone” page. Select the mode for record tag.
Details about meanings and notices can be seen in chapter 5 “Tag definition and
management”.
Define the saving path for historical data file
Click “Configure” menu on the menu bar in TouchExplorer. Select “Historical
logging” from popup menu to appear dialog box as below.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-25
Figure 8.18 History configuration
Input the saving path and data holding time of historical data file in this dialog.
Configure distributed historical data which makes KingView in local computer can
access to historical data in remote computers.
Reset historical record
Click “Special” menu on the menu bar in TouchExplorer. Select “Reset historical
record” from popup menu for resetting historical record. System will auto-stop
recording historical data if there is not enough disk space. While this situation occurs,
a message will appear to notice engineers to convert data to other disks and save some
disk space. Then you can select this command to reset historical record.
You can get details about how to use historical trend in three modes as below.
8.3.2 General historical trend
8.3.2.1 Historical trend definition
Select menu “Wizards\Open wizards” to popup “Wizards manager”. Click
“Historical trend” in “Wizards manager”. Double-click historical trend in the wizards
window (Please press F2 to activate it if wizards window is invisible). Then the
WellinControl Technology Development Co.,Ltd
8-26 Chapter 8 Trends and other curves
wizards window disappears. The mouse cursor in the picture changes to right-angle
“┌”. Move it to a proper position on the picture and click the right key of mouse.
Historical trend will be copied on the picture. It appears as below. Historical trend can
move or zoom discretionarily.
Figure 8.19 Historical trend
It has a painting area with grids on the top of historical trend object which stands
for curve should be drawn in this area. The left side and bottom side of grids are the
coordinates labels of X axis (time axis) and Y axis (value axis) separately.
There are indicator and two row buttons below the curve. You can move the
position or change the size after selecting historical trend object (8 small rectangles
around it). You can define properties of historical trend like curve definition,
parameters of function buttons, pen properties and fill properties of trend curve, and
so on. Pen properties define color and line type of trend curve frames. Fill properties
define the fill mode and the background color between frames and grids.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-27
8.3.2.2 Historical curve dialog box
After generating historical trend object, double-click on the object to popup
“Historical curve” dialog box. Historical trend dialog box has three properties pages
which are “Curve definition”, “Reference frame”, “Operation panel and safe
properties”. It appears as below.
Figure 8.20 Historical trend dialog box

Curve definition properties page:
Historical trend name: define the tag name of historical trend (match case)
which is useful when you quote each field of historical trend or use some
functions.
Curve 1~Curve 8”: define the tag name of eight curves painted by historical
WellinControl Technology Development Co.,Ltd
8-28 Chapter 8 Trends and other curves
trend. Tag name must be defined tag in database. Expression and field can’t be
used. Furthermore, “If you want to record” check box should be checked in tag
properties dialog box because “KingView” only record these tags. You can see
details about how to define historical record in the section “Tag basic properties”
in chapter 5. Click “?” button to list defined tags in the database. Each curve can
select line type and line color separately from “Line type” and “Line color”
selecting buttons on the right side.
Figure 8.21 Line type dialog box
Figure 8.22 Line color selecting

Notes: The color selecting dialog box is floating. Users need press down and
drag the mouse to color area and click needed color while users select color.
Options: define if historical trend need display time indicator, shift panel for
time axis zooming and zoom panel of Y axis. Three panels contain various
buttons for operating historical trend. Check it means the option should be shown.
Reference frame page:
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-29
Figure 8.23 Reference frame properties page
Frame color and background color: Define the color of background and frames
around grids area. Select it to popup float palette. Select needed color using the same
method as “Line color” of curve.
Draw coordinates: Select whether to show coordinate axis with arrow on the left side
and bottom of grids. Check “Draw coordinates” stands for coordinate axis is necessary.
“Axis line” button highlights for selecting color and line type.
Division line is short line: Select the type of division line. If you check it, only short
main-division line appears on the coordinates. The whole diagram area is nearly blank
and no grid exists. Meanwhile “Slave-division line” option turns to grey.
Division line: Main-division lines in X and Y directions divide the painting area to
rectangle grids. Slave-division lines divide the rectangles formed by main-division
WellinControl Technology Development Co.,Ltd
8-30 Chapter 8 Trends and other curves
lines. Both of two kinds of lines can change color and line type. The number of
division line can be added or subtracted by “Add/subtract” button on the right side or
directly input by edit box. Engineers can define the size of trend to define the number
of division line which is correlative to label definition.
Label X axis-Time axis, label Y axis-value axis: Select if you want to label X or Y
axis. Namely, labeling the values of coordinates outsides the painting area. Check it to
make the options defined corresponding labels turn highlight.
Value axis (Y axis) definition area: Because a real-time trend can display change of
eight tags at one time and range of each tag maybe far apart, in order to express each
tag clearly, tag on Y axis should be denoted in percentage, namely the ratio of tag
value and range of tag (difference between max value and min value). Therefore, the
range of Y axis is from 0 (0%) to 1 (100%).
Label number: the number of value axis labels which space on the value axis.
Initial value: Define the percentage related to the initial point of value axis, 0 is
the min value.
Max value: Define the percentage related to the end point of value axis, 100 is
the max value.
Font: Define the font of value axis label. WINDOWS standard font selecting
dialog box popup. Users can refer to WINDOWS use guide for detail operations.
Time axis definition area:
Label number: the number of value axis labels which space on the value axis.
Time in WindowMaker can be denoted in the form of yy:mm:dd:hh:mm:ss. Actual
time can be shown in TouchView.
Format: format of time axis label which is to select time need to be shown.
Time: time range denoted by time axis.
Font: Define the font of value axis label. Use the same selecting method with
font of value axis.
 Operation panel and safe properties page:
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-31
Figure 8.24 Operation panel and safe properties page
Control panel related tags: Define the parameters for zooming and shifting X axis
(time axis), namely parameters related to operation buttons. It contains adjust span
and scroll percentage.
Adjust span: Time axis of historical trend can shift a time span to the left or right to
change the value of time span by editing this tag. It’s an integer tag and need to be
predefined in Tagname Dictionary.
Scroll percentage: Time axis of historical trend can shift a time percentage to the left
or right. Percentage is the radio of movement and length of current time axis of trend
curve. The tag can change the value of percentage. It’s an integer tag and need to be
predefined in Tagname Dictionary.
Users only need define these two tags (adjust span and scroll percentage) in
Tagname Dictionary. Script link is built on the operation button in historical trend.
WellinControl Technology Development Co.,Ltd
8-32 Chapter 8 Trends and other curves
Details can be seen in the section 8.3.2.3.
8.3.2.3 Operation button of historical trend
Because historical trend diagram can’t auto-update while system is running,
operation buttons need be created for historical trend. Time axis zoom/shift panel is
just a series of operation button with scripts links for viewing.
Figure 8.25 Operation buttons
The functions of the operation buttons are:
1. Time axis one-side scroll button:
It’s used to edit the time value of left or right side of trend.
 The first two buttons on the first row:
Left side of time axis scroll to left
Select the button to make the left side of time axis scroll to left in which
movement can be selected by the operation buttons on the second row which are
“4 hour”, “1 hour”, “30 minutes”, “10 minutes”, or by “Input adjust span” button.
For example, press down “10 minutes” button on the second row which means
shift left side of time axis to left for ten minutes, but the right side holds the line.
Left side of time axis scroll to right
Select the button to make the left side of time axis scroll to right in which
movement can be selected by the operation buttons on the second row which are
“4 hour”, “1 hour”, “30 minutes”, “10 minutes”, or by “Input adjust span” button.
For example, press down “10 minutes” button on the second row which means
shift left side of time axis to right for ten minutes, but the right side holds the line.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves

8-33
The last two buttons on the first row:
Right side of time axis scroll to left
Select the button to make the right side of time axis scroll to left using the same
method as “Left side of time axis scroll to left”. For example, press down “10
minutes” button on the second row which means shift right side of time axis to
left for ten minutes, but the left side holds the line.
Right side of time axis scroll to right
Select the button to make the right side of time axis scroll to right using the same
method as “Left side of time axis scroll to left”. For example, press down “10
minutes” button on the second row which means shift right side of time axis to
right for ten minutes, but the left side holds the line.
2. Time axis shift button:
It’s used to shift the left and right sides of trend to left or right at one time.
 The first four buttons on the second row:
Time axis scroll to left
Select the button to make both sides of time axis scroll to left in which movement
can be selected by the operation buttons on the second row which are “4 hour”, “1
hour”, “30 minutes”, “10 minutes”, or by “Input adjust span” button. For example,
press down “10 minutes” button on the second row which means shift both sides
of time axis to left for ten minutes.
Time axis scroll to right
Select the button to make both sides of time axis scroll to right in which
movement can be selected by the operation buttons on the second row which are
“4 hour”, “1 hour”, “30 minutes”, “10 minutes”, or by “Input adjust span” button.
For example, press down “10 minutes” button on the second row which means
shift both sides of time axis to right for ten minutes.
WellinControl Technology Development Co.,Ltd
8-34 Chapter 8 Trends and other curves
Time axis scroll to left twice
Select the button to make both sides of time axis scroll to left in which the
movement is twice of selected movement. For example, press down “10 minutes”
button on the second row which means shift both sides of time axis to left for 20
minutes.
Time axis scroll to right twice
Select the button to make both sides of time axis scroll to right in which the
movement is twice of selected movement. For example, press down “10 minutes”
button on the second row which means shift both sides of time axis to right for 20
minutes.
3. Time axis percentage shift button
It is to make time axis of trend curve shift to right or left for one percentage which
is the ratio of movement and length of current time axis. For example, the range
of time axis before movement is 12:00~14:00, the time interval is 120 minutes.
Shift it 10%, namely 12 minutes, the time axis turns to 11:48~13:48.
 The sixth, seventh, eighth buttons on the first row:
Scroll percentage input
Click the button to popup scroll percentage input dialog box. The min value of
scroll percentage is 0, and the max value is 100.
Percentage of time axis scroll to left
Select the button to make both sides of time axis scroll to left for one percentage
which can be inputted by “Scroll percentage” button. For example, inputting 10
means scroll 10%. Press once to shift both sides of time axis to left for ten
percentages.
Percentage of time axis scroll to right
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-35
Select the button to make both sides of time axis scroll to right for one percentage
which can be inputted by “Scroll percentage” button. For example, inputting 10
means scroll 10%. Press once to shift both sides of time axis to right for ten
percentages.
4. Adjust span and input button
Select or input an amount of adjusting span.
 The fifth to ninth buttons on the second row:
Input “Adjust span” button
Input the button to popup historical adjust span input dialog box for inputting
adjust span time (counted by second). For example, inputting 7200 means adjust
span time is 2 hours.
Click the button to set “Adjust span” to 4 hours. The button appears
white when it’s selected.
Click the button to set “Adjust span” to 1 hour. The button appears
white when it’s selected.
Click the button to set “Adjust span” to 30 minutes. The button
appears white when it’s selected.
Click the button to set “Adjust span” to 10 minutes. The button
appears white when it’s selected.
5. Time axis zoom button
It’s used to view the change of data quickly and particularly. Zoom button is to
zoom out or zoom in the visible range of time axis.
 The third to fifth buttons on the first row:
Display the range of time axis.
WellinControl Technology Development Co.,Ltd
8-36 Chapter 8 Trends and other curves
Zoom out button
Zoom out the range of time axis to the distance between two indicators. If both
indicators were located on the two ends of window, range would become half of
it.
Zoom in button
It will make the range of time axis twice.
6. Other buttons on the operation curve panel
Time update button: Set the rightmost of historical trend time axis as
current time to view the last data.
Setup parameter button: Setup record parameter while system running
which contains starting time of record, record size and so on.
Click the button while TouchView is running to popup the dialog box as below.
Figure 8.26 Setup parameters
8.3.2.4 Time axis indicator of historical trend
Move the indicator to view the change situation of all the tags on the curve.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-37
Move the indicator by buttons. Additionally, indicator can be set as a glider as well.
The indicator has scripts links which include several moving modes as below:
Left indicator moves to left
Click or press down the leftmost button of indicator in the first row. Move the
left indicator to the left. The executing frequency is 55 milliseconds while down.
Left indicator moves to right
Click or press down the rightmost button of indicator in the first row. Move the
left indicator to the right. The executing frequency is 55 milliseconds while down.
Right indicator moves to left
Click or press down the leftmost button of indicator in the second row. Move the
right indicator to the left. The executing frequency is 55 milliseconds while down.
Right indicator moves to right
Click or press down the rightmost button of indicator in the second row. Move
the right indicator to the right. The executing frequency is 55 milliseconds while down.
8.3.3 Historical trend control
KVHTrend control is a tool used to draw historical trend and ODBC database
curve provided in form of ActiveX control. It has characters as below:
1. It can not only access to historical database, but access to KingHistorian, also
connect to other databases through ODBC data source like Access, SQL
Sever, etc.
2. When the control connects to historical Database or KingHistorian, it can
define the interval for querying data like using query interval while using
report to query historical data.
3. Compatible of functions of original historical trend in KingView. Sixteen
curves can be drawn at one time at most.
4. You can add, delete, hide curve dynamically while system is running. And
you can edit the properties of curve.
5. Diagram can realize infinity zoom.
WellinControl Technology Development Co.,Ltd
8-38 Chapter 8 Trends and other curves
6. It can realize the curve comparison of some time segments on a certain curve.
7. Value axis can be labeled by engineering percentage or the actual range of
curve. You can switch between them.
8. Diagram can be printed directly.
9. You can select the content in list box of curves.
10. You can select whether to display value of curve while moving cursor.
11. You can display the background color of alarm area on the curve.
8.3.3.1 Create historical trend control
Create a new picture in WindowMaker. Click “Insert general control” in the
toolbox or select “Insert general control” command in “Edit” menu to popup “Insert
control” dialog box. Select “Historical trend” in the list. Click “OK”. Dialog box
disappears automatically. Mouse cursor turns to “+” shape. Click the top left corner of
control on the picture, press down the left key of mouse and drag it to appear a dashed
rectangle frame. The rectangle is the frame of created curve. Release the left key of
mouse when the rectangle is big enough. The historical trend control is created and the
curve appears as below.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-39
Figure 8.27 Historical trend control
8.3.3.2 Setup historical trend control properties
After creating historical trend control, click the right key on the control to popup
the shortcut menu. Select “Control properties” command from it to popup historical
trend properties dialog box as below.
Control properties have some properties pages as below: Curve, Coordinate
system, Preview print, Alarm zone, Cursor configuration. Hereby explain the meaning
of each property page in detail.
Figure 8.28 Historical trend control properties
WellinControl Technology Development Co.,Ltd
8-40 Chapter 8 Trends and other curves

Curve property page:
Lower part of the curve property page is to explain the source of historical
data when you draw the curve. You can select the historical database in
KingView, also select KingHistorian or select other ODBC databases as data
source. The upper part of “Curves” list in curve properties page is to define the
tags in diagram initial status, method of drawing the curve, whether to compare
curve, etc.
 Add from KingView…: Add tags from the historical database to curve
diagram and define the method of drawing the curve. Click “Add from
Historian” button to popup dialog box as below.
Figure 8.29 Add from KingView…
The meaning of each part of Add curve dialog box:
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves

8-41
Tagname: Input the tag name need to add in “Tag name” text box, or select from
the list box on the left side. The list box only lists all the tags with defined
historical record properties in the project. If no historical record is defined during
tag properties defining, the tag can’t be here. Click the tag name to “Tag name”
dialog box once a time and only click “OK” for finishing the addition.
Right click the tag name, and you can rearrange the tags when you add or modify
the curves of historicalbase variables. Including: Sort by Variant ID Increase(I), Sort
by Variant ID Decrease(J), Sort by Variant Name Increase(A), Sort by Variant Name
Decrease(D). It’s convenient for you to find the tag that you need.
 Curve definition:
Line type: Click the dropdown list box in “Line type” for selecting line type of
current curve.
Line color: Click the button in “Line color” for selecting the color of current
curve from popup palette.
Drawing mode: It has four kinds of modes for drawing curve: analog, ladder,
logic, bar graph. You can select each of them.
Invalid data drawing mode: Dashed lines, No Line or Solid Lines are available
in situations the variable values are not available, communication fails, quality stamps
break or TouchView exits.
Display value of data point: if it is selected, the value of the curve data point
will be displayed in drawing area.
Data background: Set the background of the value of the curve data point and it
works with “Display value of data point” together.
Hide curve: Whether to display the curve while system running. You can control
to display or hide the curve by selecting properties from the list in the curve window.
Y-Axis Unit: every curve has its own “Y Axis Unit”. If it is not defined in “Y
Axis Unit” as shown in Figure 8.29, the curve unit is determined based on the “Y Axis
Unit” setting in the “Coordinate System” of this control.
Decimal digits: Set the decimal digits for the cure and it works only when the
variant is float. Different cures can be set different digits.
WellinControl Technology Development Co.,Ltd
8-42 Chapter 8 Trends and other curves
Curve compare: Setup two different times of curve display to make the position
of curve has a shift on the time axis. Therefore, these two curves can be used to realize
the curve comparison in which one is to display the same time as time axis, another is
to display value of time deviation for comparing (e. g.: yesterday).
Click “OK” after tag configuration. The name of curve is added to “Curve” as
below:
Figure 8.30 Increased KingView tags to the list of curve
Historical trend curve when running as Figure 8.31 shows.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-43
Figure 8.31 Show curve from KingView

Add from KingHistorian…: Add tags from KingHistorian to curve
diagram and define the method of drawing the curve. Click “Add from
KingHistorian” button to popup dialog box as below.
WellinControl Technology Development Co.,Ltd
8-44 Chapter 8 Trends and other curves
Figure 8.32 Setting KingHistorian curve
After setting “Configure KingHistorian Server” in dialog box “History
Configuration” (refer to 24.2), accessible KingHistorian server will be displayed in
Server name column. Select the accessible KingHistorian server, click button “Select
tag”, and dialog box for tag selection will pop up, as Figure 8.33 shows.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-45
Figure 8.33 Select tag from KingHistorian
All of tag group name is shown on the left of the dialog box, users can select any
group tag, after that, all of tags that belong to this group is listed in the middle page.
When there is a large amount of tags, users can zoom out query range through setting
“Tag group query condition”, and tick off Tag name, then selected tags are shown in
“Tag name that has been selected”. After clicking “OK”, “Tag name” lists selected
tags, as Figure 8.34 shows.
WellinControl Technology Development Co.,Ltd
8-46 Chapter 8 Trends and other curves
Figure 8.34 Add tag from KingHistorian to curve list
Historical trend curve when running as Figure 8.35 shows.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-47
Figure 8.35 Show curve from KingHistorian
The meaning of other items in the dialog box “KingHistorian curve setting” is
same to that of “Add curve” from KingView.
 Add from Database…: Add tags from database to curve diagram and
define the method of drawing the curve. Click “Add from Database” button
to popup dialog box as below.
WellinControl Technology Development Co.,Ltd
8-48 Chapter 8 Trends and other curves
Figure 8.36 Curves settings page
If users want to add tags from database, ODBC data source need be configured
first as below:
1. Open “Control panel”-> “Management tools”-> “ODBC”. Click “Users
DSN” option. Click “Add” to popup “Create new data source” dialog box.
2. Select driver of data source like “Microsoft Access Driver (*.mdb)”. Click
“Finish” button to popup “ODBC Microsoft Access installation” dialog box.
3. Define a name for data source in “Data source name”. Select database
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-49
having the data need to access.. The table of the database has three fields as
least: time field, value field, millisecond field. Click “OK” to add new
database to “Users DSN” list.
When you select “Use ODBC data source” in “Data source”, the data source
definition option under the interface changes to available.
Data source: Select database of curve data source. Select data source defined in
control panel in popup “Select Data source”.
Table name: Data of curve come from a certain table of selected database.
Time field: Select time record correlative to curve data. Date/Time type.
Data field: Select value correlative to curve data. Discrete, long or float type.
Millisecond field: Select millisecond record correlative to curve data. Integer
type.
Null value: Each curve is correlated to a field labeling its values in the table. The
value of the field may be null in a certain time. However, the value of the field in a
record can’t be null because of the structure of table.
For example,
When the value field set to null, the point is unavailable. The null value can
be set to null.
When the value field is 0, the point is unavailable. The null value can be set
to “0”.
When the value field is “abcd”, the point is unavailable. The null value can
be set to “abcd”.
Time zone: Select the time zone for database record time. For ensuring the basic
time, KingView reads data according to standard time--- Greenwich Time. Therefore,
users need define their own time zone. If you selected the wrong time zone, you might
miss the curve on the time segment.
Curves settings is as Figure 8.37 shows.
WellinControl Technology Development Co.,Ltd
8-50 Chapter 8 Trends and other curves
Figure 8.37 Curves settings page
After setting the database tag curve, click “OK”, save and run, set the parameter,
then curve picture is shown as Figure 8.38.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-51
Figure 8.38 Show curve from database
The meaning of other items in the dialog box “Curves setting” from database is
same to that of “Add curve” from KingView.
You can add many tags in the curve list. Select the added curve, “Delete” and
“Edit” button change to available.



Delete: Delete selected curve in current list box. After clicking “Delete”,
system prompts “Confirm delete” dialog box.
Edit: Edit selected curve in current list box. After clicking “Edit”, system
popup the “Edit trend” dialog box as below for editing the defined
properties.
Display list: Select the option, all the curves are listed under the curve
window. You can select whether to display the list by control button while
WellinControl Technology Development Co.,Ltd
8-52 Chapter 8 Trends and other curves
system running. The content in the list can be displayed as diagram above or
custom. But “Legend” can’t be deleted. Click “List” button to popup list
selecting dialog box as below:
Figure 8.39 List dialog box
Unused items are listed on the left list box. Items need to be listed show on the
right list box. Select the item in the list box, click “Add” or “Delete” to confirm item.
Click “Up” and “Down” buttons to list the order of selected items. “Legend” can not
be moved.
 Coordinates properties page:
Click “Coordinates system” label to enter coordinates properties page as below.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-53
Figure 8.40 Coordinate system properties page
Frame color and background color: Setup the frame color and background
color of the curve. Click the correlative button to popup floating palette for selecting
needed color.
Drawing coordinates item: Whether to draw coordinates in the diagram. Click
“Axis type” list box to select the line type of coordinates. Click “Axis color” button to
WellinControl Technology Development Co.,Ltd
8-54 Chapter 8 Trends and other curves
select the color of coordinates. Coordinate is two lines in X, Y direction with arrows.
Division line: Define the number, line type, line color of main/slave division
lines for time axis and value axis. If you select division line as “short line”, defined
main-division line changes to short line on the coordinate and curve diagram wouldn’t
be divided net structure by division line as below. Meanwhile, slave-division line can’t
be used any more.
Figure 8.41 Division line and short division line
Labels of values on Y Axis:
 “Number of labels”: the number of Y-axis labels entered into the edit
box.
 “Initial Value” / “Maximum Value”: the start and end point values on
the axis. When “Draw by Percentage” is selected, the “Initial Value”
and “Maximum Value” range from 0 to 100; when “Actual Value” is
selected, the actual value of each item is entered.
 “Y axis unit”: the label for the Y-axis unit. The unit will be labeled at
the top of the axis when we select the display mode as Fixed Scale
Auto Adjust, Actual Value or Query Range Auto-adjust.
 Show tag name: Show the name of the selected curve at the top of the
axis.
 Show in scientific notation: Select the option and the value of the axis
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves





8-55
will be showed in scientific notation.
“All float display on same decimal digits”: Select and set the decimal
digits in the list, and all the curves of float tags will be displayed
according to the decimal digits while the setting doesn’t work in “Add
curve” for each curve.
“Percent”: The axis is labeled with the percentage. The percetage is the
ratio tag value to the difference between the maximum and minimum.
Select “Percent” and the axis will be labeled with percetage according
to the setting of “Start value” and “End value”..
“Fixed Scale Auto Adjust”: The curve shape is drawn with the
percentage and the display value is the actual value of the selected
variable. The range of the Y axis is corresponding to the range of the
selected variable(the min and the max value of the variable defined in
tagname dictionary).
“Actual Value”: the axis is labeled with the actual values according to
the “Start Value” and “End value”. There’re some differences between
“Actual Value” and “Fixed Scale Auto Adjust”. The curves will be
drawn with percentage in the mode of ”Fixed Scale Auto Adjust”,
while in the mode of “Actual Value”, all the curves will be drawn with
the actual value in the same Y axis. Double click the curve to select it,
and the Y axis will be labeled with the range of the selected curve.
“Query Range Auto-adjust”: The scale of the axis changes in
accordance with Max and Min values in search time. That is to say,
when querying data during a specific period of time, the curve changed
according to the Min and Max values in the drawing area. When a
curve is selected from the list inside the control, the axis values range
from minimum to maximum during the period of time.
Note:
You can double click to select the curve in the curve list.
WellinControl Technology Development Co.,Ltd
8-56 Chapter 8 Trends and other curves
Example:
Define variables as below:
Tag name
Min
max
increal
0
50
Liqulidlevelofreacrionpot
0
100
Fixed Scale Auto Adjust:
“LiquidlevelofReactionpot” is selected and the figure is shown as below:
“increal” is selected and the figure is shown as below:
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
Actual Value:
“LiquidlevelofReactionpot” is selected and the figure is shown as below:
“increal” is selected and the figure is shown as below:
WellinControl Technology Development Co.,Ltd
8-57
8-58 Chapter 8 Trends and other curves
 “Fonts”: click “Fonts” the font and label color settings dialog box.
Label time (X) axis: The number of labels on the value axis in “Label number”
edit box. Select the time format for displaying time axis through “Format”. “Time
interval” edit box defines the time interval of original diagram. Click “Font” button to
popup font, style, size dialog box to select font and color for value axis labels.
Cursor display: if it is selected, left cursor and right cursor will be displayed in
drawing area.
Click “OK” to return after definition.

Preview print option page:
Click “Preview print” label to enter preview print properties page as below.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-59
Figure 8.42 Preset print option
Whether to print title: Check it to make the edit box of title become available.
Input the title of diagram need to print in the edit box.
Whether to print curve list: Check it to print the list of curve tags.
Boundary background color: Click boundary background color button to select
the boundary background color for printing curve.
Whether to edit curve background color: Check it to make background color
button of curve available. Click the button to select the background color for
printing curve.
WellinControl Technology Development Co.,Ltd
8-60 Chapter 8 Trends and other curves

Select alarm area option page:
Display the background color of alarm area in the curve control. Click alarm area
button to enter select alarm area properties page as below:
Figure 8.43 Alarm area option
Whether to display HiHi-limit alarm area: Check it to activate the lowerboundary position, the upper-boundary position and background color of alarm
area. Input percentage of HiHi alarm area in upper and lower boundary edit box
then select the background color of the alarm area’ trend
Whether to display Hi-limit alarm area: similar operation as above
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-61
Whether to display Lo-limit alarm area: similar operation as above
Whether to display Lolo-limit alarm area: similar operation as above
The result of definition is shown as below.
Figure 8.44 Alarm area
 Cursor configuration option page:
When users query historical data using historical trend, some other
information need to be known sometime as well which may be not recorded in
history. Such as operator information, class/group information and so on.
Historical trend control can get the additional information from any third party
database by ODBC.
Enter into cursor configuration option page as below.
WellinControl Technology Development Co.,Ltd
8-62 Chapter 8 Trends and other curves
Figure 8.45 Cursor configuration
Left cursor and right cursor: Select left cursor check box to operate the left cursor.
Select right cursor check box to operate the right cursor.
Additional information of left cursor and right cursor: to define the additional
information of cursors. May check directly “Additional information of left cursor”
check box then input the additional information (31 characters at most) in the edit box,
or select corresponding field in database at the right “Get additional information from
database”. Both ways could not be used at same time. If you select them simultaneity,
only information form database is displayed in runtime. Additional information of left
cursor and right cursor could not be used simultaneity.
Check “Additional information of left cursor” check box and input “Liquid level
of Reaction pot“ in edit box, then click OK to save the picture. You can see the result
as below after switching to TouchView.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-63
Figure 8.46 information of cursor
Must create database which supports ODBC before using “Get additional
information from database”.
Create a data table including the following fields:
 Starting time: Date/Time type.
 End time: Date/Time type.
 Additional information: string or text type.
Taking ACCESS database for example, defined additional information table is shown
as below.
WellinControl Technology Development Co.,Ltd
8-64 Chapter 8 Trends and other curves
Figure 8.47 additional information
The values of curve display mode: It has three types can be selected in values of
curve display mode which are “Never display values”, “Display values all the time”,
“Display values while moving cursor”. When you select one of them, values of curve
will display in the corresponding cursor position according to the selected type while
system is running. For example, select “Display values all the time” in the “The
values of curve display mode” of the left and right cursor. In TouchView, the values of
curve are shown all the time on the cursor axis by moving cursor.
 Data source: Select ODBC data source name of additional information
database.
 User name: Select the user name for using ODBC data source.
 Password: Input user password. for using ODBC data source.
 Table name: Select the table where the curve data come from, as
“Additional information table” above.
 Starting time: Select the field of starting time of additional information in
database. End time: Select the field of ending time of additional information
in database.
 Additional information field: Select the additional information field
recorded in database.
 Time zone: Select the time zone for database record time. For ensuring the
basic time, KingView reads data according to standard time--- Greenwich
Time. Therefore, users need define their own time zone. If you selected the
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-65
wrong time zone, you might miss the prompt message on the time segment.
For example:
The starting time is 8 a.m. 10/9/2007 and the end time is 11 a.m. 10/9/2004. The
additional information field in this time segment is evening. When you move cursor to
any point in this time segment, Morning will appear.
Figure 8.48 Additional information display
Note:
When you create the field in database, the starting time field and end time field
can only be date/time type, the additional information field can only be string type.
Other types can’t be called in.
 Display style of value at the curve cursor: to define the cursor style on the chart.
Track curve: as moving the cursor, position of the value display box follows the cross
point of the curve and the cursor.
Paratactic display at top: as moving the cursor, the value display box is at top of the
WellinControl Technology Development Co.,Ltd
8-66 Chapter 8 Trends and other curves
chart.
Paratactic display at bottom: as moving the cursor, the value display box is at bottom
of the chart.
Display tag name: display correlative tag name and value simultaneity in the value
display box, shown as below.
Figure 8.49 Display tag name
Transparent background: to define if background of the value display box is
transparent.
8.3.3.3 Setup animation link properties of historical trend
Because the historical appears in form of control, the curve has control properties
as well. Namely, you can define “Properties” and “Event”. You can get details about
“Properties” and “Event” of general control in the chapter 14 “Control”. Hereby
introduce to “Properties” and “Event” of the historical trend.
Double-click the control to popup “Animation links properties” dialog box as
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-67
below.
Figure 8.50 Set Animation links properties
Animation links properties have three properties pages as below:
“General” properties page:
Control name: define the label name of the control in KingView, like
“Historical trend” which is unique in current project in KingView.
Priority and security zone: define the security of control. You can get details
about the meanings of priority and security zone in the chapter 16 “Security
Management”. Users can operate the historical trend only when the defined
access level is satisfied.
“Properties” properties page:
Define the relation between control properties and KingView tags. The
properties and meanings of the historical trend appear as below.
WellinControl Technology Development Co.,Ltd
8-68 Chapter 8 Trends and other curves
Figure 8.51 Properties
“Event” properties page:
Define the event functions of control. The events and meanings of the historical
trend appear as below.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-69
Figure 8.52 Event
8.3.3.4 List of properties and methods of historical trend
No.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Name
CurveUseKVHistData
CurveDSN
CurveTable
CurveDateTimeField
CurveInvalidColor
CurveVarName
CurveColor
CurveLineType
CurveTimeDelay
CurveDrawType
CurveAlmColor
CurveHideCurve
CurveMilliSecondField
CurveDataField
CurveInvalidValue
Data type
Bool
String
String
String
OLE_COLOR
String
OLE_COLOR
Short
String
Short
OLE_COLOR
Bool
String
String
String
Meaning
Use KingView historical data
Use name of data source
Table name of database
Time field name of database
Invalid value of database
Tag name
Curve color
Curve line type
Curve time delay
Curve drawing type
Display color for alarm
Whether to hide curve
Name of millisecond field name
Name of data field
Name of invalid value
WellinControl Technology Development Co.,Ltd
8-70 Chapter 8 Trends and other curves
16
17
18
19
20
21
22
23
24
25
26
27
CurveUser
CurvePwd
CurveSavePwd
CurveList
CtrlBtn
BorderColor
BakColor
DrawXYAxis
AxisLineType
AxisColor
ShortDivLine
MajXDivNum
String
String
Bool
Bool
Bool
OLE_COLOR
OLE_COLOR
Bool
Short
OLE_COLOR
Bool
Short
28
MinXDivNum
Short
29
MajYDivNum
Short
30
MinYDivNum
Short
31
MajXDivLineType
Short
32
MinXDivLineType
Short
33
MajYDivLineType
Short
34
MinYDivLineType
Short
35
36
37
38
39
40
41
42
43
44
MajXDivColor
MinXDivColor
MajYDivColor
MinYDivColor
YLabelNum
YMinVal
YMaxVal
YLableFont
XLabelNum
Xwidth
OLE_COLOR
OLE_COLOR
OLE_COLOR
OLE_COLOR
Short
Double
Double
IFontDisp
Short
Short
User name of ODBC data source
Password of ODBC data source
Whether to save password for ODBC
Whether to display curve list
Whether to display control button
Border color
Background color
Whether to draw coordinates
Line type of axis
Color of axis
Division line is short line or not
Number of main-division line on X
axis
Number of slave-division line on X
axis
Number of main-division line on Y
axis
Number of slave-division line on Y
axis
Line type of main-division line on X
axis
Line type of slave-division line on X
axis
Line type of main-division line on Y
axis
Line type of slave-division line on Y
axis
Color of main-division line on X axis
Color of slave-division line on X axis
Color of main-division line on Y axis
Color of slave-division line on Y axis
Number of labels on Y axis
Minimum value of label on Y axis
Maximum value of label on Y axis
Font of label on Y axis
Number of labels on X axis
Width of X axis
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
45
46
XLabelFont
XLabelFmtYear
IFontDisp
Bool
47
XLabelFmtMonth
Bool
48
XLabelFmtDay
Bool
49
XLabelFmtHour
Bool
50
XLabelFmtMinute
Bool
51
XLabelFmtSecond
Bool
52
XlabelFmtMilliSecond
Bool
53
XWidthUnit
Short
54
55
XLabelColor
YLabelColor
OLE_COLOR
OLE_COLOR
56
CurveNum
Long
57
AdjustWidth
Long
58
AdjustWidthUnit
short
59
60
61
62
63
64
65
66
Percent
YMinReal
YMaxReal
SampleInterval
SampleIntervalMs
PrintTitle
XLVernierShow
XRVernierShow
Bool
Double
Double
Long
Long
String
Bool
Bool
XLabelFmtMicroSecond
Bool
SampleUS
bPrintTitle
bPrintList
Bool
Bool
Bool
67
68
69
70
8-71
Font of label on X axis
Format of label on X axis-whether to
show year
Format of label on X axis-whether to
show month
Format of label on X axis-whether to
show day
Format of label on X axis-whether to
show hour
Format of label on X axis-whether to
show minute
Format of label on X axis-whether to
show second
Format of label on X axis-whether to
show millisecond
Width unit of X axis: second, minute,
hour, day
Color of label on X axis
Color of label on Y axis
Obtain the number of curve in current
chart
Adjust width of time axis
Adjust width unit of time axis: second,
minute, hour, day
Whether to draw in percentage
Minimum value on Y axis
Maximum value on Y axis
Sample interval second
Sample interval millisecond
Print title
Whether to display left cursor
Whether to display right cursor
Format of label on X axis-whether to
show microsecond
Whether to sample in microsecond
Whether to print title
Whether to print curve list
WellinControl Technology Development Co.,Ltd
8-72 Chapter 8 Trends and other curves
71
72
73
YUNIT
bHiHiAlarmArea
HiHiAlarmAreaUp
String
Bool
Double
74
HiHiAlarmAreaDown
Double
75
76
77
78
79
80
81
HiAlarmArea
HiAlarmAreaUp
HiAlarmAreaDown
bLoAlarmArea
LoAlarmAreaUp
LoAlarmAreaDown
bLoLoAlarmArea
Bool
Double
Double
Bool
Double
Double
Bool
82
LoLoAlarmAreaUp
Double
83
LoLoAlarmAreaDown
Double
84
85
86
LVernierStr
RVernierStr
LVernierAppendStr
String
String
Bool
87
RVernierAppendStr
Bool
88
LShowVernierValType
Short
89
RShowVernierValType
Short
90
91
92
bPrintSubTitle
PrintSubTitle
SubTitlePos
Bool
String
Short
Unit of Y axis
Whether to show HiHi-limit alarm area
Upper boundary of HiHi-limit alarm
area
Lower boundary of HiHi-limit alarm
area
Whether to show Hi-limit alarm area
Upper boundary of Hi-limit alarm area
Lower boundary of Hi-limit alarm area
Whether to show Lo-limit alarm area
Upper boundary of Lo-limit alarm area
Lower boundary of Lo-limit alarm area
Whether to show LoLo-limit alarm
area
Upper boundary of LoLo-limit alarm
area
Lower boundary of LoLo-limit alarm
area
Additional information on left cursor
Additional information on right cursor
Whether
to
show
additional
information on left cursor
Whether
to
show
additional
information on right cursor
Value display type of left cursor
0. no value displayed
1. display value all the time
2. Display value while moving cursor
Value display type of right cursor
1. no value displayed
2. display value all the time
3. Display value while moving cursor
Whether to print subtitle
Print subtitle
Position of subtitle
Note:
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-73
Besides CurveNumis read-only, all the properties above are read-write.
All the properties started by “Cur” in historical trend control properties supply to
KingView system. Users can’t call in. Especially, users can’t use “Event” in the
control.
Historical trend control has many methods for users to use in scripts. Hereby
explain how to use historical trend control.
1. Void ChangeCurveVarName(long 1Index,STRING szNewName);
Function: change the tags connected to historical trend which data come from
KingView history.
Parameters: 1Index: curve index
szNewName: tag name
For example: Define tag V1, m is the name of historical trend. Define on key up
m. ChangeCurveVarName(1,”\\Local node\v1”);
Change the tag connected to the first curve to V1.
2. Void ChangeCurveVarNameForODBC(Long 1Index, String szNewName, String
szDSN, String szUser, String szPwd, String szTable, String szDateTimeField,
String szMilliSecondField, String szDataField, String szInvalidValue);
Function: change the tags connected to historical trend which data come from
ODBC data source.
Parameters: 1Index: curve index
szNewName: tag
szDSN: name of data source
szUser: user name
szPwd: password
szTable: table name of database
szDateTimeField: time field of the table
szMilliSecondField: millisecond field of the table
szDataField: data field of the table
WellinControl Technology Development Co.,Ltd
8-74 Chapter 8 Trends and other curves
szInvalidValue: invalid value of the table
For example: Define tag V2, m is the name of historical trend. “Historical trend”
is
the
name
of
data
source.
Define
on
key
up
m.ChangeCurveVarNameForODBC(2,”\\Local node\v2”, “Historical trend”,
“User1”, “abcd”, “milli”, “date”, “ms”, “data”,);
Change the tag connected to the second curve to V2.
3. String HTGetTimeStringAtScooter(LONG nScootNum, STRING szFormat);
Function: get the time from the indicator. The time is in string format.
Parameters: nScootNum: indicator index, 1-left, 2-right
szFormat: assign the format of needed time string.
“Date”: display date in the same form of Windows control panel
“Time”: display time in the same form of Windows control panel
“DateTime”: display date and time in the same form of Windows
control panel
Returned value: date/time value in string type
4. Float HTGetPenRealValue(LONG nPenNum, STRING szContent);
Function: get the actual values of the starting point and end point of the curve on
Y axis (value axis).
Parameters: nPenNum: curve index, 1~16
szContent: assign the needed type
“Start”: convert the engineering percentage of lower-limit value on
Y axis to actual value
“End”: convert the engineering percentage of upper-limit value on
Y axis to actual value
“Valid”: judge whether the value is available. 0-invaild, 1-valid
Returned value: actual value corresponding to engineering percentage
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-75
For example: define PenVal as float tag, m is the name of historical trend control.
Define on key up PenVal= m. HTGetPenRealValue(1, “Start”); to get the actual
value corresponding to engineering percentage of lower-limit value of the first
curve on Y axis.
Tip: the method can’t be used to discrete tag.
5. Float HTGetValue(LONG nPenNum, STRING szValType);
Function: get the maximum/minimum/average values of the whole table (visible
part) of assigned curve
Parameters: nPenNum: curve index, 1~16
szValType: assign the needed value type
“AverageValue”: the average value of the whole trend
“MaxValue”: the maximum value of the whole trend
“MinValue”: the minimum value of the whole trend
“Valid”: judge whether the value is available. 0-invaild, 1-valid
Returned value: the maximum/minimum/average values of the whole table
(visible part)
For example: define PenVal as float tag, m is the name of historical trend control.
Define on key up PenVal= m. HTGetValue(1, “MaxValue”); to get the maximum
value of the first curve on the whole diagram.
Tip: the method can’t be used to discrete tag.
6. String HTGetValueAtScooter(LONG nPenNum, LONG nScootNum, STRING
szValType);
Function: get the needed value of assigned curve from the indicator.
Parameters: nPenNum: curve index, 1~16
nScootNum: indicator index, 1-left, 2-right
WellinControl Technology Development Co.,Ltd
8-76 Chapter 8 Trends and other curves
szValType: assign the needed type
“Value”: get the value on the indicator
“Valid”: judge whether the value is available. 0-invaild, 1-valid
Returned value: date/time value in string type
For example: define PenVal as float tag, m is the name of historical trend control.
Define on key up PenVal= m.HTGetValueAtScooter(1, 2, “Value”); to get the
value of right indicator of the first curve.
7. Float HTGetValueAtZone(LONG nPenNum, STRING szValType);
Function: get the maximum/minimum/average values between two indicators of
assigned curve
Parameters: nPenNum: curve index, 1~16
szValType: assign the needed value type
“AverageValue”: the average value
“MaxValue”: the maximum value
“MinValue”: the minimum value
“Valid”: judge whether the value is available. 0-invaild, 1-valid
Returned value: the maximum/minimum/average values between two indicators
of assigned curve
For example: define PenVal as float tag, m is the name of historical trend control.
Define on key up PenVal= m. HTGetValueAtZone(1, “MaxValue”); to get the
maximum value of the first curve.
Tip: the method can’t be used to discrete tag.
8. Void HTScrollLeft();
Function: move the starting time of curve to the left for one adjust span
Parameters: none
Returned value: none
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-77
9. Void HTScrollRight();
Function: move the starting time of curve to the right for one adjust span
Parameters: none
Returned value: none
10. Void HTUpdateToCurrentTime();
Function: set the end time of curve as current time
Parameters: none
Returned value: none
11. Void HTSetLeftScooterTime(LONG 1Time, LONG sMilliSeond);
Function: Setup the starting point of time axis
Parameters: 1Time: year, month, day, hour, minute, second parts of time. Convert
the time by function HTConvertTime() to the second unit of
assigned time from 0 a.m., Jan 1th, 1970.
sMilliSecond: millisecond part of time
Returned value: none
For example: Define ST as the starting time, m is the name of the historical trend
control, Define on key up ST=HTConvertTime(2001,12,1,0,0,0);
m.HTSetLeftScooterTime(ST,0);
to set the starting time of the curve as 00:00, Dec 1th, 2001 (millisecond part is 0)
12. Void HTZoomIn(STRING szLookString);
Function: zoom in the curve diagram by adding the length of time and value axis
Parameters: szLookString: zoom type
“StartTime”: Hold the start time in line with the position before
zooming
“EndTime”: Hold the end time in line with the position before
zooming
“Center”: Hold the center time in line with the position before
WellinControl Technology Development Co.,Ltd
8-78 Chapter 8 Trends and other curves
zooming
Returned value: none
For example: Zoom in diagram to hold the center time in line, m is the name of
historical trend, define on key up m.HTZoomIn(“Center”);
13. Void HTZoomOut(STRING szLookString);
Function: zoom out the curve diagram by adding the length of time and value
axis
Parameters: szLookString: zoom type
“StartTime”: Hold the start time in line with the position before
zooming
“EndTime”: Hold the end time in line with the position before
zooming
“Center”: Hold the center time in line with the position before
zooming
Returned value: none
For example: Zoom out diagram to hold starting time in line, m is the name of
historical trend, define on key up m.HTZoomOut(“StartTime”);
14. Void SetTimeParam(LONG 1StartTime, LONG sStartms, LONG 1XWidth,
LONG sXWidthUnit)
Function: Setup the starting point of historical trend coordinate, length of time
axis
Parameters: 1StartTime: year, month, day, hour, minute, second parts of time.
sStartms: millisecond part of time
1XWidth: length of time axis
sXWidthUnit: length unit of time axis:0-second, 1-minute, 2-hour, 3day, 4-millisecond
Returned value: none
Tip: sXWidthUnit must be 0, namely second. 1XWidth is the time length after
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-79
converting to second.
For example: m is the name of historical trend control, define ST as the starting
time,
define
on
key
up,
ST=HTConvertTime(2002,12,16,8,0,0);
m.SetTimeParam(ST,0,10,1);
Set the start time of historical trend as 8 a.m., Dec 16th, 2002. The length of time
axis of historical trend is 10 minutes.
In the second edition of KingView, it should be:
ST=HTConvertTime(2002,12,16,8,0,0); m.SetTimeParam(ST,0,600,0);
Set the start time of historical trend as 8 a.m., Dec 16th, 2002. The length of time
axis of historical trend is 10 minutes.
15. void SetTimeParamDivided(LONG sStartYear, LONG sStartMonth, LONG
sStartDay, LONG sStartHour, LONG sStartMinute, LONG sStartSecond, LONG
sStartms, LONG 1XWidth, LONG sXWidthUnit)
Function: Setup the starting point of historical trend coordinate, length of time
axis. You can input time parameters directly. It has the same functions as
SetTimeParam.
Parameters: sStartYear: year
sStartMonth: month
sStartDay: day
sStartHour: hour
sStartMinute: minute
sStartSecond: second
sStartms: millisecond
1XWidth: length of time axis
sXWidthUnit: unit of time axis: 0-second
Returned value: none
For example: m is the name of historical trend control, define on key up:
m.SetTimeParamDivided(2002,12,16,8,0,0,0,600,0)
Set the start time of historical trend as 8 a.m., Dec 16th, 2002. The length of time
WellinControl Technology Development Co.,Ltd
8-80 Chapter 8 Trends and other curves
axis of historical trend is 10 minutes.
16. void SetTimeParamString(STRING strStartTime, STRING strEndTime)
Function: Setup the start point and end point of historical trend. You can input
time parameters in string format.
Parameters: strStartTime: string of start time
strEndTime: string of end time
For example: m is the name of historical trend control, define on key up:
m.SetTimeParamString(“13:00:00:001, Sep 20th, 2004”, “15:20:02:999, Sep 20th,
2004”) which setup the range of time axis like: 13:00:00:001, Sep 20th,
2004~15:20:02:999, Sep 20th, 2004.
17. ShowCurve(LONG 1Index, BOOL bShow)
Function: Show or hide assigned curve
Parameters: 1Index: curve index, 1~16
bShow: select 1 to show curve, select 0 to hide curve
Ex. m is the name of a historical trend curve control, when button is up:
m.ShowCurve( 1,0)
Hide = 1.
18. void MutePrintCurve()
Function: print which can realize the same functions as print control button
Parameters: none
Returned value: none
Note:
Please use properties and methods introduced in the document when users use
historical trend control. Other properties and methods are not allowed.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-81
8.3.3.5 Edit historical trend properties while system running
After defining curve properties of historical trend, you can see the historical
trend appear as below in TouchView:
Figure 8.53 Control in TouchView
Use indicator on the value axis:Drag indicator of Y axis to zoom in/out the
length of curve on the Y axis. Generally, the indicator label is the percentage of
tag range in current diagram.
Use indicator of time axis: Time string obtained by indicator of time axis
appears on the top of it as below. Indicator of time axis can obtain data of a
certain point on the time axis to cooperate with functions.
Use toolbar: Toolbar on the curve diagram is to view the detail about tag curve.
You can get the details from popup message by moving mouse cursor on the
button. Details about how to use each button can be seen as below.
WellinControl Technology Development Co.,Ltd
8-82 Chapter 8 Trends and other curves
Figure 8.54 Toolbar
 Setup adjust span button:
Figure 8.55 Adjust span
Click the button to popup a dialog box for editing the default value of current
span time.
Figure 8.56 Change span
Select the span time unit in “Unit” list box which contains day, hour, minute,
second, millisecond. Input the value of time span in the “Span” edit box.
It supports displaying data in millisecond:
A. Because KingView doesn’t support displaying data in millisecond. It only
can be realized after high-speed history is complete.
B. The shortest width of time axis is 10ms.
C. Zooming and moving support to millisecond.
Can’t set to millisecond in setup parameter, you need scripts to finish it.
Click button
to make curve diagram move to left for an assigned time
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
segment. Click button
8-83
to make curve diagram move to right for an assigned
time segment.
 Setup curve for Y axis label:
Click the drop-down arrow on the right side of the button, to open the dialog box
shown as Figure 8.57.
Figure 8.57 Y–Axis settings
When “Percent” is selected, the axis is labeled with the percentage values. When
“Fixed Scale Auto Adjust” is selected, the scale is determined by Min and Max values
of the curve of the variable defined in Tagname dictionary. When “Actual Value” is
selected, the axis is labeled with the actual values. When “Query range Auto adjust” is
selected, the scale is determined by Min and Max values of the curve in search time
and the axis is marked with Min and Max values of the current curve. Please refer to
“Setup historical trend control properties” for details.
Continues zoom for curve diagram:
Zoom in
: select a rectangle area in the curve diagram. Click the button to
zoom in current diagram:
A. When you select a rectangle area in the curve area, the leftmost/rightmost of
WellinControl Technology Development Co.,Ltd
8-84 Chapter 8 Trends and other curves
time axis adjusts to time of left/right boundary of rectangle. The
topmost/bottommost of value axis adjusts to value of top/bottom boundary of
rectangle. Therefore, the curve is partly enlarged. The left/right indicator is
set to the leftmost/rightmost of time axis.
B. When the rectangle area isn’t selected, like the left/right indicator isn’t set to
the leftmost/rightmost of time axis, the leftmost/rightmost of time axis adjusts
to time of left/right indicator, value axis is fixed. Therefore, the curve is
partly enlarged. The left/right indicator is set to the leftmost/rightmost of time
axis.
C. When the rectangle area isn’t selected, like the left/right indicator is set to the
leftmost/rightmost of time axis, width of time axis is set to half of original
one, keep the center position fixed, and the value axis is fixed. Therefore, the
curve is partly enlarged. The left/right indicator is set to the
leftmost/rightmost of time axis.
Zoom out
: select a rectangle area in the curve diagram. Click the button to zoom
out current diagram:
A. When you select a rectangle area in the curve area, the leftmost/rightmost of
time axis adjusts to time of left/right boundary of rectangle. The
topmost/bottommost of value axis adjusts to value of top/bottom boundary of
rectangle. Therefore, the curve is partly shortened. The left/right indicator is
set to the leftmost/rightmost of time axis.
B. When the rectangle area isn’t selected, like the left/right indicator isn’t set to
the leftmost/rightmost of time axis, the leftmost/rightmost of time axis adjusts
to time of left/right indicator, value axis is fixed. Therefore, the curve is
partly shorten. The left/right indicator is set to the leftmost/rightmost of time
axis.
C. When the rectangle area isn’t selected, like the left/right indicator is set to the
leftmost/rightmost of time axis, width of time axis is set to twice of original
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-85
one, keep the center position fixed, and the value axis is fixed. Therefore, the
curve is partly shortened. The left/right indicator is set to the
leftmost/rightmost of time axis.
 Rollback button: Click button
to make the curve chart return to the
historical curve that received by previous inquiries. The button can just rollback
once, it turns gray when it can’t be used.
 Print curve: Click button
to popup “Print properties” dialog box as below.
Select a printer. Click “Properties” button to setup print properties: page size,
direction, etc. You can print current curve and coordinates.
Figure 8.58 Print
 Update end time of curve diagram to current time: Click the button
WellinControl Technology Development Co.,Ltd
to
8-86 Chapter 8 Trends and other curves
update end time of curve diagram to current time.
Figure 8.59 Add curve
 Setup parameters of time axis and value axis: Click the button
to popup
“Input new parameter” dialog box as below. Edit the range of start/end time of
time axis, range of value axis and display mode of cursor.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-87
Figure 8.60 Input new parameters
 Set property page: Click the button
to set the page property.
WellinControl Technology Development Co.,Ltd
8-88 Chapter 8 Trends and other curves
You can edit the related parameter to the history trend curve in TouchView and it
works as Control properties in Windowmaker.
 Hide/show tag list: Click the button
or
to
hide/show tag list.
Curve tag list
The list of curve variables shows information regarding the curves and the
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-89
variables associated with them in the current picture. The contents is controlled by the
list of items in “Properties of Curves” which is located in the control properties of
TouchView.
Right-click in the variable list or right click in a row to open the shortcut menu
shown in Figure 8.61.
Figure 8.61 Shortcut menu
Add: add a curve to current diagram
Delete: delete a selected curve from current diagram
Modify properties: edit the drawing properties of selected curve
8.3.4 Individual historical trend
8.3.4.1 Historical trend definition
When you make picture in WindowMaker, you can select “Tools\Historical
trend” menu or click “Draw historical trend” button in the toolbox. Mouse cursor
turns to “+” shape. Draw a rectangle in the picture, historical trend will be drawn in it.
Figure 8.62 Historical trend
WellinControl Technology Development Co.,Ltd
8-90 Chapter 8 Trends and other curves
There is a drawing area with grids among historical trend which stands for curve
will be drawn in it. The left and bottom of grid are the coordinate labels of X axis and
Y axis. You can move position or change size by selecting historical trend object (8
small rectangles around it). You can change pen properties and fill properties of trend
by palette tool or menu command. Pen property is the color and line type of the frame
of trend curve. Fill property is the background color and filling mode between frames
and grids. The label number will disappear sometimes because background color and
font color are the same which need to change font or background color.
8.3.4.2 Historical trend dialog box
After the visible part of historical trend is generated, double-click on the object to
popup “Historical trend” dialog box which contains two properties pages: “Trend
definition” and “Mark definition” as below.
Figure 8.63 Historical trend dialog box
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-91
Trend definition page:
Coordinate: Select whether to display coordinates with arrows on the bottom
and left of grids. Select “Coordinate” check box to stand for coordinate lines.
Meanwhile, “coordinate lines” button highlight for selecting the color and line
type of coordinate lines. Press down line type button or color button to popup
line type or color selecting dialog box.
Select line type: Click line type button to popup line type selecting floating menu.
Press down the left key of mouse and drag it downwards. Selected line type will
appear on the button. Release the mouse.
Select color: Click color button to popup color selecting floating menu. Press
down the left key of mouse and drag it to color floating menu. Release the mouse
and select needed color.
Figure 8.64 Line type and color selecting
Division line is short line: Select the type of division line. If you check it, only
short main-division line appears on the coordinates. The whole diagram area is
nearly blank and no grid exists. Meanwhile “Slave-division line” option turns to
grey.
Frame color, background color: Define frame color and background color of
defined painting area. You can use the same method to edit two buttons as
coordinates button. Popup floating dialog box almost keeps the same. However,
no line type option exists.
X direction, Y direction: Main-division lines in X and Y directions divide the
WellinControl Technology Development Co.,Ltd
8-92 Chapter 8 Trends and other curves
painting area to rectangle grids. Slave-division lines divide the rectangles formed
by main-division lines. Both of two kinds of lines can change color and line type.
The number of division line can be added or subtracted by “Add/subtract” button
on the right side or directly input by edit box. Engineers can define the size of
trend to define the number of division line which is correlative to label definition.
Historical trend name: define the tag name of historical trend (match case)
which is useful when you quote each field of historical trend or use some
functions.
Curve 1~Curve 8: define the tag name of eight curves painted by historical trend.
Tag name must be defined tag in database. Expression and field can’t be used.
Furthermore, “If you want to record” check box should be checked in tag
properties dialog box because “KingView” only record these tags. You can see
details about how to define historical record in the section “Tag basic properties”
in chapter 5. Click “?” button to list defined tags in the database. Each curve can
select line type and line color separately from “Line type” and “Line color”
selecting buttons on the right side.
Solutions of drawing invalid data: Dashed lines, No Line or Solid Lines are
available in situations where the variable values are not available,
communication fails, quality stamps break or TouchView exits
Mark configuration properties page:
Click “Mark configuration” properties page on the top of “Historical trend”
dialog box. Historical trend dialog box appears as below.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-93
Figure 8.65 “Mark configuration” properties page
Label X axis-Time axis, label Y axis-value axis: Select if you want to label X
or Y axis. Namely, labeling the values of coordinates outsides the painting area.
Check it to make the options defined corresponding labels turn highlight.
Value axis (Y axis) definition area:
Label number: the number of value axis labels which space on the value axis.
Initial/ Maximum Value: Are the start and end points of the axis. When “Draw
by Percentage” is selected, they are percentage values (0~100); when “Actual
Value ” is selected, they are the actual values.Max value: Define the percentage
related to the end point of value axis, 100 is the max value.
Integral Digits: the number of displayed integral digits on an axis.
Decimal Digits: the maximum number of displayed decimal digits on an axis.
Scientific Notation: the axis values are displayed in scientific notation.
Fonts: The axis label font. This opens a WINDOWS standard fonts dialog box.
WellinControl Technology Development Co.,Ltd
8-94 Chapter 8 Trends and other curves
Please refer to WINDOWS User Guide if you are a developer.
Data Format:
Engineering Format: the axis is drawn using percentage values, which means all
values are divided by the difference between the Max and Min values. When
“Draw by Percentage” is selected, the axis is labeled with the percentage values
according to the “Initial Value” and “Maximum Value”.
“Actual Value”: the axis is labeled with the actual values according to the “Initial
Value ” and “Maximum Value”.
If “Actual Value” is selected and “Self-adapted values are applied to the Y-Axis
in Browser View according to the current pen” is selected, then a user can publishes a
curve on the Web in such a way that IE explorer can draw the curve using the selfadapted values on the Y-axis which come from the minimum and maximum values of
the curve. If “Self-adapted values applied to the Y-Axis in Browser View according to
the current pen” is not selected, the explorer draws the curve using the actual values.
Time axis definition area:
Label number: the number of value axis labels which space on the value axis.
Time in WindowMaker can be denoted in the form of yy:mm:dd:hh:mm:ss.
Actual time can be shown in TouchView.
Format: format of time axis label which is to select time need to be shown.
Time length: time range denoted by time axis. Change it via scripts while running
Font: Define the font of value axis label. Use the same selecting method with
font of value axis.
8.3.4.3 Create operation button while historical trend running
Because historical trend pictures don’t update automatically, operation button is
needed for historical trend. You can finish the functions like view, print, change pen
by scripts or using functions to change tag fields of historical trend.
Tags of historical trend have fields as below:
ChartLength: Time length of historical trend, long, read/write, counted by second
ChartStart: Start time of historical trend, long, read/write, counted by second
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-95
ValueChart: Initial value of historical trend on Y axis, analog, read/write
ValueSize: Range of historical trend on Y axis, analog, read/write
ScooterPosLeft: Position of left indicator, analog, read/write
ScooterPosRight: Position of right indicator, analog, read/write
Pen1-Pen8: ID number of tags of historical trend, read/write, used to change tags for
drawing curve.
Tag is a percentage value of historical trend on the Y axis. What properties
ValueStart and ValueSize used are values expressed by percentage. For example,
ValueStart is 0.2, ValueSize is 0.6. Only change between 20% and 60% of maximum
value of tag appears on Y axis.
Properties ScooterPosLeft and ScooterPosRight values changes from 0.0 to 0.1 in
which 0.0 is the leftmost of historical trend diagram and 1.0 is the rightmost of
historical trend diagram.
Common buttons are mainly center fixing and moving time button and zoom
button. Additionally, creating output animation link to view data is often used. Hereby
is an example of historical trend.
Figure 8.66 historical trend example
Create center fixing and moving time button:
WellinControl Technology Development Co.,Ltd
8-96 Chapter 8 Trends and other curves
One-side scroll button: It’s used to edit the time value of left or right side of trend.
Script program appears as below:
Left side of time axis scroll to left
history.ChartStart=history.ChartStart-3600;
history.ChartLength=history.ChartLength+3600;
“History” is the name of historical trend. The example is to move the leftmost of
time axis to the left for 1 hour, but the rightmost holds in line.
Left side of time axis scroll to right
history.ChartStart=history.ChartStart+3600;
history.ChartLength=history.ChartLength-3600;
The example is to move the leftmost of time axis to the right for 1 hour, but the
rightmost holds in line.
Right side of time axis scroll to left
history.ChartLength=history.ChartLength-3600;
The example is to move the rightmost of time axis to the left for 1 hour, but the
leftmost holds in line.
Right side of time axis scroll to right
history.ChartLength=history.ChartLength+3600;
The example is to move the rightmost of time axis to the right for 1 hour, but the
leftmost holds in line.
Time axis shift button: It’s used to shift the left or right side of trend to left or
right at one time.
Time axis shift to left
history.ChartStart=history.ChartStart-3600;
The example is to shift the left and right sides of time axis to the left at one time
for 1 hour.
Time axis shift to right
history.ChartStart=history.ChartStart+3600;
The example is to shift the left and right sides of time axis to the right at one time
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-97
for 1 hour.
Time axis percentage shift button: It is used to move the time axis of trend to
left or right for one percentage. Percentage is a radio of movement and length of
time axis of trend curve. For example, the range of time axis before moving is
12:00~14:00. The length of time is 120 minutes. Move 10%, namely 12 minutes
to left, time axis changes to 11:48~13:48.
Time axis percentage move to left
HTScrollLeft(history, 10);
The example is to shift the left and right sides of time axis 10% to the left at
one time.
Time axis percentage move to right
HTScrollRight(history, 10);
The example is to shift the left and right sides of time axis 10% to the right at
one time.
Create indicator moving button:
You can view tag value on the indicator by system function. Move the indicator
to view the change of tags on the whole curve. Additionally, indicator can be seen as a
scooter for using easily. Use following method to create an indicator:
Click “Historical trend” button in the toolbox and draw a historical trend object
on the picture. Meanwhile draw the button of indicator and for moving indicator.
Indicator is composed of a rectangle and a vertical line which can make rectangle
more beautiful. However, all the symbols for making rectangle need to compose to a
complex symbol. Text object “##:##:##” on the indicator will be used to display
correlative time of indicator.
WellinControl Technology Development Co.,Ltd
8-98 Chapter 8 Trends and other curves
Figure 8.67 Create indicator moving button
Create slider input link for the rectangle part of indicator. The width of historical
trend window is known. Draw a line with the same width as window below the curve
window. Double-click the line object. Get the width of the line from the first line of
“Animation links” dialog box. Delete the line. It’s supposed the width of curve
window is 390, the name of curve is history, create “Slider horizontal input”
animation link for the rectangle part of left indicator:
Figure 8.68 Create slider horizontal input for indicator
Create “Shift horizontal” animation link for the vertical line of left indicator and
object “##:##:##”.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-99
Figure 8.69 Create Shift horizontal for indicator
Create “String output” animation link for text object “##:##:##” of indicator.
Figure 8.70 Create String output for indicator
Setting the right indicator can use the same method as the left indicator.
Create script link for indicator moving button. In order to move indicator
fast, it is suggested to setup “On key up” and “While down” scripts:
Move left indicator to left
“On key up”
History.ScooterPosLeft=history.ScooterPosLeft-0.002;
“While down” (execute frequency: 55 milliseconds)
History.ScooterPosLeft=history.ScooterPosLeft-0.05;
WellinControl Technology Development Co.,Ltd
8-100 Chapter 8 Trends and other curves
Move left indicator to right
“On key up”
History.ScooterPosLeft=history.ScooterPosLeft+0.002;
“While down” (execute frequency: 55 milliseconds)
History.ScooterPosLeft=history.ScooterPosLeft+0.05;
Move right indicator to left
“On key up”
History.ScooterPosRight=history.ScooterPosRight-0.002;
“While down” (execute frequency: 55 milliseconds)
History.ScooterPosRight=history.ScooterPosRight-0.05;
Move right indicator to right
“On key up”
History.ScooterPosRight=history.ScooterPosRight+0.002;
“While down” (execute frequency: 55 milliseconds)
History.ScooterPosRight=history.ScooterPosRight+0.05;
Create zoom button:
Create a zoom button on the time axis to view the change of data fast and
carefully. Move indicator first for creating “Zoom button”.
Zoom button on time axis:
The button is to zoom in/out the visible range on time axis. It has three kinds of
zoom mode.
Zoom in button
HTZoomIn(history, “Center”);
The example is to double the range of time axis.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-101
Zoom out button
HTZoomOut(history, “Center”);
The example is to zoom out the range of time axis to the length between two
indicators. If the left/right indicators are located on the end of window, you can
zoom out range to half.
Other buttons:
Update time button: Set the right end of time axis of historical trend as current
time to view the last data. Scripts program:
HTUpdateToCurrentTime(history);
Setup parameters button: Setup record parameters while software running
which including starting time, record length, etc. Click “Setup parameters”
button to popup dialog box as below.
Figure 8.71 Set parameters
Scripts program:
SetTrendPara(history);
Create output animation link to view data
View tag name: Create “String output” animation link for text object.
Expression: HTGetPenName(history, 3);
It appears the tag name related to the third pen of history trend.
WellinControl Technology Development Co.,Ltd
8-102 Chapter 8 Trends and other curves
View the time value on the indicator: Create “String output” animation link for
text object.
Expression: HTGetTimeStringAtScooter(history, 1, “Time”);
It appears the time value related to the left indicator of history trend.
View the value on the indicator: Create “Analog output” animation link for text
object.
Expression: HTGetValueAtScooter(history, 1, 2, “Value”);
It appears the value related to the second pen of left indicator of history trend.
View the statistical value at the zone: Create “Analog output” animation link for
text object.
Expression: HTGetValueAtZone(history, 1, “MaxValue”);
It appears the maximum value among tags related to the first pen of history trend
between two indicators. You can obtain the minimum value and average of tags at the
zone using the same method.
Setup value axis:
When the change of value is small, you can enlarge the range of tag changing by
changing the range of value axis in trend window. For example, the diagram enlarge
the change between 0% and 30% of tag to the full screen which is realized by “Slider
input” button to edit the ValueStart and ValueSize properties of curve.
Edit the initial value of value axis
Add “Slider vertical input” link to symbol:
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-103
Figure 8.72 Animation link of initial value
Edit the end value of value axis
Add “Slider vertical input” link to symbol:
Figure 8.73 Animation link of end value
Display value axis:
Obtain the actual value related to the trend pen of assigned historical trend.
Analog output expression:
HTGetPenRealValue(history, 1, “end”);
HTGetPenRealValue(history, 1, “end”)/2+ HTGetPenRealValue(history, 1,
“start”)/2;
HTGetPenRealValue(history, 1, “start”);
WellinControl Technology Development Co.,Ltd
8-104 Chapter 8 Trends and other curves
They are maximum value, minimum value and average of value axis separately.
Figure 8.74 Display value axis
8.3.5 Access to remote history
KingView cannot only read the history in local machine, but also access to
history in remote computers. Furthermore, it can view tags of history in remote
computer by historical trend in local machine. Details can be seen in chapter 21
“Network”.
8.4 Temp-control curve
8.4.1 Setup temp-control curve on the picture
Temp-control curve works as a control in KingView.
1. Click “Insert control” button in toolbox or select menu command
“Edit\Insert control” to popup “Create control” dialog box.
2. Select “Temp-control curve” from “Trend curve” in “Create control” dialog
box.
3. Click “Create” button to make mouse cursor turn to “+”. Draw a rectangle on
the picture. Temp-control curve appears. You can move or zoom it arbitrarily
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-105
like a cell. The temp-control curve appears as below.
Figure 8.75 Temp-control curve
Y axis stands for temperature. X axis relates to the change of time. Every
sample point appears on the curve. Two cursors are supplied in TouchView as
well. When you put cursor on a certain sample point, the comment value of the
sample point will appear.
8.4.2 Properties of temp-control curve
Double-click temp-control curve to popup “Properties page” dialog box of tempcontrol curve as below.
WellinControl Technology Development Co.,Ltd
8-106 Chapter 8 Trends and other curves
Figure 8.76 Temp-control curve properties
Name: The name of temp-control curve in KingView which is composed of
letters and numbers.
Access level: The access level for users to operate temp-control curve which is
integer from 1 to 999.
Y axis of temp-control trend: stands for the name of measured tag. If input
“Temperature”, the Y axis (value axis) is tuned automatically as below, which
brings convenience for defining the name of value axis.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-107
Figure 8.77 Y axis of temp-control trend
Maximum value: to set the maximum value of Y coordinate of temp-control
curve. Y axis stands for temperature tag, and Y coordinate axis stands for height
of temperature in temp-control curve.
Minimum value: to set the minimum value of Y coordinate of temp-control
curve. It can be 0 or minus.
Temperature degree: It’s used to assign space value between maximum
coordinate value and minimum coordinate value of Y axis. For example,
maximum coordinate value of Y axis is 90, minimum coordinate value of Y axis
is 10, the temperature degree is 20. Therefore, 20 shares appear between
maximum coordinate value and minimum coordinate value in which one share
stands for 4. Different temperature degree stands for different value of each share.
Decimal digit: It’s used to setup the valid decimal digit of Y coordinate axis. For
example, if temperature on Y axis of temp-control curve has 2 bits decimal
fraction, input 2 in “decimal digit” dialog box.
Original time: to set the original value of X coordinate of temp-control curve,
namely, the default width. When temp-control curve scrolls automatically, its
width is changeless. X axis stands for time tag, and X coordinate axis stands for
height of time in temp-control curve. It is counted by average time unit of control
data points.
Time degree: It’s used to set the degree of X axis time. The more the value, the
WellinControl Technology Development Co.,Ltd
8-108 Chapter 8 Trends and other curves
less the time interval.
Time decimal digit: It’s used to set the valid decimal digit of X coordinate axis.
Note:
The unit of time axis of temp-control curve depends on the basic time unit of
added curve, like, adding data sample point counted by second. So the time of curve
counted by second.
Maximum sample point: It’s used to define the number of displayed real-time
data point at most.
Set curve: The button is to setup the color of “Set curve”. Click “Set curve”
button to popup dropdown color list box for selecting. Set curve is the tempcontrol curve pre-designed by engineers.
Real-time curve: The button is to setup the color of “Real-time curve”. Click
“Real-time curve” button to popup dropdown color list box for selecting. Realtime curve is the real temperature changing curve acquired from scene.
Label letter: This button is to setup the color of “Label letter”. Click “Label
letter” button to popup dropdown color list box for selecting. Label letter is the
character or number shown on the cursor.
Foreground: This button is to setup the scale value of Y axis of temp-control
curve, display color of grid line. Click “Foreground” button to popup dropdown
color list box for selecting.
Background: The button is to setup the background color of temp-control curve.
Cursor: The button is to setup display color of “Cursor”.
Font: It’s used to setup string font of scale and cursor.
Display operation bar: The option is to show/hide operation bar. Check it to make
the option available. “Initial status” option box changes from grey to normal.
Initial status: When “Display operation bar” is available, “Initial status” option
box changes from grey to normal. It determines if operation bar displays in
maximize mode or minimize mode. Select a certain initial status. If you select
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-109
“Maximize”, the temp-control curve appears as below:
Figure 8.78 Maximize operation bar
Note:
When the operation bar displays maximized, temp-control curve need big
enough space on the interface if you want an integrated operation bar.
Figure 8.79 Operation bar of temp-control trend
To the left border, moves the X axis towards the left.
To the left border, moves the X axis towards the right.
Zooms into the X-axis 2 times.
Zooms out of the X-axis 2 times.
Curve Scroll Bar.
When the system is running and the curve reaches the end of the drawing area,
WellinControl Technology Development Co.,Ltd
8-110 Chapter 8 Trends and other curves
the window automatically scrolls towards the right.
Stop scrolling.
To the right border, moves the X axis towards the left.
To the right border, moves the X axis towards the right.
Hide/show operation platform
Load set curve from file
Save set curve
Adjust coordinate. Click the button to popup dialog box:
Figure 8.80 Adjust coordinate
Maximum value of temperature, minimum value of temperature, temperature
degree, decimal digit are used to reconfirm Y axis- coordinate of temperature
axis; maximum value of time is to reconfirm X axis- coordinate of time axis.
Move left cursor to left
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-111
Move left cursor to right
Move right cursor to left
Move right cursor to right
The following three buttons are to operate some section of selected tempcontrol. Select the section to make three buttons available.
Insert setting section.
Add section: it’s to show selected section number of temp-control curve. Start
from 0 and can’t be inputted.
Velocity: it’s to setup the slope of the section of temp-control curve.
Target value: it’s to setup the target value of the section of temp-control curve.
Keeping time: it’s to setup time for keeping temperature section of temp-control
curve.
Previous: it’s to insert a certain section of temp-control curve to previous one.
Next: it’s to insert a certain section of temp-control curve to next one.
OK: save setting and insert the setting to proper section of temp-control curve.
Cancel: Don’t save setting.
Edit setting section. Click the button. It appears:
Ok: save setting and edit the setting to proper section of temp-control curve.
Other options are the same as above.
Delete setting section. Delete a certain section of assigned temp-control curve.
Zoom and scroll the trend:
WellinControl Technology Development Co.,Ltd
8-112 Chapter 8 Trends and other curves
Move lest boundary to left: move the coordinate of lest boundary of time axis
to left. original display time/time degree, time units
Move lest boundary to right: move the coordinate of lest boundary of time
axis to right. original display time/time degree, time units
Zoom in trend:
Zoom out trend:
Scroll trend: click the left button, time axis
move time degree of current time length to left by 2 time units. Click the left of
cursor, time axis move time degree of current time length to left by 2 time units.
Drag the cursor, so scroll quickly.
Stop auto-scroll
Start auto-scroll
Move right boundary to left: move the coordinate of right boundary of time
axis to left. original display time/time degree, time units
Move right boundary to right: move the coordinate of right boundary of time
axis to right. original display time/time degree, time units
No background color of operation bar: it’s used to control background color of
operation bar. When you check it to make it available, the background color of
operation bar is different from background color of interface. When the option is
invalid, the background color of operation bar is the same as background color of
interface.
Show cursor: it’s to hide/show cursor. Check it to make it available. “Comment
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-113
mode” radio button turns from grey to normal.
Comment mode: if “Show cursor” is available. “Comment mode” radio button
turns from grey to normal. It determines whether to show information or value
while displaying the cursor.
Hide scale value: it’s used to show/hide the scale value of Y coordinate axis.
Check it to make it available.
Add grid line: it’s used to show/hide grid line. Check it to make it available. Grid
line is to label the scale value of Y coordinate axis.
Label sampling point: it’s used to show/hide sampling point. Check it to make it
available. Meanwhile, sampling point appears on the temp-control curve.
Whereas sampling point doesn’t appear on the temp-control curve.
Show frame: it’s used to show/hide the frame of temp-control curve. Check it to
make it available.
Setup mode: The setup mode of temp-control curve contains ascending/keeping
heat mode and custom mode.
Note:
If you select “Ascending/keeping heat mode”, you can’t add setup point on the
temp-control curve. If you select “Custom mode”, you can add setup point on the
temp-control curve.
Auto-save real time trend: if check the opinion, the real time trend on the chart of
current picture will be saved automatically in each saving interval. System names
a folder in the current project directory with the control name automatically for
saving the trend data.
Saving interval: time interval to save real time trend automatically counted by
second. Suggest set it to multiple time to add real time trend data point.
Auto-load real time trend: if check the opinion, when system restarts or reopens a
picture (before it is close), real time trend saved when KingView ran last time is
WellinControl Technology Development Co.,Ltd
8-114 Chapter 8 Trends and other curves
loaded automatically. When adding a sampling real time value, time offset
depends on last sampling value in last time. It doesn’t load if the last saved real
time trend reached to time of set curve.
For example:
1. Draw temp-control curve
Draw temp-control curve control “tru” on the picture and define the
properties for temp-control curve as below.
Figure 8.81 Define temp-control curve properties
2.
Load setup temp-control curve
Save setup temp-control curve as .csv file. Such as the setup temp-control
curve setsave.csv has a file (the file is in KingView demo project):
SetData
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-115
20
39.000000
10.000000, 20.000000,0
10.000000, 20.000000,10
20.000000, 20.000000,10
30.000000, 20.000000,10
40.000000, 20.000000,10
Thereinto, 20 stands for curve points, 39.000000 stands for position of the
first point on the curve. 10.000000, 20.000000,0 stands for the ascending heat
velocity of the first section is 10, setup time is 20, keeping time is 0. 10.000000,
20.000000,10 stands for the ascending heat velocity of the second section is 10,
setup time is 20, keeping time is 10 and the like.
Notes: .csv file must be generated first. Data is setup according to the actual
need of devices. Write the following sentence to “on startup” of scripts in
“Picture properties”:
Setchart=InfoAppDir()+ “setsave.csv”;
pvLoadData(“tru”, setchart, “SetValue”);
which stands for acquiring setup temp-control curve setsave.csv from current
project path.
3.
Generate real-time curve using acquired data
Add a real-time sampling value by function PvAddNewRealPt to assigned
temp-control curve control. If you need keep drawing acquired data on the
picture, you need write down sentence to “while running” of scripts in “Picture
properties”:
IF(Time deviation<200)
pvAddNewRealPt(“tru”, 1, water-temp, “RV_TIME”);
Thereinto, tru is the name of control. 1 stands for time deviation of previous
sampling point. “Water-temp” is the data acquired from device. “RV_TIME” is a
comment string.
WellinControl Technology Development Co.,Ltd
8-116 Chapter 8 Trends and other curves
Drawing speed can be adjusted by edit the executing period of “while
running”. Then you can find whether acquired data keep in line with setup curve.
For users’ satisfaction, our company is developing software solutions
specifically for temperature control, including temperature control data tables
and temperature control trend curves. Please refer to “Solutions to Case Study”
for more details, this can be found in the contents of KingView 6.53 Software
CD.
8.5 Super X-Y curve control
Super X-Y curve control is a kind of XY curve in Active X control mode. The
curve control can display 16 curves at one time. It has more powerful functions and
easier to use compared by XY curve of KingView.
Details about how to use ActiveX control can be seen in chapter 14 “Control”.
8.5.1 Create super X-Y curve
Create a new picture in WindowMaker. Click “Insert general control” button in
toolbox or select menu command “Edit\Insert general control” to popup “Create
control” dialog box. Select “super X-Y curve” from list in “Create control” dialog box.
Click “OK” button. The dialog box disappears and mouse cursor turn to “+”. Draw a
rectangle on the picture. Super X-Y curve appears as below. You can move or zoom it
arbitrarily.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
Figure 8.82 Select super ChartXY curve
Figure 8.83 Super ChartXY curve
WellinControl Technology Development Co.,Ltd
8-117
8-118 Chapter 8 Trends and other curves
8.5.2 Setup properties of super X-Y curve
Select created control on the picture. Click the right key of mouse. Select
“Control properties’ in popup shortcut menu. Properties of super X-Y curve dialog
box appear as below.
Figure 8.84 Super chartXY curve properties - General
General properties page setting:
Color: Setup background color of curve, label letter of curve and color of
division line (foreground color). Click color button to select needed color from
popup color menu.
Font: Select font properties of label letter on the curve. Click font button to
popup a dialog box for selecting font properties.
Title: Add a title for the curve. It appears as below.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-119
Figure 8.85 Add title
Legend: Select position for showing legend on the curve. It has two options-top
and bottom.
Frame: Select curve type of curve: ThinBorder-single line frame, ClientEdgeedge of client, StaticEdge-static edge.
Control: Select whether to select toolbar supplied on the curve.
Coordinate properties page setting:
Define coordinate properties of curve. Select whether to display X, Y axis of
curve and label of X, Y axis. Define scale of coordinate axis.
WellinControl Technology Development Co.,Ltd
8-120 Chapter 8 Trends and other curves
Figure 8.86 Super chartXY curve properties - Coordinate
Figure 8.80 defines the properties of the curve axis.
 X Axis: Title, Min and Max Values, Decimal Places and Grid.
Display X Axis: Select if you want KingView to always displaythe X axis.
Title: This is activated when “Display X Axis” is selected; select this if you wish
KingView to display the title of the X axis.
Min, Max: range of values on the X-axis.
Grid: separate the drawing area into pieces of same size according to the grid
value on the X-axis. Range 1 – 100.
Decimal Places: Displays the X-axis values according to a certain number of
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves





8-121
decimal places. Range 1 – 10.
Y-axis list: The super XY curve supports multiple Y-axes (max16 curves). Choose
a curve from Y-axis list, setup and click “update Y axis” to update the list with
your modifications.
Y-axis: is used for settings multiple Y-axis.
Display Y-axis: When this is selected, KingView displays the Y-axis.
Title: This is activated when “Display Y Axis” is selected, select this if you wish
KingView to display the title of the Y axis.
Min, Max: range of values on the Y-axis.
Scale: separate the Y-axis into pieces of same size according to the values.
Range 1 – 100.
Decimal Places: Displays X-axis values to a specified number of decimal places.
Range 0 – 10.
Grid: separate the drawing area into pieces of same size according to the grid
value on the X-axis. Range 1 – 100.
Position of the Y-axis: set the position of the Y axis to either the left or right side
of the drawing area inside the curve control.
Scale of the Y-axis: it is related to the position of Y-axis (Left, Right).
Scale of the Y-axis: the horizontal position of the Y-axis scale.
Update the Y-axis: update the Y-axis from the Y-axis list. Once all the settings
have been completed it only takes one more step to update the Y-axis and save
the settings.
Grid: Select this to display grids in the drawing area.
Curve Property Options:
WellinControl Technology Development Co.,Ltd
8-122 Chapter 8 Trends and other curves
Figure 8.87 Super chartXY curve properties – Curve
Define curve properties as below:
 Maximum number of points: The number of points which can be labeled on a
curve. For example, 1024 is the maximum number, which allows at most 1024
data points to be labeled. This number significantly affects the performance of
the system, so please set an appropriate number for your desired performance
level.
 Curve Style: Defines the Color and Shape of a curve and the Name of the Y-axis.
Choose a curve from the list and modify its settings from the edit box at the
bottom of the dialog box, the Color and Shape buttons display the curve
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-123
properties.
 Curve Name: Choose a curve from the list and insert a name for the curve. In this
step you can also modify the curve’s color and shape.
 Color, Shape, Label: Appearance of a Curve.
 Index Number of the Y-axis: since the super XY curve has multiple Y-axes, it
displays the Y-axis index number its name on the Y axis list.
Click “Apply” button to view the result after properties definition completed.
Click “OK” to close dialog box.
8.5.3 Setup animation link properties for super X-Y curve
Before you use the control, animation link need to be defined first. Double-click
the control to popup animation link properties dialog box as below.
Figure 8.88 Animation link of super ChartXY curve
WellinControl Technology Development Co.,Ltd
8-124 Chapter 8 Trends and other curves
Input control name in “Control name” of “General” properties page. Define the
priority and security zone. Properties of control properties page is the same as
introduction in the section 8.6.2.
8.5.4 Use super X-Y curve
Super X-Y curve supplies various methods and toolbar with various functions.
Hereby is the super X-Y curve while running.
Figure 8.89 Super X-Y curve in TouchView
You can operate curve by using toolbar functions like editing properties, infinity
zooming, moving, saving, and printing, and so on.
Infinity zoom: Click the button. Click the left key of mouse and drag it to
form a rectangle area. Release the mouse. Selected area zooms in automatically.
Zoom in twice: Zoom in curve twice based on the center of X, Y axis of curve.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-125
Curve diagram extends to edges.
Zoom out twice: Zoom out curve twice based on the center of X, Y axis of
curve. Curve diagram compresses to center.
Original size: Resume curve diagram to original size.
Move: Click the button. Curve will move a scale in minimum
unit according to button directions (up, down, left, right).
Show value: When the button is available, an indicator appears on the curve
as below. Move the indicator, coordinate of current indicator and value of curve
will appear on the top left corner.
Figure 8.90 Super X-Y curve – Display value
WellinControl Technology Development Co.,Ltd
8-126 Chapter 8 Trends and other curves
Show grid: whether to show division line on the diagram.
Adjust coordinate: Click the button to popup adjust coordinate dialog box for
editing the coordinate setting of diagram.
Setup curve: Click the button to popup setup curve dialog box for editing
properties of curve, like color and line type of curve.
Option: Click the button to popup option dialog box for editing configuration
of curve.
Figure 8.91 Option dialog box
Load from file: Load an existed curve file and draw a curve.
Save curve to file: Save current drawn curve as a file.
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-127
Print: Print curve. Click the button to popup print properties dialog box for
setting page properties and selecting printer.
Close: Close toolbar of curve.
Introduction to control methods:
1. void AddNewPoint(float x, float y, long nIndex);
Add a data point to assigned curve. Define parameters of curve need to display at
the beginning of program.
Parameter:
x- setup the value of data point on X axis
y- setup the value of data point on Y axis
nIndex- the index number of X-Y curve control, the range is 0-7
Returned value:
none
2. void Clear(long nIndex);
Clear a curve data.
Parameter:
nIndex- as method 1
Returned value:
none
3. void ClearAll();
Clear all curve data.
Parameter:
none
Returned value:
none
4. float GetValueAt(float x, long nIndex);
WellinControl Technology Development Co.,Ltd
8-128 Chapter 8 Trends and other curves
Return the value of Y axis corresponding to the value of X axis.
Parameter:
X- the coordinate value of X axis
nIndex- as method 1
Returned value:
The value of Y axis corresponding to the value of X axis.
5. long GetDataCount(long nIndex);
Return the number of a certain curve point.
Parameter:
nIndex- as method 1
Returned value:
Return the number of data point which the curve index number is nIndex.
6. float GetValueX(long nDataIndex, long nCurveIndex);
Return the value of set point on X axis.
Parameter:
nDataIndex- number of data point
nCurveIndex- as method 1
Returned value:
Return the value of data point which number is nDataIndex on X axis.
7. float GetValueY(long nDataIndex, long nCurveIndex);
Return the value of set point on Y axis.
Parameter:
nDataIndex- number of data point
nCurveIndex- as method 1
Returned value:
Return the value of data point which number is nDataIndex on Y axis.
8. void ZoomIn();
Zoom in drawing area twice.
Parameter:
none
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-129
Returned value:
none
9. void ZoomOut();
Zoom out drawing area twice.
Parameter:
none
Returned value:
none
10. void Zoom Resume();
Resume the original size.
Parameter:
none
Returned value:
none
11. void SetXAxesRange(float XMax, float XMin);
Setup the minimum and maximum value of X axis.
Parameter:
Xmax- the maximum value on X axis
Xmin- the minimum value on X axis
Return value:
none
12. void SetYAxesRange(float YMax, float YMin);
Setup the minimum and maximum value of Y axis.
Parameter:
Ymax- the maximum value on Y axis
Ymin- the minimum value on Y axis
Return value: none
Note: this function is only used by single Y-axis control in older versions of
KingView(earlier than 6.51). Newer versions (6.51 or later) use the
WellinControl Technology Development Co.,Ltd
8-130 Chapter 8 Trends and other curves
SetIndexYAxesRange function
13.void SetIndexYAxesRange(float YMax, float YMin, long nIndex);
Set the Min and Max values for the Y-axis.
Parameters:
YMax – Max value of the Y-axis
YMin – Min value of the Y-axis
nIndex – Y-axis index number (Range: 0-15)
Return value:
null
14. void SetXGrids(long nGrids);
Setup degree of X axis.
Parameter: nGrids- degree
Returned value: none
15. void SetYGrids(long nGrids);
Setup degree of Y axis.
Parameter:
nGrids- degree
Returned value:
none
16. int SaveToFile(string szFileName)
Save data to file.
Parameter:
szFileName- file name
Returned value:
Return error code. If it success it returns 0. Otherwise,
-1—can’t open file
-2—invalid file name
-3—write failed
17. int LoadFromFile(string szFileName)
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-131
Load data from file.
Parameter:
szFileName- file name
Returned value:
Return error code. If it success it returns 0. Otherwise,
-1—can’t open file
-2—invalid file name
-3—invalid file format
-4—read failed
18. long SetCurvesMapToYAxisIndex(long nCurves, long nYAxisIndex);
Setup the relationship between a curve and the Y-axis
Parameters:
nCurves – curve index number (Range: 0-15)
nYAxisIndex – Y-axis index number (Range: 0-15)
Return Value:
0: Succeed
-1: nCurves value is not available
-2: nYAxisIndex value is not available
19. long SetCurvesLineStyle(long nCurvesIndex, long nLineStyle);
Set the Curve Style
Parameters:
nCurvesIndex – index number of a curve (Range: 0-15)
nLineStyle – index number of Curve Style(Range: 0-11)
Return value:
0: Succeed, 0 – 11 Curve Style index number
-1: nCurvesIndex value is not available.
-2: nLineStyle value is not available
20. long SetCurvesColorStyle(long nCurvesIndex, long nColorRed, long
nColorGreen, long nColorBlue);
Set Color of a curve, in RGB format
WellinControl Technology Development Co.,Ltd
8-132 Chapter 8 Trends and other curves
Parameters:
nCurvesIndex – index number of a curve (Range: 0-15)
nColorRed – Red value( 0-255)
nColorGreen – Green Value( 0-255)
nColorBlue – Blue value( 0-255)
Return value:
0 Succeed,
-1: nCurvesIndex value is not available.
-2: Color value is not available.
21. long SetCurvesMarkStyle(long nCurvesIndex, long nMarkStyle);
Set Mark Style of a curve
Parameter:
nCurvesIndex – curve index number (Range: 0-15)
nMarkStyle – Mark Style index number (Range: 0-8)
Return value:
0: Succeed
-1: nCurvesIndex value is not available.
-2: nMarkStyle value is not available
22.long SetCurvesName(long nCurvesIndex, string strName);
Set a name of a curve
Parameters:
nCurvesIndex – curve index number (Range: 0-15)
strName – curve name (32-bit string value)
Return value:
0: Succeed,
-1: nCurvesIndex value is not available.
-2: strName value is not available
23. long SetCurvesVisible(long nCurvesIndex, long bVisible);
The curve display is set to enabled or disabled
Parameters:
WellinControl Technology Development Co.,Ltd
Chapter 8 Trends and other curves
8-133
nCurvesIndex – curve index number (Range: 0-15)
bVisible – 0: disabled 1: enabled Only 0, 1 allowed.
Return value:
0: Succeed
-1: nCurvesIndex value is not available.
-2: bVisible value is not available.
24. long SetIndexYAxexShow(long nIndex, long bShow);
Set the display of a Y axis is enabled or disabled
Parameters:
nIndex – index number of Y axis(ranger:0-15)
bShow – 0: disable 1: enabled Only 0, 1 allowed
Return Value:
0: Succeed
-1: nIndex value is not available.
-2: bShow value is not available.
25.long SetXAxesShowTimeFormat( long nShowTime ) ;
Set Time format (“hh:mm:ss”) for X axis, Min = 0
Parameters:
nShowTime – Time is enabled or disabled 0: show data, 1: show time
Return value:
0: Succeed 1: nShowTime value is not available
26. BOOL SetChartProperty(string szName, string szProperty)
Setup properties of X-Y control.
Parameter:
szName- property name
SzProperty- property value
27. void PrintChartXY(string szFileName)
Print the assigned file.
Parameter:
szFileName—FileName
WellinControl Technology Development Co.,Ltd
8-134 Chapter 8 Trends and other curves
Returned value:
none
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-1
Chapter 9 Alarms/Events
For safety in production on the industrial spot, Alarms and events are necessary.
KingView provides strong alarms and events systems with simple operation.
9.1 About Alarms and Events
Alarm: when values of some tags in a system exceed a user-defined limit, a
system generates warning automatically which shows a tag value is beyond limits, and
notifies an operator. For example, monitoring oil tanks of a refinery. When inputting
oil into a tank, if the upper limit of oil level was not defined, a system does not trigger
an alarm for informing an operator of a problem, so it may result in dangerous “oil
overflow”. Alarms can prompt an operator to advert and to acknowledge.
Event: actions or behaviors that users make to a system, such as modifying tags
values, user log in or log out, site start or exit. Events don’t need acknowledgements
from operators.
Processing of alarms and events in KingView: when alarms or events happen,
KingView saves these messages in a buffer in memory (Can set a buffer size, see
chapter 9--9.5.1.1). Only the latest alarms and events are saved in memory, because
they are saved on a queue format of first in first out.
When the buffer is full or a record time is up, the system will save alarms and
events messages into logging which may be text files, open database or printer. In
WellinControl Technology Development Co.,Ltd
9-2
Chapter 9 Alarms/Events
addition, users may look over these messages in alarm window provided by humanmachine interface.
9.2 Alarm groups
In a monitoring system, for convenient seeing, recording and distinguishing, it is
necessary to assign alarm messages in different groups, that makes alarm messages of
tags attach to certain alarm group. KingView provides alarm groups function.
Alarm groups is a hierarchical tree structure, has only one root node by default
called RootNode (being changeable). You can add nodes and sub-nodes in this
structure using Define Alarm Group dialog box. In a catalog like a tree shape, tags
under each sub-node group belong to this group, and to a group with higher level. For
example, you add an alarm group “A” in the above default group RootNode, tags of
the group “A” also belong to RootNode as below.
KingView may have a maximum of 512 node alarm groups and deal with tag
alarms by groups through alarm group names. An alarm window can display, record
and confirm alarms by groups.
After defining alarm group, KingView assigns an ID for each alarm group by a
defined order. A system displays alarm groups ID instead of their names when
referring to alarm group fields of tags, but KingView provides the function
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-3
GetGroupName() for getting a group name. Each alarm group has a fixed ID. When a
group is deleted, IDs of other groups don’t change, and a new alarm group doesn’t use
the ID.
Select Database\Alarm Groups at the left of TouchExplorer as below.
Figure 9.1 Alarm group definition
Double-click “Double-click here to enter…” at the right. Define alarm group
dialog box appears as below.
WellinControl Technology Development Co.,Ltd
9-4
Chapter 9 Alarms/Events
Figure 9.2 Define alarm group dialog box

<Add>: add an alarm group sub-node under selected alarm group node.
1. Select RootNode in the figure 9.2 and click Add, Add Alarm Group dialog
box appears as the figure 9.3 shows.
Figure 9.3 Add alarm group dialog box
Type “ReactorShop” and click OK, an alarm group node “ReactorShop” will
be under RootNode.
2. Select RootNode and click Add, Add Alarm Group dialog box appears. Type
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-5
“SteelShop” and click OK, another alarm group node “SteelShop” will be
under RootNode.
3. Select “ReactorShop” and click Add, Add alarm group dialog box appears.
Type “LiquidLevel” and click OK, an alarm group node “LiquidLevel” will
be under the group “ReactorShop”.
4. The final result is as below.
Figure 9.4 Add alarm group example

<Edit>: edit a name of selected alarm group.
Select RootNode in the figure 9.2 and click Edit button, Modify alarm group
dialog box appears as the figure 9.5 shows.
WellinControl Technology Development Co.,Ltd
9-6
Chapter 9 Alarms/Events
Figure 9.5 Modify alarm group
The name of original alarm group appears in editor automatically. Change editor
content as “Plant” and click OK, you can see the name of original RootNode
becomes “Plant”.
Figure 9.6 Alarm groups added and modified

<Delete>: delete selected alarm group. Select a useless group and click Delete
button. A message box will appear asking you to confirm the definition, Click
Yes to delete the Alarm Group, or click No, to cancel the deletion. When deleting
an alarm group including sub alarm groups, the system prompts you. If you
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events


9-7
confirm to delete, all sub alarm groups will be deleted.
<OK>: save the changes and close the dialog box.
<Cancel>: don’t save the changes and close the dialog box.
Note:
Only change the name of RootNode but can’t delete it.
9.3 How to define tag alarm properties
Must define tag alarm properties before using alarm function. You can define
alarm properties for discrete type tags and analog (integer and long) type tags.
The following part will give you a detail.
9.3.1 General alarm properties
Create a new tag or select an existing tag in “Database/Tagname Dictionary” of
TouchExplorer, then double-click it. Tag definition dialog box appears, click Alarm
definition label, as the figure 9.7 shows.
WellinControl Technology Development Co.,Ltd
9-8
Chapter 9 Alarms/Events
Figure 9.7 General alarm properties
1. Alarm group and Priority: click Alarm group button, Select Alarm Group dialog
box appears. All available alarm groups are listed in the box, select one among
them and click OK, alarm messages of this tag belong to selected alarm group. As
the figure 9.7 shows, select “Reaction Workshop”, so current defined tag belongs
to Reaction Workshop alarm group. When recording or looking over alarms,
select Reaction Workshop alarm group directly, you can see all its alarm
messages.
Priority represents an alarm level what helps operators to distinguish the
severity of the alarm. Its value can range from 1 to 999 with 1 being the most
severe. Type the priority of current tag in the editor as the figure 9.7 shows.
2. Area for defining analog alarm: if a current tag is analog, the options in this area
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-9
are valid. For more information, see the chapter 9 – 9.3.2.
3. Area for defining switch alarm: if current tag is switch, the options in this area are
valid. For more information, see the chapter 9 – 9.3.3.
4. Defining alarm extension field: Alarm includes two extension fields for
supplementing and explaining the alarm. It appears in the alarm window when
alarm happens.
Give you three concepts before introducing alarm type:
1. Generate an alarm: Tag value exceeds normal range and enters into alarm area.
2. Confirm an alarm: alarm acknowledgement shows finding the alarm or finishing
handle the alarm. The alarm status disappears after confirming.
3. Recover an alarm: the tag value returns into normal range and is not in alarm area.
9.3.2 Analog alarm
Analog is mainly an integer and a long and includes memory type and IO type.
Analog alarm has three types: over limit, a deviation and the change rate. You can
define delay alarm and alarm dead band for over limit and a deviation.
9.3.2.1 Over limit
When analog value is outside high and low alarm limit, the alarm happens. The
alarm limit has four: LoLo limit, Low limit, High limit and HiHi limit. Schematic
diagram is shown as below.
WellinControl Technology Development Co.,Ltd
9-10 Chapter 9 Alarms/Events
Figure 9.8 Schematic diagram of Over limit
If a tag value changes and spans certain limit, the alarm over limit immediately
happens. There is only one alarm over limit for one tag at a time. For example, if a tag
value exceeds HiHi limit, the system generates HiHi alarm instead of High alarm. In
addition, if exceeding a limit twice, it depends on if the limit types are same. The
same types no longer bring new alarm and show that the alarm was recovered,
whereas the system recovers original alarm firstly, then generates new one.
The arithmetic to generate and recover an alarm,
Recover LoLo limit when bigger than LoLo limit,
Generate an alarm when less than or equal to LoLo limit,
Recover Low limit when bigger than LoLo limit,
Generate an alarm when less than or equal to Low limit,
Generate an alarm when bigger than or equal to high limit,
Recover high limit when less than High limit,
Generate an alarm when bigger than or equal to HiHi limit,
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-11
Recover HiHi limit when less than HiHi limit.
You can use one, several or all types of over limit alarm. Alarm definition over
limit includes two items: alarm limit and Alarm text as below.
Figure 9.9 Define over limit alarm
Check type over limit that you want to define, then Alarm limit textbox and text
textbox are valid, you can input alarm limit of this type. When define limit value, it
must be Minimum <= LiLi limit < Low limit < High limit < HiHi limit <= Maximum.
Input the comment about the alarm of this type in text textbox. The comment cannot
be more than 15 characters.
For example: set alarm value for liquid level tag, HiHi limit=900, High limit=
750, Low limit= 150, LoLo limit = 50. You can follow the following steps commonly:
WellinControl Technology Development Co.,Ltd
9-12 Chapter 9 Alarms/Events
1. Create a memory integer tag in the Tagname Dictionary. Set its name as
“LevelMeasure” in its basic property, tag type as “Memory analog”(usually set
as IO type, here only for explaining operation method), a minimum as 0, a
maximum as 1000. The figure 9.10 shows the definition.
Figure 9.10 Basic properties of over limit alarm tag
2. Select Alarm definition of Tag Definition dialog box, as the figure 9.11 shows.
Select LoLo in Alarm limit item, so the back Alarm limit and text textbox are
enabled. Input 50 in Alarm limit and “LoLoLevel” in text. By analog, select
other items respectively and input limit values and alarm texts as the figure 9.11.
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-13
Figure 9.11 Define over limit alarm for tag
3. Define an alarm group and a priority. Click the button behind Alarm group name
and Select Alarm group dialog box appears. Select alarm group “LiquidLevel”
defined in the section 9.2, then input 100 in Priority textbox.
4. Click OK. Finish an alarm definition.
5. Create a new picture. Select Alarm window button and create an alarm window
in the picture. Double-click alarm window, input “Alarm window over limit” in
Window Name textbox and select Historical alarm window. For more
information on Alarm window setting, see the section 9.5.1.
6. Select T (text) button in toolbox and add a text in the picture. Double-click the
text, define animation link of the text. Select “LevelMeasure” tag in analog value
input and confirm. A maximum is 1000 and a minimum is 0 in analog value
WellinControl Technology Development Co.,Ltd
9-14 Chapter 9 Alarms/Events
input. Save current picture after finishing animation link.
7. Right-click in the picture and select Switch to View in pop-up menu, so
TouchView starts. Open the above picture as the figure 9.12.
8. When input value of LevelMeasure tag is 5, alarm window displays an alarm
message as the figure 9.13. Then input 100, 146, 800, 900 respectively, alarm
window displays a series of alarms as the figure 9.14 shows. You can see, when
a input value is less than or equal to 50, the system generates LoLo limit alarm,
when bigger than 50 and less than or equal to 150, resumes LoLo limit alarm
and generates Low limit alarm, when bigger than 150 and less than 750, resumes
Low limit alarm and doesn’t generates alarm, when bigger than or equal to 750
and less than 900, generates High limit alarm, when bigger than or equal to 900,
resumes High limit alarm and generates HiHi limit alarm. Contrarily, when input
value is less and less, the system generates or resumes corresponding alarm in
certain area.
Figure 9.12 Over limit alarm window 1
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-15
Figure 9.13 Over limit alarm window 2
Figure 9.14 Over limit alarm window 3
9.3.2.2 Deviation alarm
It is an alarm when fluctuation between analog value and target value goes
beyond defined change range. Deviation alarm has two types: minor deviation and
WellinControl Technology Development Co.,Ltd
9-16 Chapter 9 Alarms/Events
major deviation. When fluctuation goes beyond minor and major deviation ranges, the
system will generate minor deviation alarm and major deviation alarm. The figure
9.15 shows the schematic diagram. Calculation method of deviation limit is:
Alarm limit of minor deviation = deviation target value +/- defined minor
deviation
Alarm limit of major deviation = deviation target value +/- defined major
deviation
Bigger than or equal to alarm limit of minor deviation, generate minor deviation
alarm
Bigger than or equal to alarm limit of major deviation, generate major deviation
alarm
Less than or equal to alarm limit of minor deviation, generate minor deviation
alarm
Less than or equal to alarm limit of major deviation, generate major deviation
alarm
You can define one among them or all according the demand when using
deviation alarm.
When a tag is changing, if it spans any limit the system generates an alarm
immediately. The system is unable to generate different types of deviation alarms at
the same time.
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-17
Figure 9.15 Schematic diagram of deviation alarms
Example: Demand a pressure being in certain range in a working procedure, that
is a pressure cannot be too big or too small. You can define deviation alarm here for
monitoring pressure.
1. Create a memory long tag in the Tagname Dictionary. In tag basic properties set
tag name as “PressureMeas”, tag type as “Memory analog”(usually set as IO tag,
only explain operation method here), a minimum as –1.5, a maximum as 6. Basic
properties after setting as below.
WellinControl Technology Development Co.,Ltd
9-18 Chapter 9 Alarms/Events
Figure 9.16 Basic properties of deviation alarms
2.
3.
4.
5.
Select Alarm Definition in Tag definition dialog box. Check Minor dev. item and
Major dev. item, their limit editors become valid. Input 2 in Target value, 2 in
minor deviation limit, 3 in major deviation limit.
Select corresponding alarm group and a priority as the figure 9.17. Click OK to
exit dialog box, finishing definition.
Create a text in the picture built in section 9.3.2.1. Define animation link, make
analog value input and output link to tag “PressureMeas”. The range of value
input is between –1.5 and 6. Save the picture.
Change tag value. As the value increases: the value changes to 4(2+2) and the
system generates minor deviation alarm, the value changes to 5(2+3) and the
system resumes minor deviation alarm and generates major one. As the value
reduces, resumes major deviation alarm and generates minor one when the value
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-19
is less than 5, resumes minor deviation alarm and does not alarm when less than
4, generates minor one when less than 0(2-2), resumes minor one and generates
major one when less than -1(2-3).
Figure 9.17 Define deviation alarms
9.3.2.3 Rate of change alarm
When change speed of analog value exceeds specified number in a period of time,
the system generates an alarm because the tag changes so fast. Whenever a tag
changes once in runtime, system will calculate changing speed automatically for
deciding alarm. A rate of change alarm has three types of time
unit: %x/second, %x/minute, %x/hour. Calculation method of a rate of change alarm
WellinControl Technology Development Co.,Ltd
9-20 Chapter 9 Alarms/Events
is shown as the following:
((Current value of the tag – Previous change value of the tag) * 100) / ((Change
time – Previous change time) * (Tag maximum – Tag minimum)
*(Corresponding value of unit of alarm type)
Define Corresponding value of unit of alarm type as: if alarm type is second, it is
1, if is minute, it is 60, if is hour, it is 3600.
The final result is absolute value of integer part of calculation result of the above
formula. If the final result is bigger than or equal to a limit value, the system generates
an alarm immediately. If it is less than the value, the system resumes.
The figure 9.18 shows definition of a rate of change alarm. Check Rate of
change item, type alarm limit in the textbox and select unit of alarm type.
Figure 9.18 alarm of Rate of change
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-21
9.3.2.4 Alarm delay and Dead band
You can define alarm delay and dead band for alarm over limit and deviation
alarm.
The figure 9.19 shows the schematic diagram. When tag value fluctuates near
alarm limit, the system generates many false alarms. Add a threshold value above and
below original alarm limit, so original alarm limit becomes a strip of alarm limit –
dead band. When tag changes inside alarm limit strip, the system does not generates
and resumes alarms, but once tag goes beyond the range, the system generates alarms.
Dead band plays active role in eliminating invalid alarms of fluctuation signals.
Figure 9.19 Schematic diagram of dead band alarm
For example: refer to the example in the section 9.3.2.1, define dead band for
alarm over limit of “LevelMeasure” tag. The foregoing demand is HiHi limit=900,
High limit= 750, Low limit= 150, LoLo limit = 50. Add dead band with 5 to alarm
limit. The method is the following:
1. Redefine alarm property of “LevelMeasure” tag in the Tagname Dictionary as the
figure 9.20 shows. Check Deadband item, type dead band value 5 in the editor
WellinControl Technology Development Co.,Ltd
9-22 Chapter 9 Alarms/Events
2.
and click OK to close dialog box.
Switch to TouchView and modify the value of “LevelMeasure”. When value
changes, alarm limits are the following.
Alarm value
Resume value
LoLo limit
<=45
>55
Low limit
<=145
>155
High limit
>=755
<745
HiHi limit
>=905
<895
Figure 9.20 Define dead band
The method of defining and using dead band of deviation alarm is almost same
as of alarm over limit.
Alarm delay: the system doesn’t display and record current alarm messages but
delays. When a delay time is up, if the alarm doesn’t exist, which show the alarm
might be a false one, the system ignores and clears it. Whereas if the alarm exists,
which show be a true one, the system adds it in alarm buffer, displays and records it. If
a new alarm appears within the delay, the system restarts to time.
The figure 9.21 shows the schematic diagram of alarm delay. Dashed line
indicates tag curve when a tag begins to arouse an alarm, real line indicates tag curve
after a delay.
The tag changes and arouses an alarm at t1. The tag is still above alarm limit
after T as the figure (a) shows, so the system generates an alarm. The tag resumes
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-23
below alarm limit (like burr signals) after T as the figure (b) shows, so the system
doesn’t generate. Delay is counted by second. Alarm over limit and deviation alarm of
a tag use same delay in KingView.
Figure 9.21 Schematic diagram of alarm delay
For example: refer to the example in the section 9.3.2.2, define alarm delay for
deviation alarm of “PressureMeas” tag. Demand an alarm to delay 2 seconds against
false alarm.
1. Redefine alarm property of “PressureMeas” tag in the Tagname Dictionary as the
figure 9.22 shows. Check Delay of alarm over limit or deviation alarm item,
type delay time 2 in the textbox and click OK to close dialog box.
2. Switch to TouchView. Make “PressureMeas” equal to 5, so the system doesn’t
generate an alarm immediately. Holding it for 2 seconds, the system generates
minor deviation alarm. Re-change “PressureMeas” as 3.5, so the system doesn’t
resume immediately. The system resumes minor deviation alarm after 2 seconds.
3. Change “PressureMeas” as 5, the system doesn’t generate an alarm immediately.
Re-change “PressureMeas” as 3 within 2 seconds, the system doesn’t generate
the alarm 2 seconds after re-changing.
WellinControl Technology Development Co.,Ltd
9-24 Chapter 9 Alarms/Events
Figure 9.22 Alarm delay definition
9.3.3 Discrete Alarm
A discrete has two statuses: 1 and 0. A discrete alarm has three statuses:
1. 1 status alarm: generate an alarm when a tag changes from 0 to 1.
2. 0 status alarm: generate an alarm when a tag changes from 1 to 0.
3. Status change alarm: generate an alarm when a tag changes from 1 to 0 or from 0
to 1.
The figure 9.23 shows the property definition of discrete alarm. Defining Group
name, Priority and Extension field in Alarm definition is same as of analog alarm.
Check Discrete item in Switch Value Alarm, items become valid. You can only select
one among them to define. After selecting, input a type presentation being less than 15
characters in text textbox.
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-25
Figure 9.23 Alarm properties of discrete tag
9.4 Events
Events don’t need acknowledgement. By different operation objects and ways in
KingView, events have the following types:
1. Operate event: users modify tag value or values of other tag fields.
2. Enter event: users log in a system or log out.
3. Station event: TouchView starts or exit in stand-alone or network node.
4. Application event: tags from DDE or OPC change.
WellinControl Technology Development Co.,Ltd
9-26 Chapter 9 Alarms/Events
Events in TouchView display output in human-machine interface through historical
alarm window.
9.4.1 Operate Events
Operate events happen when an user modifies value or other field values of a tag
with defining Generate Event item, such as important parameters, an alarm limit or a
priority.
Note: modifying string tags or field values of string type doesn’t bring events like
alarms. You can record operation events for finding values of the time and after
changing you must define Generate Event property of a tag for generating operate
event.
1. Create memory integer tag “Operate” in the Tagname Dictionary. Select Log and
Security Zone sheet of Tag Definition as the figure 9.24 shows. Check Create
Event item in Security Zone group and click OK to exit dialog box.
2. Create a picture. Then create a text in the picture. Define animation link of the
text (analog input and analog output), select link tag as “Operate”. Create second
text. Define animation link of second text (analog input and analog output),
select link tag as the priority field of “Operate” tag.
3. Create an alarm window and define its name as “Event”, type as “Historical
alarm window”. Save the picture and switch to TouchView.
4. Open above picture and modify tag value and tag priority, so the system
generates operate event and displays it in alarm window as the figure 9.25 shows.
Second row in alarm window is operation event of modifying tag value whose
type is “Operate” and field name is “Value ”. Third row is a value of modified tag
priority, field name is “Priority”. In addition you can see an old value and a new
value.
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-27
Figure 9.24 Define “Create event” for tag
Figure 9.25 Operate event
9.4.2 Enter Event
Enter event is generated when user log in a system. You can configure user
account (such as name, password and authority level) in User configuration of
TouchExplorer.
A system generates “Successful enter” event if enter successfully. Generates
WellinControl Technology Development Co.,Ltd
9-28 Chapter 9 Alarms/Events
“Failing enter” if enter unsuccessfully or cancel to enter. Generates “Log out” if user
exit enter status.
For example: refer to the example in the section 9.4.1, switch to TouchView and
open a picture. Select the Special/Log On menu, Login dialog box appears. Select
“System administrator”, type password and click OK, then the system generates
“LoginSuccessful” event. If still select the user but click Cancel in Login dialog box,
the system generates “LoginFail”. Select the Special/Log Off menu, “LogOut” event
happens. All results are shown as below.
Figure 9.26 LogIn event
9.4.3 Application Event
If a tag is IO one and tag data source is applications such as DDE or OPC server,
after defining Create Event of the tag as the figure 9.23 shows, the system generates
application event when acquired data change.
For example: Create a tag of DDE device of EXCEL and generate application
event of the tag.
1. Create DDE device in KingView. Set device name as “Excel”, server
application name as “Excel”, topic name as “Sheet1”.
2. Create a tag in the Tagname Dictionary. Set tag name as “DDEEvent”, tag
type as IO long, associated device as “Excel”, item name as “r1c1”.
3. Check Create Event in Log and Security Zone sheet of the tag and click
OK to close dialog box.
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
4.
5.
9-29
Create a text in the picture built in the section 9.4.1. Build animation link
(analog output) and set associated tag as “DDEEvent”. Save the picture.
Start Excel and switch to TouchView, then open the picture.
Modify data in the R1C1 cell in the sheet1 of Excel. Whenever KingView
detects data change, the system generates application event as below.
Figure 9.27 Application event
9.4.4 Station Event
Station event is TouchView start and exit event on a station node, includes standalone and network. The system generates station start event when TouchView startup,
generates exist event when exists. The first message in alarm window shown in the
figure 9.27 is a station start event.
9.5 Record and Display alarms
KingView has ways to record and display alarms, such as alarm window,
database, printer and so on. A system provides a preset buffer to save alarm messages.
Alarm window displays messages according with requests from the buffer in terms of
defined conditions. When the buffer is full or KingView inner timing is up, the system
records messages by configured conditions.
WellinControl Technology Development Co.,Ltd
9-30 Chapter 9 Alarms/Events
9.5.1 Alarm Window to display alarms
A real time display of alarms is finished by alarm window in TouchView. Alarm
window has two types: real time alarm window and historical alarm window. Real
time alarm window displays existing real time alarm messages and acknowledgement
messages satisfying configured conditions of alarm window display. When certain
alarm resumes, real time alarm window doesn’t display it. Historical alarm window
displays all alarm messages and event messages satisfying configured conditions of
alarm window display. A maximum of alarm messages that alarm window displays
depends on the size of set alarm buffer.
9.5.1.1 Define a Size of an alarm buffer
Alarm buffer is the space that a system allocates from a memory for users to save
alarm messages temporarily. You can specify buffer size. Double-click System
configuration/Alarm configuration in TouchExplorer, Alarm Config sheet dialog box
appears as the figure 9.28 shows. Buffer size item is in the upper right of dialog box. A
set value of buffer size is by saved messages number and must be between 1 and
10,000. Buffer size affects directly messages number that alarm window displays.
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-31
Figure 9.28 Set alarm buffer
9.5.1.2 Create Alarm Window
Create a picture in KingView and click Alarm button in a toolbox as the figure
9.29 shows. Or select the Tools\Alarm menu, the cursor changes + shape, then hold
down left mouse button and drag to draw a rectangle in position. When a rectangle
size is according with alarm window demand, release the left button. So you create
alarm window successfully as the figure 9.30 shows.
You can change a position of an alarm window in the picture by the following
method: Select the border of an alarm window, when the cursor becomes + shape,
press down the left button and drag the alarm window to a proper position, then
release the button.
Eight little boxes surround selected alarm window. When the cursor moves over
the little box, it becomes the double-arrow one. Then you press down the left button
and drag to resize the alarm window.
WellinControl Technology Development Co.,Ltd
9-32 Chapter 9 Alarms/Events
Figure 9.29 Alarm window button
Figure 9.30 Alarm window
9.5.1.3 Configure Real time and Historical Alarm Window
Double click an alarm window. Alarm window config dialog box appears as the
figure 9.31 shows. You can select the type of current alarm window by Real time
Alarm Window and Historical Alarm Window option in the General properties sheet.
The most of configuration options of a real time and historical alarm window are same.
The configuration options are public if there are no special in this section.
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-33
Figure 9.31 Alarm Window Config sheet – General
The meanings of options in General properties sheet are shown as the following:
 Alarm Window: a register name of the tag defining an alarm window in
database. The tag name can be used in script program for operating the alarm
window.
 Attributes have 7 options:
1. Column Title: if it is checked, titles of each column appear at the top of a
window in development and runtime. For example, the system displays title
“Alarm time” at the top of the Alarm Time column.
2. Status Bar: if it is checked, the status bar of an alarm window appears at the
bottom of a window in development and runtime. It displays an alarm
number in current alarm window and other messages.
3. Scroll automatically: if it is checked, when current window cannot display
WellinControl Technology Development Co.,Ltd
9-34 Chapter 9 Alarms/Events
all alarm messages in a screen in runtime, the alarm window will scroll
automatically to display new alarm.
4. Horizontal grid: if it is checked, Horizontal grid appears at message display
area of a window in development and runtime.
5. Vertical grid: if it is checked, vertical grid appears at message display area
of a window in development and runtime.
6. Decimal digits: define the decimal digits of data displayed in an alarm
window.
7. Position of a new alarm: define a position where a new alarm or event
appears. Forefront means that a new alarm appears at the uppermost of an
alarm window and past alarms move down a row orderly. Lattermost
means that an alarm at the bottommost row.
 Date format: choose a display format of date in an alarm window.
 Time format: choose a display format of time in an alarm window. Namely,
determine to display the parts, such “XX MM XX SS” or “XX HH xx MM xx
SS”. Note selecting should be logical. For example, only selecting an hour and a
second is false. A system gives warning “False time format” when selecting a
false time format.
Configure Column Properties sheet:
Click Column Properties label and set column properties of an alarm window as
below.
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-35
Figure 9.32 Alarm Window Config sheet – Column property
Column Properties determines display columns and columns order in an alarm
window. The meanings of the options are shown as the following:
 Unselected Columns: columns in it don’t appear in an alarm window.
 Selected Columns: columns in it appear in an alarm window.
 Add: add an item to display in an alarm window. Select an item in Unselected
and click Add to increase selected item in Selected, so the selected item can be
displayed in an alarm window. Note must select certain item then execute this
function.
 Remote: remote an item from Selected. Select an item in Selected and click
Remote to decrease selected item in Unselected, so the selected item cannot be
displayed in an alarm window. Note must select certain item in Selected then
execute this function.
 Up: move an item up a row. Must select certain item being not at the most top in
WellinControl Technology Development Co.,Ltd
9-36 Chapter 9 Alarms/Events
Selected then can execute this function.
 Down: move an item down a row. Must select certain item being not at the most
bottom in Selected then can execute this function.
Configure the Operation Properties sheet:
Click the Operation Properties label and set operation properties of an alarm
window as below.
Figure 9.33 Alarm Window Config sheet – Operation property
The meanings of the options are shown as the following:
 Security Zone: configure an access level to operate an alarm window in
TouchView. You can select the security zones.
 Operation Type: configure operation contents and ways that an alarm window
supports in TouchView.
1. Alarm acknowledge: allow respond an alarm using an icon and other ways
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-37
in runtime.
2. Show toolbar: if it is checked, shortcut buttons appear at the top of a
window in development and runtime.
3. Double-click: double-click an alarm message can execute pre-custom
function.
Configure the Condition Properties sheet:
Click the Condition Properties label and set the filter conditions of an alarm
messages display as below. You can modify them in runtime.
Figure 9.34 Alarm Window Config sheet – Condition property

Alarm server: if a system is a stand-alone mode, you don’t need to select the
option. If a network mode, alarm messages of all nodes are saved in alarm server.
Configure a network then specify servers providing service for local node (for
more information on network configuration, see chapter 21 network). Display all
WellinControl Technology Development Co.,Ltd
9-38 Chapter 9 Alarms/Events
servers of local node in the list. You can specify a server whose alarm messages
are displayed in the alarm window.
 Alarm source node: if a system is a stand-alone mode and a default is local, you
don’t need to select the option. If online, configure a network then specify the IO
servers providing service for local because alarm messages of data are originally
from IO server (for more information on network configuration, see chapter 21
network). Display all IO servers under current alarm server in the list. You can
specify IO servers whose alarm messages are displayed in the alarm window. You
can select several IO servers.
 Priority: specify a priority condition of alarms and events that are displayed in an
alarm window. Alarms and events with the higher priority than a defined one can
be displayed in an alarm window. If a defined priority is 500, Alarms and events
with a priority between 1 and 500 are in an alarm window. A priority value is an
integer between 1 and 999.
 Alarm group: select an alarm group whose alarms and events will be displayed in
an alarm window. Alarms and events of selected group and its sub groups can be
displayed in an alarm window. You can only one alarm group.
 Alarm type: type of alarms that are displayed in an alarm window.
 Event type: type of alarms that are displayed in an alarm window. Note: Event
type option is unavailable for a real-time alarm window. You only modify it in
TouchView. Event of a real time alarm window has three types: alarm, confirm
and resume.
Configure the Color and Font sheet:
Click the Color and Font label and set the font color, type and size of alarms
and events messages display as below. You can modify them in runtime.
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-39
Figure 9.35 Alarm Window Config sheet - Color and font
Click a color button behind the label, Select Color dialog box appears and you
can select a color for label information. Click the font button, Select Font dialog box
appears and you can select a font for label information.
For example: Define a color and font for messages of Station Start event. Click
a color button
behind Station Start label, the Color palette appears as below.
Figure 9.36 Palette
WellinControl Technology Development Co.,Ltd
9-40 Chapter 9 Alarms/Events
Select color, the button becomes selected color and the Color palette close
automatically.
Click Font button, Select Font dialog box appears as below. Select a font and
click OK to close the dialog box.
Figure 9.37 Font
9.5.1.4 Operate an alarm window in TouchView
If check Show toolbar and Show status bar in Alarm Window config, a
standard alarm window in runtime as below.
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-41
Figure 9.38 Standard alarm window in TouchView
A standard alarm window consists of 3 parts: a toolbar, alarms and events display
area and a status bar. Functions of buttons in toolbox are the following:

Confirm an alarm: when select an unconfirmed alarm message, this button
becomes valid. Click the button to confirm selected alarm.

Alarm window pause/resume to scroll: Click the button each time,
Pause/resume to scroll status change once. If an alarm window continuously
scrolls to display alarms, you can click the button to pause for looking over
messages in detail, then click it again to resume to scroll. Pause scrolling doesn’t
affect alarm generating, because all alarms including alarms can’t be shown
during a pause will be displayed after resuming. Pause/resume to scroll status is
shown in a third column of a status bar.

Modify alarm type: modify a filter condition of types of alarms that are
displayed in current alarm window. It is same as the Alarm Type option of
Condition Property in the section 9.5.1.3. Click this button and an Alarm Type
dialog box appears. All alarm types are available in the list of the dialog box.
Select them and click OK to exit the dialog box.

Modify event type: modify a filter condition of types of events that are
displayed in current alarm window. It is same as the Event Type option of
Condition Property in the section 9.5.1.3. Click this button and an Event Type
WellinControl Technology Development Co.,Ltd
9-42 Chapter 9 Alarms/Events
dialog box appears. All event types are available in the list of the dialog box.
Select them and click OK to exit the dialog box.

Modify Priority: modify a filter condition of a priority of events and alarms
that are displayed in current alarm window. It is the same as the Priority option
of Condition Property in the section 9.5.1.3. Click this button and a Priority
dialog box appears. Input a priority you wish and click OK to exit the dialog box.

Modify Alarm group: modify a filter condition of types of alarm groups that
are displayed in current alarm window. It is the same as the Alarm Group option
of Condition Property in the section 9.5.1.3. Click this button and an Alarm
Group dialog box appears. Select an alarm group and click OK to exit the dialog
box.

Modify Info Source: modify a filter condition of alarm info sources that are
displayed in current alarm window. It is the same as the Info Source option of
Condition Property in the section 9.5.1.3. Click this button and an Info source
dialog box appears. All info sources are available in the list of the dialog box.
Select them and click OK to exit the dialog box.

Modify Filter condition of alarm server display:
It is the same as the Alarm Server option of Condition Property in the section
9.5.1.3. Click the pull down arrow at the right of the list and select an alarm
server form it.
A status bar consists of three columns, the first column shows alarms number in
current alarm window, second shows a position of new alarm, third shows a scroll
status of the window.
It is allowable that an alarm window doesn’t configure a toolbar and status bar in
TouchView.
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-43
9.5.2 Output alarm logging to a file:
You can check alarm logging by the text file what a system output alarm
messages to. You can define a period of time, record contents, save term and so on for
a text file A postfix of files is “.a12”. Please refer to section 9.5.2.1 for a naming rule
of the files.
9.5.2.1 Configure File Output
Open Project Manager, select Configure Alarm in the toolbar or double click
System Configuration /Alarm Configuration item, dialog box appears as below.
Figure 9.39 Alarm config – File configuration

Select record contents: include the following options: Record Alarm Event,
Record Operate Event, Record Enter Event, Record Station Event. Only check
WellinControl Technology Development Co.,Ltd
9-44 Chapter 9 Alarms/Events






the option, its messages can be recorded to a file. For example, if Record Station
Event is unchecked, a system doesn’t record any messages about station in
runtime. Except these options you can define record contents and format such as
Alarm Format. For more information on option format, see the section 9.5.2.2.
Select record path: specify a path of saving an alarm file. It has two options:
Current Project is one what a current project is saved at. Specified: type a path
of saving an alarm file in a back textbox, which becomes available when this
option is checked.
Time of recording: in general, there are a lot of alarm record files. The option is
to specify the length of record time for what there are no new files. Its unit is
hour and range is from 1 to 24. A system generates a new record file when
specified record time is up. For example, it is defined as 8 hours, a system
generates a new alarm record file each 8 hours according to defined start time.
Start Time: a time when name an alarm record file (hour), that is time to begin to
record a file. Its value is an integer between 0 and 23. KingView generates a
series of alarm record files on Start/Stop Time and File Record Time. A naming
rule is a format YYMMDDHH.AL2, YY, MM, DD, HH indicate a year, a month,
a day, an hour respectively. For example, define File Record Time as 8 hours,
Start Time as 8 o’clock, and it is Nov 18 2002 now, so when current time is
between 8 and 16 o’clock, a system generates the file 02112808.al2 for saving
alarms and events messages.
Time of saving file: define days (an integer between 1 and 999) what a file is
saved in hardware for (before this day). Record files beyond days are deleted
automatically.
Alarm Group: define conditions to record alarms groups’ alarms and events. Only
alarms and events of alarm groups what satisfy conditions can be recorded in
files.
Priority: define a priority to record alarms and events. Only alarms and events
whose priority is higher than a defined one can be recorded in files.
Finish File Configuration then click OK to exit the dialog box.
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-45
Each alarm or event record only uses arow in a file and has all record items
separated with []. For example, records in front section of this chapter can be shown
as the following by a default format:
Station Start Event: [Machine Name: Local][Event Type: Station Start][Station Time:
09:31:14]
Application Event: [Operation Time: 09:31:33][Event Type: Application][Success
Flag: Success][Tag Name: DDE event][Tag Note: ][Operator:
][New
Value:1.000000][Field Name: value][Old Value: 0.000000] [Machine Name:
Local][IO Sever Name: Local]
Alarm: [Alarm Time: 15:38:25:380][Confirm/Resume Time: ][Tag Name: Pressure
Measure][Alarm Value:5.5508][Limit Value: 3.0000][Alarm Type: Major
Deviation][Event Type: Alarm][Resume Value:
][Operator: ][Quality Stamp:
192][Priority: 200] [Machine Name: Local][IO Sever Name: Local]
Alarm
Resume:
[Alarm
Time:
15:38:25:660][Confirm/Resume
Time:
15:38:25:770][Tag Name: Pressure Measure][Alarm Value: -0.238][Limit Value:
2.0000][Alarm
Type:
minor
Deviation][Event
Type:
Alarm][Resume
Value: ][Operator: ][Quality Stamp: 192][Priority: 200] [Machine Name: Local][IO
Sever Name: Local]
Enter Event: [Enter Time: 16:55:23][Event Type: Enter out][Success Flag:
Success][Operator: Non] [Machine Name: Local]
[Enter Time: 16:55:23][Event Type: Enter in][Success Flag: Success][Operator:
Administrator] [Machine Name: Local]
Station Exit Event: [Machine Name: Local][Event Type: Station Exit][Station Time:
15:47:59]
9.5.2.2 Configure record format of General Alarms and Events
When outputting alarms and events messages, you can specify output contents
and its length. That is Format Configuration what is same as File, Database and printer
output.
Format Configuration is the same in File Output, Database Input and Printer Output.
WellinControl Technology Development Co.,Ltd
9-46 Chapter 9 Alarms/Events
1.
Alarm Format: each option has Format or Character Configuration as the figure
9.40 shows. When an option is selected, its name is displayed in the right list. All
options in the list appear in record file, a real time print or record database by a
list order. Click UP or Down to change an option order.
Note:
Event in Alarm Format is Confirm/Resume Event.
Only record a defined character length. When actual length is less than a
defined, use blank space to fill. When more than a defined, intercept characters of a
defined length automatically. This note is applied to all record formats.
Figure 9.40 Alarm format
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
















9-47
Database Option: it will be introduced in the section 9.5.3.3
Alarm Date: if the option is checked, the back format sub-options become
available. You can select any format of an alarm date.
Alarm Time: if the option is checked, the back format sub-options become
available. You can select any format of time.
Event Date: if the option is checked, the back format sub-options become
available. You can select any format of an event date.
Event Time: if the option is checked, the back format sub-options become
available. You can select any format of an event time.
Tag Name: if the option is checked, record a tag name in an output. Define a
character length in an editor that is an integer between 1 and 127.
Alarm Group: if the option is checked, record an alarm group in an output.
Define a character length in an editor that is an integer between 1 and 31.
Alarm Value: if the option is checked, record an alarm value in an output. Define
a character length in an editor that is an integer between 1 and 31.
Limit Value: if the option is checked, record an alarm limit in an output. Define a
character length in an editor that is an integer between 1 and 31.
Comment: if the option is checked, record a tag comment in an output. Define a
character length in an editor that is an integer between 1 and 39.
Alarm Type: if the option is checked, record an alarm type in an output. Define a
character length in an editor that is an integer between 1 and 31.
Machine: if the option is checked, record a machine name in an output. Define a
character length in an editor that is an integer between 1 and 31.
Event Type: if the option is checked, record an event type in an output. Define a
character length in an editor that is an integer between 1 and 31.
Resume Value: if the option is checked, record a resume value in an output.
Define a character length in an editor that is an integer between 1 and 31.
Operator: if the option is checked, record an operator name in an output. Define a
character length in an editor that is an integer between 1 and 31.
IO Server: if the option is checked, record an IO server in an output. Define a
WellinControl Technology Development Co.,Ltd
9-48 Chapter 9 Alarms/Events


2.
character length in an editor that is an integer between 1 and 31.
Quality (an integer value of a quality stamp): if the option is checked, record a
value of a quality stamp of IO data in an output.
Priority: if the option is checked, record a priority of alarms or events in an
output.
Operation Format: each option has Format or Character Configuration as the
figure 9.41 shows. When an option is selected, its name is displayed in the right
list. All options in the list appear in record file, a real time print or record
database by a list order. Click UP or Down to change
Figure 9.41 Operation format



Event Date: if the option is checked, the back format sub-options become
available. You can select any format of an event date.
Event Time: if the option is checked, the back format sub-options become
available. You can select any format of an event time.
Event Type: if the option is checked, record an event type in an output. Define a
character length in an editor that is an integer between 1 and 31.
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events









3.
9-49
Success Flag: if the option is checked, record a success flag in an output. Define
a character length in an editor that is an integer between 1 and 31.
Tag Name: if the option is checked, record a tag name in an output. Define a
character length in an editor that is an integer between 1 and 127.
Tag Comment: if the option is checked, record a tag comment in an output.
Define a character length in an editor that is an integer between 1 and 39.
Machine: if the option is checked, record a machine name in an output. Define a
character length in an editor that is an integer between 1 and 31.
Operator: if the option is checked, record an operator name in an output. Define a
character length in an editor that is an integer between 1 and 31.
New name: if the option is checked, record a tag value before an operation in an
output. Define a character length in an editor that is an integer between 1 and 31.
Field: if the option is checked, record a tag field in an output. Define a character
length in an editor that is an integer between 1 and 31.
Old name: if the option is checked, record a tag value after an operation in an
output. Define a character length in an editor that is an integer between 1 and 31.
IO Server: if the option is checked, record an IO server in an output. Define a
character length in an editor that is an integer between 1 and 31.
Enter Format: each option has Format or Character Configuration as the figure
9.42 shows. When an option is selected, its name is displayed in the right list. All
options in the list appear in record file, a real time print or record database by a
list order. Click UP or Down button to change.
WellinControl Technology Development Co.,Ltd
9-50 Chapter 9 Alarms/Events
Figure 9.42 LogIn format






4.
Date: if the option is checked, the back format sub-options become available.
You can select any format of an event date.
Time: if the option is checked, the back format sub-options become available.
You can select any format of an event time.
Event Type: if the option is checked, record an event type in an output. Define a
character length in an editor that is an integer between 1 and 31.
Success Flag: if the option is checked, record a success flag in an output. Define
a character length in an editor that is an integer between 1 and 31.
Operator: if the option is checked, record an operator name in an output. Define a
character length in an editor that is an integer between 1 and 31.
Machine: if the option is checked, record a machine name in an output. Define a
character length in an editor that is an integer between 1 and 31.
Station Format: each option has Format or Character Configuration as the figure
9.43 shows. When an option is selected, its name is displayed in the right list. All
options in the list appear in record file, a real time print or record database by a
list order. Click UP or Down button to change.
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-51
Figure 9.43 Station format




Date: if the option is checked, the back format sub-options become available.
You can select any format of an event date.
Time: if the option is checked, the back format sub-options become available.
You can select any format of an event time.
Event Type: if the option is checked, record an event type in an output. Define a
character length in an editor that is an integer between 1 and 31.
Machine: if the option is checked, record a machine name in an output. Define a
character length in an editor that is an integer between 1 and 31.
9.5.3 Configure a database output
KingView records alarms and events in open database (such as Access, SQL
Server) through ODBC. Before using this function, it is necessary to the following:
create a corresponding data table and fields in a database (see to the section 9.5.3.1)
then configure ODBC data source (user DSN or system DSN) in a control panel. You
can define a user name, a password and so on.
9.5.3.1 Define database to record alarms
A data tables in a database is corresponding to an output configuration. A data
tables have four types: Alarm Event, Operate Event, Enter Event and Station
WellinControl Technology Development Co.,Ltd
9-52 Chapter 9 Alarms/Events
(workstation) Event. According to a demand, you can create tables which fields is
corresponding with record options, such as Alarmdate field in Alarm table to Alarm
Date option in an alarm record. Refer to the following table for more detail
 Alarm
When entering an alarm event into the database (See Ch 9.5.3.3) and selecting
the “date & time saved as string format”, the alarm table includes the following fields:
Field Name
AlarmDate
AlarmTime
VarName
GroupName
AlarmValue
LimitValue
AlarmType
Pri
Quality
AcrDate
AcrTime
OperatorName
VarComment
ResumeValue
EventType
MachineName
IOServerName
Corresponding Option
Alarm Date
Alarm Time
Tag Name
Alarm Group
Alarm Value
Alarm Limit
Alarm Type
Priority
Quality Place
Event Date
Event Time
Operator
Tag Comment
Resume Value
Event Type
Machine Name
IO Server
When selecting the “date & time saved as Date format”, the alarm table includes
the following fields:
Field Name
AlarmDateTime
AlarmMilliSecond
AlarmType
AcrDateTime
Description
Date & Time
Msec
Type
Date
&
WellinControl Technology Development Co.,Ltd
Time
of
Chapter 9 Alarms/Events
AcrMilliSecond
EventType
VarName
AlarmValue
LimitValue
ResumeValue
OperatorName
Quality
Pri
GroupName
VarComment
MachineName
IOServerName
9-53
Acknowledgement
Msec of Acknowledgement
Event Type
Variable Name
Alarm Value
Limit Value
Resume Value
Operator’s Name
Quality
Priority
Group Name
Comment
Machine Name
Server Name
In this table, the data type for the AlarmDateTime and AcrDateTime fields must
be the date.
 Fields in Operate table
Field Name
VarName
OldValue
NewValue
OperatorName
AlarmDate
AlarmTime
SuccessOa
EventType
FieldName
VarComment
MachineName
IOServerName

Corresponding Option
Tag Name
Old Value
New Value
Operator
Alarm Date
Alarm Time
Success Flag
Event Type
Field Name
Tag Comment
Machine Name
IO Server
Fields in Enter table
WellinControl Technology Development Co.,Ltd
9-54 Chapter 9 Alarms/Events
Field Name
OperatorName
SuccessEnter
EventType
AlarmDate
AlarmTime
MachineName

Corresponding Option
Operator
Success Flag
Event Type
Alarm Date
Alarm Time
Machine Name
Fields in Station table
Field Name
EventType
AlarmDate
AlarmTime
MachineName
Corresponding Option
Event Type
Alarm Date
Alarm Time
Machine Name
Note:
1.Field name of data table must be right, or it might happen to fail to record.
2.For date & time related fields, if SQL functions in Kingview are used for
database search, they have to be defined as Text format.
9.5.3.2 Configure Database
You can configure a database output after defining an alarm record database and
ODBC data source following steps in the section 9.5.3.1. The figure 9.44 shows
Alarm Config sheet --Database Configuration dialog box.
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-55
Figure 9.44 Database configuration






Record Alarm Event: if the option is checked, record an alarm event in an alarm
database. Refer to the section 9.5.3.3 for defining alarm format.
Record Operate Event: if the option is checked, record an operate event in an
alarm database. Refer to the section 9.5.2.2 for defining alarm format.
Record Enter Event: if the option is checked, record an enter event in an alarm
database. Refer to the section 9.5.2.2 for defining alarm format.
Record Station Event: if the option is checked, record a station event in alarm
database. Refer to the section 9.5.2.2 for defining alarm format.
Use Default DataSource: On “alarm config sheet”, make the default event in
“File configuration” unselected, in figure 9.44, whether the “Use Default
DataSource” is valid or not depends on the four records events above.
User name and password: Input the user name and password defined in ODBC
data source. If don’t define, please set null.
WellinControl Technology Development Co.,Ltd
9-56 Chapter 9 Alarms/Events

Data source: input a defined ODBC data source connected to Alarm Database.
You can also click the button behind Data Source label. ODBC data source
dialog box appears. The dialog box includes two options: System DSN and User
DSN that list all available data sources respectively in current system.
 Group: Select conditions of alarm groups whose alarms and events are recorded
in database. Only can select one alarm group.
 Priority: select priority of alarms and events what are recorded in database. Only
alarms and events with higher priority than this defined one can be recorded in
database. Priority value is an integer between 1 and 999.
When one of the four record events is valid, the “Use Default DataSource” is
valid, and then you can operate the “Use Default DataSource”. If not select the “Use
Default DataSource”, you can make “user”, “Password” and “DataSource” valid to do
corresponding operations.
9.5.3.3 Configuration of alarm events into the database
Alarm events can be recorded either by a table in the database, or monthly. The
alarm date & time can be saved in date or string format.
The interface Alarm configuration is shown in Figure 9.45:
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-57
Figure 9.45 Configuration of Alarm Format
The meaning of each item is as follows:
 Save the Data Table Monthly: Save the alarm data in different tables
identified using the month name. Data should be saved monthly regardless
of whether you use the date or string type to save the date & time records.
See Figure 9.45, selecting “Save alarm data by monthly”, means a new table,
based on the “Alarm” table already in the database, will automatically be
created to save the alarm data for the current month in the Alarm database.
For example in an Access Database, a new table named “Alarm” + “Year
WellinControl Technology Development Co.,Ltd
9-58 Chapter 9 Alarms/Events
Month” is created as shown below:
Figure 9.46 A new table is created in an Access Database
All alarm data is saved in the alarm table for each month. The “Alarm”
table is used as a module, which does not have any saved alarm data. If we do
not select “Save Data Monthly”, all the alarm data will be saved into one table
named “Alarm”.
 The Date & Time saved in Date Format: selecting this item, as shown in
Figure 9.47, means all Date & Time data in Kingview, such as Alarms,
Acknowledgements and Recoveries are saved in the database in date format.
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-59
Figure 9.47 Configuration of Alarm format (Date & Time saved as Date Format)
When this item is selected, the fields used in the “Alarm” table are slightly
different from those created by “Date & Time saved in string Format”. Please
see Chapter 9.5.3.1.
Note: When this item is selected, TouchView will input alarm records in the
database according to the OS Date & Time format. To ensure synchronised Date
& Time formats between computers in Windows 2000 systems, set the Date &
Time format as follows: Start->Settings->Control Panel->Regions & languages>Date & Time. If you use SQL Server databases, please do not use tt h:mm:ss or
WellinControl Technology Development Co.,Ltd
9-60 Chapter 9 Alarms/Events
tt hh:mm:ss as the Date & Time format (tt means am or pm).
 Msec: This keeps track of all Date & Time data in Kingview to the
nearest Msec, such as Alarms, Acknowledgements and Recoveries. “Msec”
is valid only when selecting “Date & Time saved in Date Format”. “Alarm
Msec” and “Acknowledgements or Recoveries Msec” can be seen in the
alarm format list, shown as follows. These two fields correspond to the
alarm times Msec values.

Date & Time saved in String Format: if this is not selected the Date &
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-61
Time data is saved in string format.
 Extend 1, Extend 2: Select the item, the operating system of KingView will
conserve corresponding Extends information of alarm variable in “Alarm”
data table
Please refer to Chapter 9.5.2.2 for the configuration of alarm format saved
in string format, such as Alarm Date, Alarm Time, Event Date, Event Time,
length of characters, etc.
9.5.4 Configure Print Output
KingView can print real time alarms and events messages by parallel port. Before
using this function, it is necessary to configure a real time print as the figure 9.48
shows.
Figure 9.48 Print configuration
WellinControl Technology Development Co.,Ltd
9-62 Chapter 9 Alarms/Events

Real time Alarm Event: if the option is checked, include an Alarm event at
printing alarms. Refer to the section 9.5.2.2 for defining alarm format.
 Real time Operate Event: if the option is checked, include an Operate event at
printing alarms. Refer to the section 9.5.2.2 for defining alarm format.
 Real time Enter Event: if the option is checked, include an Enter event at printing
alarms. Refer to the section 9.5.2.2 for defining alarm format.
 Real time Station Event: if the option is checked, include a Station event at
printing alarms. Refer to the section 9.5.2.2 for defining alarm format.
 Printer: it is connected to a computer by a parallel port. Only set a printer name
as one among LPT1, LPT2 or LPT3.
 Group: Select conditions of alarm groups whose alarms and events are printed.
Only select one alarm group.
 Priority: select priority of alarms and events what are printed. Only alarms and
events with higher priority than this defined one can be printed.
A system sends alarms messages to a defined print buffer and prints it in a real
time according to a print formant and contents defined by users. Each field is
separated with “/” and contained in “<>”. A title and contents of a field are separated
with “:”, and both alarm messages are with “----- “.
For example: print Station Event:
<Station Date: Nov 18, 2002>/< Station Time: 14:24:07>/<Event Type: Station
Start>/<Machine Name: Local>
------------------------------------------------------------------------<Station Date: Nov 18, 2002>/< Station Time: 14:24:14>/<Event Type: Station
Exit>/<Machine Name: Local>
Note:
Suggest users to use a stylus printer with a hard font library at a real time
alarm print, because KingView outputs real time alarm messages to printer port
(such as LPT1) directly. Other types of printers (laser, ink printer) in a market have
no own font library but use one of a system, for example 1600II and 1600KIII of
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-63
EPSON, which might lead to messy code at printing Chinese characters.
9.6 Function and Alarm field
KingView provides functions, tags and an alarm field of tags.
9.6.1 $use a new alarm tag
A new alarm tag is a system one and indicates if a new alarm happens in current
system. When any new alarm happens, this tag is set as I automatically. This tag
cannot be set 0 automatically, but need to set as 1 artificially.
9.6.2 Alarm Functions


Functions on an alarm operation:
Alarm Confirm---- Ack(Tagname or Groupname): Confirm an alarm of a tag or a
alarm group. If a function parameter is a tag name, only confirm an alarm of the
tag. If a parameter is a group name, confirm alarms of all tags belonging the
alarm group and sub-groups. The parameter of this function should be a variable
or alarm group name instead of a string variable.
Example:
Ack (\\Site\LiquidDepth)
Ack(Alarm Group 1)
Alarm
Confirm----AckByTagName(“tag_name”):
Acknowledges
alarm
variables. The parameter can either be a string variable or a string that takes a
variable name.
Example:
AckByTagName (\\Site\LiquidDepth)
WellinControl Technology Development Co.,Ltd
9-64 Chapter 9 Alarms/Events
AckByTagName(Varname), Varname is a string variable.

Alarm Confirm---- AckByGroupName( “station_name”, “group_name”):
Acknowledges an alarm group. The Station_name is the name of the IO server
which provides the alarm. The Group_name is the alarm group name. The
parameter can either be a string variable or a string that takes the IO server’s or
alarm group’s name.
Example:
AckByGroupName (“PC1”, “Alarm Group 1”)
AckByGroupName (PCName, GroupName), PCName, GroupName is string
variables.
In addition to the button in an alarm window to finish an alarm confirm, you can
use KingView script and the function to do it. For example, create a button on a
picture, and use the function in an animation link script of the button to confirm.
 Get a name of an alarm group----GetGroupName(StationName, GroupID): a
alarm group field of tags returns is ID (number) of an alarm group, but you can
use the function to get a name of an alarm group.
Modifying variable values will not create any operational events in Kingview
script languages except the Button script. Two functions can be used as solutions for
this problem.
 The operational event function used to create the real variable
SetRealDBForFloat("VarName",Value):VarName is the variable; Value is the
value.
Example:
Script type commands in the “On Startup” window:
SetRealDBForFloat ("\\Site\Liquid Depth", 1.5)
Set real variable \\Site\Liquid Depth as 1.5
The “On Startup” window creates a real variable operational event \\Site\Liquid
Depth.
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-65

The operational event function is used
to create the integer variable
SetRealDBForInt("VarName",Value): Varname is the variable; Value is the value.
Example:
Script type commands in the “On Startup” window:
SetRRealDBForInt (“\\Site\Row,10”)
Set the integer variable “\\Site\Row” as 10.
The window “On Startup” window creates an integer variable operational event
“\\Site\Row”.
Refer to “Function Guide of KingView” for more detail of functions.
9.6.3 Alarm Field
KingView has many types of alarm fields.
Discrete tags have the following alarm fields:
 .Ack: indicates if to confirm a tag. If a system initializes or doesn’t confirm a
new alarm of a tag, the field is 0. When finishes confirming the alarm, it is 1.
 .Alarm: indicates if a tag is in an alarm status. When a tag is in a normal status, a
field value is 0. When in an alarm status, a value is 1 whether or not the alarm is
confirmed.
 .AlarmEnable: indicates the enabling status of tag alarm, read/write.
When .AlarmEnable is set to 0, no alarm occurs even if tag satisfies the alarm
condition. Only when .AlarmEnable is set to 1, tag brings about
alarm. .AlarmEnable default is 1.
 .Group: an alarm group ID of a tag.
 .Priority: a priority of a tag.
Besides having the above 4 types of alarm fields, analog tags have different
alarm fields by an alarm type of tags.
Alarm over limit:
 Limit Field: high and high limit (.HiHiLimit), high limit (.HiLimit), low and low
WellinControl Technology Development Co.,Ltd
9-66 Chapter 9 Alarms/Events
limit (LoLoLimit), low limit (LoLimit). Their limit fields are read/write and
modified on line.
 Status Field: high and high status (.HiHiStatus), high status (.HiStatus), low and
low status (.LoLoLimit), low status (.LoStatus). Each status field which values
are discrete is corresponding to an alarm type over limit. When a tag is in High
Limit alarm, .HiStatus of a tag is set 1 automatically. When the alarm resumes,
the field is set as 0 automatically.
Deviation alarm:
 Limit Field: Major deviation limit (.MajorDevPct), Minor deviation limit
(MinorDevPct), Deviation Target Value (.DevTarget). These fields are read/write
and modified on line.
 Status Field: Major deviation status (.MajorDevStatus), Minor deviation Status
(MinorDevStatus). Each status field which values are discrete is corresponding to
a deviation alarm type. When a tag is in a Major deviation alarm, a
field .MajorDevStatus is set 1 automatically, when the alarm resumes, a value is
set 0 automatically.
Alarm of change rate:
 Limit Field: limit of change rate (.ROCPct) is read/write and modified on line.
Buy its time unit (hour, minute and second) cannot be modified on line.
 Status Field: status field (.ROCStatus) which value is discrete.
9.7 Preset custom function
There are three alarm custom functions preset by a system in KingView custom
functions. They are functions of long alarm ($System_RealAlarm), integer alarm
($System_LongAlarm) and discrete alarm ($System_DiscAlarm).
Note:
1. Names of three preset custom functions are match case, formal parameters
of functions too.
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-67
2. Alarm events here are one of Generate Alarm, Confirm Alarm and Resume
Alarm. Other events (such as Enter Event and Operate Event) don’t invoke these
functions.
Two ways to invoke a custom function:
 A system generates an alarm event then invokes a function of corresponding
data type automatically. For example, a system invokes a integer preset
function when an alarm of integer tag happens.
 If check the option “Allow to double click alarm bar” of Operation Property
in Configure Alarm Window, a system invokes a function of
corresponding data type automatically in runtime when double click the
alarm bar.
Note:
Cannot use Preset custom functions in other scripts.
Cannot modify a function name and parameters.
Cannot evaluate a tag or tag field resulting in Alarm Event in each function.
Custom preset functions:
1. Long: void $System_RealAlarm(RealTag rTag, long nTime, long nEvent, long
nAction)
{
}
2. Integer: void $System_LongAlarm(LongTag iTag, long nTime, long nEvent, long
nAction)
{
}
3. Discrete: void $System_DiscAlarm(DiscTag dTag, long nTime, long nEvent,
long nAction)
{
WellinControl Technology Development Co.,Ltd
9-68 Chapter 9 Alarms/Events
}
The meaning of parameters in preset custom functions (Take Long for example,
other types are same):
Void $System_RealAlarm(RealTag rTag, long nTime, long nEvent, long nAction)
 rTag: general tag which has values and all fields of system tags. These values and
is read-only.
 nTime: number of seconds from o o’clock of Jan 1, 1970 to the time when an
alarm happens. It represents the time of an alarm.
 nEvent: type of an alarm generated by a systme or led in double click alarm
window. A return value of an alarm type:
0----Alarm
1----Resume
2----Confirm
 nAction: when nAction==1, indicate double–click alarm window. When
nAction==0, indicate Generate Alarm event.
A function body of preset custom functions is empty in an initial status, so users
must to add scripts in it. You can realize some handles that you want to do after
an alarm using preset custom functions.
For example: monitoring system of a plant defines two alarm groups “Steelmaking Workshop” and “Reaction Workshop”. Reaction Workshop has a sub-alarm
group “Liquid level”. And each group has important alarm messages. Now demand to
record tag names, alarm groups, alarm time, tag comments and so on in KingView
report when an alarm happens. At the same time, print them for submitting those
concerned. A tag type is integer.
You can finish it easily by preset custom functions, but you firstly must make a
KingView report associated with it.
Create a new picture in KingView. Create an alarm window with 10 rows and 2
columns called Alarm Report in the picture. Define a cell property of the report and
input some items in the report as the figure 9.49 shows..
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-69
Figure 9.49 Alarm report in TouchExplorer
Select Custom Function Language sheet of Script in TouchExplorer. Then
double click an integer custom function---- void $System_LongAlarm(LongTag iTag,
long nTime, long nEvent, long nAction), . Type the following program in an appearing
script editor .
string sGroupName;
//Name of an alarm group
string tempstr;
//temporary tag
//Get name of an alarm group
sGroupName=GetGroupName(“”, iTag.Group);
//if it is Generate instead of Confirm Alarm or Resume Alarm
if(nEvent==0)
{//if Alarm group of a tag belongs to Reaction Workshop, add a report.
if(sGroupName==”Reaction Workshop” || sGroupName==”Liquid Level”)
{
ShowPicture(“Alarm Report Picture”)
//Add a tag name in the report.
ReportSetCellString(“Alarm Report”, 2, 2, lTag.Name);
//Add a tag Comment in the report.
ReportSetCellString(“Alarm Report”, 3, 2, lTag.Comment);
//Add an alarm group in the report.
ReportSetCellString(“Alarm Report”, 4,2, sGroupName);
WellinControl Technology Development Co.,Ltd
9-70 Chapter 9 Alarms/Events
//Add a priority in the report.
ReportSetCellString(“Alarm Report”, 2, 2, lTag.Priority);
//Add a tag value in the report.
ReportSetCellString(“Alarm Report”, 6, 2, lTag);
//Add an alarm date in the report.
Tempstr=SetCellForm(nTime, 1);
ReportSetCellString(“Alarm Report”, 7, 2, tempstr)
//Add an alarm time in the report.
Tempstr=SetCellForm(nTime, 2);
ReportSetCellString(“Alarm Report”, 8, 2, tempstr)
//Add an alarm manage in the report.
ReportSetCellString(“Alarm Report”, 9, 2, Alarm Manage);
//Print the report
ReportPrint2(“Alarm Report”);
}
)
When an alarm happens, a system invokes preset custom functions in runtime
and writes alarm messages in a report automatically as the figure 9.50 shows.
Figure 9.50 Alarm report in TouchView
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-71
9.8 Send Alarm Messages by Short Message and E-mail
With a fast development of Internet and communication, Web and Mobile
telephone are indispensable to modern life. It is not a dream that you can know a
production situation on site wherever you are.
KingView cannot only publish pictures as WEB Page or users to browse a
dynamic field pictures, real time data and to search historical logging but also provide
Short Message and E-mail functions what are used easily and support by general
driver. Using any or both functions, KingView can send data or alarm messages to a
specified user by Short Message and E-mail.
9.8.1 Short Message
When using Short Message, a user needs to buy a model of a mobile telephone
from hardware vendor besides a card of a mobile telephone. Recently KingView
supports communication of short message with Siemens T53 Terminal devices.
Register Table of short message device:
Register
Read/write
Tag type
Register presentation
Name
property
AT
Read-only
I/O long, Online status: indicate that online
I/O integer communication is normal when it is
1.
CMGF
Read/write
I/O long
Set a format of short message: 1 is
text, 0 is PDU code, this drive only
support PDU mode
CSCA
Read/write
I/O string
Set a center code of Short message
CMGD
Write-only
I/O long, Delete short message (SM) with
I/O integer special serial number (SN): SN is a
position of SM in SIM card.
CMGD=1 means to delete SM with
SN 1 in SIM. Its value should begin
from 1.
NEW
Write-only
I/O
Read new SM command: read new
WellinControl Technology Development Co.,Ltd
9-72 Chapter 9 Alarms/Events
discrete
MsgNewdd
MsgNec
MsgNeddd
OLD
Read-only
Read-only
Read-only
Write-only
I/O string
I/O string
I/O string
I/O
discrete
MsgOilddd
MsgInfdd
Read-only
Read-only
I/O string
I/O string
SEND
Write-only
I/O
discrete
Tele
Read/write
I/O string
MsgSenddd
Read/write
I/O string
Edelay
Read/write
I/O integer
Sreturn
Read/write
I/O integer
CodeMod
Read/write
I/O integer
ReSTime
Read/write
I/O integer
SM in SIM card and write it into the
register MsgNew and MsgNec.
Read new SM: return a new SM read
from SIM last time. Display it by
MsgNew, MsgNec, MsgNed.
Read old SM command: read a read
SM in SIM card and write it into the
register MsgOld and MsgInf.
Read old SM: return a read old SM
from SIM last time. Display it by
MsgOld and MsgInf.
Send SM commandL sent contents in
MsgSend register to code record in
Tele register.
Set a phone code of receiver: write a
phone code of receiver in the register
before sending SM
Set SM contents: before sending SM,
write sent contents into the register.
When contents exceed 63 Chinese
characters,
put
contents
in
MsgSend1, or MsgSend1 is empty.
Set a delay time to restart a device
when failing to communicate
Return a send success flag. 1:
success. 0: fail. Write SReturn as 0
before sending SM, then send SM.
Can judge a sending result by
SReturn.
(It is available when CMGF=0) code
mode. 0: English code with 7 bits. 1:
mixture code of Chinese and English
with 8 bits. The default is 1. You can
send 160 English letters when it is 0.
70 characters when it is 1.
Set a resend time when failing to
send SM. ReSTime=0,1 means not
resend, ReSTime =3 means resend 3
WellinControl Technology Development Co.,Ltd
Chapter 9 Alarms/Events
9-73
times. Suggest it is less than 3.
The above part is only a simple introduction of Short Message function, Refer to
KingView device help---- intelligent Instrument/KingView SIM Short Message or
contract the Technical Support of WellinControl for more detail.
9.8.2 E-Mail
KingView can send a simple mail (less than 256 characters) by E-Mail. Must
connect a host computer sending mail to local area network or wide area network
before using the function. The local doesn’t need be set specially.
Select Device in TouchExplorer and double click “New…”. Create device wizard
appears. You can select Intelligent Model>YanHua>Email>Email. Create a device and
corresponding tags. The meanings of device registers are shown as the following table.
For example, a mail address of an user name is Testemail102@sohu.com, an user name is
username, a password is password, an address of a receiver is Testemail101@163.com, so
each register is set as the following table shows:
Register Meaning
Data type
Tag example Example of register
name
value
Str0
Server address
I/O string
Server
Smtp.163.com
Testemail102@sohu.com
Str1
Receiver address
I/O string
Receiver
Testemail101@163.com
Str2
Sender address
I/O string
Sender
Str3
User name
I/O string
User name
Username
Str4
Password
I/O string
Password
Password
Str5
Subject
I/O string
Subject
A string less than 128
bytes
Str6
Body
I/O string
Body
A string less than 128
bytes
Control Sending
control I/O integer Control
1: sending
and flag:
0: finish sending
0: stop or finish
set 0 in a course of
sending
sending
indicates
1: send mail or
stopping sending
body
Status
Sending status:
I/O integer Status
1: succeed to send
WellinControl Technology Development Co.,Ltd
9-74 Chapter 9 Alarms/Events
0:
initializing
status
1: succeed to send
255: fail to send
255: fail to send
Note:
This function is used for sending a simple mail (such as Alarm message). A
message must be less than 256 characters.
Refer to KingView device help---- intelligent Model/KingView E-Mail or
contract the Technical Support of an WellinControl for more detail.
WellinControl Technology Development Co.,Ltd
10-1 Chapter 10 Scripts In KingView
Chapter 10 Scripts In KingView
10.1 Scripts Type
KingView scripts are analogous to C language in syntax. Engineers can use it to
increase application flexibility, handle some arithmetic and operations.
All KingView scripts are event driven. The event may be a data change, timer,
mouse click, key press and so on. It contains application scripts, key scripts, condition
scripts, data change scripts, custom scripts, animation link scripts and picture scripts
on different events and functions. They have self-contained testing for bug and rich
operators, mathematic functions, string functions, control functions, SQL functions,
system functions. You can type and edit Scripts in Scripts Editor, then compile and
execute them in TouchView.
Application scripts, key scripts, condition scripts and data change scripts are
called back scripts because executing them is not restricted by picture open or not but
depends on execute conditions. In addition you cannot use Special\Start Back Scripts
and Special\Stop Back Scripts menu to control these scripts, which doesn’t affect
executing animation link scripts and picture scripts. You can also modify $Start Back
Scripts of a system tag to finish the above control (set it as 0 means stop or 1 means
start).
10.1.1 Application Scripts
Select File\Scripts\ Application scripts in the left of TouchExplorer, so the Icon
“Double-click here to enter…” appears in the right contents area as the figure 10.1
WellinControl Technology Development Co.,Ltd
Chapter 10 Scripts In KingView
shows.
Figure 10.1 Select application scripts
Double click the icon, so dialog box appears as the figure 10.2 shows.
WellinControl Technology Development Co.,Ltd
10-2
10-3 Chapter 10 Scripts In KingView
Figure 10.2 Application scripts
10.1.1.1 Application Scripts Editor
You can type an edit scripts in Application Scripts Editor which compositions
are shown in the figure 10.2. Interfaces and main parts of all application scripts editors
are almost same. Only difference between them is a trigger condition, which
represents parts of Trigger Condition interface.
Tough functions of parts of the Editor:
 Menu bar: operation menu for the editor. The File menu has tow submenus:
Confirm and Cancel. Confirm means saving changes in the editor and closing it.
Cancel means closing the editor directly without saving changes. Functions of
these submenus are same as of the OK and Cancel buttons at the right lower
corner in the editor. The Edit menu provides some operation tools for editing
scripts. See the section for a tool using method
WellinControl Technology Development Co.,Ltd
Chapter 10 Scripts In KingView
10-4

Toolbar: tools for editing scripts. It includes Cut, Copy, Paste, Delete,
Select all, Find, Replace, Font, Font Size and so on. See the section for a tool
using method
 Keyword list: select directly existing pictures, alarm groups and other keywords
(such as operators) to Scripts Editor. For example, select a picture name and
double click it, so a picture name is added into the editor automatically.
 Function: click a button to show a relevant function list, select a function directly
to Scripts Editor. Function buttons have followings:
All Function: display all functions lists provided by KingView.
System: only display system functions list.
String: only display relevant string functions list.
Math: only display math functions list.
SQL: only display SQL functions list.
Control: select properties and methods of Active X. Refer to chapter 14.
Custom: display custom functions list.
You can click Help to enter online help when don’t know how to use functions.
 Operator: click a button, an operator on the button label is added to the editor
automatically.
 Tag: select a tag or a tag field to the editor. Click the button, Select Tag Name
dialog box appears. Refer the chapter 5 for using the dialog box.
The above four tools are designed for reduce a manual input.
 Scripts Editor: input scripts here.
 Trigger Condition: trigger condition for executing scripts. Different scripts types
have different trigger conditions. Refer to the following sections for more
information.
10.1.1.1.1 Cut
Cut the currently selected objects and copy them to the Windows Clipboard. The
following are some Cut methods:
 Select Edit\Cut in the editor menu
WellinControl Technology Development Co.,Ltd
10-5 Chapter 10 Scripts In KingView


 Click button
on the toolbar
Right click on an editor then select Cut command in pop up shortcut menu
as the figure 10.3 shows. Or press <Ctrl>+<T> when shortcut menu appears.
Use a shortcut key of Windows: <Ctrl>+<X>
Figure 10.3 Scripts shortcut menu
10.1.1.1.2 Copy
Copy the currently selected objects to the Windows Clipboard. The following are
some Copy methods:
 Select Edit\Copy in the editor menu


Click button
on the toolbar
Right click on an editor then select Copy command in pop up shortcut menu
as the figure 10.3 shows. Or press <Ctrl>+<C> when shortcut menu appears.
 Use a shortcut key of Windows: <Ctrl>+<C>
10.1.1.1.3 Paste
Move the mouse to where you want to paste objects then paste. The following are
some Paste methods:
 Select Edit\Paste in the editor menu


Click button
on the toolbar
Right click on an editor then select Paste command in pop up shortcut menu
as the figure 10.3 shows. Or press <Ctrl>+<P> when shortcut menu appears.
WellinControl Technology Development Co.,Ltd
Chapter 10 Scripts In KingView
10-6
 Use a shortcut key of Windows: <Ctrl>+<V>
10.1.1.1.4 Delete
Select objects that you want to delete then delete. The following are some Delete
methods:
 Select Edit\Delete in the editor menu


Click button
on the toolbar
Right click on an editor then select Delete in pop up shortcut menu as the
figure 10.3 shows. Or press <Ctrl>+<D> when shortcut menu appears.
 Use a shortcut key of Windows: <Del>
10.1.1.1.5 Select All
You can use Select All to select all contents in the scripts editor. The following
are some Select All methods:
 Select Edit\Select All in the editor menu
 Click the Select All button on the toolbar
 Right click on an editor then select “Select All” command in pop up
shortcut menu as the figure 10.3 shows. Or press <Ctrl>+<L> when shortcut
menu appears.
 Use a shortcut key of Windows: <Ctrl>+<A>
10.1.1.1.6 Find
You can use Find to find certain characters in the editor. The following are some
methods to start Find:
 Select Edit\Find in the editor menu


Click button
on the toolbar
Right click on an editor then select Find command in pop up shortcut menu
as the figure 10.3 shows. Or press <Ctrl>+<F> when shortcut menu appears.
Click Find button. Find dialog box appears as the figure 10.4 shows.
WellinControl Technology Development Co.,Ltd
10-7 Chapter 10 Scripts In KingView
Figure 10.4 Find dialog box
Move the cursor to the start place of where you want to find in. Open Find dialog
box and input a found string in Find what textbox. If a found content is a word, check
the Match whole word only option, or don’t check. When the option is not checked,
all same strings as a found string including what is a part of a word are found. If you
hope to match case in finding, check the Match Case.
Direction has two options: Up means to find a string from a current position of
the cursor to an application start. Down means from a current position to an end.
When found a matched string, a system highlights it. If you hope to continue to find,
click Find Next button. If to stop, click the Cancel to close the dialog box.
10.1.1.1.7 Replace
You can use Replace to replace a string with other string in the editor. The
following are some methods to start Replace:
 Select Edit\Replace in the editor menu
 Click the Replace button on the toolbar
 Right click on an editor then select Replace command in pop up shortcut
menu as the figure 10.3 shows. Or press <Ctrl>+<E> when shortcut menu
appears.
Click Replace. Replace dialog box appears as the figure 10.5 shows.
WellinControl Technology Development Co.,Ltd
Chapter 10 Scripts In KingView
10-8
Figure 10.5 Replace dialog box
Move the cursor to the start place of where you want to find in. Open the
Replace dialog box and input a found string in the Find what textbox and a new
string in Replace with textbox. If a found content is a word, check the Match Whole
Word Only option, or don’t check. When the option is not checked, all same strings
as a found string including what is a part of a word are found. If you hope to match
case in finding, check the Match Case. When found a matched string, a system
highlights it.
If you hope to replace one target string once, click Find Next. When found a
target string, click Replace, a current found string is replaced.
If you hope to replace all target strings once, click the Replace All, so all string
satisfying conditions are replaced.
Finishing Replace, click Cancel button to close the dialog box.
10.1.1.1.8 Modify Font style and size
Font of the editor is default, but a user can modify its font style and size. The
methods of opening the Font dialog box:
 Select Edit\Font in the editor menu
 Click the Font button on the toolbar
 Right click on an editor then select Font command in pop up shortcut menu
as the figure 10.3 shows. Or press <Ctrl>+<O> when shortcut menu appears.
Font dialog box is a standard one as the figure 10.6 shows.
WellinControl Technology Development Co.,Ltd
10-9 Chapter 10 Scripts In KingView
Figure 10.6 Font
Note:
Keywords (such as punctuation mark) must be input in western state, except
Chinese character.
10.1.1.1.9 Select Function Name and Picture Name
KingView provides a convenient way to input picture names, alarm group names
and functions into the textbox to reduce a manual input.
For example, display a picture at TouchView starting.
You can configure main picture in System Configuration\Set TouchView, or open
the picture using Application Scripts\Startup.
 Open Application Scripts editor and select the Starting label.
 Click the All Functions. The Select Function dialog box appears as the
figure 10.7 shows.
WellinControl Technology Development Co.,Ltd
Chapter 10 Scripts In KingView
10-10
Figure 10.7 Select function
Select the “ShowPicture” function and click OK then double click the function
name to close the dialog box. The function and its parameter are selected in the editor
as the figure 10.8 shows.
WellinControl Technology Development Co.,Ltd
10-11 Chapter 10 Scripts In KingView
Figure 10.8 Add selected function into editor
The ShowPicture function parameter is the name of a displayed picture. Select
the Default Value and delete it (keeping the quotes) and put the cursor between the
quotes of the parameter ; click “+”“Picture Name” from the right-hand Editor list to
expand the list of picture names, which have been added to the current project. Select
the picture name needed for the display and double-click it. The parameter position
will automatically be filled with this picture name, thus ending the editing of the
display picture.
You can select alarm group name, operator name and tag name to the editor
following the above steps.
10.1.1.2 Application Scripts
Application Scripts are executed when TouchView is on startup or while running
or on shutdown. The application is executed in a defined interval when TouchView is
running.
When select the Running label, you must input an executing period. When
WellinControl Technology Development Co.,Ltd
Chapter 10 Scripts In KingView
10-12
TouchView is running, the application is executed once each period
whether a picture is open.
Select the Starting label and input scripts in the editor. The application is
executed once when TouchView starts.
Select the stopping label and input scripts in the editor. The application is
executed once when TouchView exits.
Figure 10.9 Application scripts
You can only define one type of application scripts.
10.1.2 Data Change Scripts
Select Scripts\Data Change Scripts and double click New… in TouchExplorer.
The editor of Data Change Scripts appears as the figure 10.10 shows. A trigger
WellinControl Technology Development Co.,Ltd
10-13 Chapter 10 Scripts In KingView
condition of Data Change Scripts is a change of a value of associated tag or
tag field.
Input a tag name (such as $second) or a tag field (such as LiquidLevel.Alarm) in
the Tag[.field] editor or select it trough clicking “?” button. Any type of tags or tag
fields (as discrete, integer, long and string) can be associated here. When their values
change, a system executes a script application automatically.
Figure 10.10 Data change scripts editor
Note:
Notice to avoid endless loop when using Condition Scripts or Data Change
Scripts.
For example, a tag A change brings to execute Data Change Scripts
application including the command B=B+1. If B change brings to execute an
WellinControl Technology Development Co.,Ltd
Chapter 10 Scripts In KingView
10-14
application of Condition Scripts or Data Change Scripts, the
application doesn’t have the commands like A=A+1.
If conditions of Condition Scripts or Data Change Scripts refer to remote tags,
the back commands cannot be executed.
10.1.3 Condition Scripts
Condition Scripts are executed when a defined condition of an expression comes
true. For example, a tag is equal to a fixed value or a condition of an expression comes
true.
Select Scripts\Condition Scripts and double-click New… in TouchExplorer. The
editor of Condition Scripts appears as the figure 10.11 shows.
The following are tree types of Condition Scripts:
On startup: it is executed when an initial condition is true.
While running: input an executing period in the editor for timing to execute. It is
executed once each period when a condition is true as the figure 10.12 shows.
On shutdown: it is executed when a condition comes false.
 Condition Comment: specify a condition to execute scripts.
 Remark: some explanatory text for the script.
WellinControl Technology Development Co.,Ltd
10-15 Chapter 10 Scripts In KingView
Figure 10.11 Event scripts editor
Figure 10.12 Event scripts – While running
10.1.4 Hotkey Scripts
Link Hotkey Scripts to a specified hotkey. Press the hotkey to start the key scripts
in runtime. You can specify access level and security zone for key scripts.
Select Scripts\hotkey Scripts and double click New… in TouchExplorer. The
editor of Condition Scripts appears as the figure 10.13 shows.
WellinControl Technology Development Co.,Ltd
Chapter 10 Scripts In KingView
10-16
Figure 10.13 Hotkey scripts
Define Key:
When check boxes of Ctrl and Shift key are checked, both keys are valid as the
figure 10.14 shows.
Figure 10.13 Key definition
Click the Key… button to display Select Key dialog box as the figure 10.15
shows.
WellinControl Technology Development Co.,Ltd
10-17 Chapter 10 Scripts In KingView
Figure 10.15 Select key
Select a key in the dialog box. You can define it as a hotkey or define it with Ctrl
and Shift as a key combination.
You can define security management (access level and security zone) for Key
Scripts as the figure 10.16 shows. You can use any of them or both. For example, set
access level as 918. So only when an operator with higher access level than or equal to
918 logins and presses the hotkey, scripts can be executed.
Figure 10.16 Key security management
10.1.5 Custom Function
If various functions don’t satisfy all requests of project, you can use custom
functions. For example, you can finish special arithmetic or module program through
WellinControl Technology Development Co.,Ltd
Chapter 10 Scripts In KingView
10-18
custom functions.
Custom function is like a C language program, is not called directly by
KingView trigger, but must be called by other scripts.
Select Scripts\Custom function scripts and double click New… in TouchExplorer.
Custom function scripts dialog box appears as the figure 10.17 shows.
Figure 10.17 Custom Scripts editor
10.1.5.1 Concepts in custom Function
There are 6 keywords in Custom Scripts: LONG, FLOAT, STRING, BOOL,
VOID, RETUREN. They don’t match case, and have syntax like C language.
LONG: a type of data/tag is an integer.
FLOAT: a type of data/tag is a long.
STRING: a type of data/tag is a string.
WellinControl Technology Development Co.,Ltd
10-19 Chapter 10 Scripts In KingView
BOOL: a type of data/tag is a Boolean.
VOID: a function has no return value or return value is NULL.
RETURN: a function has return value, and it returns to a main function.
Syntax of custom functions is analogous to sub function in C language. Custom
scripts are a single entity consists of tag defining part and executing language part.
A definition of custom function is the following:
Type of custom function (a type of return value)
Name of a function, name and type of parameters
Function contents
10.1.5.2 Define and use custom Function
The figure 10.17 shows the editor of custom functions. Select a type of a return
value (LONG, FLOAT, STRING, BOOL, VOID, RETUREN) in the list behind
Function Declare. If a function has no a return, select directly VOID.
Input function name in the textbox behind Function Declare what must be not
empty. Function naming must comply with a naming rule of KingView that a name
cannot be same as names of keywords and existing tags. Bracket “()” follows the
function name. If a function has parameters, you should declare types and names of
parameters in the bracket. The final part in the function is a return statement. If the
function has a return, use the statement Return Value (Value is a tag name). If no
return, use Return, that shows current scripts or function are over.
Input a defined function body in the Function Body editor. You can use custom
tags.
Note:
Names of function and tag in custom functions must be different with one of
defined tags, keywords and functions provide by KingView.
Refer to the following example for the detail using method.
WellinControl Technology Development Co.,Ltd
Chapter 10 Scripts In KingView
10-20
Example 1: use VOID function to realize factorial.
Type of a return: VOID
Function Name: jiechen(long Ref.long Ret)
Function body:
//the function has no return and realizes factorial. All tags are
among function parameters
//Ref is a tag. Ret is a result.
Long a;
//custom tag to control time of factorial loop
Long mul; // custom tag to save a factorial result
a=1;
mul=1;
if(Ref<=1)
mul=1;
else
{while (a<=Ref)
{mul=mul*a;
a=a+1;
}}
Ret=mul;
Return;
//the function is over
VOID jiecheng(long Ref.long Ret) function appears in a user-defined
function area after defining. For example, invoke the function in Key Scripts to
finish a number factorial. Define two integer tags: Factor and Result then input
“jiechen(Factor, Result)” in the Key Scripts editor. So a calculating result is save
in the Result tag.
Example 2: a function has a long return.
Type of a return: LONG
Function Name: function2(long nTemp2)
Function body (add up):
WellinControl Technology Development Co.,Ltd
10-21 Chapter 10 Scripts In KingView
nTemp2= nTemp2+1;
//add up
return nTemp2;
//return nTemp2;
LONG function2(long nTemp2) function appears in a user-defined function
area after defining. If a tag is Count2, you can input “function2(Count2)” to
call the function.
Example 3: finish a conversion from an angle to a radian.
Type of a return: FLOAT
Function Name: RadianConversion(float Ref)
Function body:
float pai;
//π
float Ret;
pai=3.14159265;
Ret=(Ref/180)*pai;
Return Ret;
//return result
Note:
Defined function supports RETURN (with return value) and VOID (without
return value). If parameters passed by the function are variable and unchanged
after executing the function, this is the way of passing address. The type of return
value must be consistent with of the evaluated variable
A piece of program might be used several times in scripts. You can define a
custom function to realize its function, which reduces a manual input and a program
scale, at the same time, makes modify and debug a program easily and simply.
Besides custom functions, KingView provides three preset custom functions for
convenient treatments when an alarm happens. See the chapter 9 Alarms and Events
for more detail on preset custom functions. The Active X control event functions can
be treated as user-defined functions. The names of the defined events functions will
be displayed in the contents of the user-defined functions of TouchExplorer. Editing of
these functions can only be done in the controller properties interface. Please refer to
WellinControl Technology Development Co.,Ltd
Chapter 10 Scripts In KingView
10-22
“Chapter 14: Controllers” for more inforation.10.1.6 Picture Scripts
10.1.6 Picture Scripts
Picture Scripts are one associated with a picture display. Open a picture. Select
the Edit/Picture Properties or right click the picture and select Picture Properties in
popup shortcut menu or press <Ctrl>+<W> for opening the Picture Properties dialog
box. Click the Scripts… button in the dialog box, the Picture Scripts editor appears as
the figure 10.18.
Figure 10.18 Picture Scripts editor
Picture Scripts have three options:
On startup: it is executed when open or enable or display a picture
While running: it is executed periodically when a picture is active or displayed form
WellinControl Technology Development Co.,Ltd
10-23 Chapter 10 Scripts In KingView
hide status. You can define an executing period in the editor.
On shutdown: it is executed when close or hide a picture.
Only when a picture is closed or covered by other pictures, Picture Scripts stop
executing.
Scripts only associated with a picture (such as scripts controlling animation in a
picture) can be in Picture Scripts instead of Back Scripts (as Application Scripts),
which may relieve Back Scripts and promote system efficiency.
10.1.7 Animation Link Scripts
Only click a button and other symbols in a picture to finish works what general
animation link expressions are incapable to finish. For example, click a button to
execute a series of actions or some calculations and operations. You can use
Animation Link Scripts under the circumstances. You can define animation link
scripts for the most of symbols in KingView. Put a button in a picture and double click
it. The Animation Link dialog box appears as the figure 10.19 shows.
WellinControl Technology Development Co.,Ltd
Chapter 10 Scripts In KingView
Figure 10.19 Animation Link Scripts of symbol
WellinControl Technology Development Co.,Ltd
10-24
10-25 Chapter 10 Scripts In KingView
Figure 10.20 Animation Link Scripts editor for symbol
Animation Link Scripts have three options:
Key down: it is executed when a key associated the link is down.
Key up: it is executed when a key associated the link is up.
Holding: it is executed periodically when a key associated the link is in down. You
must define an executing period in the editor.
Click any of above buttons, the Animation Link Scripts editor appears as the
figure 10.20 shows. Its usage is same as of other scripts editors.
You can define Animation Link Scripts to associate with a hotkey as the figure
10.29 shows. Click the No button in Key Equivalent and select an associated hotkey
or a key combination with <Ctrl> and <Shift>. You can press the mouse on the button
or press the hotkey in runtime.
You can define access level and security zone for the symbol with Animation
WellinControl Technology Development Co.,Ltd
Chapter 10 Scripts In KingView
10-26
Link Scripts. Only qualified user can use the symbol.
10.2 Scripts Syntax
Scripts Syntax is analogous to of C language. Each program statement ends with
semicolon. Statements should be bracketed with {} when using if…else… and while
().
10.2.1 Operator
You can connect tags or constants with operators to form simple scripts, such as
evaluating, comparing and calculating. Available operators and their priority in Scripts
are same as in expressions. Operators have the following:
~
*
Patch number, convert a integer tag to a patch
number of 2
Multiply
/
Division
%
Modular arithmetic
+
Addition
-
Subtraction (two operands)
&
Integral AND
|
Integral OR
^
Integral NOT OR
&&
Logic AND
||
Logic OR
<
Less than
>
Bigger than
WellinControl Technology Development Co.,Ltd
10-27 Chapter 10 Scripts In KingView
<=
Less than or equal to
>=
Bigger than or equal to
==
Equal to (judge)
!=
Unequal to
=
Equal to (evaluate)
Note:
You can use the following operators besides the above:
!
( )
Get in reverse, convert a positive to a negative
Logic NOT
bracket that makes calculate orderly
enhances calculating function
Operator priority;
Calculating order of operators is shown below. Operators in the same row have an
equal priority.
()
the upper priority
- (Single operand). !, ~
*, /, %
+, <, >, <=, >=, ==, !=
&, |, ^
&&, ||
=
the lowermost priority
Expression example:
Complicated expression: switch==1 Liquid High>50 && Liquid High<50
(switch1|| switch2)&&(Liquid High. alarm)
WellinControl Technology Development Co.,Ltd
Chapter 10 Scripts In KingView
10-28
10.2.2 Evaluating Statements
Syntax of evaluating statements is following:
Tag (read/write field of tags) = expression
You can evaluate a tag or a read/write field of a tag.
For example:
Auto-switch =1;
//set a switch on (1--on, 0--off)
Color =2;
//set a color black(if 2 presents a black)
Reaction tank temperature.Priority=3;
//set a Priority of Reaction tank
temperature 3
10.2.3 If-Else statement
If-Else statement executes different program by a result of expression. It can be
used in nesting format. The syntax is following:
IF(expression)
{
statements
}
ELSE
{
statements
}
Note:
If there is a statement in if-else, the {} bracket can be ignored. But statements
must be in the {} bracket. ELSE brand can be ignored.
Example 1:
WellinControl Technology Development Co.,Ltd
10-29 Chapter 10 Scripts In KingView
If (step==3)
Color= “Red”;
The above statement means that when the step tag is equal to 3,
set the color tag as “Red” (Color is a memory string tag)
Example 2:
If (export valve==1)
export valve=0;
//discrete tag export valve is set as 0
else
export valve=1;
The above statements mean set memory discrete tag export valve as a
contrary state. If-else has one statement, so {} can be ignored.
Example 3:
If (step==3)
{
color=”Red”;
Reaction temperature. Priority=1
}
else
{
color=”Black”;
Reaction temperature. Priority=3
}
The above statements mean that when step is equal to 3, set color as red (tag
color is memory string), a priority of Reaction temperature alarm as 1. Or else set
color as black, a priority as 3.
10.2.4 while ()
WellinControl Technology Development Co.,Ltd
Chapter 10 Scripts In KingView
10-30
When condition of expression in while () is true, execute a
statements in {} l circularly. Its syntax is the following:
While (expression)
}
One statement or statements (end with ;)
}
Note:
Like the IF statement, if WHIL has one statement in the {}, {} can be ignored,
bur statements in the {}, {} cannot be ignored. Please use it carefully, or it can lead
dead loop
Example 1:
While (loop<=10)
{
ReportSetCellvalue(“Real time print”, loop, 1, liquid
level of material tank)
Loop=loop+1
}
When tag loop is less than or equal to 10, add value of liquid level of material
tank to the row 1-10 of first column in a report. Must make expression of while satisfy
condition then exit a loop.
10.2.5 Noting of scripts
Noting for scripts benefits application reading, maintaining and modifying.
Noting method has two types: single row noting and multi-row noting. You can make
noting for all scripts anyplace.
Single row noting: add “//” at a beginning of noting statement.
Example 1:
WellinControl Technology Development Co.,Ltd
10-31 Chapter 10 Scripts In KingView
//set a tank speed
if(cursor scale>=10)
//judge liquid level
thank speed=80;
multi-row noting: add “/*” at a beginning of noting statement and “*/” at an
ending. It can be used in a single row noting.
Example 2:
if(cursor scale>=10)
thank speed=80;
/*judge liquid level*/
Example 3:
/*judge liquid level
change a tank speed*/
if(cursor scale>=10)
{thank speed=80;}
else
thank speed=60;
Note: don’t use multi-row noting in nesting.
10.3 Track a tag value in executing Scripts
A final result is often shown in executing scripts, so if there are errors, it is
necessary to look over debug scripts. KingView provides the function Trace() to send
some defined messages to KingMessage analogous to program debug. You can know
scripts executing process and tags changes on these messages. Trace() can be added to
anyplace in scripts and deleted when finishing debugging. See the KingView
functions guide for more details.
WellinControl Technology Development Co.,Ltd
Chapter 10 Scripts In KingView
10-32
10.4 Custom tags in scripts
Custom tags whose operator domain is current scripts are specified a type solely
in scripts and can join in calculating, evaluating and so on. Custom tags are similar
with local tags since their values disappear with finishing executing scripts. Custom
tags don’t be countered in point number of Kingview and adapted to Application
Scripts, condition scripts, data change scripts, key scripts, Custom functions, Picture
Scripts, Animation Link Scripts, Active X Event Scripts. It is very convenient for
users to make program.
Types of custom tags have BOOL, LONG, FLOAT, STRING and custom
structure. Their usage in scripts is same as of KingView tags.
Note:
1. Must define custom tags before using them
2. Custom tags have no fields but only tag value.
For example: define a structure in structure tag as the figure 10.21 shows.
Demand to design custom function to calculate upper and lower average temperatures
of material tank.
Figure 10.21 Structure tag
WellinControl Technology Development Co.,Ltd
10-33 Chapter 10 Scripts In KingView
Type of a return value of the function: FLOAT
Function name a parameter table: AverageTemperature(MaterialPot yuanliao1)
Function body:
Float averageTemperature1;
averageTemperature1=(yuanliao1.TankUpperTemperature+yuanliao1.TankLowerTem
perature)/2
return yuanliao1;
MaterialTank is a defined structure. Yuanliao1is a custom structure tag what inherits
all members of an original structure. AverageTemperature1 is a custom tag as a return.
10.5 Functions in Scripts
KingView supports built-in complicated functions what include string functions,
mathematic functions, system functions, control functions, SQL functions and so on.
See the KingView Scripts Function Guide for more details.
WellinControl Technology Development Co.,Ltd
Chapter 11 TouchView
11-1
Chapter 11 TouchView
KingView software contains three parts which are ProjectManager,
TouchExplorer and TouchView. Therein, TouchExplorer embeds WindowMaker to
generate human-computer interface project, which developed in WindowMaker can
run in TouchView. TouchExplorer and TouchView are separated. One project can be
edited and run at one time which makes project debug easy. This chapter will
introduce TouchView by its menu commands.
11.1 Configure TouchView
Before running project, running environment of TouchView should be configured
first. Click “Configure\View” command on the menu bar or “Run” button in the
toolbar or “Project list display area\System configuration\Set TouchView” button in
TouchExplorer to popup “TouchView setting” dialog box which appears as below.
WellinControl Technology Development Co.,Ltd
11-2 Chapter 11 TouchView
Figure 11.1 TouchView setting - Appearance

“TouchView appearance” properties page
You can get the definition and introduction of each item in this properties
page as below:
Maximum when startup: TouchView displays full-screen when it startup.
Minimum when startup: TouchView contracts to an icon when it startup.
Title bar text: This textbox is to input title on the title bar when TouchView
is running. If it was empty, TouchView would hide title bar and display fullscreen.
System menu: Check it to make title bar show system menu while
TouchView is running.
Minimize button: Check it to make title bar show minimize button while
WellinControl Technology Development Co.,Ltd
Chapter 11 TouchView

11-3
TouchView is running.
Maximize button: Check it to make title bar show maximize button while
TouchView is running.
Zoom-able frame: Check it to make windows zoom-able while TouchView
is running.
Display project path on title bar: Check it to make title bar show current
project directory.
Menu: Check it to make title bar show each item in this menu while
TouchView is running.
“Main window setting” properties page
Click “Main window setting” properties page to popup this page where
picture list dialog box shows all of available pictures in current application in
which selected pictures highlight. It appears as below. This page is to decide
which pictures need to open automatically when TouchView startup. If some
pictures overlap, the last loaded picture displays on the top.
WellinControl Technology Development Co.,Ltd
11-4 Chapter 11 TouchView
Figure 11.2 TouchView setting – main window setting

“Special” properties page
This properties page dialog box is to configure some special properties like
basic frequency of TouchView. Click “Special” properties page to popup a page
as below.
WellinControl Technology Development Co.,Ltd
Chapter 11 TouchView
11-5
Figure 11.3 TouchView setting - special




Basic frequency: It is a time value. All of the other items related to time (for
example, blink frequency of graphic object have “Blink” animation link, update
frequency of trend curve, running frequency of scripts) are measured by it. The
highest basic frequency is 55 milliseconds.
Updating frequency: It is to control when to update time tags ($second, $minute,
$hour and so on) while TouchView is running.
Display previous value when communication failed. It is to control IO tags in
KingView how to display on pictures when communication failed. If user
checked it, picture would show the last collected data value for “Value output”
link of IO tags in KingView pictures. Otherwise, it would show “???”.
Disable Exit TouchView: Check it to make user cannot exit program by using
“Close” button or menu after TouchView startup. However, user can use EXIT()
function to exit KingView.
WellinControl Technology Development Co.,Ltd
11-6 Chapter 11 TouchView


Disable task switch (CTRL+ESC): Check it to disable “CTRL+ESC” key so that
user can’t switch tasks.
Disable ALT key: Check it to disable “ALT” key so that user can’t use ALT key
to import menu commands.
Note:
If all of above items are checked, only inner functions “Exit(Option)” supplied by
KingView can realize exit.
 Use Virtual keyboard: After TouchView startup, when operator need keyboard
(such as inputting analog values), virtual keyboard window popup to make operator
input by clicking corresponding characters on the virtual keyboard.
 Ring when clicking touch-sensitive objects: Buzzer sounds when user click
symbols like button while system running.
 Support multi-screens display: Check it to support multi graphic cards which make
multi-monitors connect to one computer and display KingView pictures on multimonitors.
 Write triggered by changes in variables: Select this item when the acquisition
frequency is zero and Kingview is set to write variables. This will only Write when
the variable value changes and not otherwise.
 Write only when write-only variables start: For write-only variables, select this
item when Kingview is running, when write downwardly the preset values, otherwise
do not write.
11.2 TouchView menu introduction
After configuring TouchView, you can startup TouchView. Click “VIEW” button
in the tool bar or “Switch to View” command in the shortcut menu to enter into
TouchView.
WellinControl Technology Development Co.,Ltd
Chapter 11 TouchView
11-7
Figure 11.4 TouchView
Hereby introduce TouchView menu command.
11.2.1 Picture menu
Click “Picture” menu to popup dropdown menu as below.
WellinControl Technology Development Co.,Ltd
11-8 Chapter 11 TouchView
Figure 11.5 Picture menu
Select the Open command to popup Open picture dialog box which appears as
below.
Figure 11.6 Open picture
All of the unopened pictures in current path list in the dialog box. Select one or
more pictures by mouse or space. Click “OK” button to open all of the selected
pictures, or click “Cancel” button to cancel current operation.
WellinControl Technology Development Co.,Ltd
Chapter 11 TouchView
11-9
Picture\Close
Select the command to popup “Close picture” dialog box as below.
Figure 11.7 Close picture
All of the opened pictures in current path list in the dialog box. Select one or
more pictures by mouse or space. Click “OK” button to close all of the selected
pictures, or click “Cancel” button to cancel current operation.
Picture\Print setup
Select the command to popup “Print setup” dialog box. When the Printer’s
properties for printing a picture are set as shown below, such as Name of Printer, Size,
Direction, etc. TouchView will print preview or print based on these settings.
WellinControl Technology Development Co.,Ltd
11-10 Chapter 11 TouchView
Example:
Setting print direction to “Vertical” and “Horizontal” each time means snapshots
of Kingview are shown as follows:
WellinControl Technology Development Co.,Ltd
Chapter 11 TouchView
WellinControl Technology Development Co.,Ltd
11-11
11-12 Chapter 11 TouchView
Picture\Screen copy
It isn’t supported yet.
Picture\Exit (Alt+F4)
Select the command to exit TouchView.
11.2.2 Special menu
Click “Special” menu to popup dropdown menu as below.
Figure 11.8 Special menu
Special\Rebuild DDE connection
TouchView paused built DDE connection. This command is used to rebuild DDE
connection.
Special\Rebuild failed connection
Rebuild failed connection during TouchView startup. Meanwhile built DDE
connection wouldn’t be affected.
WellinControl Technology Development Co.,Ltd
Chapter 11 TouchView
11-13
Special\Restart historical alarm record
This command is to restart historical alarm record. If there is not enough disk
space, historical alarm record stops automatically. A message box appears to remind
users. In order to restart historical alarm record, users need clear some disk space
and select this command.
Special\Begin background task
This command is to startup back scripts to make it run timed.
Special\Stop background task
This command is to stop back scripts.
Special\Log in
This command is to log in users. Users can operate graphic objects with
authorization after log in. When the picture is opened in TouchView, click the
command to popup a dialog box as below.
Figure11.9 Log in dialog box
User name: Select defined user name. Click the arrow on the right of list box
to popup a list box which lists all the user names. Select the user name need to
log in. You can get details about user configuration in chapter 16 “System
WellinControl Technology Development Co.,Ltd
11-14 Chapter 11 TouchView
security management”.
Password: Input the password of selected user. If using virtual keyboard is
defined in WindowMaker, click the text box to appear a virtual keyboard. You
can input by peripheral keyboard directly as well.
Click “OK” to log in users. If error password is inputted, “Log in failed”
message will appear. Click “Cancel” to cancel current operation.
After users log in, all of graphic objects become available which have lower
access level than the login user and belong to the operator security zone.
Special\Modify password
This command is to modify the password of login operator. When the picture is
opened in TouchView, click the command to popup a dialog box as below.
Figure 11.10 Modify password dialog box
Input the current user password in the “Old password” dialog box. Input a
new password in the “New password” dialog box. Input the new password in
“Verify password” dialog box again to confirm the new password. Finally,
click “OK” to confirm changing. Click “Cancel” to cancel current operation.
Special\User configuration
This command is to reset the access level, password and security zone of users. If
WellinControl Technology Development Co.,Ltd
Chapter 11 TouchView
11-15
the access level of operator is more than or equal to 900, the command is available.
“User and security zone configuration” dialog box popup as below.
Figure 11.11 User and security zone
You can get details about how to configure user and security zone in chapter
16 “System security management”.
When the access level of operator is less than 900, this command is
unavailable and reminds user have no authorization.
Special\Log out
This command is to make current user exit login status. All the graphic objects
with password setting close to stop users access them.
11.2.3 Debug menu
Click “Debug” menu to popup dropdown menu.
WellinControl Technology Development Co.,Ltd
11-16 Chapter 11 TouchView
Figure 11.12 Test menu
Debug\Communication
This command is to show debug messages while KingView communicates with
I/O devices which contain message, succeed to read, fail to read, succeed to write,
fail to write. When users need communication information, click “Message”. Check
it to make it available so that communication information can appear in
KingMessage window while KingView communicates with I/O devices. It appears
as below.
Figure 11.13 KingMessage window
WellinControl Technology Development Co.,Ltd
Chapter 11 TouchView
11-17
Message: Show/Hide communication information in KingMessage window
while KingView communicates with I/O devices.
Succeed to read: Show/Hide information in KingMessage window about which
KingView reads data from device register success.
Fail to read: Show/Hide information in KingMessage window about which
KingView reads data from device register failed.
Succeed to write: Show/Hide information in KingMessage window about
which KingView writes data from device register success.
Fail to write: Show/Hide information in KingMessage window about which
KingView writes data from device register failed.
Debug\Script
This command is not available yet.
All the options above are available while checked.
11.2.4 Navigation menu
Click “Navigation” menu to popup dropdown menu as below.
Figure 11.14 Navigation menu
Navigation\Navigation chart
This command is to show or close navigation chart. When system running, not to
display navigation is defaulted.
WellinControl Technology Development Co.,Ltd
11-18 Chapter 11 TouchView
A small rectangle window appears on the top right of picture after clicking
“Navigation” command. The small window is navigation chart which appears as
below.
Figure 11.15 Navigation chart in TouchView
There are three ways to enable or disable navigation:
1. Use the navigation menu as mentioned above.
2. Right-click in the TouchView window, the shortcut menu shown in Figure
11.16 will popup, click “Navigation” to either enable or disable it.
Figure 11.16 Navigation shortcut menu
3. Use the function EnableNavigate (is_enable) to display Navigation.
WellinControl Technology Development Co.,Ltd
The
Chapter 11 TouchView
11-19
parameter of the function is as follows:
is_enable: Integer, value: 0 or 1.
is_enable = 1: show; is_enable = 0: do not show.
Once Navigation is turned off by calling the EnableNavigate function, it can
be displayed again by calling the function again.
The picture appeared in navigation chart is always the picture obtained by
clicking mouse cursor on it. Running picture shows the position of display window
in the whole picture which is a symbol rectangle in the navigation chart. All the
symbols in the picture are contracted symbols in the navigation chart. Alarm
window, report, KingView control and standard ActiveX control are not symbols,
but respective identifiers.
The size of navigation chart is fixed. When the proportion of picture actual size is
different from the proportion of navigation chart, left or top side is valid display
area. The moving area of mouse is among the valid area of navigation chart.
Press down the grey title bar of navigation chart and drag it. The navigation chart
can be put in any position on the screen.
You can operate picture and navigation chart interactively by mouse.
When the navigation startup, it displays current editing picture.
When you switch the pictures, such as navigation chart is in display status, its
content changes as well.
When you roll the picture, the rectangle in navigation chart displaying picture
content moves as well.
Click mouse on a point to assign a position in the navigation chart so that current
editing picture moves to the position centered in the point. The rectangle in
navigation chart displaying picture content moves as well, but the size doesn’t
change.
When needed position in the navigation chart locates in the symbol rectangle,
you should press down the left key of mouse and drag it to assigned position.
Release the key. Current editing picture moves to corresponding position.
WellinControl Technology Development Co.,Ltd
11-20 Chapter 11 TouchView
When the picture has no roll bar, the operation of display navigation chart will be
unavailable.
Navigation\Move chart
This option is to move TouchView picture. Click the right key of mouse on the
picture to popup a shortcut menu as below. “Move picture navigation chart”
command can realize moving picture function as well.
Check the command. Mouse cursor turns to small hand shape. Press down the
left key of mouse and drag it to move picture. However, mouse can’t get the focus
in this situation.
Click the command again to cancel moving picture, or right-click mouse to
cancel moving picture status.
11.2.5 About menu
Click “About” menu to popup dropdown menu as below.
Figure 11.17 About menu
This menu command is to display information about KingView copyright and
system memory. The dialog box appears as below.
WellinControl Technology Development Co.,Ltd
Chapter 11 TouchView
Figure 11.18 About KingView dialog box
WellinControl Technology Development Co.,Ltd
11-21
12-1 Chapter 12 KingMessage
Chapter 12 KingMessage
12.1 How to obtain information from KingMessage
KingMessage is an independent Windows application for logging and displaying
runtime information of TouchView and WindowMaker. Messages displayed in
KingMessage can be saved in an assigned directory as a file, or printed out for future
reference. KingMessage will start up automatically when TouchView or
WindowMaker are initialized.
When KingView system is started, KingMessage will provide information as
below:
KingView system modes: startup, close, running,
Start message and close message,
Start and close I/O device,
Network status,
Device connection status,
Error message when functions run failed in scripts.
If you want to view the communication info with device, you can select items
like Read success, Read fail, Write success or Write fail in the “Debug” menu of
TouchView. Then, messages about whether I/O variables are reading data from the
device successfully can be shown in KingMessage as well.
WellinControl Technology Development Co.,Ltd
Chapter 12 KingMessage
12-2
Below is a sample of the KingMessage window as it appears on
screen:
Figure 12.1 The KingMessage window
12.2 How to save messages in KingMessage
12.2.1 Setup saving path
Users can save KingMessage messages to the disk in *.kvl format for future
reference. Click “Setup saving path” in the Log menu to open the following dialog
box:
WellinControl Technology Development Co.,Ltd
12-3 Chapter 12 KingMessage
Figure 12.2 Log - Setup the saving path
When running KingMessage for the first time, the default saving path is the local
temporary path (C:\Windows\Temp\). Click on the “Browse…” button to change the
saving path. Once you set a new path, KingMessage will automatically create a new
message file and save all the message files on this path from now on. Each message
file should be named according to the date and time it was created at, in a
“YYMMDDHHMM.kvl” format. For example, if you save a message file at 10:29
a.m. on December30th, 2007, the name of the message file should be 0712301029.kvl.
12.2.2 Setup saving parameters
Besides setting the saving path of message file, you can set the saving parameters
as well. Click “Setup saving parameters” in the Log menu to open a dialog box as
below:
WellinControl Technology Development Co.,Ltd
Chapter 12 KingMessage
12-4
Figure 12.3 Log - Setup saving parameters



Log Saving Interval: Each message file is saved into the hard disk every
certain amount of time. The default time is 600 seconds, but it can be
changed by the user.
Log Files Keeping: This function specifies the number of days during which
the user wants to keep a message file available in the hard disk.
KingMessage will keep the messages within the user-defined holding time,
and will automatically delete the outdated message files.
Log Files Overflow: It determines the desired size of a message file to be
kept. If the file is larger than the specified size, the system will
automatically create a new file to save the remaining of the first one.
12.2.3 Save the Contents of KingMessage as txt files
A user can save the contents of the current KingMessage window as a .txt file.
Click “Save As” from the “Message” menu, as shown in Figure 12.4.
WellinControl Technology Development Co.,Ltd
12-5 Chapter 12 KingMessage
Figure 12.4 Save as
Click “Save As” to open the “Select A Message File” dialog box, which allows
you to choose the path and filename for the saved file. As Figure 12.5 shows.
Figure 12.5 Save as
WellinControl Technology Development Co.,Ltd
Chapter 12 KingMessage
12-6
Click “Save” as shown above, to create a file named messahe.txt in
the E drive.
12.3 How to view the historical log
Messages from TouchView and WindowMaker saved to the hard disk as *.kvl
files create the historical log. You can browse for saved message files by using
KingMessage. Click “Browse for a message file” in the Log menu to open the
following window:
Figure 12.6 Log – Browse for a message file
Notice: The format of the message for of earlier versions (earlier than KingView
6.0) is *.log whilst for Version 6.0 or later with the format is *.kvl, like
0212271056.kvl. A user can view a message file which is in either *.log format or
*.kvl format i.
Select a log file, and click “Open” button to open a window as shown below:
WellinControl Technology Development Co.,Ltd
12-7 Chapter 12 KingMessage
Figure 12.7 Browse for a message
Contents of the message window can be printed out as well. The Print menu will
display two options. Click “Print” to print out KingMessage contents, or “Print
Setting” to set the printing parameters.
12.4 How to print messages in KingMessage
KingMessage has two kinds of print modes: one is for printing messages in the
current window, and the other is for printing browsed historical logs. Both modes are
almost the same which sets “Print setup” first and then run “Print” command.
The following is an example of how to print messages in the current window:
 Log\Print Setup
Click “Log\Print Setup” to open the “Setup Print Parameter”:
WellinControl Technology Development Co.,Ltd
Chapter 12 KingMessage
12-8
Figure 12.8 Log – Print setup
The user must set parameters like printing range, page configuration, font,
etc. in “Setup Print Parameter” window. Notice that “Print Range” has four
modes to choose from:
1. All: Prints all the information displayed on the window.
2. From… To…: Prints messages created within the selected time interval.
3. Before: Printins messages created before the selected time.
4. After: Prints messages created after selected time.
Note: In case of time input failure, a dialog box with the legend “Check print
range” will popup.


Page setup: Choose the printer and paper.
Print font: Select a printing font.
Click “OK” to finish the print setup.
WellinControl Technology Development Co.,Ltd
12-9 Chapter 12 KingMessage
 Log\Print
Click “Log\Print” to popup “Print” window as below:
Figure 12.9 Log - Print
Define printer parameters like properties, layout, copies by “Print” window.
Click “Print” button to print.
Print browsed historical logs following the same method as described above.
12.5 Using other menus of KingMessage
12.5.1 View menu
Users can select from various fonts, styles, sizes and colors for the KingMessage
WellinControl Technology Development Co.,Ltd
12-10
Chapter 12 KingMessage
contents to appear in. Click “View\Font” to open the “Font” dialog box.
Figure 12.10 View menu
Click “Display Font”, to open the “Font” dialog box, as shown in Figure 12.11.
Figure 12.11 Font
12.5.2 About menu
Click “About KingMessage” in the “About” menu to open information about
KingMessage, as below:
WellinControl Technology Development Co.,Ltd
12-11 Chapter 12 KingMessage
Figure 12.12 About dialog box
12.5.3 System menu
The system menu is located on the left top of KingMessage, as appears below:
Figure 12.13 KingMessage - System menu
Right-click “System menu” on the left top of KingMessage to open a dropdown
menu as follows.
WellinControl Technology Development Co.,Ltd
Chapter 12 KingMessage
12-12
Figure 12.14 KingMessage System menu
Click “Always on the top” to display KingMessage in front of all other Windows
applications. To cancel this action, repeat the steps as follows.
Figure 12.15 KingMessage System menu
Click “Always on the top” to display KingMessage in front of all other Windows
applications.
Note: When KingMessage is minimized on the Start menu bar of Windows
Operation System (as appears below).
Figure 12.16 Icon of KingMessage
WellinControl Technology Development Co.,Ltd
12-13 Chapter 12 KingMessage
Right-click on the KingMessage icon to open up a system menu like this:
Figure 12.17
WellinControl Technology Development Co.,Ltd
Chapter 13 Wizards
13-1
Chapter 13 Wizards
13.1 Wizards
Wizards are a symbols combination made by KingView. Its each member is
called as a symbol wizard.
It has at least three advantages to use Wizards to develop project interfaces: first,
reducing hardness of designing interfaces and making engineers concentrate more on
maintain database and enhancing software logical control to shorten developing
period. Second, making software uniform appearance that is convenient for studying
and mastering. Third, engineers can build own wizard elements taking advantage of
wizards opening for decreasing investment.
KingView provides a Wizards Manager for using easily which integrates
operations of managing wizards. You can finish New Wizard, Modify Wizard Name,
Load User Wizard and Delete Symbol Wizard in uniform interface as the figure 13.1.
WellinControl Technology Development Co.,Ltd
13-2 Chapter 13 Wizards
Figure 13.1 Wizards manager
13.2 Symbol Wizard
The reason that elements in Wizards are called Symbol Wizard is that they have
own life. Symbol wizard is similar with combo symbol in appearance but has rich
animation link and logical control inside it. As long as engineers place it on a picture
and modify a little text, they can dynamically control a symbol appearance and finish
complicated functions.
You can make some complicated shapes form a Symbol Wizard for repeated use
as required and add them in a Wizards Manager. KingView provides two ways for
user to build custom wizards. One, making program, that is a user takes development
toolkit provided by WellinControl Company, uses VC developing tool and Wizard
WellinControl Technology Development Co.,Ltd
Chapter 13 Wizards
13-3
Comment Text in WindowMaker to make *.dll file. See the wizard development
toolkit of WellinControl Company on the way for more detail. Other, a user creates
animation link and combines symbols to build Symbol wizard directly.
The chapter will introduce the second way in detail.
For example, need a button that means a switch. When the switch is on, the
button becomes green, when off, red. And it can be defined as “Set”, “Reset” or
“Switch”. If you have no Wizards, you need to create it. So you firstly draw a green
and a red button. Then connect them with a tag and set their hide properties. Finally
overlap them. That is a button wizard. In face as long as you copy Button Wizard from
Kingview Wizards to a picture, you can realize a button of on is green and off is red.
You can also change a button color, type and function.
symbol wizard
Cells forming symbol wizard
Figure 13.2 Symbol wizard forming
Each symbol wizard in Wizards has almost similar defined animation link, so
using a symbol wizard leads increasing greatly efficiency. For example, first way has
a wizard function of controlling automatically a symbol appearance. Double click a
shape of the type, Guide dialog box appears similar with the figure 13.3.
WellinControl Technology Development Co.,Ltd
13-4 Chapter 13 Wizards
Figure 13.3 Animation link of symbol wizards by making program
All symbol wizards in system wizards of Kingview are made on the way.
Symbol wizards made on second way have Property Definition. Double click a
shape of this type, a Wizards appears similar with the figure 13.4.
WellinControl Technology Development Co.,Ltd
Chapter 13 Wizards
13-5
Figure 13.4 Properties of symbol wizard created by animation link
You can change a symbol wizard in any size.
13.3 Creating Symbol Wizard
Refer to Wizards development toolkit of WellinControl Company for more detail
of the first way to create symbol wizard. This section introduces the second way. Take
a on-off switch for example, introduce how to create symbol wizard:
1. Create tow buttons on a picture, the text of one button is substituted as “On”,
other is as “Off”.
2. Define a memory discrete tag in tagname dictionary as OnOff.
3. Add animation link. Double click the “On” button and select Hind Link then
type OnOff==1 and click OK as the figure 13.5 shows.
WellinControl Technology Development Co.,Ltd
13-6 Chapter 13 Wizards
Figure 13.5 Hide link
Select Connect while Key up and type OnOff==0 then click OK as below.
Figure 13.6 Button animation link
WellinControl Technology Development Co.,Ltd
Chapter 13 Wizards
13-7
Similarly, Double click “Off” button and select Hind Link then type OnOff==0
and click OK button.
4. Make cells. Place two buttons together with Off on top. Select two buttons
then click Make Cells icon in toolbox as the figure 13.7 shows.
Figure 13.7 Combine cells
5. Following the above steps, you have already a symbol wizard. Select menu
Wizards\Create Symbol Wizard, the figure 13.8 appears.
Figure 13.8 Enter symbol name
WellinControl Technology Development Co.,Ltd
13-8 Chapter 13 Wizards
6. Type a Wizard name and click OK, Wizard Manager appears. Select wizards
where you want to save the symbol wizard in at the left of Wizard Manager
then click at the right of the manager, so you finish it. For example, place the
button of changing colors in custom special wizards as the figure 13.8 shows.
Figure 13.9 Custom symbol in Wizards manager
13.4 Using Symbol Wizard
If Wizard Manager is hidden in developing, you can select the menu
Wizards\Open or press F2 to activate the manager.
1. Place a symbol wizard on a picture.
Placing it is very easy. Double click a symbol wizard that you want to place
in Wizard Manager window (if Wizard Manager is not visual, press F2 to
activate it). Then the mouse becomes a right-angle shape. You move the
mouse to a right position and left click, so the symbol wizard is copied in a
picture. The method of moving, zooming a symbol wizard is similar with one
WellinControl Technology Development Co.,Ltd
Chapter 13 Wizards
13-9
of a cell.
2. Modify a symbol wizard
Symbol wizard made on the first way has a personal appearance. Double
click a symbol wizard in a picture, the Property Wizard dialog box for
modifying appearance and defining animation appears. The box has options
of appearance, action, access level and tag linked animation to set. Different
symbol wizards have different interface of Property Wizard. As long as you
type a tag name and adjust options setting, you can design personal shapes.
Figure 13.10 Symbol by making program - button
Tag in Property wizard is asked to type a practical tag name. The tag must be
defined in database. You can click the ? button to reduce text input, select a tag in
popup Tag Select dialog box. Note that a tag in Tag must have defined tag type
according with a symbol wizard.
Symbol wizard made on the second way has changeable property interface.
Double click symbol wizard, Substitute dialog box for animation link appears. There
WellinControl Technology Development Co.,Ltd
13-10 Chapter 13 Wizards
are all animation links and all used tags in links in the box. Click Tag Name, all tags
used by symbol wizards are listed in the box. Click Animation Link, you can see
comments of animation link.
Figure 13.11 Animation link of switch
Any tag name used by the symbol wizard almost shows the meaning but is not
always adapted to request of engineers. If you want to change tag name, select the Tag
Name button then double click a tag name that you want to modify in the dialog box.
The Substitute Tags appears as the following figure shows.
WellinControl Technology Development Co.,Ltd
Chapter 13 Wizards
13-11
Figure 13.12 Substitute tag dialog box
Type a tag name that you wish in the dialog box. A tag must be defined in
tagname dictionary. You can click the ? button to reduce text input, select a tag in
popup Tag Select dialog box. Note that the type of new tag must be same as of
original tag, or else a system prompts:
Figure 13.13 Error prompt
When you change all tag names in all animation links of symbol wizard, you can
modify any animation link by own request. Click the Animation Link button in
Substitute then double click a column that you want to modify. The Animation Link
dialog box appears:
WellinControl Technology Development Co.,Ltd
13-12 Chapter 13 Wizards
Figure 13.14 Animation link
The setting of animation link of symbol wizard is same as of general symbol.
If composing parts of symbol wizard include a text, the “Static Text” button of
Substitute is highlighted. Click ? button, all static texts in a symbol wizard are
displayed in the dialog box. Modifying method is same as other symbols.
Finish modifying and click OK to modify animation link of symbol wizard. Or
click Cancel to cancel changes.
If you want to adjust a symbol in symbol wizard, you must firstly convert symbol
wizard to general symbol. Select a symbol wizard (8 small boxes around it) and select
the menu Wizards\Convert to General Symbol. So symbol wizard is divided into
many cells and symbols. For those cells, you can select the Break Cell icon in toolbox
to break down them into symbols. Then you can do any change on them.
WellinControl Technology Development Co.,Ltd
Chapter 13 Wizards
13-13
Symbol wizard
Cells after breaking symbol wizard
13.5 Managing Wizards
Managing wizards is based on Wizards Manager to realize. A Wizards Manager
integrates operations of managing wizards. You can finish New Wizard, Modify
Wizard Name, Load User Wizard and Delete Symbol Wizard in uniform interface
If Wizard Manager is hidden in developing, you can select the menu
Wizards\Open Wizards or press F2 to activate the manager.
Select Open Wizards menu, the Wizard Manager appears as the figure 13.15
shows.
Figure 13.15 Wizards manager
Manager menu bar: managing wizards by popup menu.
Manager tool bar: managing wizards by shortcut icon.
Wizards Display area: all wizards in the manager.
Symbol wizard display area: all symbol wizard in a wizard.
WellinControl Technology Development Co.,Ltd
13-14 Chapter 13 Wizards
13.5.1 File
File\Close: Click the File menu in the manager as the figure 13.16 shows.
Figure 13.16 File menu
It is for closing the manager. If Wizard Manager is hidden in developing, you can
select the menu Wizards\Open or press F2 to activate the manager.
13.5.2 Edit
Click the Edit menu in the manager as below.
Figure 3.17 Edit menu
Edit\Create New Symbol Wizard: Click Create New Wizard, the following
dialog box appears.
WellinControl Technology Development Co.,Ltd
Chapter 13 Wizards
13-15
Figure 13.18 Define new wizard
Type the name in the dialog box. A name is less than 8 characters (4 Chinese
characters). Click OK button, you can see a wizard name in the left of manager.
Figure 13.19 New wizard – Special
Edit\Modify Symbol Wizard Name: Select a wizard name at the left and click
Change Wizard Name. The following dialog box appears.
WellinControl Technology Development Co.,Ltd
13-16 Chapter 13 Wizards
Figure 13.20 Rename wizard
Type a new name (must be different with existing wizard). For example, change
Special Wizard as Especial Wizard as the following figure 13.21 shows.
Figure 13.21 Wizard after rename
Edit\Delete Symbol Wizard: Select a symbol wizard that you want to delete and
click Delete Symbol Wizard. The following figure 13.22 shows.
WellinControl Technology Development Co.,Ltd
Chapter 13 Wizards
13-17
Figure 13.22 Delete prompt
Click OK button.
Edit\Load User’s Symbol Wizard: when you use wizard development toolkit to
make a special shape (a file type is *.dll), you can select the item to add your
shape into Wizards Manager. Click Load User Symbol Wizard, the dialog box
appears as the following figure 13.23 shows.
Figure 13.23 Import wizard
The menu is only valid for symbol wizard made by first way.
WellinControl Technology Development Co.,Ltd
13-18 Chapter 13 Wizards
Symbol Wizard File Name: Click
button to load wizard name. You can
select symbol wizards in a system and the files (*.dll) made by users. Both are
saved in the Dynamos path of current path that is system default one. Click the
button, all dll files under the Dynamos path are displayed, you can select any one.
Number of Symbol Wizard: Wizards application may include many symbol
wizards. Each symbol wizard has a serial number what is from 0. Select the Load
All Symbol Wizards options, you can load all symbol wizards in the wizards
once. For example, loading user-defined pump.
Click
button in the dialog box, the Open dialog box appears as the figure
13.24 shows.
Figure 13.24 All wizard files in Dynamos path
Select a wizard name that you want to load and specify an index for it as the
figure 13.25 shows.
WellinControl Technology Development Co.,Ltd
Chapter 13 Wizards
13-19
Figure 13.25 Import fifth wizard in Pump.dll
Click OK, then the cursor becomes L-shape. Select a wizard and click in the
right of Wizard Manager.
13.5.3 Toolbar
The toolbar is at the upper left of Wizards Manager. You can use shortcut icons to
manage the manager. The following figure is the toolbar.
New Wizard: has same function with Edit\Create New Wizard menu in
Project Manager.
WellinControl Technology Development Co.,Ltd
13-20 Chapter 13 Wizards
Modify Wizard Name: has same function with Edit\Change Wizard Name
menu.
Load User Symbol Wizard: has same function with Edit\Load User
Symbol Wizard menu
Delete Symbol Wizard: has same function with Edit\Delete Symbol Wizard
menu.
13.6 Convert Symbol Wizard to General Symbol.
If you want to change a property of symbol wizard such as color, you can convert
symbol wizard to general symbol.
1. Select a symbol wizard and drag it on a picture. For example, light_7 in the
special wizard.
2. Select the symbol wizard then select Wizards\Convert Symbol Wizard to General
Symbol in the menu of WindowMaker as the following figure shows.
WellinControl Technology Development Co.,Ltd
Chapter 13 Wizards
13-21
3. Select the Break Cell icon in toolbox then select light_7 as the following figure
shows.
4. Move the mouse and separate light_7 as shown:
5. If you want to continue to break, select symbol and select the Break Combo
Symbol icon to break.
Note:
When a symbol wizard making by program is converted general symbols,
animation links of these symbols disappear. But a symbol wizard making by
KingView symbols is converted general symbols, animation links of these symbols
exist.
13.7 Wizards Development Toolkit
WellinControl Company provides KingView Develop Tools (includes Wizards
development toolkit) for that you can develop wizards yourselves. You can make a
symbol wizard of DLL type by making program. Contact with WellinControl
Company or its branch for more detail of the development toolkit.
When developing a symbol wizard with the development toolkit, you need to
describe symbol appearance and properties with program. KingView provides the
Wizard Description tool in WindowMaker for convenience.
WellinControl Technology Development Co.,Ltd
13-22 Chapter 13 Wizards
Wizard Description is a text file describing a symbol made by KingView drawing
tools and includes line type, color, animation link, access level and scripts of symbols.
It is analogous text to C Language. You can use it to make own symbol wizard by C or
other program languages. The method is following:
1. Draw a symbol and make necessary animation link as below. Create a small
rectangle and an ellipse. Define color as transition and animation link of the
ellipse as Rotate, connected tag as integer “Rotate”.
Figure 13.26 Create symbol and animation link
2. Select a symbol or symbols that you want to describe. Select the menu
Wizards\Create Wizard Description, a system shows Create Wizard Description.
Select all created objects in the example and click the Create Wizard Description
command.
The following is wizard description in the example:
WellinControl Technology Development Co.,Ltd
Chapter 13 Wizards
/* Draw rectangle */
{
DRAWRECT graphic;
graphic.x1 = 0 * fact;
graphic.x2 = 7 * fact;
graphic.y1 = 56 * fact;
graphic.y2 = 64 * fact;
graphic.brushColor = 255;
graphic.brushStyle = 0;
graphic.brushHatch = 0;
graphic.fillStyle = 21;
graphic.fromColor = 255;
graphic.toColor = 10079487;
graphic.penColor = 65535;
graphic.penStyle = 0;
graphic.penWidth = 1;
KVDrawRoundRect( &graphic);
}
/* Draw ellipse */
{
DRAWRECT graphic;
graphic.x1 = 0 * fact;
graphic.x2 = 7 * fact;
graphic.y1 = 0 * fact;
graphic.y2 = 61 * fact;
graphic.brushColor = 255;
graphic.brushStyle = 0;
graphic.brushHatch = 0;
graphic.fillStyle = 3;
WellinControl Technology Development Co.,Ltd
13-23
13-24 Chapter 13 Wizards
graphic.fromColor = 255;
graphic.toColor = 10079487;
graphic.penColor = 65535;
graphic.penStyle = 0;
graphic.penWidth = 1;
KVDrawEllipse( &graphic);
}
/*Set animation link as Rotate */
{
LINKROTATE links;
links.minVal = 0.000000;
links.maxVal = 100.000000;
links.minAngle = 0;
links.maxAngle = 360;
links.CenterPt.x = 0;
links.CenterPt.y = 96;
char Express[14];
strcpy(Express,"\\Local\Rotate");
links.pExpress = Express;
KVLinkRotate( &links);
}
If a symbol has security restrict, for example, when you define animation link,
you define priority or security zone, these messages can be indicated in Wizard
Description.
Wizard Description brings convenience and help for users to make symbol
wizard, and avoid some errors at programming. See KingView development toolkit
for more detail.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-1
Chapter 14 Control
14.1 Introduction to control
14.1.1 What is control
Control is actually a reusable object to execute special assignment. Each control
is actually a minimize program but not an independent application. It controls the
appearance and behavior by property and method of control. It accepts input and offer
output. For example, drop combo box of Windows operation system is a control. By
setting properties, you can define size of combo box, font type of display text and
color. KingView control (like bar graph, temp-control curve, X-Y curve) is a small
program which can supply various properties and scripts to complete variety of
special functions.
14.1.2 Functions of control
Control looks like complex symbol and engineers only need put it on the picture.
Configure properties of control to connect corresponding functions. Then control can
WellinControl Technology Development Co.,Ltd
14-2 Chapter 14 Control
finish complex functions.
When the function need complex scripts or can’t be finished, you can use control.
Main program only need offer input to control, controls deal with other complex work.
Main program needn’t pay attention to the process, control only needs to offer output.
Additionally, reusability of control is convenient as well. For example, put several 2-D
bar charts on the picture to express the changing conditions of various tags. No bar
chart control exists. You need draw several rectangle frames by the toolbox, define fill
links for them with one tag corresponding to one rectangle frame. Finally, you can get
a bar chart control. If you want to use bar chart control directly, you need copy bar
chart control to the picture and set its properties and link its scripts for realizing the
changing situation of different tags by 2-D bar chart or 3-D bar chart.
All in all, using control can improve the efficiency of project exploiting and
project running.
14.1.3 Control supported by KingView
KingView supplies many embedded controls, such as list box, option button, bar
chart, temp-control curve, video control, etc. These controls only can be called in by
main program of KingView. They are realized by correlative control functions or
connected tags. The using method is as below.
ActiveX control is used widely following the coming of ActiveX technology.
KingView supports ActiveX control correlative to its data type. They contain
Microsoft Windows standard control and any custom standard ActiveX control which
are called “General control”. Details about how to use ActiveX control can be seen in
the section 14.3.
Note:
When you use functions, properties and methods of controls in TouchView, you
should open picture with controls. Otherwise, the operation would fail. At this time,
a message will appear in KingMessage.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-3
14.2 Embedded control of KingView
Embedded control of KingView is a kind of control only can be used in
KingView program. It can realize functions of control. KingView operates control to
obtain output result by embedded control functions and linked tags. Other programs
can’t acquire KingView embedded control. They contain: temp-control trend, list box,
option button, text box, super-text box, AVI player control, video control, ODBC
query control, historical trend control, etc. Load embedded control in KingView. Click
“Insert control” button in toolbox.
Figure 14.1 Toolbox – Insert control
or select “Edit/Insert control” menu in WindowMaker. “Create control” dialog box
appears as below.
WellinControl Technology Development Co.,Ltd
14-4 Chapter 14 Control
Figure 14.2 Create control dialog box
Embedded control types are listed in “Type” list on the left side of dialog box.
Select each of them to get corresponding controls of this type in content displaying
area on the right side. Select the control icon. Click “Create” button to create control.
Click “Cancel” button to cancel creating.
14.2.1 Temp-control curve control
Temp-control curve responses to the situation of changing of actual value
according to settled change of curve. In temp-control curve, Y axis stands for
temperature. X axis relates to the change of time. Every sample point appears on the
curve. Two cursors are supplied in TouchView as well. When you put cursor on a
certain sample point, the comment value of the sample point will appear. It can be
used to control temperature, control flow rate and etc. You can see details about how
to use it in chapter 8 “Trend and other curve”.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-5
14.2.2 List box and combo box control
You can load data items dynamically in the list box. When you need data, you
can select from list box directly to obtain data from related tags. Combo box is the
composition of text box and list box. You can select data items directly from the list
box of combo box, or you can input data directly from the text box of combo box. The
list box and combo box contain following formats: list box, simple combo box, drop
combo box, dropdown list combo box. Although they have different appearances, the
operation and using method are the same. The data items of list box and combo box
can be added or edited dynamically by functions supplied by KingView, or you can
load from files (list box in .csv format) directly.
14.2.2.1 How to create list box control
You must follow:
 Click “Insert control” button in the toolbox as below, or you can select
“Edit/Insert control” menu in WindowMaker. “Create control” dialog box popup
as below.
 Select “Window control” from type list. Select “List box” icon on the right
content. Click “Create” button in the dialog box or double-click “list box” icon to
close dialog box. The mouse cursor turns to “+” shape. Click the left key of
mouse on any position need insert control on the picture and drag it to form a
rectangle. It means the size of control interface. Release the mouse key to display
picture on the screen. Move mouse on the small rectangles with arrow around
control. When the mouse cursor turns to arrow, drag the left key of mouse to
change the size of control. When the mouse turns to double “+” shape, drag the
left key of mouse to change the position of control.
WellinControl Technology Development Co.,Ltd
14-6 Chapter 14 Control
Figure 14.3 List box control
List box control on the picture is similar with common rectangle symbol on the
appearance, but different on animation link and running environment.
14.2.2.2 Setup properties of list box control
Before using list box control, you need setup control properties first, including
setup control name, related tag, access level and so on.
 Right-click list box control to popup floating menu as below.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-7
Figure 14.4 Floating menu
Select menu command “animation links” to popup “List box control properties”
dialog box, or double-click list box control to popup “List box control properties”
dialog box as below.
Figure 14.5 List box control properties
WellinControl Technology Development Co.,Ltd
14-8 Chapter 14 Control
Control name: define the name of control. One list box control has one unique
control name. It can’t be repeated. Naming control should accord with the
naming rule of KingView.
Tag name: it assigns the tag related to current list box control. The tag is a string
tag defined in Tagname Dictionary.
Access level: Setup the access level of the list box. It changes from 1 to 999.
Order: The contents of list box order in alphabet sequence when it’s available.
Click “Ok” button to close dialog box after definition of list box properties.
14.2.2.3 How to use list box control
Some operations like add, edit, get or delete for data items of list box control can
be realized by list box control functions. Hereby are functions of list box control.
 listLoadList(“ControlName”, “Filename”)
The function is to load the list items in the file “Filename” in CSV format to
assigned list box control “ControlName” and replace the old list item in the list
box. List box only displays the names of list items (string message), doesn’t
display related data value.
 listSaveList(“ControlName”, “Filename”)
The function is to save the list items in the file “Filename” in CSV format to
assigned list box control “ControlName”. If it’s not available, you can create it
directly.
 listAddItem(“ControlName”, “MessageTag”)
It’s to add defined list box string message “MessageTag” to assigned list box
control “ControlName” and display it. KingView sets added string message as an
item in the list box ---Item and define an index number ---ItemIndex for the
member item automatically. ItemIndex starts from 1 and ascends 1 automatically.
 listClear(“ControlName”)
It’s to clear all the list items in assigned list box control “ControlName”.
 listDeleteItem(“ControlName”, ItemIndex)
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-9
It’s to delete list item with ItemIndex as index number in assigned list box
control “ControlName”.
 listDeleteSelection(“ControlName”)
It’s to delete selected list items in assigned list box control “ControlName”.
 listFindItem(“ControlName”, “MessageTag”, IndexTag)
It’s to find the index number corresponding to defined string message in assigned
control “ControlName” and send to integer tag IndexTag.
 listGetItem(“ControlName”, ItemIndex, “StringTag”)
It’s to obtain the string message of list item with ItemIndex as index number in
assigned control “ControlName” and send to string tag StringTag.
 listGetItemCount("ControlName")
This function is used to show the quality of the “ControlName” list.
 listGetCurSel("ControlName")
This function is used to show the ID number (starting from 0) for each item in
the “ControlName” list. -1 means no item has been selected.
 listSetCurSel("ControlName",ItemIndex)
This function is used to set the items of the ItemIndex in the list as the current
selected items. The returned data is the index number (starting from 0) for the current
selected item. If the returned data is -1, the setting has been unsuccessful (ItemIndex
is either negative or exceeds the number of items).
 listGetItemData(“ControlName”, ItemIndex, NumberTag)
It’s to obtain the data value of list item with ItemIndex as index number in
assigned control “ControlName” and send to integer tag NumberTag.
 listInsertItem(“ControlName”, ItemIndex, “StringTag”)
It’s to insert string message StringTag to assigned position with ItemIndex as
index number in assigned control “ControlName”. If ItemIndex=-1, string message
StringTag is inserted to the end of list item.
 listSetItemData(“ControlName”, ItemIndex, Number)
It’s to set the value of tag Number to the list item with ItemIndex as index
number in assigned control “ControlName”.
WellinControl Technology Development Co.,Ltd
14-10 Chapter 14 Control

listLoadFileName(“CtrlName”, “*.ext”)
It’s to show the filename like “*.ext” to the list box of assigned control
“ControlName”. Details can be seen in <KingView function manual>.
Example 1: Create a dynamic list for adding data to list box. After adding, you
need save list as a file. File can be saved to current project path (like D:\Test) for
later using. You can load list information from file when you need it.
Define tag “DataItem” string tag in Tagname Dictionary. Create list box
control on the picture. Define control properties as below.
Figure 14.6 Setup list box properties

Create three buttons on the picture. The functions of button and scripts of
animation links are:
Button 1---“Add”: add data item:
listAddItem(“List 1”, list data);
Button 2---“save”: save content of list box:
listSaveList(“List 1”, “D:\Test\list1.csv”);
Button 3---“load”: load content of assigned .csv file to list box:
listLoadList(“List1”, “D:\Test\list1.csv”);
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-11
Figure 14.7 Create list box and buttons


Create a text symbol on the picture. Define animation link as string input
and string output. The connected tag is “DataItem”.
Save the picture and switch to TouchView. Input the string value of data
item in text symbol, like “Dataitem1”. Click “Add” button to add tag to the
list box.
Figure 14.8 Add item to list box

You can add several data items to list box according to above method. When
you select a certain item in the list box. Tags related to list box can get the
string value of current selected data item automatically.
WellinControl Technology Development Co.,Ltd
14-12 Chapter 14 Control
Figure 14.9 Select items in list box


Click “Save” button to save data item in the list box.
Click “Load” button to load data need to be saved in the list box. Old list
data should be loaded to current list box.
Example 2: List the file name with “.exe” as extension name in assigned path
(C:\Program Files\KingView) to the list box. You can use this function in the
script: ListLoadFileName(). The operation method is:
 Add a button on the picture. Define it as “.EXE” as below. Double click the
button and define the animation link—script link—on key up:
ListLoadFileName(“List1”, “C:\Program Files\KingView\*.exe”);
Figure 14.10 Add a button

Save the picture and switch to TouchView. Click the button to list all the
files with “.exe” as extension name in assigned path to list box as below.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-13
Figure 14.11 Result while running
14.2.2.4 How to use combo control
You can use the same method to create combo box and list box. Combo box is
composed of list box and text box. Combo box has three types: simple combo box,
drop combo box and dropdown list combo box. The definition of properties of combo
box is the same as list box.
Figure 14.12 Simple combo boxes
Simple combo box:
 After creating simple combo box, the size of the list box is fixed. When list item
is beyond the list box display, list box will load vertical scroll bar automatically.
Move mouse cursor to edit box of text. You can input data items excluding
current list directly.
WellinControl Technology Development Co.,Ltd
14-14 Chapter 14 Control
Figure 14.13 Drop combo box
Drop combo box:
 After creating drop combo box, the edit box of text is invalid which stands for
adding data is disabled. When users click the edit box of text in TouchView, list
box will popup. Click dropdown arrow to popup list box. Generally, the list box
of drop combo box is hidden, unless click the edit box of text or dropdown arrow.
It means you can only select data items from list.
Figure 14.14 Drop combo box
Drop combo box:
 Drop combo box has both simple combo box and drop combo box functions.
Generally, the list box of drop combo box is hidden. After clicking dropdown
arrow, list box will popup. After selecting data items, list box will auto-hide. You
can input data items directly in the text box of drop combo box.
In the simple combo box control and list box control, when the character string is
entered into the text box, the value of the character string will change according to the
control. For example, set the simple combo box control, the attributes are shown in the
picture below: when the character string is entered in the text box, the tag value “data
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-15
option” will be change accordingly.
The operation of combo box is realized by functions as well. It’s totally the same
as list box. You can get details in the section 14.2.4.3.
14.2.3 Check box control
Check box control is to operate discrete tag, like controlling various switches,
making selections for multi-selecting options, etc. Check box is to connect a tag by a
control which the change of value can’t be affected by other controls of same type.
When the control is checked, tag sets to 1. When the control isn’t checked, tag sets to
0.
14.2.3.1 How to create check box control
Click “Insert control” button in the toolbox as below, or you can select
“Edit/Insert control” menu in WindowMaker. “Create control” dialog box popup as
below. Select “Window control” from type list. Select “Check box” icon on the right
content. Click “Create” button in the dialog box or double-click “Check box” icon to
close dialog box. The mouse cursor turns to “+” shape. Click the left key of mouse on
any position need insert control on the picture and drag it to form a rectangle. It means
the size of control interface. Release the mouse key to display picture on the screen.
Move mouse on the small rectangles with arrow around control. When the mouse
WellinControl Technology Development Co.,Ltd
14-16 Chapter 14 Control
cursor turns to arrow, drag the left key of mouse to change the size of control. When
the mouse turns to double “+” shape, drag the left key of mouse to change the position
of control.
Figure 14.15 Check box control
14.2.3.2 Setup properties of check box control
Before using check box control, you need setup control properties first. Doubleclick control on the picture to popup “Check box properties” dialog box as below.
Figure 14.16 Properties of check box
Check box control properties:
 Control: define the name of control. One list box control has one unique
control name. It can’t be repeated. Naming control should accord with the
naming rule of KingView, such as “switch”.
 Tag name: it assigns the tag related to control. It’s usually a discrete tag, like
“switch”. When it’s checked, the value of the tag is 1, otherwise, its 0.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-17

Access: Setup the access level of control. It changes from 1 to 999. After
defining access level, only authorized users can operate the control while
running. Otherwise, the value of control can’t be edited, like 100.
 Caption: The text for showing tip or expression of control on the picture,
like “Power switch”.
The complete control appears as below.
Figure 14.17 Check box definition and result
14.2.3.3 How to use check box control
Check box control has no scripts function. You only need use tags in “Setup
control” dialog box. Control property is related to tag as below.
For example, control a switch by check box control.
 Create check box control on the picture. The control property appears as
below.
 Create a text symbol on the picture. Define animation link for text---discrete
output animation link as below. Tag of animation link is tag “switch” related
to control.
 Save the picture and switch to TouchView.
WellinControl Technology Development Co.,Ltd
14-18 Chapter 14 Control
Figure 14.18 Create animation link
Click the check box control in TouchView. The change of tag value and the
change of control selecting relation appear as below.
Figure 14.19 Check box values in TouchView
Besides of above methods, check box can be used as a condition option as
well, like multi-selecting option.
14.2.4 Edit box control
It’s used to input text string and send to assigned string tag. No virtual keyboard
or other dialog boxes appeared while inputting.
14.2.4.1 How to create edit box control
Click “Insert control” button in the toolbox, or select “Edit/Insert control” menu
in WindowMaker. “Create control” dialog box popup as below. Select “Window
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-19
control” from type list. Select “Edit box” icon on the right content. Click “Create”
button in the dialog box or double-click “Edit box” icon to close dialog box. The
mouse cursor turns to “+” shape. Click the left key of mouse on any position need
insert control on the picture and drag it to form a rectangle. It means the size of
control interface. Release the mouse key to display picture on the screen. Move mouse
on the small rectangles with arrow around control. When the mouse cursor turns to
arrow, drag the left key of mouse to change the size of control. When the mouse turns
to double “+” shape, drag the left key of mouse to change the position of control.
Figure 14.20 Edit box
14.2.4.2 Setup properties of edit box control
Before using edit box control, you need setup control properties first. Doubleclick control on the picture and right-click on the control. Select “Animation links”
scripts on the popup shortcut menu to popup control properties dialog box as below.
WellinControl Technology Development Co.,Ltd
14-20 Chapter 14 Control
Figure 14.21 Editbox control properties
Edit box control properties:
Control: define the name of control. One list box control has unique control
name. It can’t be repeated. Naming control should accord with the naming
rule of KingView.
Tagname: it assigns the tag related to edit box control. It’s a string tag
defined in Tagname Dictionary.
Access: Setup the access level of control. It changes from 1 to 999.
Style: define the style of edit box control which contains:
 Multi-line character: allow to display several lines characters in edit
box which is usually used with “newline acceptance”.
 Show password: When you input characters to edit box, actual
characters can’t be displayed. It displays “*”.
 Newline acceptance: When you input characters in the edit box, you
can input to a new line in the edit box after pressing enter key. It is
usually used with “Multi-line display”.
 All uppercase: When you input English words in edit box, they are
converted to uppercase no matter uppercase or lowercase.
 All lowercase: When you input English words in edit box, they are
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-21
converted to lowercase no matter uppercase or lowercase.
14.2.4.3 How to use edit box control
Edit box control has no scripts function. You only need to define the connection
between its property and string tag. Because the maximum string length is 127 bytes,
KingView edit box control only accepts 127 characters. You can input characters or
password on the picture directly.
For example: Inputted characters on the picture need to be shown as “*” like
password inputting.
 Create edit box control on the picture. Define string tag---“password” in
KingView.
 Define control properties as below. Select “Passwordinput” in “Style” option.
Click “OK” button after definition. Close the dialog box. Save the picture and
switch to TouchView.
Figure 14.22 Define edit box properties

Open the picture in TouchView. Input characters in the edit box as below.
Inputted characters appear as “*” and actual content is invisible.
WellinControl Technology Development Co.,Ltd
14-22 Chapter 14 Control
Figure 14.23 Password display
14.2.5 Radio button control
You can realize multiple-choice-one by using radio button. Radio button control
is actually a group of option buttons. You can only select one option from one group.
14.2.5.1 How to create radio button control
Click “Insert control” button in the toolbox as below, or select “Edit/Insert
control” menu in WindowMaker. “Create control” dialog box popup as below. Select
“Window control” from type list. Select “Radio button” icon on the right content.
Click “Create” button in the dialog box or double-click “Radio button” icon to close
dialog box. The mouse cursor turns to “+” shape. Click the left key of mouse on any
position need insert control on the picture and drag it to form a rectangle. It means the
size of control interface. Release the mouse key to display picture on the screen. Move
mouse on the small rectangles with arrow around control. When the mouse cursor
turns to arrow, drag the left key of mouse to change the size of control. When the
mouse turns to double “+” shape, drag the left key of mouse to change the position of
control.
Figure 14.24 Radio buttons
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-23
14.2.5.2 Setup properties of radio button control
Before using radio button control, you need setup control properties first.
Double-click control on the picture or right-click on the control. Select “Animation
links” scripts on the popup shortcut menu to popup control properties dialog box as
below.
Figure 14.25 Properties of radio button
Radio button control properties:
Control: define the name of control. One list box control has unique control name.
It can’t be repeated. Naming control should accord with the naming rule of
KingView, such as “optionbutton1”.
Tagname: it assigns the tag related to control. It’s usually an integer tag, like
“option item”. Every time when you select a radio button, the integer tag will get
different values.
Access: Setup the access level of control. It changes from 1 to 999. After
defining access level, only authorized users can operate the control while running.
Otherwise, the value of control can’t be edited, like 100.
WellinControl Technology Development Co.,Ltd
14-24 Chapter 14 Control
Topic data: The text for showing title text of every radio button on the picture,
like “option 1”, “option 2”, etc. Title item is composed of a drop combo box and
three function buttons. Select a certain option from list box. You can “edit” title
text in selected item or “insert” an item at the front of the position or delete
selected item.
Button: it means the number of defined radio buttons. The number can’t be over
100 but must be over 2.
Align: define the align mode of radio buttons. “Horizontal” means align radio
buttons to a row horizontally. “Vertical” means align radio buttons to a column
vertically.
The complete control appears as below.
14.2.5.3 How to use radio button control
Radio button control has no scripts function. You only need use tags in “Setup
control” dialog box. Define control property related to tags.
Figure 14.26 Define control property
For example: control a switch by radio button control.
 Create a radio button control on the picture. The control property appears as
WellinControl Technology Development Co.,Ltd
Chapter 14 Control


14-25
below.
Create a text symbol on the picture. Define animation link for text---analog
output animation link. Related tag is tag related to radio button.
Save the picture and switch to TouchView. Open the picture. Click different
buttons to get different values of tags as below.
Figure 14.27 Use radio buttons
You can adjust which option user selected according to the value of related tag.
14.2.6 Hyper text display control
KingView has a hyper text display control for showing text file in RTF or TXT
format. You can input string to hyper text display control and save it as an assigned
file. You can load files in RTF or TXT format and save file by hyper text display
control.
14.2.6.1 How to create hyper text display control
Click “Insert control” button in the toolbox as below, or select “Edit/Insert
control” menu in WindowMaker. “Create control” dialog box popup as below. Select
“Hyper text display” from type list. Select “Hyper text display” icon on the right
content. Click “Create” button in the dialog box or double-click “Hyper text display”
icon to close dialog box. The mouse cursor turns to “+” shape. Click the left key of
mouse on any position need insert control on the picture and drag it to form a
WellinControl Technology Development Co.,Ltd
14-26 Chapter 14 Control
rectangle. It means the size of control interface. Release the mouse key to display
picture on the screen. Move mouse on the small rectangles with arrow around control.
When the mouse cursor turns to arrow, drag the left key of mouse to change the size of
control. When the mouse turns to double “+” shape, drag the left key of mouse to
change the position of control.
Figure 14.28 Hyper text display control
14.2.6.2 How to define properties of hyper text display control
Before using hyper text display control, you need setup control properties first.
Double-click control to appear “Hyper text display control properties” dialog box as
below.
Figure 14.29 Properties of Hyper text display control
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-27
Hyper text control properties:
Control name: define the name of control. One list box control has one unique
control name. It can’t be repeated. Naming control should accord with the
naming rule of KingView, such as “Richtxt1”.
Access level: Setup the access level of control. It changes from 1 to 999. After
defining access level, only authorized users can operate the control while running.
Otherwise, the value of control can’t be edited, like 100.
Click “Ok” button to close dialog box after properties definition.
14.2.6.3 How to use hyper text to display control
Hyper text display box is to show the content of text file in RTF or TXT format or
input text string to display box and save it as text file in RTF or TXT format. It needs
two functions supplied by KingView to realize:
1) LoadText() function: Load the content of assigned file in RTF or TXT format to
text display box.
2) SaveText() function: Save the content of text display box to assigned file in RTF
or TXT format.
It has two examples to express the operation and usage of hyper text to display
control.
For example: write file in RTF format
Step 1: Write a RTF file---ht1.rtf in the WordPad of Windows. It contains
WellinControl Technology Development Co.,Ltd
14-28 Chapter 14 Control
Save file to assigned contents, like D:\Test\recipe.
Step 2: Setup hyper text display control and correlative operation buttons in
WindowMaker.
Setup hyper text display control named “Richtxt1” and two command buttons
with scripts as below.
Scripts of “Load hyper text” button are
LoadText(“Richtxt1”, “D:\Text\recipe\ht1.rtf”, “.Rtf”);
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-29
Scripts of “Save hyper text” button are
SaveText(“Richtxt1”, “D:\Text\recipe\ht1.rtf”, “.Rtf”);
Save all the picture files.
Step 3: Run picture
Start TouchView. Click “Load hyper text” button
Before
text”)
After (Execute “Load hyper
If you edit the content of display box and click “Save hyper text” button, you can
save them to assigned file.
For example: write file in TXT format
Step 1: Write a TXT file---ht1.txt in the WordPad of Windows. It contains:
Save file to assigned contents, like D:\Test\recipe.
WellinControl Technology Development Co.,Ltd
14-30 Chapter 14 Control
Step 2: Setup hyper text display control and correlative operation buttons in
WindowMaker.
Setup hyper text display control named “Richtxt2” and two command buttons with
scripts as below.
Scripts of “Load hyper text” button are
LoadText(“Richtxt2”, “D:\Text\recipe\ht2.txt”, “.Txt”);
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-31
Scripts of “Save hyper text” button are
SaveText(“Richtxt2”, “D:\Text\recipe\ht2.txt”, “.Txt”);
Save all the picture files.
Step 3: Run picture
Start TouchView. Click “Load hyper text” button
Before
After (Execute “Load hyper text”)
If you edit the content of display box and click “Save hyper text” button, you can
save them to assigned file.
14.2.7 Multimedia control
KingView has two kinds of multimedia controls: AVI player control and video
output control. And video output control has two embedded controls: video control
and TDM video control. Additionally, ActiveX video control can be used as well.
Details could be seen in the section 14.3.3.
14.2.7.1 AVI player control
AVI player control is used to play files in AVI format.
14.2.7.1.1 How to create AVI player control
WellinControl Technology Development Co.,Ltd
14-32 Chapter 14 Control
Click “Insert control” button in the toolbox as below, or you can select
“Edit/Insert control” menu in WindowMaker. “Create control” dialog box popup as
below. Select “Multimedia control” from type list. Select “AVI pl ayer” icon on the
right content. Click “Create” button in the dialog box or double-click “AVI pl ayer”
icon to close dialog box. The mouse cursor turns to “+” shape. Click the left key of
mouse on any position need insert control on the picture and drag it to form a
rectangle. It means the size of control interface. Release the mouse key to display
picture on the screen. Move mouse on the small rectangles with arrow around control.
When the mouse cursor turns to arrow, drag the left key of mouse to change the size of
control. When the mouse turns to double “+” shape, drag the left key of mouse to
change the position of control.
Figure 14.30 AVI control
14.2.7.1.2 Setup properties of AVI player control
Setup its properties before using AVI control. Double-click control to popup
control properties dialog box as below:
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-33
Figure 14.31 AVI control property
Properties of AVI control:
Control name: define the name of control. One AVI control has unique control
name. It can’t be repeated. Naming control should accord with the naming rule of
KingView, such as “AVICtrl”.
14.2.7.1.3 How to use AVI player control
The driver of AVI player control is supplied by a function of KingView which is:
PlayAvi(“CtrlName”, filename, option);
Hereby is an example to explain the operation method of AVI player control function.
For example: Set a button and load avi file c:\demo\Winner.avi to an AVI player
control with name of “AVICtrl”. The operation method is:
Step 1: Draw a text button “Play” on the picture.
Step 2: Double-click the button to popup “Script link” dialog box. The relation
between text button and script link is as below:
WellinControl Technology Development Co.,Ltd
14-34 Chapter 14 Control
Step 3: Save all the picture files and enter into TouchView. Click “Play” button. The
content of winner.avi as below:
14.2.7.2 Video control
The video control is a simple control which only can input for one channel video.
Not many configurations are needed. Because no selecting for input channel, the
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-35
control generally adapts to one channel video input. Namely, the whole system only
monitors the situation of one video. Otherwise, please select ActiveX video control.
 Put video output control on the picture
You must follow:
Step 1: Click “Insert control” button in the toolbox as below, or select
“Edit/Insert control” menu in WindowMaker. “Create control” dialog box popup
as below.
Step 2: Select “Multimedia” from type list. Select “Video output” icon on the
right content. Step 3: Click “Create” button in the dialog box. The mouse cursor
turns to “+” shape. Click the left key of mouse on any position need insert
control on the picture and drag it to form a rectangle, so the video control is
created. You can move or zoom video output control arbitrarily like process a cell.
Video control on the picture appears as below:
Figure 14.32 Video control

Setup video control
Double-click video control to popup “Setup control” dialog box, or right-click
WellinControl Technology Development Co.,Ltd
14-36 Chapter 14 Control
menu command “Animation links” of video control to popup “Setup control”
dialog box as below.
Figure 14.33 Setup control

Control name: One video control has one unique control name. It can’t be
repeated. Control name is settled by engineers, such as “monitor”.
Use video control
Firstly, insert video input card to computer. Start up computer and install driver
of video card. Generally, video card has own video software. Configure the video
card using the software and check if the video card is working properly. Finish
checking, close the software and create video control in KingView. Switch to
TouchView. You can get the video image.
For example: Install a camera in the room. Setup a video control on the screen.
All the contents captured by camera display on the screen as below.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-37
Note:
You can’t display the same video information using two video controls in
TouchView.
14.2.7.3 AVICapture control
AVICapture control can only get one channel video input. It has functions like
capture, video, playback, etc. Users can capture a certain picture and save it as an
image, or record a section of information and save it to file in AVI format and view it
by “playback” function. You can zoom in/out the picture while playback.
14.2.7.3.1 How to create AVICapture video control
Click “Insert control” button in the toolbox as below, or you can select
“Edit/Insert control” menu in WindowMaker. “Create control” dialog box popup as
below. Select “TDM Video” from type list. Select “AVICapture” icon on the right
content. Click “Create” button in the dialog box or double-click “AVICapture” icon to
close dialog box. The mouse cursor turns to “+” shape. Click the left key of mouse on
WellinControl Technology Development Co.,Ltd
14-38 Chapter 14 Control
any position need insert control on the picture and drag it to form a rectangle. It means
the size of control interface. Release the mouse key to display picture on the screen.
Move mouse on the small rectangles with arrow around control. When the mouse
cursor turns to arrow, drag the left key of mouse to change the size of control. When
the mouse turns to double “+” shape, drag the left key of mouse to change the position
of control.
Figure 14.34 AVICapture video control
14.2.7.3.2 How to define properties of AVICapture video control
Before using AVICapture control, you need setup control properties first.
Double-click control to appear control properties dialog box as below.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-39
Figure 14.35 AVICapture control properties
Control: define the name of control. One list box control has one unique control
name. It can’t be repeated. Naming control should accord with the naming rule of
KingView, such as “AVICap”.
Access level: Setup the access level of control. It changes from 1 to 999. After
defining access level, only authorized users can operate the control while running.
Otherwise, the value of control can’t be edited, like 100.
Path to save video file: it assigns a default saving path by using “video” function
while control running.
Path to save picture file path: it assigns a default saving path by using “capture”
function while control running.
Click “Ok” button to close dialog box after properties definition.
14.2.7.3.3 How to use AVICapture video control
Firstly, users insert video input card to computer. Start up computer and install
driver of video card. Generally, video card has own video software. Configure the
video card using the software and check if the video card is working properly. Finish
checking, close the software and create video control in KingView. Switch to
TouchView. Open the picture of video control. The initial status of control has no
WellinControl Technology Development Co.,Ltd
14-40 Chapter 14 Control
image. It need open switch first like a television. Therefore, users should click
“ON/OFF” switch to acquire video image as below. Function of each button is:
Capture: Capture video image in single frame and save it to assigned path in DIB
format (C:\BmpFile)
Video: Acquire video to an assigned AVI file real-timely and dynamically.
(C:\AVIFile)
Playback: Playback video recorded by users or user-assigned video (AVI file).
Setup: Setup the playback mode as default or user-defined.
Stop: Stop video.
ON/OFF: Video acquiring switch.
Hereby is the detail about how to use each button.
1. Capture: Users can capture a video image dynamically by capture function
supplied by AVICapture video control. Save the image to assigned path:
C:\BmpFile. Users can view pictures from the path.
2. Video: Users can record video real-timely and dynamically by capture
function supplied by AVICapture video control. Use “Stop” key to stop video.
Recorded video is saved to C:\AVIFile. File name is named in order as 01.avi,
02.avi, 03.avi……
3. Setup and playback: Users can setup playback mode for video. The dialog
box is:
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-41
AVICapture video control won’t occupy current acquiring window while
playback video, but open another video playback window. It appears as below.
Users can operate video in new video playback window, like enlarge,
playback, close, and so on.
4. Open/ close video acquisition
Users can open or close video acquisition.
Note:
You can’t display the same video information using two video controls in
TouchView.
For example: Install a camera in the room. Setup a video control on the screen.
All the contents captured by camera display on the screen as below.
WellinControl Technology Development Co.,Ltd
14-42 Chapter 14 Control
14.3 ActiveX control
14.3.1 Introduction to ActiveX control
KingView supports ActiveX control in Windows standard which contains
Microsoft standard ActiveX control and custom ActiveX control. Introducing ActiveX
control brings users great convenience. Users can create a control according to own
need smartly, or call in a standard control to finish a complex task instead of making
many complex works in KingView. Generally, ActiveX control has control properties,
control method and control event. Users can operate project by using them in
KingView.
14.3.2 How to use AcitiveX control in KingView
14.3.2.1 Create ActiveX control
Click “Insert general control” in the toolbox or select menu command
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
“Edit\Insert general control” to popup “Insert control” dialog box as below.
Figure 14.36 Button to insert general controls
Figure 14.37 Insert control dialog box
WellinControl Technology Development Co.,Ltd
14-43
14-44 Chapter 14 Control
The list box of dialog box lists the names of ActiveX control registered to
Windows in local machine. Users select needed controls by the left key of mouse.
Display files related to current selected ActiveX control in the label text at the bottom
of list box. Click “Cancel” button to cancel inserting operation. Select control name
and click “Ok” button or double-click the list item to close insert control dialog box.
The mouse cursor turns to “+” shape. Click the left key of mouse on any position need
insert control on the picture and drag it to form a rectangle. It means the size of
control interface. Release the mouse key to display picture on the screen.
Note:
Some controls aren’t very large and have their own sizes so that they might
resume to their own sizes after creating.
For example: In order to display a calendar on the screen for operator to select
needed date. The operation should follow:
1. Click “Insert general control” in the toolbox or select menu command
“Edit\Insert general control” to popup “Insert control” dialog box.
2. Select “Microsoft Date and Time Picker control” from the list of dialog box.
Select it and click “OK” button or double-click it directly. “Insert control”
dialog box closes directly. Create a control on the picture according to the
method described at the start of the section. Created control appears as below.
Figure 14.38 Created contorl
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-45
KingView can’t support some special ActiveX control. Therefore, when
users create control, a message will appear as below. It prompts that the control
can’t be used in KingView.
14.3.2.2 Setup the basic properties of ActiveX control
According to characters of control, some controls have fixed property setting
interface---they are called “Basic properties” of control in KingView. By these
properties, you can setup properties of control like operation status, appearance, color,
font and others. Setting basic properties is generally the initial status of control. Each
basic properties page of control is different.
When you setup basic properties, you need select control first. Right-click on the
control and select “Control properties” from popup shortcut menu. The basic
properties page of calendar control popup as below. In the basic properties page, you
can setup properties of calendar like initial value, range of date, format, font, color of
each part, etc. Most of basic properties can be edited by control properties while
running.
The usage of control properties is the same as using general program. You can
get details about how to setup the properties page of control by querying help of
related manufacturers.
WellinControl Technology Development Co.,Ltd
14-46 Chapter 14 Control
Figure 14.39 Control properties shortcut menu
Figure 14.40 Calendar properties
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-47
The basic properties can be setup or not according to actual using condition.
It depends on the need of users.
14.3.2.3 Setup animation link for ActiveX control
Using ActiveX control in KingView, the most important is to setup its animation
link which is the hint for connecting control and KingView. You need define the label
name and security level of control in animation link properties.
14.3.2.3.1 Animation link properties page---General page
Take calendar control created in last section for example, double-click control to
popup “Animation link properties” dialog box as below. Animation link properties
page is composed of three pages: general, properties and event. General page is the
first.
Figure 14.41 Animation link properties - General
WellinControl Technology Development Co.,Ltd
14-48 Chapter 14 Control
Animation link properties page---General page
Name: define the name of control. One list box control has one unique
control name. It can’t be repeated. Naming control should accord with the
naming rule of KingView, such as “DatTimCtrl”.
Priority, security zone: Setup priority of control. It changes from 1 to 999.
Click “Select security zone” button to popup “Select security zone” dialog
box. Click the middle button to add in or remove out of security zone. When
you move mouse cursor on a certain button, the function of button appears
at the bottom of dialog box. You can select or multi-select defined security
zone. Only after authorized users log in, you can operate the control while
running. Otherwise, you can’t operate it.
Figure 14.42 Select security zone
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-49
14.3.2.3.2 Animation link properties page---Properties page
Click “Properties” label to show “Properties” page as below.
Figure 14.43 Animation link properties - Properties
It lists all the properties of control in the list of “Properties” page. It mainly
supplies related interface between KingView tags and control properties. The list
has three columns: properties, types and related tags. Properties column lists all
the properties of control. Types column labels the data type of related property.
And the properties can be related to KingView tags in animation link properties.
According to the actual need, you can relate or unrelated the tags while using
control properties.
Note:
Unsupported data type of control in KingView will be shown as “UNKNOWN”
WellinControl Technology Development Co.,Ltd
14-50 Chapter 14 Control
which related tag table appears in grey color. It stands for the property can’t be used
in KingView.
When you relate tag, click the right key of mouse in the table of “related tag”
which allows relating to property. A shortcut menu popup as below. The menu has
three items:
Add: add tag to relate to control properties
Edit: edit the properties of current related tag which can change related direction
or tag.
Delete: delete the tag related to current property
Figure 14.44 Shortcut menu of related tag
If selected property has no related tag, the “Edit” and “Delete” items are
invalid. For example, add a tag to properties “Value ” of calendar. Click the right
key in the table of related tag in “Value ” property. Select “add” to popup tag
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-51
browser as below.
Figure 14.45 Related tag – tag browser
Firstly, select tag need to relate in tag browser and select the related
direction for property and tag. There is a special button in tag browser for
selecting related tag. Click the button to popup a dialog box for selecting related
direction as below.
WellinControl Technology Development Co.,Ltd
14-52 Chapter 14 Control
Figure 14.46 Relate direction between tag and control property
The related direction has three selections:
 Tag and related control property can setup for each other: no matter how the
tag value or properties value of control changes, they can setup value for the
other side.
 Control properties value related to tag setting: when the value of tag
changes, you can setup control properties value. However, the value of tag
can’t change when the value of control properties changes.
 Control properties value setup related tag value: when control properties
value changes, you can setup the value of tag. However, the control
properties value can’t change when the value of tag changes.
Users setup related direction according to the actual need. For example,
select “Control properties value setup related tag value”. Close tag browser after
setting. “Value ” in animation link dialog box of control appears as below. The
arrow “->” appearing in front of related tag labels the related direction. Switch to
TouchView. When you change the value of properties of tag “Value” you can get
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-53
the value of changed tag “Date”. But when you edit the value of tag, the
properties value of control can’t change.
Figure 14.47 Animation link properties - Properties
14.3.2.3.3 Properties page of animation link---Event
Click “Event” label for animation link properties to show “Event” page as below.
WellinControl Technology Development Co.,Ltd
14-54 Chapter 14 Control
Figure 14.48 Animation link properties - Events
It lists all the events of the control in event properties page. For example,
click control event---“Click”, control data changing event---“Change” and so on.
You can get details of each event of control in the user guide of control (You can
view the stuff of MSDN for the calendar control).
Event properties page list has two columns: The first column is the name of
event. The second column is custom function related to the event. Namely, you
can define a custom function, when the control event happens, the function can
be called in automatically. It is noticed that the related function of control event
must be edited or added in control properties page.
Click the right key of mouse in the table of related function in related event
to popup a shortcut menu as below.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-55
Figure 14.49 Shortcut menu to edit event functions
It has three menu items in the shortcut menu:
 Add: Add a function to control event. Select “Add” command to popup
“control event function” scripts editor as below. Using the scripts editor of
control event function is the same as using general scripts editor except the
circled position in the picture:
The content behind “Event” label stands for the name of current edited
control event like “Change()” event. If the event has parameters, they can be
given in the bracket of event name.
“Expression”: The type of control event function is “VOID” which is
unchangeable. Control event function is the same as general custom
function which need define a function name, like “DatTimChange()”.
Expression can have parameters.
WellinControl Technology Development Co.,Ltd
14-56 Chapter 14 Control
Figure 14.50 Control event function editor


Note:
No matter whether function name has parameters or not in expression, the
small bracket is necessary. The using method and definition of scripts editor
and custom function can be seen in the chapter 10 “Create scripts”.
Edit: Edit the event function related to control properties. When control
event relates to event function, please click the right key of mouse to make
it available.
Delete: Delete the event function related to control properties. When control
event relates to event function, please click the right key of mouse to make
it available.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-57
Example 1: Add a control event function in the “Change” event of calendar
control. Read the properties value of control by the tags of KingView. The
operation method is:
1. Create calendar control. Define the name of control in animation link
properties like “DatTim”.
2. Click the right key and select “add” menu command in the related function
of “Change” event in the event properties page of control.
3. Input function name “DatTimChange()” in the edit box of expression.
4. Input scripts program in the edit area of scripts as below.
Figure 14.51 Control event function 1
5. Input ActiveXIsVisible(“DatTimChange”,0) in the edit area of scripts.
WellinControl Technology Development Co.,Ltd
14-58 Chapter 14 Control
Click the dropdown button of the control when it’s running, after choosing
the setted date in the dropdown box, and the form will disappear.
Example 2: KingView has a table control “KVADODBGrid”. Select insert general
control from toolbox. Select “KVADODBGrid Class” from control list and create
control. Define the control name of animation link properties as
“KVADODBGridCtrl” as below. Add the event function “MouseDown”. When you
press down the left key of mouse, the row number adds 1. When you press down
the right key of mouse, the column number adds 1. Defined scripts program
appears as below.
Figure 14.52 Add MouseDown event function
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-59
Figure 14.53 MouseDown event funcion
Note:
When you call in parameters of control event in control event function, use
“thisEvent” and add parameters of control event. Function name need match case.
14.3.2.4 Acquire properties and functions of ActiveX control from scripts
Besides relating KingView tags in control properties and defining control event
function, you can acquire properties and functions of control in any scripts of
KingView, such as picture script, animation link script, application script and so on.
What the important thing is the picture with control should be in runtime in
TouchView (can be picture besides current picture) when scripts run in condition.
WellinControl Technology Development Co.,Ltd
14-60 Chapter 14 Control
Otherwise, acquiring properties and functions of control could fail, namely, you can’t
obtain the returned value of control.
After creating a control and defining its name, you can acquire properties and
functions in scripts. Take acquiring properties and functions of calendar control by
button scripts as example to introduce how to use properties and functions of control
in scripts.
Example 1: evaluate time value of calendar control for KingView tag by a button.
1. Create a calendar control on the picture. Define animation link properties with the
name “DatTimCtrl”.
2. Create a button on the picture. Double-click the button to popup button animation
link dialog box. Select “on key up” script to popup scripts editor. Click “Control”
button at the bottom of button area of script editor to popup “Properties and
functions of control” dialog box as below. It has three lists as below:
1. Control name: It’s a dropdown list box which lists all the name of created
ActiveX control in current project. Select needed control like “DatTimCtrl”.
“View type” list box should be available.
2. View type: Select the type for viewing from list box: control properties or
control functions.
3. Properties or methods: When you select “View type”, the related list should
be listed in the properties or methods lists as below.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
Figure 14.54 Control properties and methods
Figure 14.55 Properties of calendar control
WellinControl Technology Development Co.,Ltd
14-61
14-62 Chapter 14 Control
3.
Select the control properties in the properties list like “Year”. Click “OK” button
in the dialog box or double-click the properties in the list. The list box of control
properties and functions will close automatically. Control properties will be
added into scripts editor automatically as below.
Figure 14.56 Citing control properties in scripts
Note:
When you call in control properties from scripts, you should use control name
with control property name which is different with using control event function.
Example 2: Acquire control by button scripts. The operation method is:
1. Use the calendar control in example 1. Click “Control” button in scripts editor.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-63
2. Select control name “DatTimCtrl” from popup “Properties and functions of
control” dialog box. Select “Control functions” in view type as below. Select the
about of control---“AboutBox”. After selecting, click “OK” to close dialog box.
Figure 14.57 Control methods list
WellinControl Technology Development Co.,Ltd
14-64 Chapter 14 Control
Figure 14.58 Using control method
According to the method above, you can acquire control properties and functions
from other scripts.
14.3.2.5 Example for using Active X control
ActiveX control brings convenience to users. It makes users realize some
difficult functions easily. Hereby take an example to express how to use ActiveX
control in KingView.
Take Microsoft Chart Control for example to introduce how to create a step chart
by the control.
1. Create a new picture. Click “Insert general control” button in the toolbox, or
select “Edit/ Insert general control” menu command to popup the dialog box
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-65
as below.
Figure 14.59 general control menu
2. Insert control: Select “Microsoft Chart Control” in the dialog box and click
“OK”. The dialog box disappears and the mouse cursor turns to a small “+”
shape. Click the left key of mouse on the drawing area of picture. Drag the
mouse to form a rectangle frame. Release the mouse, the chart is created and
appears on the picture as below.
WellinControl Technology Development Co.,Ltd
14-66 Chapter 14 Control
Figure 14.60 Insert control
3. Setup the basic properties of control: Right-click on the control to popup a
shortcut menu. Select “Control properties” command to popup control basic
properties dialog box as below.
Figure 14.61 Control properties 1

Select “2-D”, “Steps” in the chart type of chart properties page. Select
“Show legend” item to show the label about the relation between
various colors and curves on the right side of chart.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-67
Figure 14.62 Control properties 2

Define the title of each label of chart in text properties page. Select
object in “Properties name” list box, like title, as the title of chart. Input
the name of title in text edit box, like “Step chart”. Select “X axis”, “Y
axis” to define label name. Then define the align mode and direction of
each label by “Alignment” and “Orientation” items.

Define the font and color of each label in the font properties page. The
complete chart appears as below.
WellinControl Technology Development Co.,Ltd
14-68 Chapter 14 Control
Figure 14.63 Defined Control
4. Setup control name and function: Each control needs a unique name in
KingView. Double–click the chart control to popup animation link properties
dialog box.
Figure 14.64 animation link properties
WellinControl Technology Development Co.,Ltd
Chapter 14 Control


14-69
Input control name in “Control name” edit box in general properties page,
like “Step chart”.
Define a function in event properties page: when users double-click the
chart, the version information of chart control popup. Double-click “Related
function” corresponding to “DblClick” to popup control event function
dialog box. Define the function name as “hanshu()”. Click “Control” button.
Select “AboutBox” function of “Step chart” from popup control properties
and functions dialog box. It appears as below.
Figure 14.65 control event function
5. Evaluate for control curve: Setup picture script. Initialize the control.
Evaluate for each curve while system running. It is supposed that the tags:
real 1, real 2 and real 3 stand for the vales of three steps.
Define the picture scripts on startup
WellinControl Technology Development Co.,Ltd
14-70 Chapter 14 Control
Figure 14.66 Define function on startup
Initial chart has three rows and three columns.
Define the picture scripts while running: 1000 milliseconds
Step.Column=1;
Step.Row=1;
//evaluate for the first curve in the first row and first column
Step.Data=StrFromReal(\\local\Real1,2,"f");
Step.Column=1;
Step.Row=2;
//evaluate for the second curve in the first row and first column
Step.Data=StrFromReal(\\local\Real2,2,"f");
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
Step.Column=1;
Step.Row=3;
//evaluate for the third curve in the first row and first column
Step.Data=StrFromReal(\\local\Real3,2,"f");
Step.Column=2;
Step.Row=1;
Step.Data=StrFromReal(\\local\Real1*1.2,2,"f");
Step.Column=2;
Step.Row=2;
Step.Data=StrFromReal(\\local\Real2*1.2,2,"f");
Step.Column=2;
Step.Row=3;
Step.Data=StrFromReal(\\local\Real3*1.2,2,"f");
Step.Column=3;
Step.Row=1;
Step.Data=StrFromReal(\\local\Real1*1.8,2,"f");
Step.Column=3;
Step.Row=2;
Step.Data=StrFromReal(\\local\Real2*1.8,2,"f");
Step.Column=3;
Step.Row=3;
Step.Data=StrFromReal(\\local\Real3*1.8,2,"f");
Save the picture and switch to TouchView. The result appears as below.
WellinControl Technology Development Co.,Ltd
14-71
14-72 Chapter 14 Control
Figure 14.67 Run the control
Double-click the control to popup “About” dialog box of control as below.
Figure 14.68 control information
By using Microsoft Chart Control, you can make bar chart, distributed points
chart, curve chart, etc. You can use them by method in the example.
According to different functions, ActiveX control has different properties,
functions, events. And the complex levels are different as well. It is advised users refer
to introduction or help of control manufacturers before using ActiveX control. For
example, Microsoft control can refer to MSDN.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-73
14.3.3 Video control of KingView
Video control is an ActiveX control supporting video display. Users can connect
video devices in various models by the control. The using method appears as below:
14.3.3.1 Create Video control on the picture
First, click “Insert general control” button in the toolbox, or select “Edit/ Insert
general control” menu command to popup the dialog box as below.
Second, select Video control in the dialog box as below
Figure 14.69 Insert general control
Third, click “OK” button and the mouse cursor turns to a small “+” shape. Draw
a rectangle frame on the picture to make Video control appear on the picture. You can
WellinControl Technology Development Co.,Ltd
14-74 Chapter 14 Control
move or zoom it arbitrarily like dealing with a cell.
14.3.3.2 Setup Video control properties
Double-click Video control to popup “Animation link properties” dialog box, or
right-click menu command “Animation link” from Video control to popup “Animation
link properties” dialog box as well.
Name: One Video control has one unique control name that can’t be repeated. The
control name is defined by engineers, as “Monitor”.
Priority: It’s to setup the operation priority level for accessing the control. The
access level is from 0 to 999.
Security zone: Click the “Select” button on the right side to select the operation
security zone of the control.
Figure 14.70 Setup control properties
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-75
14.3.3.3 Use Video control
Using Video control is mainly realized by acquiring control functions. Control has
mainly following functions:
AboutBox()
CapVideoToAVI(STRING lpszAVIName)
GetDevNum()
OpenAVI(STRING lpszFileName)
OpenVideo(LONG nResIndex)
ReadPort(LONG nAddr)
SaveVideoFrame(STRING lpszPicName)
SaveVideoFrameToRect(STRING lpszPicName)
SetFrameRect()
StopCapVideo()
VideoCompression()
VideoDisplay()
VideoFormat()
VideoSource()
WritePort(LONG nAddr, LONG nData)
Take an example to introduce how to use Video control.
For example: Install a camera in the room. Install a video acquire card on the
computer. Setup a video control on the screen. All the contents captured by camera
display on the screen and can be processed by supplied functions. The video control
and operation button created in KingView as below.
WellinControl Technology Development Co.,Ltd
14-76 Chapter 14 Control
Figure 14.71 Creat Video control.
Create script link for each button separately. The mode of creating script link is:
double-click the button. Select “on key up” or “on key down” to popup script interface.
Click “Control” button to popup “Control properties and methods” dialog box.
Control name defines “Monitor”. All of the control functions are listed as below.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-77
Figure 14.72 Methods list
Use the correlative function to operate the video control.
Hereby are the expressions for operation buttons.
ON: Open video acquisition
BOOL OpenVideo(short nResIndex)
Parameters: nResIndex device number of video device, the range is from 0 to 9.
Returned value: success returns TURE, fail return FALSE.
Example: Monitor.OpenVideo(0)
OFF: Close video acquisition
BOOL CloseVideo()
Returned value: success returns TURE, fail return FALSE.
Example: Monitor.CloseVideo(0)
Setup source: popup setup video source dialog box
WellinControl Technology Development Co.,Ltd
14-78 Chapter 14 Control
BOOL VideoSource()
Returned value: success returns TURE, fail return FALSE.
Example: Monitor.CloseVideo(0)
Setup compress: popup setup video compression dialog box
BOOL VideoCompression()
Returned value: success returns TURE, fail return FALSE.
Example: Monitor. VideoCompression()
Shot: Save video image as a single frame to a BMP file.
BOOL SaveVideoFrame(LPCTSTR lpzsPicName)
Parameters: lpzsPicName, the BMP file name need to be saved.
Returned value: success returns TURE, fail return FALSE.
Example: Monitor.SaveVideoFrame(“c:\my documents\01.bmp”)
Shot Save video to an AVI file.
BOOL CapVideoToAVI(LPCTSTR lpzsAVIName)
Parameters: lpzsAVIName, the saved AVI file name.
Returned value: success returns TURE, fail return FALSE.
Example: Monitor.CapVideoToAVI(“c:\my documents\01.avi”)
Stop Capturing: stop capturing video.
BOOL StopCapVideo()
Returned value: success returns TURE, fail return FALSE.
Example: Monitor.StopCapVideo()
Play: Open an AVI file
BOOL OpenAVI(LPCTSTR lpzsAVIName)
Parameters: lpzsAVIName, the AVI file name need to be opened.
Returned value: success returns TURE, fail return FALSE.
Example: Monitor.OpenAVI(“c:\my documents\01.avi”)
Setup position: Popup setup capture position dialog box.
BOOL SetFrameRect()
Returned value: success returns TURE, fail return FALSE.
Example: Monitor.SetFrameRect()
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-79
Capture: Capture video to a BMP file.
BOOL SaveVideoFrameToRect(LPCTSTR lpzsPicName)
Parameters: lpzsPicName, the saved BMP file name.
Returned value: success returns TURE, fail return FALSE.
Example: Monitor.SaveVideoFrameToRect (“c:\my documents\01.bmp”)
Notes: You can use the dialog box of SetFrameRect() to confirm the range of capture,
or you can select range on the picture directly. Not any message displays while
using mouse to select the range.
Setup display: Popup setup video display dialog box.
BOOL VideoDisplay()
Returned value: success returns TURE, fail return FALSE.
Example: Monitor.VideoDisplay()
Setup format: Popup setup video format dialog box.
BOOL VideoFormat()
Returned value: success returns TURE, fail return FALSE.
Example: Monitor.VideoFormat()
Additionally, the control has following functions as well:
Get video device number:
Short GetDevNum()
Returned value: number of video device
Write control code to port address:
Long WritePort(short nAddr, short nData)
Parameters: nAddr port address
nData control code
Returned value: return written control code
Notes: If the operation system is Windows98, you can acquire directly. If the
operation system is Windows NT/Windows 2000, the NT sublayer driver of
KingView should be installed. Please install it from the sublayer driver in Value
pack\Video\NT from CD.
WellinControl Technology Development Co.,Ltd
14-80 Chapter 14 Control
Read data from port address:
Long ReadPort(short nAddr)
Parameters: nAddr port address
Returned value: return data read from port address
Notes: If the operation system is Windows98, you can acquire directly. If the
operation system is Windows NT/Windows 2000, the NT sublayer driver of
KingView should be installed. Please install it from the sublayer driver in Value
pack\Video\NT from CD.
If it the first time to enter TouchView, you should setup video source after opening
video.
14.3.4 ADO control
You often need to access open database in the project. It is wasting time and
power to query by SQL functions. To deal with this problem, KingView supplies a
Active X control--- KVADODBGrid by ADO to access data from open database.
Users can access and edit database conveniently in KingView picture by the control.
Users can query data in database by database query window, or calculate the
maximum, minimum and average values of data, or add/delete field dynamically by
functions. The control has following functions:
1. Not only ODBC link database, but also ADO link database.
2. Show data in database which can select field or edit query condition.
3. Setup table title in TouchExplorer.
4. You can select whether to show chart (virtual table) in developing and running.
5. You can edit data in the table in runtime.
6. You can setup parameters like data source, database, data table, etc dynamically
by interface or scripts in runtime.
7. You can select field or edit query condition dynamically by interface or scripts in
runtime.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-81
8. You can print data shown in the table or paging vertically and horizontally.
9. Query sentences need to be generated by query widow. Users can’t input.
Note:
If users need connect database by ODBC data source, you should define an
ODBC data source in control panel and link it to needed database before using the
control. If users connect to database by ADO mode directly, no ODBC data source
needs to be created.
14.3.4.1 Create KVADODBGrid control
First, click “Insert general control” button in the toolbox, or select “Edit/ Insert
general control” menu command to popup the dialog box as below.
Figure 14.73 Select KVADODBGrid control
WellinControl Technology Development Co.,Ltd
14-82 Chapter 14 Control
Second, select KVADODBGrid control in the dialog box as below
Third, click “OK” button and the mouse cursor turns to a small “+” shape. Draw a
rectangle frame on the picture to make KVADODBGrid control appear on the picture.
You can move or zoom it arbitrarily like dealing with a cell.
Figure 14.74 KVADODBGrid control
14.3.4.2 Setup the basic properties of KVADODBGrid control
Select control. Click the right key of mouse. Select “Control properties” in the
popup menu. Control basic properties page appears.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-83
Figure 14.75 KVADODBGrid properties
14.3.4.2.1 Data source: page
The properties page mainly define connected data source, database and data table.
Select the field name in the table. Setup title, format, align mode, decimal digit (if it’s
in data type) of each field of control. You can assign the query condition or edit
control properties to change query condition while running. View is a virtual table
composed of various fields from several tables. View item is to show view in database.
When you select it, the name of view will appear in the table list for selecting. When
you cancel it, the name of view will disappear from the table list.
Click “Browse” button on the top right corner of properties page to popup “Data
link properties” dialog box as below. The connection engines of various data are listed
in the list. (Note: the following used database in the example is KingView demo
project database. ……Kingview\Example\Kingdemo3\SQLdatabase.mdb)
WellinControl Technology Development Co.,Ltd
14-84 Chapter 14 Control
Figure 14.76 Selecting data to link for KVADODBGrid
If use ODBC connection, select directly “Microsoft OLE DB Provider for
ODBC Drivers”, click “Next” button to define “Connection” property. May select
“Use data source name” to choose defined ODBC data source name. Also may select
“Use connection string” to input the string. Or may directly select “Compile” button
to choose and compile the connection string automatically.
The above method for defining connection is universal. Refer to help of reference
system for details.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-85
Figure 14.77 Define ODBC connection
The control also supports ADO way to access data. You may use other data
connection engines. Select a engine name (as “Microsoft Jet 4.0 OLE DB
Provider”) then click “Next” button to enter “Connection” property page as below.
WellinControl Technology Development Co.,Ltd
14-86 Chapter 14 Control
Figure 14.78 Define JET connection
Select the database name that you want to connect. After definition, the control
can use JET engine to access the defined database via ADO way.
After selecting database, click “OK” to return to “Database source” property
page, as below. Select the table from the “Table name” list box for searching data.
System lists all the selected valid fields in “Valid fields” list box. You can select fields
to display in the control by “Add”, “Delete”, “Add all”, “Delete all” buttons and
arrange display order at the right list by “Up”, “Down” buttons.
Select a field among displayed fields that you may set the display comment of the
control title bar and display format of corresponding column for. The meaning of
opinions is shown as below:
 Title: the display name of the field in the control title bar
WellinControl Technology Development Co.,Ltd
Chapter 14 Control

14-87
Format: display format of the field in the corresponding column of the control. It
is applied in four items of the list.
 Align: the align way of the field in corresponding cells
 Decimal digit: if the field is number, it is to define the displayed digit after
decimal point at most.
 Field width: the number of characters of the field displayed in the cell at most.
 Field read-write: if check the opinion, you can not invoke the control to change
the value in database.
 Query condition: setup the default query condition for database. You only need
input the part behind SELECT……WHERE sentence. Like query “Water
temperature’ when it is >20. You need input:
WaterTemperature>20
Figure 14.79 Define fields to display
WellinControl Technology Development Co.,Ltd
14-88 Chapter 14 Control
Search overtime: set the time overtime searches.
14.3.4.2.2 Table properties page
Setup the row and column, boundary of table and so on as below.
Figure 14.80 Control properties - table
The general properties of table:
Control visible: set whether the control is visible while running.
Tunable row height: tune the display height of each row for control while
running.
Tunable column width: tune the display width of each column for control while
running.
Auto-tune column width: if all fields can not be displayed in the screen at same
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-89
time, check the opinion, so after finishing search data, system adjusts
automatically the column width to make all the fields display in the screen in
runtime. If all fields can be displayed in the screen at same time, the opinion
doesn’t work.
Changeable database: Select it, as data in the cell of the control are chagned in
runtime, the corresponding data in database are changed. Use it cautiously.
Draw horizontal line: setup whether to draw horizontal line in table while
control running.
Draw vertical line: setup whether to draw vertical line in table while control
running.
Boundary type: It has four boundary types: none, client boundary, static
boundary, mode boundary.
Fixed number of rows: If the fixed number of rows is > 1, the first line should
show the title of field. Meanwhile, other lines set to empty and can’t be edited.
Fixed number of columns: If the fixed number of columns is > 0, the fixed
column displays data as well. It can’t be null. The column can show field with
order character like “No.”. If no this kind of field exists in the database, you can
set “Fixed number of columns” as 0.
14.3.4.2.3 Color page
It is for setting various table color, as background color, foreground color, row
and column color, etc, as below.
WellinControl Technology Development Co.,Ltd
14-90 Chapter 14 Control
Figure 14.81 Control properties - color
14.3.4.2.4
Font page
It is for setting fixed row font, common row font, page header, page footer and
title font, as below.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-91
Figure 14.82 Control properties - font
14.3.4.2.5
Print setup page
It is for setup print content, as print title, header, footer and their positions, page
number format and position, page setting for each page individually, printed format as
below.
WellinControl Technology Development Co.,Ltd
14-92 Chapter 14 Control
Figure 14.83 Control properties – Print setup
14.3.4.3 Setup animation link properties of KVADODBGrid control
Must set the name and other animation link properties before using
KVADODBGrid control. Double click the control to popup “Animation link
properties” dialog box as below. Animation link properties contains three pages:
“General” property page, “Properties” list and “Event” list.
Define the control name, access level and security zone in “General”.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-93
Figure 14.84 Animation link properties of control
14.3.4.4 Use KVADODBGrid control
When using KVADODBGrid control, you can invoke various functions of
control properties, methods and events to operate the control.
14.3.4.4.1 KVADODBGrid control properties
The control properties list and meaning are shown as below.
Index
1
2
3
Properties
Rows
Cols
FixedRows
Comments
Get the total rows of current table
Get the total columns of current table
Get or setup the number of fixed rows. After
setting the property in runtime, it need obtain
data set over again by acquiring FetchData()
function
WellinControl Technology Development Co.,Ltd
14-94 Chapter 14 Control
4
FixedCols
5
Row
6
Col
7
Editable
8
CellAccordWIthDB
9
10
Table
Where
11
ADOConnStr
12
13
CurCellText
AutoAdjustColWidth
14
ResizeCols
15
ResizeRows
16
Visible
17
HorzLine
Get or setup the number of fixed columns. After
setting the property in runtime, it need obtain
data set over again by acquiring FetchData()
function
Get or set the row (start from 0) of selected cell
(focused cell)
Get or set the column (start from 0) of selected
cell (focused cell)
Whether the data cell can be edited. “0” means it
can’t be edited, “1” means it can be edited.
Whether the database can be edited. “0” means it
can’t be edited, “1” means it can be edited.
Get or setup the name of table need searching
Setup query condition. If no condition is needed,
you can set it to 0.
Configure the connection string for connecting
database. Using this property to configure string
for connecting database is not convenient and
easy to fail. So it’s not recommended to use. It’s
recommended to use SetConnectParam to
configure. However, compared with connecting
by ODBC, using SetConnectParam to connect
database can get better system capability.
Get the value of selected cell text
Whether to adjust column width, “0” means
column width won’t be auto-adjusted, “1” means
column width will be auto-adjusted.
Whether the column width is adjustable, “0”
means column width isn’t adjustable, “1” means
column width is adjustable.
Whether the row height is adjustable, “0” means
row height isn’t adjustable, “1” means row
height is adjustable.
Whether the control is visible, “0” means control
isn’t visible, “1” means control is visible.
Whether to draw horizontal line, “0” means
horizontal line is drawn, “1” means horizontal
line isn’t drawn.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
18
VertLine
19
20
21
22
PrintTitle
PrintHeader
PrintFooter
PrintOrder
23
ViewEnabled
14-95
Whether to draw vertical line, “0” means vertical
line is drawn, “1” means vertical line isn’t
drawn.
The title of print page.
The page header of print page.
The page footer of print page.
Select print order. “0” means first row then
column, “1” means first column then row.
Whether the “View” is available, “0” means it’s
invalid, “1” means it’s valid.
Next take examples to introduce the control properties.
1. FixedRows property:
Explain: Get or setup the number of fixed rows. After setting the property, it need
obtain data set over again by acquiring FetchData() function..
RW property: read-write
Related tag: integer
Use:
Get FixedRows property to KingView integer tag nFixedRows:
nFixedRows = Ctrl.FixedRows;
Use KingView integer tag nFixedRows to set FixedRows property:
Ctrl.FixedRows = nFixedRows;
Use integer constant tag to set FixedRows property:
Ctrl.FixedRows = 2;
Example:
nFixedRows = Ctrl.FixedRows; //Get the fixed number of rows of current
control, nFixedRows is the integer tag;
nFixedRows = 2;
Ctrl.FixedRows = nFixedRows; //Setup the fixed number of row as 2;
WellinControl Technology Development Co.,Ltd
14-96 Chapter 14 Control
Ctrl.FetchData(); //Refresh data set
2.Row property
Explain: Get or set the row (start from 0) of selected cell (focused cell);
RW property: read-write
Related tag: integer
Use:
Get Rows property to KingView integer tag nRows:
nRows = Ctrl.Rows;
Use KingView integer tag nRows to setup Rows property;
Ctrl.Rows = nRows;
Use integer constant tag to set Rows property:
Ctrl.Rows = 5;
3.CellAccordWIthDB property
Explain: Whether the database can be edited. “0” means it can’t be edited, “1” means
it can be edited. The property is only available in this running without changing
“TouchExplorer-Control properties-Table-Whether to edit database” item.
RW property: read-write
Related tag: discrete
Example:
bCellAccordWIthDB = Ctrl.CellAccordWIthDB;
//Get the property value of current table “Edit
database”;
bCellAccordWIthDB = ! bCellAccordWIthDB;
//Get the value in reverse.
Ctrl.CellAccordWIthDB = bCellAccordWIthDB;
//Reset the property.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-97
4.Where property:
Explain: Setup query condition. If no condition is needed, you can set it to 0.
RW property: read-write
Related tag: string
Example:
strWhere = Ctrl.Where; //Get query condition of current control, strWhere
is string tag;
strWhere =“R1 > 800”;
Ctrl.Where = strWhere; //Reset query condition;
Ctrl.FetchData; //Display data to control according to new query condition;
14.3.4.4.2 KVADODBGrid control functions
1. FetchData():
Function: Query data and fill found data to control.
Use:
Ctrl.FetchData();
Example:
strWhere =“R1 > 800”;
Ctrl.Where = strWhere; //Reset query condition;
Ctrl.FetchData(); //Refresh data according to new query condition;
2. Print():
Function: Print control.
Use:
Ctrl.Print();
3. RefreshData():
Function: Refresh data according to last query condition;
WellinControl Technology Development Co.,Ltd
14-98 Chapter 14 Control
Use:
Ctrl. RefreshData();
4. RemoveAllData();
Function: Delete all the data shown in current control.
Use:
Ctrl. RemoveAllData();
5. SaveToCSV STRING bstrCSV:
Function: Save all the data shown in current control to assigned file in CSV
format.
Parameter:
STRING bstrCSV: saving path and file name
Use:
Ctrl.SaveToCsv(“f:\Temp\a1.csv”), including “f:\Temp\a1.csv” is the saving
path and file name which can be string tag. Ctrl is the control name.
6. ScrollToBottom:
Function: Put the focus of mouse to the bottom of control.
Use:
Ctrl. ScrollToBottom();
7. GetCertainCellText(LONG lRow, LONG lCol):
Function: Get the text in assigned cell.
Parameters:
LONG lRow: assign the row of cell(start from 0).
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-99
LONG lCol: assign the column of cell(start from 0).
Example:
LONG lRow:
LONG lCol:
lRow = 2;
lCol = 3;
strCurSelText = Ctrl. GetCertainCellText(lRow, lCol);
// Get text of cell in row 2 (start from
0)and column 3 (start from 0) to string tag strCurSelText.
8. AddAllFields(LONG lFieldWidth, BOOL nReadOnly):
Function: Add all the fields of current table to control.
Parameters:
LONF lFieldWidth The field width of added field which must be bigger
than 0;
BOOL nReadOnly Whether added field is read-only (1 means field is readonly, 0 means field is read-write).
Expression: If data need to be shown according to set column width, “Autoadjust column width” item should be deleted from control properties.
Example:
Ctrl.SetConnectParam(“MyTestDSN”,“ ”,“ ”,“ ”);
//Connect MyTestDSN data source
WellinControl Technology Development Co.,Ltd
14-100Chapter 14 Control
(Access database);
Ctrl.Table = “KingTable”; //Select KingTable table;
Ctrl.AddAllField(75,1);
//Add all the fields in the table to control.
Ctrl.FetchData;
//Refresh data;
9. AddField(STRING bstrName, STRING bstrTitle, LONG lFieldWidth, BOOL
nReadOnly):
Function: Add fields to control according to assigned field names.
Parameters:
STRING bstrName: Assign field name of added field. It must be a valid
field name;
STRING bstrTitle: Actual name of added field. If it’s empty, the default
name could be display name of the field;
LONG lFieldWidth: Field width which must be larger than 0;
BOOL nReadOnly: Whether added field is read-only (1 means field is readonly, 0 means field is read-write).
Expression: If added field has existed, function is failed. If data need to be
shown according to set column width, “Auto-adjust column width” item should
be deleted from control properties.
Example:
Ctrl.SetConnectParam(“MyTestDSN”,“ ”,“ ”,“ ”);
//Connect
MyTestDSN
data
source(Access database);
Ctrl.Table = “KingTable”;
//Select KingTable table;
Ctrl.AddField(“R1”,“ Temperature”,75,1);
//Add a field with field name R1 in the table.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-101
Display field name is “Temperature”. Column
width is 75 and it’s read-only;
Ctrl.FetchData();
// Refresh data;
10. AddFieldNo(LONG lCol, STRING bstrTitle, LONG lFieldWidth, BOOL
nReadOnly):
Function: Add fields to control according to column number of assigned field
(start from 0).
Parameters:
LONG lCol: Assign the column number of added field in the table(start
from 0) which column number must be valid;
STRING bstrTitle: Actual name of added field. If it’s empty, the default
name could be display name of the field;
LONG lFieldWidth: Field width which must be larger than 0;
BOOL nReadOnly: Whether added field is read-only (1 means field is readonly, 0 means field is read-write).
Expression: If added field has existed, function is failed. If data need to be
shown according to set column width, “Auto-adjust column width” item should
be deleted from control properties.
Example:
Ctrl.SetConnectParam(“MyTestDSN”,“ ”,“ ”,“ ”)
//Connect
MyTestDSN
data
source(Access database);
Ctrl.Table = “KingTable”;
//Select KingTable table;
Ctrl.AddFieldNo(1, “Temperature”,75,1);
// Add field in the first column. Display field name
is “Temperature”. Column width is 75 and it’s
WellinControl Technology Development Co.,Ltd
14-102Chapter 14 Control
read-only;
Ctrl.FetchData();
//refresh data;
11. DeleteAllFields():
Function: Delete all the fields shown in current control.
Expression: It only deletes fields shown in current control. The fields aren’t
actually deleted in database.
Use:
Ctrl.DeleteAllFields(); Delete all the fields shown in current control.
12. DeleteField(STRING bstrName):
Function: Delete assigned fields shown in current control.
Parameter:
STRING bstrName: Assign field name.
Expression: If selected field has no assigned bstrName field, the acquisition will
fail. It only deletes display fields in current table. The fields aren’t actually deleted in
database.
Use:
Ctrl.DeleteField(strSelColName);
Delete strSelColName assigned fields shown
StrSelColName is string tag.
in
current table,
13. DeleteFieldNo(LONG lCol):
Function: Deleted fields shown in current table according to column number.
Parameters:
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-103
LONG lCol: Assign the column number of field in the table(start from 0);
Expression: If lCol is invalid column, function is failed. It only deletes display fields
in current table. The fields aren’t actually deleted in database.
Use:
Ctrl.DeleteFieldNo(nSelCol);
Delete assigned fields in column nSelCol shown in current table, nSelCol
in integer tag.
14. MaxValueInField(LONG lCol):
Function: Calculate the maximum value of column for assigned fields.
Parameter:
LONG lCol: Column of assigned field (start from 0).
Use:
fMaxValue = Ctrl.MaxValueInField(nSelCol);
Get the maximum value of assigned column by nSelCol in current
table, fMaxValue is real tag, nSelCol is integer tag.
15. MaxValueInFieldName(STRING bstrFieldName):
Function: Calculate the maximum value of column for assigned fields.
Parameter:
STRING bstrFieldName: Assign the name of field.
Use:
fMaxValue = Ctrl.MaxValueInFieldName(strSelColName);
Get the maximum value of assigned field by nSelColName in current
table, fMaxValue is real tag, nSelColName is integer tag.
WellinControl Technology Development Co.,Ltd
14-104Chapter 14 Control
16. MinValueInField(LONG lCol):
Function: Calculate the minimum value of column for assigned fields.
Parameter:
LONG lCol: Column of assigned field (start from 0).
Use:
fMinValue = Ctrl.MinValueInField(nSelCol);
Get the minimum value of assigned column by nSelCol in current table,
fMinValue is real tag, nSelCol is integer tag.
17. MinValueInFieldName(STRING bstrFieldName):
Function: Calculate the minimum value of column for assigned fields.
Parameter:
STRING bstrFieldName: Assign the name of field.
Use:
fMinValue = Ctrl.MinValueInFieldName(strSelColName);
Get the minimum value of assigned field by nSelColName in current
table, fMinValue is real tag, nSelColName is integer tag.
18. SumInField(LONG lCol):
Function: Calculate the sum value of column for assigned fields.
Parameter:
LONG lCol: Column of assigned field (start from 0).
Use:
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-105
fSumValue = Ctrl.SumInField(nSelCol);
Get the sum value of assigned column by nSelCol in current table,
fSumValueis is real tag, nSelCol is integer tag.
19. SumInFieldName(STRING bstrFieldName):
Function: Calculate the sum value of column for assigned fields.
Parameter:
STRING bstrFieldName: Assign the name of field.
Use:
fSumValue = Ctrl.SumValueInFieldName(strSelColName);
Get the sum value of assigned field by nSelColName in current table,
fSumValue is real tag, nSelColName is integer tag.
20. AverageValueInField(LONG lCol):
Function: Calculate the average value of column which field takes 0 as base with
parameter LONG lCol.
Parameter:
LONG lCol: Column of assigned field (start from 0).
Use:
fSumValue = Ctrl. AverageInField(nSelCol);
Get the average value of assigned column by nSelCol in current table,
fAveValue is real tag, nSelCol is integer tag.
21. AverageValueInFieldName(STRING bstrFieldName):
Function: Calculate the average value of column of STRING bstrFieldName
assigned field.
WellinControl Technology Development Co.,Ltd
14-106Chapter 14 Control
Parameter:
STRING bstrFieldName: Assigned field name.
Use:
fAveValue = Ctrl.AverageValueInFieldName(strSelColName);
Get the average value of STRING bstrFieldName assigned field in
current table, fAveValue is real tag, strSelColName is string tag.
22. DifferLastFirstInField(LONG lCol):
Function: Calculate the deviation value of column which field takes 0 as base
with parameter LONG lCol (difference between the first record and the last
record).
Parameter:
LONG lCol: Column of assigned field (start from 0).
Use:
Parameters as KingView tag:
fDifValue = Ctrl. DifferLastFirstInField(nSelCol);
Get the deviation value of assigned column by nSelCol in current table,
fDifValue is real tag, nSelCol is integer tag.
23. DifferLastFirstInFieldName(STRING bstrFieldName):
Function: Calculate the deviation value of column of STRING bstrFieldName
assigned field. (difference between the first record and the last record).
Parameter:
STRING bstrFieldName: Assign field name.
Use:
Parameters as KingView tag:
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-107
fDifValue = Ctrl. DifferLastFirstInFieldName(strSelColName);
Get the deviation value of STRING bstrFieldName assigned field in
current table, fDifValue is real tag, strSelColName is string tag.
24. Config():
Function: Popup “Database properties” dialog box for configuring while running
as below.
Figure 14.85 Data search invoked by Config()
25. SetConnectParam(STRING bstrDNS, STRING bstrCatalog, STRING
bstrUserName, STRING bstrPWD):
Function: Setup ODBC connecting parameters.
Parameters:
STRING bstrDNS: Name of ODBC data source;
STRING bstrCatalog: Name of assigned database. Assign database name
WellinControl Technology Development Co.,Ltd
14-108Chapter 14 Control
in SQL Server and Oracle, no need to assign in Access database which is shown
by space because it can’t be null string;
STRING bstrUserName: It’s to login user name. If it’s empty, it should be
shown by space. It can’t be null string;
STRING bstrPWD: Password for login user. If it’s empty, it should be
shown by space. It can’t be null string.
Example:
Access database: Ctrl.SetConnectParam("MyTestDSN"," "," "," ");
SQLServer database: Ctrl.SetConnectParam("MySQLODBCName",
"Northwind", "sa", " ");
Generally, it’s used to edit a certain table accessed to database corresponding to
setting “Table” property of control. For example, the following program
segments add the fields in table “TableOne” from data source “MyTestDSN” to
control for displaying.
Ctrl.SetConnectParam("MyTestDSN", " "," "," ");
Ctrl.Table = "TableOne";
Ctrl.AddField("Name", "Name", 50, 1);
26.
SetSqlStringWhere(string
bstrWhere1,string
bstrWhere2,string
bstrWhere3,string bstrWhere4,string bstrWhere5,string bstrWhere6) usage:
Functions:
Combine the string and 6 other tags (bstrWhere1—bstrWhere6) into a “where”
script.
Parameter:
bstrWhere1-bstrWhere6: is the character strings which combines “where” script.
If empty, use space to represent an incorrect empty character string.
Example:
Access database
Ctrl.SetSqlStringWhere("setting cold water valve >20 ","and
","water
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-109
temperature>10"," "," "," ");
14.3.4.4.3 KVADODBGrid control event
Please associate KingView control event function in “Animation link propertiesEvent properties page” and input scripts to functions for using the following control
events.
1. MouseMove:
Explain: event generated by moving mouse in control;
2. MouseDown:
Explain: event generated by pressing down mouse in control;
3. MouseUp:
Explain: event generated by releasing mouse in control;
4. Click:
Explain: event generated by clicking mouse in control;
5. KeyDown:
Explain: event generated by pressing down key;
6. KeyUp:
Explain: event generated by releasing key;
7. KeyPress:
Explain: event generated by holding down key;
8. StartEditing:
Explain: start editing cell event;
WellinControl Technology Development Co.,Ltd
14-110Chapter 14 Control
9. EndEditing:
Explain: finish editing cell event;
14.3.4.5 Querying condition wizard of KVADODBGrid control
KVADODBGrid control provides a querying condition wizard in runtime for
users as below. You can invoke QueryDialog() to realize the auto-configuration of
querying condition.
Use: nReturnValue = Ctrl. QueryDialog();
Parameter: none
Returned value: 0---press cancel to return query window, 1---press “OK” to
return query window;
“Inquire” dialog box popup after executing the function as below.
Figure 14.86 Inquire condition dialog box
The dialog box can set a combination of four groups of query conditions and order
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-111
for querying data. There are four check boxes on the left side of dialog box for
confirming how many groups of query conditions can be selected. Users can select
needed fields for query condition from dropdown list box, then select comparing
operator to form needed values. If selected fields are in date or time type, you can
select values from DatTimValue control conveniently. You can select whether to order
according to correlative fields on the right of dialog box and assign ordering in ASC
or DESC.
Click “Query SQL preview” button after configuring query condition. Query
condition in query sentence can be generated automatically and displayed in
“Generate query sentence” edit box. Click “OK” to save query condition. Then you
can display data by FetchData() function according to the query condition. After you
changed the Where property of the control, the query condition becomes new one.
14.3.4.6 Example of connecting database by General KVADODBGrid
1. Access to SQL Server database: (Execute ADO connection by ADOConnStr
property)
The name of database server is MySQLServer, connected database is
“Northwind”, the table name is “Order Details”, login user name is “sa”, password is
empty, there is no need to build ODBC data source. The following program segments
are connected to SQL Server. All the fields in “Order Details” table are added to
control for displaying.
Ctrl.DeleteAllFields();
Ctrl.ADOConnStr = "Provider = SQLOLEDB.1; Persist Security Info = FALSE;
User ID = sa; Initial Catalog = Northwind; Data Source=MySQLServer";
Ctrl.Table = "Order Detail";
Ctrl.AddAllFields(45,0);
2. Connect Access database: (Execute ADO connection by ADOConnStr
property)
WellinControl Technology Development Co.,Ltd
14-112Chapter 14 Control
Open database “D:\KVADODBGrid example\kvdb.mdb”, there is no need to
build ODBC data source. Both login user name and password are empty. The
following program segments are connected to Access database “D:\KVADODBGrid
example\kvdb.mdb”. All the fields in table “Tableone” are added to control for
displaying.
Ctrl.DeleteAllFields();
Ctrl.ADOConnStr ="Provider = Microsoft.Jet.OLEDB.4.0; Data Source =
D:\KVADODBGrid example\kvdb.mdb; Persist Security Info = False";
Ctrl.Table = "Tableone";
Ctrl.AddAllFields(45,0);
Notes: Typing ADOConnStr string manually need plenty database knowledge
and is easy to fail. You can view the property value of ADOConnStr using interface
alternation mode to build connection, and apply the value to script editing process for
realizing function which create database access dynamically.
Realization method:
First, create a string memory tag in KingView like strADO. After setting ADO
connection to a certain database alternately in WindowMaker, you need evaluate value
of connected ADOConStr to strADO. Namely, strADO=Ctrl0.ADOConnStr. At this
time, you can view connected ADO string value by strADO while running and record
it for editing scripts.
3. Access to SQL Server database: (Access by SetConnectParam function through
ODBC data source)
Accessed database is “Northwind”, the table name is “Order Details”, login user
name is “sa”, password is empty, it need to build ODBC data source named
“MyTestDSN”. The following program segments are connected to SQL Server. All the
fields in “Order Details” table are added to control for displaying.
Ctrl.DeleteAllFields();
Ctrl.SetConnectParam("MySQLODBCName", "Northwind", "sa", " ");
Ctrl.Table = “Order Details”;
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-113
Ctrl.AddAllFields(45, 0);
4. Connect Access database: (Connect by SetConnectParam function through ODBC
data source)
Build ODBC data source connected to Access database. All the fields in table
“Tableone” are added to control for displaying.
Ctrl.DeleteAllFields();
Ctrl.SetConnectParam("MyTestDSN"," "," "," ");
Ctrl.Table = "Tableone";
Ctrl.AddAllFields(45,0);
Notes: capability of example 1, 2 using ADOConnStr property through ADO
connection is better than that of example 3, 4 using SetConnectParam through ODBC
connection.
KVADODBGrid control can be used as query tool for great number of data.
Nowadays, the control has some limits of functions:
1. One control can only pick up data from one table, can’t query data from
several tables at one time. However, users can create view by themselves which can
query data from several tables jointly. You can realize querying from several tables
jointly by selecting view.
2. Users can’t update database.
Additionally, KingView supplies Hyper X-Y curve control which is Active X
control. Details can be seen in Chapter 8 “Trend curve and other curves”.
KingView constantly increases and updates the new controls and application
solutions to meet different customer needs. For other application solutions and more
information please refer to the “Products Solution” content of KingView 6.53 product
CD, or visit the WellinControl website.
14.4 Temp-control curve controls
WellinControl Technology Development Co.,Ltd
14-114Chapter 14 Control
In some industry’s manufacture process, productions parameters are often needed
to alter and regulate as time goes on. For example, in the process of bread production,
the temperature should be controlled in different period; and the required time length
and temperature is different during each period. Therefore, parameters of the whole
production process can be shown in a running curve according to time relation, this
curve is called temperature control curve or plan curve.
For the convenience of users to draw the temp-control curve, KingView provides
temp-control table and temp-control curve control. The function of temp-control curve
control is to display the set curve and real-time curve; and the data used in curve
enacted come from files in database; while the table control is in charge of the enacted
curve. The user can operate the data in database files by way of table control, and
add/delete records; and each record is corresponding to the control segment in the
curve as shown in the following figure:
Let’s take the 4th record in grid control as an example , in reference to the
previous record, the fourth record means that the temperature is constant 50 degree in
30 minutes; the third record means that the temperature rises from 20 degree to 50
degree within 10 minutes. Table control save this information in the files in database
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-115
and curve control can read out this information and display it on the screen, and then
the fourth record is correspondent to the fourth parallel line.
The main functions of control parameters editing table:
1).the user can define the head of the parameter editing table, the form of the
table setting is similar and can be set flexibly;
2).the user can define the corresponding relations between each parameter and
the communication channel of control equipment, such as PLC;
3).the user can input, edit and save the control parameter data in configuration;
4).to control the parameter by way of general database, so it can be generalized;
5).in running, the parameter set by the user can be transferred automatically. If
you want to add or delete controlled segment, you can choose the targeted control
segment to add or delete control segment by a simple menu choice. If these
operations are not confirmed by the user, these items will be labeled by different
colors for the convenience of the user.
6).the data of control parameters in table editing is general and can be used in
different projects;
The features of the temperature control curve are as below:
1). One temperature curve table can draw 20 real-time curve at the same time;
2). The length of the time span coordinate can be automatically regulated
according to the time set by the user;
3). The format and form set of curve table can be varied and suitable for different
requirements;
4). Support the use of cursor, the curve dot data can be shown when the cursor
point to it;
5). Support the name definition, the display and print of the legend;
6). Curve supports the function of navigation: it can be zoomed in or out, moved;
the curve can automatically save the drawn real-time curve and parameters curve as
historical data and the user can check it when the control process is over;
7). The user can control the start-up and stop of real-time curve drawing;
8). The most important function: if there is a sudden death of the system, after the
WellinControl Technology Development Co.,Ltd
14-116Chapter 14 Control
rebooting, the curve will transfer the real-time curve before the sudden death, and then
continue to draw the curve according to the time which can protect the completeness
of the data effectively.
In KingView, the batch download function is provided, and there in no need to
define many tags, what you need to do is use this function in script, and the system
will automatically download the data to control equipments, the realization of this
function needs a 512 above points encryption lock. What’s more, the integration of the
parameter curve of temp control curve and parameters setting table can be finished by
a simple configuration, which is very easy to use.
14.4.1 Introduction to SuperGrid Control
The SuperGrid Control exists in the form of OCX control and can be invoked by
Kingview WindowMaker and TouchView. The SuperGrid Control achieves the
control parameters editing in Excel mode and transferring the results edited to temp
control for monitoring. In developing the table head can be designed and has the
functions of combining and splitting cells and the field also can be designed which is
corresponding to actual control parameters(column in the table. In operating the
deleting and adding of the unexecuted control filed(row in the table)can be achieved
trough row deleting and adding and the parameters of control filed can be modified in
the dialog box which popups through double-clicking the cells and this modification
can be saved to the control parameters setting table. The display content can be
printed in table and invoked in the form of script mode or property association mode.
14.4.2 How to use SuperGrid Control
14.4.2.1 Create SuperGrid Control
Click “Insert General Controls” button in the toolbox, or select “Edit\Insert
General Controls” to popup “Insert General Controls” dialog box as below.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-117
Picture 14.91 Insert General Controls
Look for the item of “kingview.SuperGrid Controls” in the list of dialogue box
and select it, then click “OK” or double-click this item directly. The dialogue box will
be closed automatically and the control will be created in the picture according to the
method shown in the beginning of this section. The control after created is like picture
14.92.
Picture 14.92 Created SuperGrid Control
WellinControl Technology Development Co.,Ltd
14-118Chapter 14 Control
14.4.2.2 Set animation link property of the table control
Double-click the control and then popup a dialogue box “animation link
property”, as shown in picture 14.93. The animation link property page is composed of
three pages which are general, property and event. The first to display is the general
page.
Picture 14.93 Animation link property control-general page
The name, priority and security zone of the control can be set in the general page
of this dialogue box.
Animation link property page-property page
Click the property tab of animation link property and the property page will be
displayed as shown in picture 14.94.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-119
Picture 14.94 Animation link property control-property page
All the properties and types of the control are listed in the list of the property
page, such as nControlsID whose function is to message the control field which is
being executed to the table control and the current executed field can be get using
method GetCurrentControlsField() of temp-control curve control. And then associate
with nControlsID; Property RunTimeCanEdit - user can assign to this property
through script in operating to control if the table can be edited.
Please read <<Kingview 6.5 user guider>> for more information about specific
meaning, setting and using of control of animation link property control
14.4.2.3 Initialization of table control
The definition and initial input of control parameters, corresponding
configuration between parameters and registers, format configuration of table should
be achieved at the project configuration.
WellinControl Technology Development Co.,Ltd
14-120Chapter 14 Control
Note:
Because of the particularity of table control, when after defining the animation
link property of the control and it is selected, click key combination of
“<Ctrl>+<Alt>+O” then the table control can be edited; click key combination of
“<Ctrl>+<Alt>+O” again, and exit the editing status.
When the table is in editing status, double-click the grey area of the table
window(out of cells of table and no cells existing),and then popup “super table
design” dialogue box, as shown in picture 14.95. The number of rows and columns of
the table head of table control can be set in this dialogue box. The default number of
rows and columns both are 5.
Picture 14.95 Super grid design
The setting for the number of rows and columns in the dialogue box contraposes
to the table head and the topic will be added automatically.
Number of rows: Represent two parts. If the row number is set 5 then the rows 1
to 4 will be set table head and the last row will be set table body format (frame, font,
color of cells). After the system enters into operation, the table head will be locked and
any operation can’t be done.
Note:
When designing the table head, the cells in the last row can’t be combined and
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-121
can only be input character or set format. Here is a simple expressions for
calculating the number of rows and columns of the table head:
Row number= requested row number of designed table head+1
Column number= the number of all the parameters
There is “table toolbar” supplied in the table control, as shown in picture 14.96.
Please read the chapter “Table system” of <<Kingview 6.53 user guider>> for more
information about specific meaning, setting and using of each button in table toolbar.
Picture 14.96 Grid toolbar
14.4.2.4 The design of grid head (save and load of grid head)
After designing a table head, click “save table template” button on the grid
toolbar and then the system will popup a “save as” dialogue box, as shown in picture
14.97.Input filename and click “save”, then the current file will be saved as template
file whose extension name is .ght.
WellinControl Technology Development Co.,Ltd
14-122Chapter 14 Control
Picture 14.97 Save table head template
Select the table control which will be loaded with the table head template in the
picture and then click “open table template” button “
” on the table toolbar as
shown in picture 14.98. Select the template to load, and then the template will be
loaded to the table control automatically.
Picture 14.98 Load table head template
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-123
When loading the table head template, besides the table head format will be
loaded, the related information of parameters database, filed name, time field and other
information which are saved in the template will be loaded, that is to say the database
relationship will be renewed by the loaded table head information.
14.4.2.5 Connect database
After designing the table head, the configuration and input of control parameters
in configuration process can be processed.
Field name design: In editing status, right-click at the cell of table and select
the item of “field name design” and then popup the dialogue box “Field name setting”
as shown in picture 14.99.
Picture 14.99 Field name setting
“Index” represents the column number in the table and its number equals to the
number of columns in “Super grid design”. Double-click the name of “FieldNme” and
then set the control parameters name. After the setting, click “OK” button to close the
WellinControl Technology Development Co.,Ltd
14-124Chapter 14 Control
dialogue box.
Picture 14.100 the edited “Filed name setting” dialogue box
Kingview adopts database to save control parameters, so the field names which
are set here are the FiledNames in storage parameter datasheet. The data set here will
be displayed in the table control after the data is loaded when system runs and you can
edit the parameters in the table.
Virtual parameter setting: In editing status, right-click at the cell of table
and select the item of “Virtual parameter setting” and then popup the dialogue box
“Virtual parameter table setting” as shown in picture 14.101.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-125
Picture 14.101 Virtual parameter setting
Click the “add” button in the dialogue box and a virtual parameter filed will be
added, then double-click the name under “Virtual parameter name” to modify it; if
one of the virtual parameter is not needed then click “delete” button and the list in the
dialogue box will be auto arranged. After definition, click “OK” button to close the
dialogue box.
WellinControl Technology Development Co.,Ltd
14-126Chapter 14 Control
Picture 14.102 edited Virtual parameter table
The virtual parameter field is the important parameter in temp-control process.
Its value can be calculated from some related parameters in control field. When the
system runs, the virtual parameters don’t need to be displayed in the table control but
need to be downloaded to devices on-site to do driver configuration. The virtual
parameter filed has one-to-one correspondence with field parameter and in the process
of table control configuration the control parameters table can be edited to modify the
data which corresponds to the virtual parameter filed and when the system runs the
virtual parameter table can be maintained through invoking related script function.
Virtual parameter is used in two cases: one is that there is no need to modify field
manually, but it can be set new values of script by way of outer computer; the other is
that on operating secret field, that’s to say you do not want the parameters to be seen
by other people.(such as confidentiality recipe)
Note:
After the connection of the database, real parameter and virtual parameter can
not be changed any more.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-127
Driver configuration: In editing status, right-click at the cell of table and select
the item of “Driver configuration” then popup the dialogue box of “driver
configuration table setting” as shown in picture 14.103.
Picture 14.103 Driver configuration table setting
Control parameter database file path setting: set parameter, memory path and
path name of driver configuration database file. Click “browse” button to choose
memory path and file name or input directly in the display box. The default memory
path is the directory of current project and the default file name is “controls.mdb”.
There are three sheets in the database, parameter configuration sheet, virtual parameter
sheet and driver configuration information sheet.
ID: Order number, ID number will increase when add a field to the sheet.
Parameter name: the parameter needs to be downloaded. Double-click the cells
corresponding to ID and the parameter dropdown list which can be set will be
popuped. The list includes real parameters and virtual parameters and a
WellinControl Technology Development Co.,Ltd
14-128Chapter 14 Control
parameter should be selected in the list
Property: the property(real or virtual parameter)will be displayed automatically
according to the selected parameter.
Device name: the device name which the parameters correspond to. The device
name must be the name which has been defined in Kingview and the name
should be consistent with the name defined in Kingview, otherwise the
parameters can’t be downloaded normally.
Register name: The register name of device that the downloading of parameter
corresponds to.
StartingAddress, EndingAddress: the range of start and end address of register
which the parameter data set is downloaded to.
DataType: the data type of the parameter (register).
MaxValue/MinValue: the maximum and minimum of the parameter input. The
range defined here must be in the range of selected data type, and the input of
initial parameter and modification of parameter in running must be in the range,
otherwise corresponding prompts dialogue box will popup. If the modification to
parameter beyond the range when invoking script to modify the parameter, it will
display according to the boundary of the seted range.
Example: Take the temperature of parameter as example. Its type is
SHORT and its minimum and maximum are set –50 and 150. If input 300
when editing control parameter the system will popup corresponding prompt
and if invoking script to modify the parameter in running such as assigning
300 then the system will set it to be the maximum.
Please make reference to the related help file of Kingview about device support
about device definition and the name, range and data type of register.
Add: add a new parameter which will be downloaded to the configuration table.
Delete: delete the filed which has been built from the table
Parity: check the user input when the user add a filed and if there is error the
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-129
system will send out prompt
Ok: when the configuration is finished click “Ok” button to save the data and the
dialogue box will be closed
Cancel: cancel current operation and close the dialogue box
Set the time field: Each control process is composed of curves of different time and
the summation of time of each curve is the whole control period. The length of the
temp-control time axis is set according to the summation of time field supplied in
Kingview temp-control edition. To achieve this aim, the time field of parameter
should be assigned in configuration.
Right-click on any cell and select “set time filed” then the dialogue box “time
filed setting” will popup as shown in picture 14.104. Select the filed name to define as
time such as “field time” then click “OK” after that the system will sent out prompt
dialogue box as shown in picture 14.105. The data types which are supported in time
filed are LONG, SHORT, USHORT.
Picture 14.104 time filed setting
WellinControl Technology Development Co.,Ltd
14-130Chapter 14 Control
Edit control parameter: The setting table of control parameter is a data table used to
save the control parameters which need to be downloaded to the on-site devices and
the table can be created or edited by table control through recipe mode in developing
and also can be modified and edited in running. Right-click on any cell and select
“Edit control parameter” in the popuped quick-menu and then the set time field
dialogue box will popup as shown in picture 14.105. The first column of the control
parameter setting table is numbered automatically and is created by system
automatically and also can be looked as field number. Other columns correspond to a
field and the field name roots in the design of the field design and virtual parameter
design in table control; the row of control parameter setting table corresponds to
control field.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-131
Picture 14.105 Dialogue box of “edit control parameter”
The number of parameters can be set using “Add”, “Insert”, “Delete” buttons.
Double-click the corresponding cells to set the parameter.
Vary related database: When there is no need to relate the table control with the
parameter database the relationship can be canceled viz. select “Cancel database
connection” in the popuped quick-menu. After the database relationship canceled, the
table control doesn’t have any configuration information and then the information can
be rebuild.
If there are several parameter databases and the control object need to be loaded
with corresponding database, you can select “Connect other database” in the popuped
dialogue box of database file selecting.
And also you can rename the current database which is well configured to save
for reuse. Select “Save as other database” in the popuped quick-menu and the file save
dialogue box will be popuped. Select saving path and input file name in the dialogue
box then the saving is finished. After selecting “Save as other database”, the database
related with current table will be related to the new database automatically.
Table security management: Select “Attribute setting” in the popuped quick-menu
and popup the dialogue box as shown in picture 14.106.
Picture 14.106 Property setting
WellinControl Technology Development Co.,Ltd
14-132Chapter 14 Control
“Max editing row number” represents the maximal row number of control
parameter records of the table added in configuration or running which can’t be
exceeded and the range is from 1 to 195. The setting of maximal row number can help
you calculate the address range of the parameter in driver configuration and prevent
the user from wrong operation in system running, which will cause unsuccessful
downloading.
“Locking mode” is divided into “Region” and “Row”. “Region” locking is that
all the control fields which have been executed are locked by table control in running
and don’t allow the users to edit them including inserting or deleting row and
modifying single data. “Row” locking is that current control field which is being
executed is locked and the modification to single data can be done in the control fields
which has been executed before the locked control field but can’t do other operations
such inserting or deleting row etc.. Those can protect the control field data in running
against disordering.
If password protection function is selected, you can do inserting, adding, deleting
and data modification operation to the control field of table control in running after
inputting the right password. If you want to modify the parameter of control field you
should right-click on the table and select “Locking” in the popuped quick-menu and
then the system popup “Unlocking” dialogue box. And after inputting right password
you can operate the control field of the table. When the operation is finished select
“Locking” in the quick-menu again and the system will protect the table again.
Except for “password protect”, there is another method to protect the table data
against being edited discretionally. It is to define “Priority” and “Security Zone” of the
control when define the animation links property of the control and then using the
“User configuration” in Kingview to manage and the user can only operate the control
after logging in successfully using the user authority in Kingview.
14.4.2.6 Edit the table in TouchView
After the Kingview running system starts, the table control is in initial status.
First, the table control should be activated to load parameter data and then the table
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-133
control can be edited. Invoke the “run” method of the control in the script command
language of button or picture and after the picture opens in the running system execute
the script to make the table get into running status and load the parameter data
automatically.
After the table being activated to run, invoke the parameter database then the
table can be edited. You can operate to the table such as: add row, insert row, delete
row or canceling deletion, modify value, locking. The operations can be achieved
through the quick-menu which is popuped through right-clicking on the table control.
The quick-menu is as shown in the picture below.
14.4.2.7 How to use table control
Run()
This function can activate table control in system running and make it be in
running status.
SaveDefault()
This function is used to save the modified data of table in default database in
system running. (the database set in WindowMaker)
Save(DSTRING strDNPath)
This function is used to save the modified data of table in database of specified
path in system running.
The type of strDNPath is string and it is the saving path and filename.
Example:
WellinControl Technology Development Co.,Ltd
14-134Chapter 14 Control
String strDBPath="E:\database\newdatabase.mdb
Canshubiao.Save(strDNPath); strDNPath is the name of table control
long GetRowCount()
This function is used to get the row number of records of control parameter table.
The type of returned value of this function is integer and the value is the row number
of parameter data (the number of control fields).
long GetColCount()
This function is used to get the column number of fields of control parameter
table. The type of returned value of this function is integer and the value is the column
number of parameter data (the number of parameters).
long GetVirRowCount()
This function is used to get the row number of records of virtual parameter and
the type of returned value of this function is integer.
long GetVirColCount()
This function is used to get the column number of fields of virtual parameter and
the type of returned value of this function is integer.
float GetRCCellValue(LPCTSTR strFieldName, short nRow)
This function is used to get the cell value of the intersection of specified field and
specified row(control field) “nRow” in control parameter table.
float GetRCCellValue(short nRow, short nCol)
This function is used to get the cell value of the intersection of specified row
“nRow” and specified column “nCol” and the type of returned value is float.
float GetVirCellValue(LPCTSTR strVirtualName, short nRow)
This function is used to get the cell value of the intersection of specified field
“strVirtualName” and specified row(control field) “nRow” in virtual parameter table.
BOOL SetRCCellValue(short nRow, short nCol, float fValue)
This function is used to set the cell value of the intersection of specified row
“nRow” and specified column “nCol” in control parameter table. The fValue is the
setting value and its type is float. The type of returned value of this function is BOOL
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-135
and if the setting is successful the returned value is 1 otherwise 0.
BOOL SetVirCellValue(LPCTSTR strVirtualName, short nRow, float fValue)
This function is used to set the cell value of the intersection of specified filed
“strVirtualName” and specified column “nRow” in virtual parameter table. The
“fValue” is the setting value and its type is float. The type of returned value of this
function is BOOL and if the setting is successful the return value is 1 otherwise 0.
BOOL SetVirRCCellValue(LONG nRow, LONG nCol, float fValue)
This function is used to set the cell value of the intersection of specified row
“nRow” and specified column “nCol” in virtual parameter table. The fValue is the
setting value and its type is float. The type of returned value of this function is BOOL
and if the setting is successful the return value is 1 otherwise 0.
SetupPage()
This function is used to do “page setup” to the control table which is to be
printed in running.
PrintAsReport()
This function is used to output the control table content according to the table
format to specified printer directly and don’t display the print property dialogue box
again.
PrintManual(BOOL bAuto)
This function is used to output automatically or manually the table content to
printer according to different parameter setting. The type of “bAuto” is BOOL and if
it is 0 output the table content to the printer directly otherwise popup the print
property dialogue box and after confirmation output the table content to the printer.
PrintPreview()
This function achieves print preview of the table control content.
RefreshGrid()
The table control will read database once and all the operation afterwards is to
write the database. If the data in database is modified through other modes and the
new data should be refreshed into the table control this function is need to be invoked.
LoadDriverConfig(sDriverFilePath, nRow)
WellinControl Technology Development Co.,Ltd
14-136Chapter 14 Control
This function is used to write one or all the data in specified control field into
control device according to the parameter database path and filename specified in
“sDriverFilePath” and the field number of parameter to be downloaded specified in
“nRow”. When nRow equals to 9999, all the data of all the parameters specified in
driver configuration table will be downloaded. This function is the of public use in
KingView.
The return value is integer
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-137
1 It
shows
that
the
download is a failure(it
only refers to the mistake
of KingView reading data
or checkout mistake in
drive configuration, not
the success of
data
written into equipment)
0 It shows the success of the
download
- It shows the failure in
1 opening database files
- It shows there is no
WellinControl Technology Development Co.,Ltd
14-138Chapter 14 Control
2
record
in
drive
configuration table
- It shows the failure in
3 obtaining the name of
controlled field
- It shows the failure in
the
drive
4 obtaining
information according to
field
- It shows there is no
5 finding
of
collection
lineary of equipments;
and the possible reason is
that the name of the
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-139
equipment is not conform
with the name of project
- It shows there is no
6 finding of equipment
address
structure
of
corresponding
equipment,
and
the
possible reason is that the
name of the equipment is
not conform with the
name of project
- It shows it does not find
7 the point of drive
interface
WellinControl Technology Development Co.,Ltd
14-140Chapter 14 Control
- It shows the download
8 parameter does not pass
the checkout of drive
program
- It shows there is no
9 parameter information of
drive configuration
- Not defined
10
- the points downloaded is
11 over the limit
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-141
- the table is not recorded
12
- non-temp control version
13 does not support data
download
- Demo mode does not
14 support data download
Example:
1.Download the parameters whose field number is 1 specified in driver
configuration.
long lRet;
String strDBPath="E:\database\controls.mdb";
long nRow=1;
lRet=LoadDriverConfigure(strDBPath, nRow);
2. Download all the parameters specified in driver configuration
String strDBPath="E:\database\controls.mdb";
lRet=LoadDriverConfigure(strDBPath, 9999);
The use of this function needs to relate the table control with the temp-control
WellinControl Technology Development Co.,Ltd
14-142Chapter 14 Control
curve control. First, invoke the script SaveDefault() of table control to refresh the data
of table control because the data modified may not be saved and then use the system
script of Kingview to execute the parameter downloading operation and after the
downloading is finished invoke the script SetControlsField(STRING szFilename,
STRING szFieldName) of temp-control curve to refresh and display the setting curve
modified.
Note:
When the first time to download the parameters, this function will download all
the data of all the rows or the rows specified according to the value of the parameter
nRow. After this downloading, if this function is invoked here to download only the
new data which is modified (the new rows inserted and the data after them) will be
downloaded and the other will not.
14.4.3 Temp-control curve
The temp-control curve of Kingview temp-control edition are much more
different than before in drawing of real-time curve, setting of real-time curve
relationship and the supported quantity of real-time curve. The user can start and stop
the drawing of real-time curve and can also save the trend automatically.
When the temp-control curve of Kingview temp-control edition configures realtime curve, it sets the update period of control real-time curve through the relationship
of real-time acquisition variable and the property of control directly and makes the
system draw the real-time curve automatically to avoid programming lots of script.
When each curve diagram is used to set curve only the database and parameter field
used in table control configuration need to be selected.
The drawing of 20 real-time trend cures are supported in each diagram of this
temp-control curve and other curves can be hidden to only view the trend of a curve or
several curves.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-143
The curve support saving the set on the diagram and real-time trend
automatically and when the system resets, the system can invoke the curve before
power off and start to draw the trend according to the time progress. When a control
process is over the system will save the real-time and set curves automatically and the
user can open a trend database through the historical trend view button in curve
toolbar to view the running trend of a past control process.
14.4.3.1 Create temp-control curve
Click “Insert General Controls” or select “Edit\Insert General Controls” in the
menu. Select “kingview.tempare.controls” in the popuped dialogue box and click
“OK”. Create a temp-control curve in the picture as shown in picture 14.107.
Picture 14.107 temp-control curve after created
14.4.3.2 Animation link property of temp-control curve
14.4.3.2.1 Animation link property——general
Select the created curve and then double-click then popup the dialogue box
“Animation link properties” as shown in picture 14.108.
WellinControl Technology Development Co.,Ltd
14-144Chapter 14 Control
Picture 14.108 animation link property dialogue box -general
Please read the “control” chapter in<<Kingview 6.53 user guider>> about Active
X control for more information about specific meaning, operation of animation link
property control.
14.4.3.2.2 Animation link property——property
The relationship between real-time curve variable and control is achieved
through control animation link property of temp-control in the temp-control curve of
Kingview temp-control edition. Open the dialogue box “Animation link property” of
temp-control curve and click “property” as shown in picture 14.109. Plot1-Plot20 in
the property list is the property of real-time curve and the user can relate the real-time
curve variable.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-145
Picture 14.109 Animation link property dialogue box -property
The property related here are float type so only variable of float type can be
related using this method. If you must use the variable of other types you can use
command language programme to assign the value of the variable to this property of
the control.
Other properties of the control
MainWnd
ShowTitle
Title
Related
variable
type
LONG
BOOL
STRING
LegendType
LONG
ShowToolBar
ShowGrid
BOOL
BOOL
Property name
Explanation
Control window pointer
Whether display the title or not, 1.Yes; 0.No
Control title text
Display usage of legend: 0.None;
1.ThinBorder; 2.ClientEdge; 3.StaticEdge
Whether display toolbar or not: 1.Yes; 0.No
Whether display grid or not: 1.Yes; 0.No
WellinControl Technology Development Co.,Ltd
14-146Chapter 14 Control
EnableContentMenu
BOOL
ShowMark
ShowSlide
ControlsPeriod
BOOL
BOOL
FLOAT
ShowSetCurve
BOOL
SetCurveLineStype
TimeUnit
TimeType
LONG
LONG
LONG
TimeFormat
LONG
UpdateTime
MaxYAxisValue
MinYAxisValue
ShowXAxisTitle
ShowYAxisTitle
XaxisUnit
YaxisUnit
XaxisMainGrids
XaxisSecondGrids
XaxisLineStyle
YaxisLineStyle
MainGridLineStyle
SecondGridLineStyle
YaxisMainGrids
XaxisTitle
YaxisTitle
ControlsFieldName
FLOAT
FLOAT
FLOAT
BOOL
BOOL
STRING
STRING
LONG
LONG
LONG
LONG
LONG
LONG
LONG
STRING
STRING
STRING
ShowRightSlide
BOOL
ShowDate
BOOL
DateFormat
LONG
SetCurveLineLadder
BOOL
MaxControlsField
SHORT
Whether popup right-click menu or not:
1.popup; 0.not popup
Whether display mark: 1.Yes; 0.No
Whether display cursor: 1.Yes; 0.No
Control period
Whether display set curve or not: 1.Yes;
0.No
Set the linestyle of curve
Time unit: second, minute, hour
Time type: relative time, absolute time
Time format: 0,ss; 1, mm:ss; 2, hh:mm:ss; 3,
mm; 4, hh:mm
Update period: second
Maximum of Y axis
Minimum of Y axis
Whether display title of X axis: 1.Yes 0.No
Whether display title of Y axis: 1.Yes 0.No
Unit of X axis
Unit of Y axis
Main scale of X axis
Second scale of X axis
Coordinates linestyle of X axis
Coordinates linestyle of Y axis
Linestyle of main grid
Linestyle of second grid
Second scale of Y axis
Title of X axis
Title of Y axis
Name of control field
Whether display the cursor or not: 1.Yes,
2.No
Whether display the data or not: 1.Yes, 2.No
Date format: 0.DD; 1.MM-DD; 2.YY-MMDD; 3.YYYY-MM-DD
Whether display the set curve as ladder line:
1.Yes, 2.No
Maximum of control field
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-147
Control event function
The temp-control curve include 4 functions
1. RunStatusChange()
Function: When the running status of temp-control curve (start, stop or restart) is
modified this event happens.
2. ControlsFieldChange()
Function: When the control field of set curve related with temp-control curve is
modified this event happens.
3. LVernierTimeChange(long lTime)
Function: Maintain, not used at present.
4. MaxControlsFieldChange(short nMaxControlsField, short nInRange)
Function: When the control field of maximal set curve related with temp-control
curve is modified, this event happens.
14.4.3.3 Setup the basic properties of temp-control curve
Select the created control in the picture and right-click, then select “control
property” in the popuped quick-menu and the basic properties dialogue box of the
curve will be popuped as shown in picture 14.110.
WellinControl Technology Development Co.,Ltd
14-148Chapter 14 Control
Picture 14.110 Basic properties of temp-control curve-general
Each configuration of general label:
Color and font: Set the background color of the curve, the color of character
symbol and dividing line on the diagram (foreground color). Click the color and
font button directly to set the color and font.
Title: Add a title for the curve, and the color and font of title can be set.
Cursor and legend: Select if the cursor is displayed and set the color of the
cursor and background color of label. Set the location of the legend in the picture.
Other: Set the specific items displayed in the picture.
Each configuration of coordinate label:
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-149
Picture 14.111 Basic properties of temp-control curve coordinates
X axis information area: define the time unit, time format and other information
of X axis.
Control period: the time of a control period in which the temp-control curve is
executed and it is the maximum of the curve abscissa. If “time field” is set in
control parameter table the control period will be adjusted according to “time
field” after the curve is started.
Time unit: select the time unit of control period.
Time type: include relative time and absolute time. Relative time: take the actual
control period as abscissa and when the curve is stopped and restarted the
drawing point of the curve is started from the pause point last time. Absolute
time: take the absolute time of control period as abscissa and if the absolute time
WellinControl Technology Development Co.,Ltd
14-150Chapter 14 Control
in running doesn’t exceed the control period the data point of curve drawing
can’t be started from the pause point last time but from new coordinate point
according to the coordinate of absolute time until the control period ends.
Display date: Represent whether the X axis of temp-control curve displays date.
Time format: supply several time formats for selecting and for different time
format the meaning of it is different, for example 19: 45: 30, if absolute time is
selected this value represents time of 17:45 pm but if relative time is selected this
value represents time of 17 hours and 45 minutes and 30 seconds.
Date format: supply several data type for selecting and for different date format
the meaning of it is different and this is like the time format above.
Update period: the time frequency of curve updating the data. The unit is
second.
Maximal number of control fileds: input the maximal number of control field.
The value inputted here determines the number of curve control field displayed
in temp-control curve and when the value inputted exceeds the number of actual
control fileds in the table control the temp-control curve will display the control
field according to the number of actual control fields in the table control.
Y axis information area: define the maximum and minimum of Y axis and set
the decimal digits displayed.
Maximum: maximum of Y axis.
Minimum: minimum of Y axis.
Decimal digits: the decimal digits which can be display on Y axis.
Each configuration of axis grid property:
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-151
Picture 14.112 Basic properties of temp-control curve-Axis grid
Title of X, Y axis display option: whether display the title of X axis and the title
content or not.
Unit and scale of X axis and Y axis: represent the axis unit symbol and main
and second scale of the grid of X axis and Y axis directions.
Line style: set the line style of X axis and Y axis coordinate and the line type of
main and slave grid.
Color: set the color of X axis and Y axis coordinates and the line type of main
and slave grids.
Each configuration of trend property
WellinControl Technology Development Co.,Ltd
14-152Chapter 14 Control
Picture 14.113 Basic properties of temp-control curve- Trend
Parameter setting file: set the path and filename of parameter database file.
Field: select the parameter field related with setting curve.
Historical database path: set the path of curve diagram to save historical data
and the path should be absolute path, for example Z:\share_en\test_en\…… and
the system will generate a historical data file and the file will be generated in
each control period and the file name is composed of start date and start time of
control period.
Show setting trend: select if display setting curve when the control runs.
Show in ladder line: select if display setting curve as ladder line.
Trend name: set the name of the real-time curve selected in the left list box.
Label: set the symbol of the real-time curve selected in the left list box.
Only the setting in the list box of curve which has been connected with variable
is significant.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-153
14.4.3.4 How to use temp-control
After the setting of temp-control curve, it can be started to run. The temp-control
curve in TouchView can be operated using curve toolbar and also can be operated
through command language to the control using the method and property supplied by
the control. The toolbar is more convenient.
14.4.3.4.1 The methods of toolbar and right-click menu
If the “Show toolbar” option is selected in “Control properties” configuration of
temp-control curve the toolbar can be used to operate the temp-control curve in
TouchView. The temp-control curve is as shown in picture 14.114.
Picture 14.114 temp-control curve
Operator can use the curve toolbar to do operations to the curve such as curve
property modification, infinite zoom, moving, saving, printing and so on.
Look into the historical data: look into the historical database curve of the
real-time curve which has been saved. Click this button and then the system will
popup a dialogue box for the selection of path and filename and select the file to view
in the dialogue box.
Only after the execution of control period is finished or the curve is paused the
WellinControl Technology Development Co.,Ltd
14-154Chapter 14 Control
historical data can be queried. In the running process, if the control mode of absolute
time is selected only the historical data in absolute time control process can be seen ;
if the control mode of relative time is selected only the historical data in relative time
control process can be seen.
Please reference to “Use super X-Y curve” for the functions of other buttons.
Right-click on the temp-control curve in TouchView then the right-click quickmenu is popuped as shown in picture 14.115. It works as the corresponding functions
of the toolbar above.
Picture 14.115 toolbar quick-menu
14.4.3.4.2 Control method of temp-control curve
1. Start()
Function:
It is used to start the temp-control curve in TouchView and make it start to
draw real-time trend.
2. Stop()
Function:
It is used to pause the temp-control curve in running system and make it
pause to draw temp-control curve. If the function Stop() is used again the system
will calculate the time difference from the stop last time to the start this time and
start to draw the curve on the current corresponding coordinate point.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-155
3. ReStart()
Function:
Restart the temp-control curve and restart a control period but don’t record
the running data last time.
4. long GetRunStatus()
Function:
Return the curve running status.
Returned value:
0: the temp-control curve doesn’t not start;
1: temp-control curve is in running;
2: temp-control curve has been stopped
5. Long GetCurrentControlsField()
Function:
Get the number of filed which the current control of the temp-control curve
executes on. The returned value can be related to the property nControlsID of
table control and is used to display the current control field in the table control
and can also be used to determine which fields are in control status and can’t be
modified.
6. float GetSetValue(long lTime, short nOption)
Function:
Get the value of the setting curve at a time point.
Parameter:
ltime: the type of ltime is integer, the time value relative to origin of
coordinate and the unit is second.
nOption: the type of nOption is integer
0: calculate the value at lTime according to the linearity of the start
point and end point of the curve setting filed.
1: return the end-point value of the curve setting field.
Returned value:
float type.
WellinControl Technology Development Co.,Ltd
14-156Chapter 14 Control
7. BOOL SetControlsField(STRING szFilename,STRING szFieldName)
Function:
Assign the filed specified in the database file as the setting curve field of
temp-control.
Parameter:
The type of szFilename is string and it is the path of parameter database file;
the type of szFieldName is string and it is the filed name in parameter database
file.
Returned value:
The type of returned value is discrete.
1: load successfully; 0: load unsuccessfully
8. BOOL SetHistoryDbFile(STRING szFilename)
Function:
Set the historical path of the curve, It is required that the path has already
existed in the system.
Parameter:
The type of szFilename is string and it is the path of historical database
file.
Returned value:
The type of the returned value is discrete.
1: load success; 0: load failure
Example:
Define the tag aa, discrete in Tagname dictionary; establish the button in
picture, and to input into the pop-up button:
aa= BOOL SetHistoryDbFile("D:\peixun\ newtempcontrol ");
9. Print()
Function:
Print the curve in running.
WellinControl Technology Development Co.,Ltd
Chapter 14 Control
14-157
14.4.3.5 the synchronization relation of temp-control curve and table
control
There is an important property nControlsID included in the property of table
control and the important using of it is to inform the table control which control filed
is being executed and the current executed field can be get through the method
nControlsID of the temp-control curve control and then it is related with nControlsID.
Example: define the event function below in the event ControlsFieldChange() of
temp-control curve:
\\this site\CtrlID=KvTempCtrl.GetCurrentControlsField();
Connect the memory variable CtrlID with the property of the table control and
we get the picture as below in TouchView. The control field parameters which have
been executed or are in being executed will not be allowed to edit in the control
parameter table and the grounding of corresponding rows changes to grey. Only after
the control finishes all will get right.
WellinControl Technology Development Co.,Ltd
14-158Chapter 14 Control
Picture 14.116 the synchronization relation of temp-control curve and table control
WellinControl Technology Development Co.,Ltd
15-1 Chapter 15 Recipe Management
Chapter 15 Recipe Management
15.1 Recipe management
15.1.1 What is recipe
In the manufacturing field, a recipe is used to describe many different things. A
recipe is a collection of set parameters of variables in production. For example, a
bakery may have a basic cookie-dough recipe that lists all of the ingredients required
to make plain cookies such as water, flour, sugar, egg and oil and all of the optional
ingredients such as nuts, fruit, chocolate chips, and so on, that can be added to the
basic recipe to make various kinds of cookies. Next take the recipe of the bakery for
example.
Ingredient
Water
Flour
Salt
Sugar
Egg
Oil
Fruit
Chocolate
Recipe1
Fruit bread
200 grams
4500 grams
325 grams
500 grams
10 eggs
500 grams
5 pieces
0
Recipe2
Chocolate bread
200 grams
4500 grams
325 grams
500 grams
10 eggs
300 grams
0
500 grams
WellinControl Technology Development Co.,Ltd
Recipe3
Vitamin bread
200 grams
4500 grams
325 grams
500 grams
10 eggs
300 grams
0
0
15-2
Chapter 15 Recipe Management
Note: numbers in the table is any.
For another example, in a steel mill, a recipe might be a collection of machine
setup parameters. For batch processors, a recipe can be used to describe the various
steps in the batch process. You can use Recipe management of KingView to control
production process easily and quickly. For example, it needs many control tags in
production. It takes much time to set tags one by one, so if you use a recipe, you can
set a lot of tags once to satisfy production request.
15.1.2 Recipe management of KingView
Recipe management of KingView consists of two parts: Recipe Manager and
Recipe function set. Recipe Manager is in charge of creating and maintaining recipe
template files. Recipe functions are to operate kinds of recipes (such as to select, to
modify, to create and to delete) in recipe template files when KingView is running.
All recipes are defined and saved in template files. Each template has the
extension CSV and is built by recipe definition template.
Recipe definition template
It is for defining all projects name (ingredient name), project type, data tag
(corresponding to each project) and recipe name. Each recipe specifies number of
each ingredient.
The structure of Recipe definition template is shown as the following:
Project
Recipe1
Tag
name
Tag1
Recipe2
Tag2
Recipe3
Tag3
Tag type (project
type)
Long, integer,
discrete or string
Long, integer,
discrete or string
Long, integer,
Recipe1
Recipe2
Recipe M
11
21
M1
12
22
M2
13
23
M3
WellinControl Technology Development Co.,Ltd
15-3 Chapter 15 Recipe Management
Recipe4
Recipe N
discrete or string
Long, integer,
discrete or string
Tag N Long, integer, discrete
or string
Tag4
14
24
M4
1N
2N
MN
Note: recipe name is user-defined. Concrete recipe specifies the number of
each ingredient. Number here is any, and doesn’t have actual meaning.
15.1.3 Recipe principle
You can invoke and modify recipes by recipe functions Kingview after finishing
recipe definition template in recipe template file. The structure of its principle is
shown as the following:
Assign recipe is finished by recipe functions. You can specify recipe (as Recipe
M) to a tag by it. When invoking Recipe 1, you can specify data 11,12,13,14,1M of
recipe 1 to tag 1, tag2, tag3, tag4, tag N. by the same token, specify them of recipe M
to tag 1, tag2, tag3, tag4, tag N.
WellinControl Technology Development Co.,Ltd
Chapter 15 Recipe Management
15-4
15.2 Create recipe template
You can create and manage recipe template files in TouchExplorer. Select
Recipe under File in the contents outline as the figure 15.1 shows.
Figure 15.1 New recipe
Double click New button in display area or right click New… button then select
New Recipe in the popup shortcut menu. Recipe Definition dialog box appears as the
figure 15.2 shows.
WellinControl Technology Development Co.,Ltd
15-5 Chapter 15 Recipe Management
Figure 15.2 Recipe definition
Note:
First and second column in the first row in Recipe Definition dialog box is
unchangeable. It is impossible to input any in both cells.
First two columns in the dialog box are tag name and tag type.
Tag Name: defined tag name in KingView. Must define all tags used in recipe in DB
before define recipe.
Tag type: one among integer, long, discrete and string. If user selects a tag name, it is
added automatically. If users input tag name manually, it needs to input tag type
manually.
Next introduce menu commands in the dialog box.
Click the menu Table, dropdown menu shows as the figure 15.3
WellinControl Technology Development Co.,Ltd
Chapter 15 Recipe Management
15-6
Figure 15.3
Add row: add a row above the row where a focus is.
Delete row: delete the row where a focus is.
Add column: add a column front the row where a focus is.
Delete column: delete the column where a focus is.
Save: save the recipe file to the current project path. When saving the new
recipe files for the first time, the current project path is shown as the default
path, as shown in Figure 15.4 below.
Figure 15.4 Save the recipe file
Save as: Save the recipe file to the specific path. When carrying out this
WellinControl Technology Development Co.,Ltd
15-7 Chapter 15 Recipe Management
operation, the following dialog box will popup as shown in Figure 15.5 below.
Figure 15.5 Save as the recipe file
Once the path has been selected, click “Save”.
Exit: when exiting the recipe file without saving it a reminding to save the
file will pop up as shown in Figure 15.6 below.
Figure 15.6 Hint for recipe file saving
Click the menu Tool dropdown menu shows as the figure 15.7
WellinControl Technology Development Co.,Ltd
Chapter 15 Recipe Management
15-8
Figure 15.7
Properties: click it, Recipe definition dialog box shows as the figure 15.8.
Figure 15.8 Recipe properties
Recipe name: name of recipe you want to create. It is better to define a name
with practical meaning.
Item number: specify the number of recipes. A maximum is 256.
Tags Number: specify the number of tags corresponding to projects in recipe. A
maximum is 999.
WellinControl Technology Development Co.,Ltd
15-9 Chapter 15 Recipe Management
Note:
The number of recipes and the number of tags must be equal to the number of
real recipes and the number of real tags respectively. Or don’t invoke recipes
correctly in running.
Auto left: press the Enter key, an input focus to move left auto.
Auto right: press the Enter key, an input focus to move right auto
Fixed: Pressing the Enter key, an input focus is static.
Fill up: all selected panes above an input focus have the same value as of focus.
Fill down: all selected panes below an input focus have the same value as of
focus.
Fill left: all selected panes at left of an input focus have the same value as of
focus.
Fill right: all selected panes at right of an input focus have the same value as of
focus.
Click the menu Variable [V], Select tag name dialog box shows as the figure
15.6. It is to select defined tags in DB for users.
WellinControl Technology Development Co.,Ltd
Chapter 15 Recipe Management
15-10
Figure 15.9 Connect tag
Take next example to introduce how to create recipe template.
1. Add tags: select the cell across the Tag1 row and the tag name column. And the
menu – Variable [V] becomes valid. Click Tag, Select tag name apprears. Select
a defined tag then click OK. So you finish selecting tags. Corresponding tag type
of the tag is shown automatically in Recipe Definition. If tag name is input
manually, it needs to input tag type manually. a method of adding tags is same.
2. Create Recipe: input recipes name in cells in first row. Click the cell below
Recipe1, the cell become editable, so you may input recipe name. Next to input
tags values of recipes in corresponding tags below.
3. Modify recipe properties. After editing recipe, click Recipe Properties in the Tool
menu to define the recipe template name as Bread Recipe. Then input a kind of
real recipes and data for used tags.
A defined recipe template shows as the figure 15.10.
WellinControl Technology Development Co.,Ltd
15-11 Chapter 15 Recipe Management
Figure 15.10 Recipe template
15.3 Use Recipe
You can use recipes through recipe scripts functions after creating recipe
template. You may invoke scripts by create operating buttons or scripts. Firstly to
introduce recipe scripts functions, then to create a example of recipe operating button.
15.3.1 Recipe scripts functions
1.RecipeDelete
It is to delete current selected recipe in specified recipe template file.
WellinControl Technology Development Co.,Ltd
Chapter 15 Recipe Management
15-12
Syntax is shown as the following:
RecipeDelete("filename", "recipeName" );
 Filename: the name of recipe template file and the path where it is
saved.
 RecipeName: the name of selected recipe in the file.
 Note: if a file name and a recipe name is in quotation marks it indicates
they are string constant. If not they may be DDE of KingView or
memory string tags.
For example:
RecipeDelete(“C:\recipe\Beijing bread plant.csv”,“Recipe3”);
The statement is to delete recipe3 in the recipe template file Beijing bread
plant.csv.
2.RecipeLoad
It is to load specified recipe to tags in a template file.
Syntax is shown as the following:
RecipeLoad("filename", "recipeName" );
 filename:The name of recipe template file and its path what it is
saved under.
 RecipeName: the name of selected recipe in the file.
Note: if a file name and a recipe name are in quotation marks it
indicates they are string constant. If not, it indicates they may be I/O or
memory string tags.
For example:
RecipeDelete(“C:\recipe\Beijing bread plant.csv”,“ Fruit bread”);
The statement is to load the Fruit bread recipe to tags defined in the
template file Beijing bread plant.csv.
WellinControl Technology Development Co.,Ltd
15-13 Chapter 15 Recipe Management
3.RecipeSave
It is to save a new recipe or changes of existing recipes to a existing template
files.
Syntax is shown as the following:
RecipeSave("filename", "recipeName" );
 Filename: the name of recipe template file and the path where it is saved.
 RecipeName: the name of selected recipe in the file.
Note1: if a file name and a recipe name are in quotation marks it indicates they
are string constant. If not, it indicates they may be I/O or memory string tags.
Note2: a recipe template file must exist. If it doesn’t exist, you have to create it.
Or it will fail to invoke the function and return FALSE.
For example:
RecipeDelete(“C:\recipe\Beijing bread plant.csv”,“Recipe3”);
The statement is to save changes of recipe to the recipes in Beijing bread
plant.csv. If there are no recipes in the file, a system creates recipes automatically.
4.RecipeSelectNextRecipe
It is to select next recipe of specified recipe in a template file.
Syntax is shown as the following:
RecipeSelectNextRecipe( "filename", "recipeName" );
 Filename: the name of recipe template file and the path where it is saved.
 RecipeName: it is string tag and for saving selected recipe name.
Note: if a file name and a recipe name are in quotation marks it indicates they are
string constant. If not, it indicates they may be I/O or memory string tags.
For example:
RecipeSelectNextRecipe(“C:\recipe\ Beijing bread plant.csv”, “Recipe3”);
The statement is to read next recipe of recipe3 in template file. If the string tag
WellinControl Technology Development Co.,Ltd
Chapter 15 Recipe Management
15-14
recipeName is null or not found, return first recipe in the file. If
recipeName is last, still return it.
Note: recipes are saved by order after creating them.
5. RecipeSelectPreviousRecipe
It is to select previous recipe of specified recipe in a template file.
Syntax is shown as the following:
RecipeSelectPreviousRecipe("filename", "recipeName" );
 Filename: the name of recipe template file and the path where it is saved.
 RecipeName: it is string tag and for saving selected recipe name.
Note: if a file name and a recipe name are in quotation marks it indicates they are
string constant. If not, it indicates they may be I/O or memory string tags.
For example:
RecipeSelectPreviousRecipe(“C:\recipe\ Beijing bread plant.csv”,“Recipe3”);
The statement is to read previous recipe of recipe3 in template file. If the string
tag recipeName is null or not found, return last recipe in the file. If recipeName is first,
still return it.
Note: recipes are saved by order after creating them.
6. RecipeSelectRecipe
It is to select a recipe input engineers in template file. Run the function, the
dialog box shows as the figure 15.11. You can type a specified recipe and save it in
string tag.
WellinControl Technology Development Co.,Ltd
15-15 Chapter 15 Recipe Management
Figure 15.11 Select recipe
Syntax is shown as the following:
RecipeSelectRecipe("filename", "recipeNameTag", "Mess" );
 Filename: the name of recipe template file and the path where it is saved.
 RecipeNameTag: it is string tag and for saving selected recipe name.
 Mess: string message that is defined engineers.
For example:
RecipeSelectRecipe(“C:\Recipe\ Beijing bread plant.csv”,RecipeName,“ Please
input recipe name! ”)
Run the statement, Select Recipe dialog box appears and displays a message
“ Please input recipe name! ”. As long as you select a recipe in dialog box, the
function saves the recipe name to RecipeName.
7. RecipeInsertRecipe
It is to insert a new recipe in specified place. After running it, a system
shows the Select inserted Recipe dialog box as the figure 15.12. All current
recipes names are listed in the box. Select the place where you want to insert a
recipe then click OK button. So new recipe is inserted in the place.
WellinControl Technology Development Co.,Ltd
Chapter 15 Recipe Management
15-16
Figure 15.12 Select position to insert recipe
Syntax is shown as the following:
RecipeInsertRecipe(filename, InsertRecipeName);
 Filename: it is a string for defining the name of recipe template file and the
path where it is saved.
 InsertRecipeName: it is string for defining a name of inserted new recipe.
For example:
Define a new recipe “Milk bread” then select to insert it above “Chocolate”.
Select “Chocolate” in popup dialog box and click OK. So a new recipe appears in
specified place.
RecipeInsertRecipe(“C:\recipe\ Beijing bread plant.csv”,“ Milk”);
Select to show the dialog box again, order of recipes is shown as the figure 15.13.
WellinControl Technology Development Co.,Ltd
15-17 Chapter 15 Recipe Management
Figure 15.13 Inserted recipe
15.3.2 Example of recipe
Create a real example of recipe operating buttons in the section and take “bread
recipe.cvs” for recipe template file of the example.
Create the Recipe Management picture. Display ingredient tags and draw some
buttons. Each button is associated with recipe scripts as the figure 15.14 shows.
Figure 15.14 Recipe manager in TouchExplorer
WellinControl Technology Development Co.,Ltd
Chapter 15 Recipe Management
15-18
1. Create Select Recipe button
 Draw the button on the picture and make button text as Select Recipe.
 Associate the button with scripts. Scripts are shown as the following:
RecipeSelectRecipe( "D:\Recipe Management\bread recipe.csv",
recipeName, "Please input recipe name" );
RecipeLoad("D:\ Recipe Management\bread recipe.csv", recipeName );
Note: recipe is memory string KingView tag defined in DB.
2. Create Invoke Recipe button:
 Draw the button on the picture and make button text as Invoke Recipe.
 Associate the button with scripts. Scripts are shown as the following:
RecipeLoad("D:\ Recipe Management\bread recipe.csv", recipeName);
3. Create Save Recipe button
 Draw the button on the picture and make button text as Save Recipe.
 Associate the button with scripts. Scripts are shown as the following:
RecipeSave("D:\ Recipe Management\bread recipe.csv", recipeName );
4. Create Select Next Recipe button
 Draw the button on the picture and make button text as Select Next Recipe.
 Associate the button with scripts. Scripts are shown as the following:
RecipeSelectNextRecipe ("D:\ Recipe Management\bread recipe.csv",
recipeName);
RecipeLoad("D:\ Recipe Management\bread recipe.csv", recipeName);
5. Create Select Previous Recipe button
 Draw the button on the picture and make button text as Select Previous
Recipe.
 Associate the button with scripts. Scripts are shown as the following:
RecipeSelectPreviousRecipe ("D:\ Recipe Management\bread recipe.csv",
recipeName);
RecipeLoad("D:\ Recipe Management\bread recipe.csv", recipeName );
6. Create Delete Recipe button
WellinControl Technology Development Co.,Ltd
15-19 Chapter 15 Recipe Management

Draw the button on the picture and make button text as Delete
Recipe.
 Associate the button with scripts. Scripts are shown as the following:
RecipeDelete("D:\ Recipe Management\bread recipe.csv", recipeName);
7. Create Insert Recipe button
 Draw the button on the picture and make button text as Insert Recipe.
 Associate the button with scripts. Scripts are shown as the following:
RecipeInsertRecipe("D:\
Recipe
Management\bread
recipe.csv",
recipeName);
Save Recipe Management picture then switch to TouchView. Operate the recipe
operating buttons to manage recipe. TouchView displays the result as the figure 15.15.
Figure 15.15 Recipe manager in TouchView
WellinControl Technology Development Co.,Ltd
Chapter 16 System security management
Chapter
16
Management
System
16-1
Security
Security is important for application system. It must deal with access level and
security well for big and complicated system for users in different types. A system
must have ability to enable or disenable users to operate the system by their access
levels. KingView provides a powerful and advanced security management system
based on user. You can encrypt a project in WindowMaker, so only who gives correct
password may open the project. If setting access level for objects on a picture as well
as priority and security zone for an operator, so the operator has no right to access
objects when priority of the operator is lower than of objects or security zone of the
operator is not in ones of objects. But when the operator has higher priority and
security zone within one of objects, he may access objects. KingView sustains system
security in this way.
16.1 Security management of WindowMaker
16.1.1 How to encrypt project
WellinControl Technology Development Co.,Ltd
16-2 Chapter 16 System security management
To avoid others to modify a project, you can encrypt projects respectively in
WindowMaker. When opening an encrypted project, it is asked to give correct
password. If you fail to give, you cannot open the project.
Open TouchExplorer to create project. A default new project is without a
password, so you can open WindowMaker directly. If want to encrypt a project, select
Tool\Encryption menu. So Encryption manage dialog box shows as the figure 16.1.
Figure 16.1 Encryption dialog box

Password: it is less than 12 bytes and consists of letters (match case), digits
and other marks.
 Validate password: input the same password again.
Click Cancel to abandon encrypting. Click OK to confirm it. A system shows a
prompt message for each encrypted picture in encrypting. When finishing encrypting,
“Operation complete” is displayed as the figure 16.2.shows.
WellinControl Technology Development Co.,Ltd
Chapter 16 System security management
16-3
Figure 16.2 Encryption prompt
So later when opening this project each time, you are asked to input a password.
Check file password dialog box is shown as the figure 16.3.
Figure 16.3 Check password of file
When giving correct password, you may open the project, or else the following
dialog box shows.
Figure 16.4 Error prompt
Click Retry button to return to The Check file password dialog box, so you can
input password again. Click Cancel button, you cannot open it.
16.1.2 Remove project encryption
If you want to remove encryption, click Tool\Encryption after opening the
WellinControl Technology Development Co.,Ltd
16-4 Chapter 16 System security management
project. Project encrypt appears, Set password as empty and click OK. The dialog box
shows as the figure 16.5.
Figure 16.5 Cancel encryption
Click OK in the box to remove encryption. Click Cancel to abandon removing
encryption.
Note:
If you forgot password, you cannot open and modify a project. So must be
careful to save password!
16.2 Security management of TouchView
16.2.1 About of Security management of TouchView
You can set access level for objects on a picture as well as priority and security
zone for an operator in KingView for system security. An operator have no right to
access objects when priority of the operator is lower than of objects or the operator is
not in security zone of objects. But when the operator has higher priority and security
zone within one of objects, he may access objects. A priority of an operator is an
integer between 1 and 999. Every operator or object only has one priority. There are
64 security zones in a system. You can select some security zones except Non for a
WellinControl Technology Development Co.,Ltd
Chapter 16 System security management
16-5
user in configuring user, which may have several security zones. And each object also
may have security zones. Name of security zone is changeable except Non. User with
higher priority than 900 can configure other operators in running such as set user
name, password, a priority and security zones.
16.2.2 Configure Security management
16.2.2.1 Priority and Security zone
KingView adopts double protection method of priority and security zone. A
priority is an integer between 1 and 999. You can set priority for user, objects, key
scripts and controls. Security zone is used widely in a project because a control system
often has some control courses and allows many users to operate it. For managing
different control courses easily and safely, KingView uses security zone. You can set
security zone for objects in control course and allow users to operate them. For
example, a project requests a worker A only may operate data and objects in a
workshop A, B only operate in workshop B. You can do it in KingView following the
following method. Set security zone for all data and objects of workshop A and make
it within security zone of worker A. Set security zone for workshop B and make it
within security zone of worker B. Worker A and B have different security zone here.
You can define protection level (max is 999, min is 1) and security zone (64
zones at most) for each operable element in application system, and security zone for
shape objects, tags and key scripts. Of course, designer can specify work priority and
work security zone for operators. When priority of operators is lower than of operable
element or security zone of operators is over of element, operators aren’t allowed to
access the element.
You can define the fowling priority and security zone in KingView.
User input link: analog input, discrete input, string input.
Glider input link: horizontal glider input, vertical glider input.
Scripts input link and key script input: (mouse or Key Equivalent) while hold
WellinControl Technology Development Co.,Ltd
16-6 Chapter 16 System security management
down, while press down, while pull up.
Other: alarm window, symbol wizard, control (including general controls),
custom menus.
Tag definition (each tag have corresponding security zones and priority).
After successful login, only when priority of login user is not lower than one of
symbol or key and user security zone is within of symbol or key, the user can access
the symbol or key scripts. tags in scripts don’t affect scripts to be executed. For glider
input and user input besides general request, it must that its security zone is within of
connected tags. Of else user can access objects (make objects getting focus) but
modify prompt messages of access level.
16.2.2.2 Configure users
You can divide user into some groups by request in KingView that is user group.
Double click User Configuration in the outline System Configuration in content
area or click User in toolbar at the top of TouchExplorer. User and security zone
Configuration dialog box shows as the figure 16.5.
Figure 16.6 User and security zone
WellinControl Technology Development Co.,Ltd
Chapter 16 System security management
16-7
16.2.2.2.1 Define user group
Click New button, so Define User group and User dialog box appears. Select
User Group as the figure 16.6 shows.
User group can contain many users. Type a current user group name that you
want to configure in User Group Name as “Administrator”. Type a comment of
current group in User Group Comment such as “Administrator”. Check public
security zone of all users of current group in the Security list at the right. Click OK
after configuring.
Figure 16.7 User group configuration
You can also modify a defined user group. Select a user group that you want to
modify in User and security zone Configuration and click Modify. Define User group
and User dialog box appears. You can modify user group name, comment and security
zones. Click Delete button to delete a selected user group. Here a system will prompt
you if sure to delete group. If yes, click OK. Or else click Cancel. If there are users in
WellinControl Technology Development Co.,Ltd
16-8 Chapter 16 System security management
the user group, the Delete button is invalid, so you cannot delete groups. Only when a
user group is empty, you can delete it. For a default “system administrator group” and
“Non”, you can modify it but delete it.
Note:
User name, user group name, user comment, user password have 31 characters
respectively at most.
16.2.2.2.2 Define users under user group
User group may have many users. After creating user group, you can add user in
it. Click User radio button in Define users under user group, all option below User are
valid as below.
Figure 16.8 User configuration
Check Add User Group, select a user name in pull down list. For example,
defined system administrator. Type a name of current independent user in Username
WellinControl Technology Development Co.,Ltd
Chapter 16 System security management
16-9
as Administrator A. Type password of current user in Password. The password is
display as *. Type a comment for current user in User Comment. Type login overtime
in Login overtime. It is a time what a user has access level for after login. When
defined time is up, a system access level becomes Non automatically. If set login
overtime is zero, limit of login overtime doesn’t exist. Type a priority of user in
Priority. Select a security zone for user in Security zone. Click OK after configuring
user.
You can also modify a defined user of user group. Select user of user group that
you want to modify in User and security zone Configuration and click Modify button.
Define User group and User dialog box appears. You can modify user name, password,
comment, overtime, priority and security zones. Don’t change to make the user belong
to other user group. Click Delete button to delete a selected user. Here a system will
prompt you if sure to delete user. If yes, click OK button. Or else click Cancel button.
For a default “system administrator” user and “Non”, you can modify it but delete it.
Note:
User added to a group inherits setting of security zone and priority of group
that it belongs to. Bur you can modify them for each user.
16.2.2.2.3 Define independent user
You can define user what is not added to any group as independent user.
Click New in User and security zone Configuration, Define User group and User
dialog box for configuring independent user appears as below.
WellinControl Technology Development Co.,Ltd
16-10 Chapter 16 System security management
Figure 16.9 Independent user configuration
Independent user doesn’t belong to any group. Type a name of current user in
Username as “technologist”. Type a password of current user in Password. Type a
comment for current user in User Comment. Type login overtime in Login overtime.
Select a security zone for user in Security zone. Click OK after configuring user.
You can also modify a defined user. Select user that you want to modify in User
and security zone Configuration and click Modify. Define User group and User dialog
box appears. You can modify user name, password, comment, overtime, priority and
security zones.
16.2.2.2.4 Modify security zone
A default name of security zone is A, B, C …… .You can change them by
clicking the Edit Security zone button in User and security zone Manager. Click Edit
Security zone, and Security zone configuration dialog box below.
WellinControl Technology Development Co.,Ltd
Chapter 16 System security management
16-11
Figure 16.10 Security zone configuration
Select a security zone except Non that you want to change, Click Modify button
becoming valid. Change security zone name dialog box appears as below.
Figure 16.11 Change security zone name
Type new name of security zone and click OK. You can modify name of all
security zone by the way. Names of security zone become new in other security zone
list.
16.2.2.3 Set security property of object
16.2.2.3.1 Set security property of shape object
After successful login, for animation link scripts of shapes, only when priority of
WellinControl Technology Development Co.,Ltd
16-12 Chapter 16 System security management
login user is not lower than one of shape and user security zone is within of the shape,
user can access the shape or execute scripts. Security zone of connected tags with
scripts don’t affect scripts to be executed properly. For glider input and user input
besides general request, it must that its security zone is within of connected tags. Of
else user can access objects (make objects getting focus) but modify and operate there
is a prompt message that connected tag has not access level in info window.
Double click an object on a picture in WindowMaker as a rectangle. The
Animation Link dialog box shows as the figure 16.12 shows. Select one item with
data security animation link as scripts link. Here Priority and Security Zone become
valid. Type an access priority in Priority. Click
button behind Security Zone to
select security zone as the figure 16.12 shows. Select Security Zone dialog box shows
as the figure 16.13 shows.
Figure 16.12 Setup access level
WellinControl Technology Development Co.,Ltd
Chapter 16 System security management
16-13
Figure 16.13 Select security zone
The step of adding security zone are shown as the following:
Click a security zone name in the Available Security Zone list the click the >
button, so you can add the name into the Selected Security Zone list at the right. If you
want to select continual zones once, you have to hold down mouse and press the Shift
key. f you want to select discrete zones once, you have to click names that you want to
select and press the Ctrl key. If you want to add all security zones at the left into the
right, can use the >> button.
The step of removing security zone are shown as the following:
Click a security zone name in the Selected Security Zone list the click the <
button. The method of Selecting zones is same as the above. If you want to remove all
security zones at the right into the left, can use the << button.
Click OK to return after selecting.
16.2.2.3.2 Set security property of key scripts
After successful login, for key scripts, only when priority of login user is not
WellinControl Technology Development Co.,Ltd
16-14 Chapter 16 System security management
lower than one of scripts and user security zone is within of scripts, user can execute
scripts. Security zone of connected tags with scripts don’t affect scripts to be executed
properly.
Select File\Script\Hotkey Scripts in the content area in TouchExplorer then
double click New in the right display area. Scripts dialog box appears as the figure
16.14 shows. Set key and type a priority in Priority then select security zones in the
security zones list. Only when priority of login user is higher than of key and security
zone is within one of key, the user can execute the scripts. The method of setting key
priority and security zones is same as one of setting shape object. See the section
16.2.2.3.1 for more.
Figure 16.14 Key priority and security zones
WellinControl Technology Development Co.,Ltd
Chapter 16 System security management
16-15
16.2.2.3.3 Setting security property of tags
Create a new tag in Tagname Dictionary in TouchExplorer, the Tag Properties
dialog box appears. Define a tag then click the label Record and Security zone to enter
Log and Security zone dialog box as the figure 16.15.
Figure 16.15 Tag definition – Log and security zone
You can select a security zone on request of project then click OK.
16.2.2.3.4 Setting security property of control
You can only set access level for temp-control trend and X-Y trend in trend, form
control (as list, combo box, check box, edit box, radio box) and hypertext control but
security zones. It is related with connected tags.
You can set priority as well as security zones for Active X control. Double click
a control on a picture in WindowMaker, so the Animation link properties dialog box
WellinControl Technology Development Co.,Ltd
16-16 Chapter 16 System security management
shows as the figure 16.16,k. Type a priority (between 1 and 999) of the control in
Priority. Click the Select Security zone button, to select security zone. After selecting,
a selected security zone is shown in the Security zone text box.
Note:
Only allowed setting priority for controls that can set access level for.
Figure 16.16 Setup priority and security zone
16.2.3 how to login in running
16.2.3.1 login
An operator must logon by himself to get some operating rights in TouchView.
Turn on the menu Special\Log On in TouchView. The dialog box as the figure 16.17
WellinControl Technology Development Co.,Ltd
Chapter 16 System security management
16-17
shows.
Figure 16.17 Log in whiling running
Click the Username pull down list to display all users names defined in
TouchView and select one among them. Type correct password in the Password text
box and click OK. If login is successful, a user gets some operation rights, or a system
displays the message “Login failed!”.
You can make login on through scripts. If you set the button User Login to link
scripts LogOn(), when an operator click the button in running, the Login dialog box
shows. If select the menu Configure\View in TouchExplorer and check the option
“use virtual keyboard” in the Special sheet of popup TouctView Setting dialog box, a
virtual keyboard shows as you click a password dialog box. User can use the mouse to
select letters or digits as using real keyboard. The figure 16.18 shows as below.
Figure 16.18 Virtual keyboard
WellinControl Technology Development Co.,Ltd
16-18 Chapter 16 System security management
TouchView provides a double identification for checking system security. When
user want to further operation (as switch off a brake or switch on a brake), it need
double identification check to avoid fault operation, which asks you to input both
name and password of operator and of monitor. In identification check dialog box. If
they are correct, it is allowed to operate. You can invoke the function
PowerCheckUser() to do a double identification check. Syntax is shown as the
following:
bool PowerCheckUser(string OperatorName, string MonitorName);
OperatorName: name of operator.
MonitorName: name of monitor.
Return value: 1 means success, 0 means fail.
The identification check dialog box shows as the figure 16.19 after running the
function.
Figure 16.19 Identification check
Current login user is displayed by default in Operator. Last login user is
displayed by default in Monitor. You can select defined user in pull down list. It is not
WellinControl Technology Development Co.,Ltd
Chapter 16 System security management
16-19
allowed to login with same names of operator and monitor. Click OK, if user names
and passwords are correct, identification check is successful. However, identification
check doesn’t affect condition of user login. When user cancels the login, the message
of failing login returns. Operator and monitor have different access levels and types. It
suggests adopting flexible method that is making them KingView user.
TouchView provides an encrypting lock. Invoke the function GetKey() to define
a project with only lock for encryption. Running the function can get serial number of
encrypting lock in current computer in TouchView. Syntax of the function is shown as
the following:
GetKey();
The function has no parameters. Return a string: serial number of encrypting lock.
16.2.3.2 Exit login
When user finished operation, it is necessary to exit login for avoiding illegal
user. You can select the menu Special\Log off to exit login.
You also can make log off through scripts. If you set the button User Logoff to
link scripts LogOff(), when an operator click the button in running .
16.2.4 How to set password and access level again in running
KingView allows any successful login user (has no access level limit) to modify
password. Firstly login (see the section 16.2.3.1 for method) then select the menu
Special\Modify Password. The dialog box is as below.
WellinControl Technology Development Co.,Ltd
16-20 Chapter 16 System security management
Figure 16.20 Modify password
Type old password in Old Password, new password in New Password and in
Verify password. Then click OK, so old password is replaced by new one.
You can modify password by scripts. The function ChangePassword() is same as
the menu Special\Modify Password.. When an operator click the button, the Modify
Password dialog box shows.
User with higher access level than 900 can modify user access level in
TouchView as well as add, delete and modify priority and security zones of users. If
login user has lower access level than 900, when he run Special\User configuration,
the window as below.
Figure 16.21 Configuration prompt
If login user has higher priority than 900 or equal to 900, when he runs
Special\User configuration, User and security zone Configuration dialog box shows.
After configuring user in TouchView, a system remembers it automatically. When
WellinControl Technology Development Co.,Ltd
Chapter 16 System security management
16-21
opening User Configuration, new configured user is displayed.
The function EditUsers(); is same as the menu Special\ User Configuration. If
you set the button Config User to link scripts: EditUsers(). When an operator click the
button, if an operator have access level higher than or equal to 900, User and security
zone Configuration dialog box shows.
16.2.5 System tags and functions related with security
management
System tags related with security management: $Username and $Access level.
 $Username is a memory string tag and for recording current user name in
running. If there is no user login or user exited, it is None.
 $Access level is a memory long tag for recording user access level in running. If
there is no user login or user exited, it is Non and security is Non.
Functions related with security management:
ChangePassWord()
It is to display the Modify Password dialog box to help user to change password.
Calling format: ChangePassWord()
It has no parameters.
EditUsers()
It is to display the User and Security zone dialog box. It allows user with higher
access level than 900 to configure user and security zone.
Calling format: EditUsers()
It has no parameters.
GetKey()
It is for getting serial number of encrypting lock in running.
Calling format: GetKey()
It has no parameters.
Return a string that is serial number of encrypting lock.
WellinControl Technology Development Co.,Ltd
16-22 Chapter 16 System security management
LogOn()
It is to login TouchView.
Calling format: LogOn()
It has no parameters.
LogOff()
It is to exit login in TouchView.
Calling format: LogOff()
It has no parameters.
PowerCheckUser()
It is for making a double identification check in TouchView.
Calling format: Result=PowerCheckUser(string OperatorName,
MonitorName);
OperatorName: name of an operator.
MonitorName: name of a monitor.
Return value: 1 success, 0 fail.
WellinControl Technology Development Co.,Ltd
string
Chapter 17 Report
17-1
Chapter 17 Report
Report is an important way to reflect and record data and states in production. It
is absolutely necessary in production. It can reflect real time production of system, as
well as provide data for statistics and analysis to help engineers to master real time
production situation.
KingView provides a build-in report system with rich report functions what are
used for calculating, data converting, statistic analysis and report printing. It supports
input operation for cells in running. You can set a report format and configure reports.
And you can make real time and historical reports. In addition, you can make various
report templates to reuse.
17.1 Create report
17.1.1 Create report window
Create new picture in WindowMaker and click the Report Window icon in the
toolbox as the figure 17.1 shows. The cursor becomes + shape. Press the mouse in the
proper place on the picture and drag it to draw a rectangle. Then release the mouse, so
create a report window successfully as the figure 17.2 shows. Move the mouse to the
border of the report. When the cursor becomes + shape, press the mouse and move it
WellinControl Technology Development Co.,Ltd
17-2 Chapter 17 Report
to change the position of report window. Move the mouse over the small box at the
border of report window, when the cursor becomes an arrow with same direction as
the arrow in the box, press the mouse and move it to change the size of report window.
When report window is selected, report toolbox appears automatically. Otherwise,
toolbox disappears automatically.
Figure 17.1 Report button in toolbox
Figure 17.2 Report window
17.1.2 Configure name of report window and apply format
It must define an identification name for each report window in KingView. Then
defining the name, must comply with a naming rule. The string name is at most 31
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-3
characters.
Double click the grey area in report window (area without cells) to popup Design
report dialog box shown as the figure 17.3. It is for setting report name, row and
column numbers of tables as well as applied format.
Figure 17.3 Design report
The meaning of options in Report Design:
 Report control: type a report name in the Report name text box as Real time
data.
Note: report name must be different with other name, functions, tag name and
keywords in KingView.
 Report size: input row number and column number of report that you want to
make (can be changed at report configure). A default is 5 rows and 5 columns. A
table has at most 2000 rows and 52 columns. Digit 1,2,3… indicates rows and
letter A,B,C,D… indicates columns. Cell name is defined as Row number+
column number as A1, which means a cell across first row and first column.
Column number doesn’t match case, as A1 and a1 means same cell.
 Report type: you can use a defined report template directly to avoid redefining
the same report format. Click Report type button, the Report applied format
WellinControl Technology Development Co.,Ltd
17-4 Chapter 17 Report
automatically dialog box appears as the figure 17.4 shows. If you defined report
types, select a type at the left list and preview it at the right table. You can
modify applied format by request. Of course, you can delete or add applied
formats, too.
 Add applied report format: Click the ••• button behind “Template”, the
Select File dialog box shows. Select a self-made report template (*.rtl File)
and click Open. So the name and the path of report template file are
displayed in the “Template” textbox. Type a name for table format that
current report template defines in the “Custom:” textbox as Format1. Click
Add button to add it in the format list.
 Delete applied report format: select a report format in the list and click
Delete to remove format that you don’t need. Deleting applied format
doesn’t affect the report template file.
 Preview applied report format: Select a format in the format list and it is
displayed in the right list.
Figure 17.4 Report applies format dialog box
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-5
Click OK button after finishing definition. Click Cancel to call off current
operation. You can use Applied report format to gather report template formats
here for invoking at any time, so you have no search for templates one by one in
use.
Applied report format has same function as of Open report template in report
toolbox. Both can be called in report configure.
17.2 Report Configure
17.2.1 Report toolbox and Shortcut menu
There is an empty table or a table with applied format after creating report. It is
needed to configure the report. Report configure has setting report format, editing
cells content and so on. Do these operations by tools in report toolbox or popup
shortcut menu of the right clicking.
Figure 17.5 Report toolbox and shortcut menu
WellinControl Technology Development Co.,Ltd
17-6 Chapter 17 Report
Buttons in Report toolbox:
Cut: cut the selected contents in one or several cells (ex cell format). After cutting,
contents are cleared up.
Cutting Method:
Select one or more cells, click the Cut button in report toolbox.
Right click on a report, select the Cut on popup menu.
Right click on a report, press hotkeys <Ctrl>+<T> when shortcut menu appears.
Copy: copy the selected contents in one or several cells (ex cell format).
Copying method:
Select one or more cells, click the Copy button in report toolbox.
Right click on a report, select the Copy on popup menu.
Right click on a report, press hotkeys <Ctrl>+<C> when shortcut menu appears.
Paste: paste a cut or copied contents in cells at the right of and below current cell
orderly.
Pasting Method:
Select one or more cells, click the Paste button in report toolbox.
Right click on a report, select the Paste on popup menu.
Right click on a report, press hotkeys <Ctrl>+<P> when shortcut menu appears.
Delete: delete the selected contents in one or several cells (ex cell format).
Deleting method:
Select one or more cells, click the Delete button in report toolbox.
Right click on a report, select the Delete on popup menu.
Right click on a report, press hotkeys <Ctrl>+<N> when shortcut menu appears.
Align: align left, align center and align right as the following figure
shows.
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-7
Figure 17.6 Cell align format
Combine Cells: select one or more cells to combine, so the selected cells become
one cell what has same content and format with original left upper cell.
Combining Cells method:
Select two or more cells, click the Combine Cells button in report toolbox.
Right click on a report, select the Combine Cells on popup menu.
Right click on a report, press hotkeys <Ctrl>+<O> when shortcut menu appears.
Undo Combine: select a combined cell to undo combine, so it is broken off to
basic cells what have same content and format with the combined cell.
Undoing Combine method:
Select combined cell, click the Undo combine button in report toolbox.
Right click on a report, select the Undo combine Cells on popup menu.
Right click on a report, press hotkeys <Ctrl>+<S> when shortcut menu appears.
Open: open a report template and add it in current report window. Click the
button, the Open dialog box appears as the figure 17.7. Select a report template file
(*.rtl) and click Open. The report template is loaded in current report.
WellinControl Technology Development Co.,Ltd
17-8 Chapter 17 Report
Figure 17.7 Open a report template
Save: save current report as a report template. Click the button, the Save as dialog
box appears as the figure 17.8. Select saving path and input the report template file
name then click Save. So the template file is saved as “*.rtl” file.
Figure 17.8 Save a report as template
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-9
Page Setup: Click the button, the Page Setup dialog box appears as the figure
17.9. You can set default printer, page size, resource, page direction and border
distance. Click the Header and Footer list as the figure and select contents of the
header and footer. It is page setup for report in WindowMaker. You can invoke
functions to make page setup in TouchView. Refer to the section Report functions for
more.
Figure 17.9 Page setup for report
Figure 17.10 Setup header and footer
Preview: it is to preview a designed report in WindowMaker. When you preview
report, a system hides WindowMaker and TouchView automatically and displays the
WellinControl Technology Development Co.,Ltd
17-10 Chapter 17 Report
toolbox as the figure. You can make page setup in previewing.





Print: click the button, the Print Properties dialog box appears.
Next, Back: if a size of a report is larger than two pages, turn pages to preview.
Two/One page: to preview by two pages or one page per screen. Can switch
them.
Zoom in/Zoom out: zoom in or zoom out previewed pages.
Setup: make page setup for report.
Print: Click the button in WindowMaker, Print dialog box shows as the figure
17.11. It is to use report print function ReportPrint2() in TouchView.
Figure 17.11 Print dialog box
Cell format: set a format of selected cell. It includes type (as number, date, font,
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-11
align, frame style and cell pattern). Click it, the Cell Format dialog box shows. Refer
to the section 17.2.4 for setting report format.
The method of starting up the Cell Format:
 Select cell, click the Set Cell Format button in report toolbox.
 Right click on a report, select Set Cell Format on popup menu.
 Right click on a report, press hotkeys <Ctrl>+<P> when shortcut menu
appears.
Cancel: cancel last operation on report cell.
OK: confirm to add content in text box of report toolbox to current cell. When
you input a text in text box of report toolbox, you must click the button to add the text
into current cell. When you select a cell with contents, the contents are displayed in
text box automatically.
The method of inputting text and formula:
 Input KingView tag, report formula and text in text box of report toolbox, click
OK.
 Double click cell to make the cursor in the cell then edit directly.
Note:
It must add “=” in the front of tag, called function or formula when input them.
Insert KingView tag: Click the button, Select Tag dialog box appears. For
example, you want to display the value of the tag “$Time” in a cell. You firstly input a
“=” in text box of toolbox and click the button. Select the tag in popup Tag Selector
and click OK to close the dialog box. “=$Time” is displayed in text box here. Click
OK in toolbox, so the expression is added into current cell. The value of the cell is
refreshed with tag change when running.
WellinControl Technology Development Co.,Ltd
17-12 Chapter 17 Report
Insert Report Function: Click the button, Function selection dialog box shows
as the figure 17.12.
Figure 17.12 Report functions

Insert row and column quickly in report: when edit a report, if you want to insert
a row in report, select any cell in row where you want to insert a row in, if you
want to insert a column, select any cell in column where you want to insert a
column in. For example, if you want to insert a row in a position of the “Insert
row” cell in report window as the figure 17.13 shows, select the cell and right
click, select the Insert in popup shortcut menu, the Insert dialog box shows as the
figure 17.14. Select Entire Row and click OK. So a new row is inserted above
old third row as the figure 17.15 shows and old third row becomes fourth row
and by parity of reasoning. Cells in inserted row inherit format of its above row
(second row in this example). If you want to insert a column in a position of the
“Insert Column” cell in report window as the figure 17.13 shows, select the cell
and right click, select the Insert in popup shortcut menu, the Insert dialog box
shows as the figure 17.14. Select Entire Column and click OK. So a new
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-13
column is inserted at the left of old third column (C column in the example) as
the figure 17.16 shows. Original columns at the right of “Insert column” move to
the right orderly Cells in inserted column inherit format of its left column. If
there is a combined cell in Insert Row or insert column, the combined cell is
extended to a row or a column.
Figure 17.13 Original report
Figure 17.14 Insert dialog box
Figure 17.15 Report after inserting a row
WellinControl Technology Development Co.,Ltd
17-14 Chapter 17 Report
Figure 17.16 Report after inserting a column

Delete row and column quickly in report: if a row or a column is useless, select
any cell in the row or the column and right click. Select the Delete in the popup
menu, the Delete dialog box shows as the figure 17.17. if you want to delete a
row, select Entire Row. If you want to delete a column, select Entire column.
Click Ok to close the dialog box. Selected row or column is deleted. Other rows
or columns move up or left orderly. And their numbers also change.
Figure 17.17 Delete dialog box

Set read only: Select a cell or Drag the mouse to select some cells and right click.
Select Read Only in shortcut menu. So all selected cells is not changeable in
TouchView.
Note:
Commands in report toolbox and shortcut menu can only be applied in report.
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-15
17.2.2 Define protection properties of report cells
You can input data into and modify the content in cells of KingView report in
runtime
Report has a protection property – read-only in order to modify the content of
cells, which is forbidden.
When configuring reports in developing environment, select the cell area to
protect and right click it to popup the shortcut menu. Select “Read-only” in the menu.
The protected cells cannot be edited in runtime. If you want to see if to assign Readonly to cell, you may right click the cell. If there is the sign “” in front of “Readonly”, it stands for finishing Read-only definition. Re-click the menu item to cancel
protection property.
Note:
Users change the content of cell containing expression in runtime, which
clears up the original expression in current picture. Only close and re-open picture
may recover the expression.
17.2.3 Other Shortcut Editing Methods
Other editing methods of Report:
 Select a cell and press the mouse to drag, you can select more cells. The cell
at the left upper of the area is current cell.
 Select a focus cell and press the mouse then drag the mouse to target cell. If
you press Ctrl at the same time, so all contents in the cells are copied.
 You can click the fixed grey cell what denotes row number and column
number in a report to select an entire row or an entire column.
 Click the grey fixed cell at the upper left of the report to select the report.
WellinControl Technology Development Co.,Ltd
17-16 Chapter 17 Report



Allow you to input a text in a focus cell directly. Double click the cell to
make the cursor in the cell and input a text. Press Enter or click other cell to
confirm the input. Press Esc to cancel the input.
Allow you to drag the mouse to change a row high or a column width. Move
the mouse over the division line between fixed rows or fixed columns, when
the mouse becomes a two-directions black arrow, press the left key and drag
to change a row high or a column width.
If first character of text in a cell is “=”, other characters are expression of
KingView. The expression consists of defined tags, functions and cell
names. Or else it is string.
17.2.4 Set Report Style
Click Set Cell style button in report toolbox or select Set Cell Style command in
menu. Set Cell style dialog box shows as the figure 17.18.
Figure 17.18 Set cell
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-17
The dialog box has five properties sheets: digit, font, align, frame and pattern.
Next introduce them in detail.
Digit: select the type for the value in selected cell from list. It is valid when
running.
 General as the figurer 17.18 shows. The cell doesn’t have any special format.
Number: the figurer 17.19 shows it. When a number is in the cell, you can
set to display decimal digits. If you check the option “Use a kilobit Delimiter”,
when digits of the value is much, it is added thousands delimiter automatically. It
is valid only when the value in the cell is a number.
Figure 17.19

Date: as the figure 17.20 shows. When it is needed to display a special date
format, it is valid only for the cell what you configure the data function Date for
(refer to KingView report functions). You can select any among them.
WellinControl Technology Development Co.,Ltd
17-18 Chapter 17 Report
Figure 17.20

Time: as the figure 17.21 shows. When it is needed to display a special time
format, it is valid only for the cell what you configure the time function Time for
(refer to KingView report functions). You can select any among them.
Figure 17.21
Note:
When displaying the KingView system tags $Time and $Date in cells, you
cannot change their display formats.
WellinControl Technology Development Co.,Ltd
Chapter 17 Report

17-19
Scientific notation: as the figure 17.22 shows. It is valid only when the value in
the cell is a number.
Figure 17.22
Font: set selected font in cell as the figure 17.23. You can set font, type and size.
Click the button with color below the color label then select the font color in popup
palette. Select the font effect: strikethrough and underline. And you can see the effect
in the Preview window.
Figure 17.23 Font
WellinControl Technology Development Co.,Ltd
17-20 Chapter 17 Report
Align: align the contents in selected cells. It has two parts: horizontal and
vertical as the figure 17.24 shows. Horizontal contains the following options:
general, align left, align center, align right and justify align. Vertical contains the
following options: general, align top, align center, align bottom and justify align.
Figure 17.24 Align
Frame: Set a type, line and color of the frame of selected cell. Meaning of options in
the dialog box as the figure 17.25 shows are the following:
Preset: A) Non: set all the selected cells being without frame.
B) Outside frame: set outside frame of cells in rectangle area with selected line style
and color.
C) Inside frame: set inside frame of cells in rectangle area with selected line style and
color.
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-21
Line: set a style and color of a line. Click a line style in line list. Click the button with
color, select a line color in popup palette.
Frame: set a line of frame individually or add an inclined line. You can preview the
cell, when setting a frame.
Default report line is grey what is displayed but printed.
Note:
When defining a table frame, select a line style and color firstly then position
to add frame.
Figure 17.25 Frame
Pattern: set shading and fill style of a cell as the figure 17.26 shows. Click the color
button in Cell Shading, select a background color in the popup palette. Select a fill
WellinControl Technology Development Co.,Ltd
17-22 Chapter 17 Report
style in Cell Pattern. Fill style has the following ways: full-fill, non-fill, left inclined
line, horizontal and vertical grid line, inclined grid line, right inclined line, horizontal
line and vertical line. Click the Color button, the palette appears. Select fill color. You
can preview a fill effect in the right Example.
Figure 17.26 Pattern
17.3 Report Function
KingView provides a set of report functions for calculating data in cells and
operating report in TouchView. Report functions are divided into the following parts:
report build in function, operating cell function, report accessing function, report
function to search historical data, statistic function and report print function.
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-23
17.3.1 Report build-in function
Report build in functions are only used in cell (as math, string and statistic
functions). Most of them are from system functions, have same using method. Just
their parameters change for reducing study quantity and make use convenient.
Referring parameters are same in report functions and functions with cells as
parameters. When parameters are cells,
 If you select cells at random, you need to separate them with comma, as “a1, b3,
c6, h10”
 If you select continual cells, you can input first cell name and last cell name what
are separated with colon. For example, select a cell area between a1 and c10, it is
‘a1:c10’.
 Cell parameters can be replaced with KingView tags in report build-in functions.
That is report supports KingView system functions.
 When using this function, the value in the combined cell will be placed at the top
left, no matter how it is aligned.
Example:
In the B3 and C3 is a combined cell;
\\ Local Node \a0=1; \\Local Node\a1=1;
The resulting sum is:
Sum('b2:b3')=2
Sum('c2:c3')=1
WellinControl Technology Development Co.,Ltd
17-24 Chapter 17 Report
Note:
1. When using report functions in cells, it must add “=” in the front of functions.
Or else a system considers them as string.
2. When cells are parameters in functions, cell parameters should be braced with
single quotation marks.
3. Report build in functions (cells as parameters) are only used in report cells
rather than in scripts except indicating specially.
Next introduce functions and using method of report functions:
1. Abs:
 Function: calculating an absolute value of data in a cell and displaying the
result in current cell.
 Format: =Abs(‘column number and row number of data cell’)
 Return: integer or long
 Example: calculating an absolute value of data in the cell b10 is =Abs(‘b10’)
2. ArcCos:
 Function: calculating an arc cosine value of data in a cell and displaying the
result in current cell.
 Format: = ArcCos (‘column number and row number of data cell’)
 Return: integer or long
 Example: calculating an arc cosine value of data in the cell a6 is = ArcCos
(‘a6’)
3. ArcSin:
 Function: calculating an arc sine value of data in a cell and displaying the
result in current cell.
 Format: = ArcSin (‘column number and row number of data cell’)
 Return: integer or long
 Example: calculating an arc sine value of data in the cell a5 is = ArcSin
(‘a5’)
4. ArcTan:
WellinControl Technology Development Co.,Ltd
Chapter 17 Report




17-25
Function: calculating an arc tangent value of data in a cell and displaying
the result in current cell.
Format: = ArcTan (‘column number and row number of data cell’)
Return: integer or long
Example: calculating an arc tangent value of data in the cell a6 is = ArcTan
(‘a6’)
5. Bit:
 Function: getting a value of a bit (0 or 1) of an integer or long data in a cell
and displaying the result in current cell.
 Format: = Bit (‘column number and row number of data cell’, order number
of bit) order number of bit is an integer between 1 and 16
 Return: 0 or 1
 Example: getting fifth bit of value in the cell a5 is = Bit (‘a5’, 5)
6. Cos:
 Function: calculating a cosine value of data in a cell and displaying the
result in current cell.
 Format: = Cos (‘column number and row number of data cell’)
 Return: integer or long
 Example: calculating an cosine value of data in the cell a5 is = Cos (‘a5’)
7. Date:
 Function: return a date string with same format as current cell on integer
year, month and day in the cell and display it in current cell. Default format
is year-month-day. Date format of the cell is set in the General sheet of Set
Cell Format.
 Format: = Date (‘a1’, ‘a2’, ‘a3’‘) or =Date (long a, long b, long c)
 Example: a year, a month and a day are respectively in cells: b5, b6, b7, if
you want to display a date string depending on the above integers in the cell
b8. input in the cell b8: = Date (‘b5’, ‘b6’, ‘b7’‘).
8. Exp:
 Function: calculating ex when x is equal to a value in a cell and displaying
WellinControl Technology Development Co.,Ltd
17-26 Chapter 17 Report
the result in current cell.
Format: = Exp (‘column number and row number of data cell’)
Return: long
Example: calculating ex when x is equal to a value in the cell a5: =Exp (‘a5’)
9.
10.
11.
12.



Int:
 Function: rounding data in a cell and displaying the result in current cell.
 Format: = Int (‘column number and row number of data cell’)
 Return: integer
 Example: rounding data in the cell a6 is = Int (‘a6’)
LogE:
 Function: calculating Log e x when x is equal to a value in a cell and
displaying the result in current cell.
 Format: = LogE (‘column number and row number of data cell’)
 Return: long
 Example: calculating Log e x when x is equal to a value in the cell a5: =Exp
(‘a5’)
LgoN:
 Function: calculating Log N x when x is equal to a value in a cell and
displaying the result in current cell.
 Format: = LogN (‘column number and row number of data cell’, N)
 Return: long
 Example: calculating Log N x when x is equal to a value in the cell a5: =
LgoN (‘a5’, 10)
Max:
 Function: comparing data in three or more cells and getting a maximum
then displaying in current cell.
 Format: = Max (‘cells area’)
 Example: A) compare values in cells a1, b3, c8 and i10 and get a maximum:
=Max (‘a1’, ‘b5’, ‘c8’, ‘i10’)
B) Get a maximum of values in cells between b5 and b12.: = Max (‘b5:b12’)
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-27
13. Min:
 Function: comparing data in three or more cells and getting a minimum then
displaying in current cell.
 Format: = Min (‘cells area’)
 Example: A) compare values in cells a1, b3, c8 and i10 and get a minimum:
=Min (‘a1’, ‘b5’, ‘c8’, ‘i10’)
B) Get a minimum of values in cells between b5 and b12.: = Min (‘b5:b12’)
14. Pow:
 Function: calculating a random power of a value in a cell and displaying the
result in current cell.
 Format: = Pow (‘column number and row number of data cell’, index)
 Example: calculating the fourth power of the value in the cell a5 is = Pow
(‘a5’)
15. Sgb:
 Function: returning the sign of data in a cell and displaying the result in
current cell.
 Format: = Sgn (‘column number and row number of data cell’)
 Return: if it is positive, return 1.
If it is zero, return zero.
If it is negative, return –1.
 Example: returning the sign of the value in the cell a6 is = Sgn (‘a6’)
16. Sin:
 Function: calculating a sine value of data in a cell and displaying the result
in current cell.
 Format: = Sin (‘column number and row number of data cell’)
 Return: integer or long
 Example: calculating a sine value of data in the cell a5 is = ArcTan (‘a5’)
17. Sqrt:
 Function: calculating a square root of the value in a cell and displaying the
result in current cell.
WellinControl Technology Development Co.,Ltd
17-28 Chapter 17 Report
18.
19.
20.
21.
 Format: = Sqrt (‘column number and row number of data cell’)
 Return: integer or long
 Example: calculating a square root of the value in the cell a5 is = Sqrt (‘a5’)
StrAscII:
 Function: returning AscII value of first case of string in a cell and displaying
the result in current cell.
 Format: = StrAscII (‘column number and row number of data cell’)
 Example: Getting AscII value of first case of string in the cell a6 is =
StrAscII (‘a6’)
StrChar:
 Function: returning a corresponding character of AscII code in a cell and
displaying the result in current cell.
 Format: = StrChar (‘column number and row number of data cell’)
 Example: getting a character of AscII in the cell a5 is = StrChar (‘a5’)
StrFromInt:
 Function: converting an integer value in a cell to a string under other scale
then displaying the result in current cell.
 Format: = StrFromInt (‘column number and row number of data cell’, scale)
Scale: one that you want to convert to
 Example: converting an integer value in the cell a6 to a octal string is =
StrFromInt (‘a6’, 8)
StrFromReal:
 Function: converting a long value in a cell to a string then displaying the
result in current cell.
 Format: = StrFromReal (‘column number and row number of data cell’,
Decimal digits, type)
Decimal digits: indicates to display how much decimal
Type: “f”: display by floating point number
“e”: display by index of lowercase “e”
“E”: display by index of uppercase “E”
WellinControl Technology Development Co.,Ltd
Chapter 17 Report

22.
23.
24.
25.
17-29
Example: converting a long value in the cell a6 to floating point number
with two decimal digits is = StrFromReal (‘a6’, 2, “f”)
StrFromTime:
 Function: converting a time value (begin with 1970-1-1, with unit-second)
in a cell to a string then displaying the result in current cell.
 Format: = StrFromTime (‘column number and row number of data cell’,
String type)
String type: 1. Display date in same way with Windows control pane
2. Display time in same way with Windows control pane
3. Display time and date.
 Example: converting a time value in the cell a6 to time string is =
StrFromTime (‘a6’, 2)
StrInStr:
 Function: finding first occurrence of found string in data source cell and
displaying the result in current cell.
 Format: = StrInStr (‘column number and row number of data cell’, found
string, starting position, if match case)
 Example: find first occurrence of the string “abc” in the cell a5 starting from
second character and match case is = StrInStr (‘a5’, “abc”, 2, 1)
StrLeft:
 Function: returning a string of specified number at the most left in data
source cell and displaying it in current cell.
 Format: = StrLeft (‘column number and row number of data cell’, number)
Number: number of returned characters, if it is zero, return all characters.
 Example: get the most left four characters in the cell a5 is = StrLen (‘a5’, 4)
StrLen:
 Function: returning length of string in the cell and displaying it in current
cell.
 Format: = StrLen (‘column number and row number of data cell’)
 Example: return length of string in the cell a5 is = StrLen (‘a5’)
WellinControl Technology Development Co.,Ltd
17-30 Chapter 17 Report
26. StrLower:
 Function: converting uppercases in string in a cell to lowercases and
displaying the result in current cell. It doesn’t affect other a lowercases,
digits and special characters.
 Format: = StrLower (‘column number and row number of data cell’)
 Example: converting uppercases in the cell a5 to lowercases is = StrLower
(‘a5’)
27. StrMid:
 Function: getting a string of fixed length from string in a cell and displaying
the result in current cell.
 Format: = StrMid (‘column number and row number of data cell’, begin
position, length)
 Example: getting 4 characters from second character in the cell a5 is =
StrMid (‘a5’)
28. StrReplace:
 Function: replacing specified string in a cell with some characters and
displaying the result in current cell.
 Format: = StrReplace (‘column number and row number of data cell’,
parameter1, parameter2, parameter3, parameter4 parameter5)
Parameter1: target string that you want to replace.
Parameter2: replacing string
Parameter3: if match case (1: yes. 0: no)
Parameter4: number to replace (0 indicates to replace all)
Parameter5: if match whole word only (0: yes. 0: no)
 Example: replacing “abc” in string in the cell a5 with “mn”, asking match
case and replace two time as well match whole word only is = StrReplace
(‘a5’, “abc”, “mn”, 1,2,1)
29. StrRight:
 Function: returning a string of specified number at the most right in data
source cell and displaying it in current cell.
WellinControl Technology Development Co.,Ltd
Chapter 17 Report

30.
31.
32.
33.
17-31
Format: = StrRight (‘column number and row number of data cell’, number)
Number: number of returned characters, if it is zero, return all characters.
 Example: get the most right four characters in the cell a5 is = StrRight (‘a5’,
4)
StrSpace:
 Function: generating some blanks in specified positions and displaying the
result in current cell.
 Format: = StrSpace (number of blanks)
 Example: A) =“worker”+ StrSpace(2) + ”on duty”, the result is “Worker
on duty”
B) =’a5’ + StrSpace(2) + ‘a6’, the result is a string equal to string in a5 +
two blanks + string in a6
StrToInt:
 Function: converting string consisting of digits in a cell to an integer then
displaying the result in current cell. Stop converting till reaching to nondigit character. If a capital character is non-digit character, it returns zero.
 Format: = StrToInt (‘column number and row number of data cell’, scale)
 Example: = StrToInt (‘a5’)
StrToReal:
 Function: converting string consisting of digits in a cell to a long then
displaying the result in current cell. Stop converting till reaching to nondigit character. If a capital character is non-digit character, it returns zero.
 Format: = StrToReal (‘column number and row number of data cell’, scale)
 Example: = StrToReal (‘a5’)
StrTrim:
 Function: deleting blanks of specified positions in string in a cell and
displaying the result in current cell.
 Format: = StrTrim (‘column number and row number of data cell’, deleting
type)
Deleting type: 1. Blanks at the left of string
WellinControl Technology Development Co.,Ltd
17-32 Chapter 17 Report
2. Blanks at the right of string
3. Blanks in string except one between words
 Example: “ This is a test! ” is in cell a5, use the function = StrTrim (‘a5’,
2), the result is “ This is a test!”
34. StrType:
 Function: detecting if capital character of string in a cell belongs to
specified type and displaying the judging result in current cell (0: yes. 0: no).
 Format: = StrType (‘column number and row number of data cell’, detecting
type)
Detecting type:
1. Letters digits (A-Z, a-z, 0-9)
2. Digits (0-9)
3. Letters blanks (A-Z, a-z)
4. Uppercase( A-Z)
5. Lowercase (a-z)
6. Punctuation mark (0x20-0x2F)
7. AscII characters
8. Hexadecimal characters (A-F, a-f, 0-9)
9. Printable characters (0x20-0x7E)
10. Control characters (0x00-0x1F or 0x20)
11. Blank characters (0x09-oxoD or 0x20)
 Example: judge if capital character of string in cell a5 is uppercase: StrType(‘a5’, 4)
35. StrUpper:
 Function: converting lowercases in string in a cell to uppercase and
displaying the result in current cell. It doesn’t affect other uppercases, digits
and special characters.
 Format: = StrUpper (‘column number and row number of data cell’)
 Example: converting lowercases in the cell a5 to uppercases is = StrUpper
(‘a5’)
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-33
36. Tan:
 Function: calculating a tangent value of data in a cell and displaying the
result in current cell.
 Format: = Tan (‘column number and row number of data cell’)
 Return: integer or long
 Example: calculating a tangent value of data in the cell a5 is = ArcTan (‘a5’)
37. Text:
 Function: setting the format of data in a cell as special format and displaying
the result in current cell.
 Format: = Text (‘column number and row number of data cell’, special
format)
 Example: setting the format of data in the cell a5 as the format “0#.00” is =
Text (‘a5’, “0#.00”)
38. Time:
 Function: returning time string with same format as defined in current cell
on hour, minute and second integer in cells then displaying the result in
current cell. The default format is hour: minute: second. Cell time format is
set in the General sheet of Setting Cell format.
 Format: = Time(‘a1’, ‘a2’, ‘a3’) or =Time (long a, long b, long c)
 Example: Hour, minute and second are respectively in cells b5, b6, b7, time
string depending on the above three integers is displayed in the cell b8:
=Time(‘b5’, ‘b6”, ‘b7’)
39. Trumc:
 Function: deleting digits after decimal point and getting a long then
displaying the result in current cell.
 Format: = Trumc (‘column number and row number of data cell’)
 Example: truncate data in the cell a5 to get a long: = Trumc (‘a5’)
Logical operator:
Refer to the sector 10.2.1 Operator for logical operator.
The above part introduces KingView report build in functions. Refer to the KingView
WellinControl Technology Development Co.,Ltd
17-34 Chapter 17 Report
functions manual for parameters setting.
17.3.2 Operating cell functions
It doesn’t allow you to input in report cells directly in TouchView, so you have
to use functions. Operating cell functions in scripts is used for operating contents in
cells or getting data in cells. The most of these functions are use in scripts.
1) Setting value of single cell
Long nRet = ReportSetCellValue(String szRptName, long nRow, long nCol, float
fValue)
 Function: setting a value in specified report cell
 Return: integer 0: success
-1: number of row or column is less than zero
-2: wrong report name
-3: fail to set a value
 Parameter: szRptName: report name
Row: row number of cell (may be replaced by tag)
Col: column number of cell (may be replaced by tag)
Value: setting value
 Example: set the long tag Pressure in the cell across second row and fourth
column of real time data report by the tag Pressure changes then return the result
of setting – the KingView tag Long Setting Result. Input the following in data
change scripts: Long Setting Result= ReportSetCellValue(“Real time data
report”, 2, 4, Pressure)
2) Setting text of single cell
Long nRet = ReportSetCellString(String szRptName, long nRow, long nCol, String
szValue)
 Function: setting a string in specified report cell
 Return: integer 0: success
-1: number of row or column is less than zero
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-35
-2: wrong report name
-3: fail to set a string
 Parameter: szRptName: report name
Row: row number of cell (may be replaced by tag)
Col: column number of cell (may be replaced by tag)
Value: setting string
 Example: set the string tag Pressure Comment in the cell across second row and
fifth column of real time data report by the tag Pressure changes then return the
result of setting – the KingView tag String Setting Result. Input the following in
data change scripts: String Setting Result= ReportSetCellString(“Real time data
report”, 2, 5, Pressure Comment)
3) Setting value of cells
Long nRet = ReportSetCellValue2(String szRptName, long nStartRow, long
nStartCol, long nEndRow, long nEndCol, float fValue)
 Function: setting a value in specified report cells area
 Return: integer 0: success
-1: number of row or column is less than zero
-2: wrong report name
-3: fail to set a value
 Parameter: szRptName: report name
StartRow: beginning row number of cells area (may be replaced by tag)
StartCol: beginning column number of cells area (may be replaced by tag)
EndRow: ending row number of cells area (may be replaced by tag)
EndCol: ending column number of cells area (may be replaced by tag)
Value: setting value
 Example: set the long tag Pressure in the cells of area from the cell across third
row and fourth column to the cell across sixth row and seventh column of real
time data report by the tag Pressure changes then return the result of setting – the
KingView tag Long Setting Result2. Input the following in data change scripts:
Long Setting Result2= ReportSetCellValue2 (“Real time data report”, 3, 4, 6, 7,
WellinControl Technology Development Co.,Ltd
17-36 Chapter 17 Report
Pressure)
4) Setting text of cells
Long nRet = ReportSetCellString2(String szRptName, long nStartRow, long
nStartCol, long nEndRow, long nEndCol, String szValue)
 Function: setting text in specified report cells area
 Return: integer 0: success
-1: number of row or column is less than zero
-2: wrong report name
-3: fail to set a value
 Parameter: szRptName: report name
StartRow: beginning row number of cells area (may be replaced by tag)
StartCol: beginning column number of cells area (may be replaced by tag)
EndRow: ending row number of cells area (may be replaced by tag)
EndCol: ending column number of cells area (may be replaced by tag)
Value: setting value
 Example: set the string tag Pressure Comment in the cells of area from the cell
across eighth row and fifth column to the cell across tenth row and seventh
column of real time data report by the tag Pressure changes then return the result
of setting – the KingView tag String Setting Result2. Input the following in data
change scripts:
String Setting Result2= ReportSetCellValue2 (“Real time data report”, 8, 5, 10, 7,
Pressure Comment)
5) Getting value of single cell
float fValue = ReportGetCellValue(String szRptName, long nRow, long nCol)
 Function: getting a value in specified report cell
 Return: long
 Parameter: szRptName: report name
Row: row number of cell (may be replaced by tag)
Col: column number of cell (may be replaced by tag)
 Example: get a value in the cell across second row and fourth column of real time
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-37
data report and give it to the long tag Number: Number= ReportGetCellValue
(“Real time data report”, 2, 4)
6) Getting text of single cell
String szValue = ReportGetCellString(String szRptName, long nRow, long nCol,)
 Function: getting text in specified report cell
 Return: string
 Parameter: szRptName: report name
Row: row number of cell (may be replaced by tag)
Col: column number of cell (may be replaced by tag)
 Example: get text in the cell across second row and fifth column of real time data
report and give it to the string tag Text: Text= ReportGetCellString (“Real time
data report”, 2, 5)
7) Getting number of report rows
Long nRows = ReportGetRows(String szRptName)
 Function: get number of report rows
 Parameters: szRptName: report name
 Example: get the rows number of real time data report and give it to the tag Row
number:
Row number = ReportGetRows (“Real time data report”)
8) Getting number of report columns
Long nCols = ReportGetColumns(String szRptName)
 Function: get number of report columns
 Parameters: szRptName: report name
 Example: get the columns number of real time data report and give it to the tag
Columns number:
Columns number = ReportGetColumns( “Real time data report”)
9) Set the number of rows in the report
ReportSetRows(String szRptName, long RowNum)
 Function:Set the number of rows for the report
 Parameter: szRptName: Report name
WellinControl Technology Development Co.,Ltd
17-38 Chapter 17 Report
RowNum: Row number
 For Example: Set the number of rows for the “Real time data report” as 1000:
ReportSetRows(“Real time data report”, 1000);
10) Set the number of columns for the report
ReportSetColumns(String szRptName, long ColumnNum)
 Function: Set the number of columns in the report
 Parameter: szRptName: Report name
RowNum: Column number
 For Example: Set the number of columns for the “Real time data report” as 1000:
ReportSetRows(“Real time data report”, 1000);
17.3.3 Report accessing functions
Report accessing functions are to save a specified report and look over a saved
report. You can use them to save and look over historical data or save a report.
1) Save report
Long nRet = ReportSaveAs(String szRptName, String szFileName)
 Function: save a report in specified file. The function supports files with format
rtl, xls, csv. Saving path depends on a file suffix.
 Parameters: szRptName: report name
SzFileName: saving path and file name
 Return: flag what indicates if succeed to save. 0 – success.
 Example: save the report “Real time data report” in the file “Data reprot1”, the
path is “C:\My Documents”, Return value is given to the tag SavingFile:
SavingFile = ReportSaveAs(“Real time data report”, “C:\My Documents\ Data
reprot1.Rtl”)
2) Read report
Long nRet = ReportLoad(String szRptName, String szFileName)
 Function: read a file in the specified path to current report. The function supports
files with format rtl, xls, csv. The file path depends on a file suffix.
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-39

Parameters: szRptName: report name
SzFileName: saving path and file name
 Return: flag what indicates if succeed to save. 0 – success.
 Example: read the file Data report1 in the path “C:\My Documents” to current
report, is, Return value is given to the tag ReadingFile:
ReadingFile = ReportLoad (“Real time data report”, “C:\My Documents\ Data
reprot1.Rtl”)
17.3.4 Report statistic function
1.
2.
Average:
 Function: averaging data in cells area and displaying the result in current
cell.
 Format: =Average (”cells area”)
 Example: =Average (‘a1’, ‘b2’, ‘c10’) average data in cells at random
position
=Average (‘b1:b10’) average data in continual cells
Sum:
 Function: summing up data in cells area and displaying the result in current
cell. Doesn’t affect to sum up if blanks or strings are encountered in the
cells area.
 Format: =Sum (”cells area”)
 Example: =Sum (‘a1’, ‘b2’, ‘c10’) sum up data in cells at random position
=Sum (‘b1:b10’) sum up data in continual cells
17.3.5 Report functions to search historical data
Report function to search historical data is to search data from historical database
from KingView or KingHistorian record on user-defined start and end time as well as
search interval, then add the search result in specified report.
WellinControl Technology Development Co.,Ltd
17-40 Chapter 17 Report
1) ReportSetHistData()
ReportSetHistData(String szRptName, String szTagName, Long nStartTime, Long
nSepTime, String szContent)
 Function: to search historical data on specified parameters
 Parameters: szRptName: report name what search result is added into.
SzTagName:: tag name that you want to search for
NstartTime: start time to search data. It is a long converted by
KingView HTConvertTime function on reference of 8:00:00, Jan
1, 1970. So you must convert search start time to a long before
using the function to search.
NsepTime: search interval, it takes second as a unit.
SzContent: cells area what the search result is filled in.
 Example: search data of the gat Pressure since 8:00:00, may 1, 2001, with search
interval of 30 seconds and cells area of “a2:a100”:
Long StartTime;
(StartTime is a custom variable)
StartTime= HTConvertTime (2001, 5, 1, 8, 0, 0);
ReportSetHistData(“Historical data report”, “Pressure”, StartTime, 30,
“a2:a100”);
Note:
When number of searched data rows is larger than number of report rows, a
system add rows automatically to satisfy data demand, most row number can up to
20,000.
2) Set the report to continuous time string
ReportSetTime(String szRptName, Long nStartTime, Long nSepTime,
String szContent)
 Function: Set the report to continuous time string, match, using the function
ReportSetHisData to set the time for the historical data.
 Parameter: szRptName: Select the name of the report you wish to search.
WellinControl Technology Development Co.,Ltd
Chapter 17 Report

17-41
SzTagName: Is the Tag name, which will be searched for.
StartTime: is used to set the start time for the search, which is set
by the KingViewfunction HTConvertTime to 8: 00: 00 1st Jan
1970, which is a long integral type. Therefore, users should ensure
that the start time for the search is set to long integral type before
using this function to search for historical data.
SepTime: Sets the time interval, in seconds, for data searches.
SzContent: Sets the cell that the resulting data will be sent to.
For example: Set the time interval for the report starting at 8:00:00 1st May 2001,
to 30 seconds, the data report filled with ”a2:a100”:
long
StartTime;
(
StartTime
is
customized
tag)
StartTime=HTConvertTime(2001,
5,
1,
8,
0,
0);
ReportSetTime (“Historical Data Report”, StartTime, 30, “a2:a100”);
3) ReportSetHistData2()
ReportSetHistData2(StartRow,StartCol);
 Parameters: StartRow: the starting row of filling data
StartCol: the starting column of filling data
Both parameters are optional, so you are allowed to omit them. Their omitting
values are 1.
 Function: if you don’t specify any parameters, a system shows Search of
historical report dialog box as the figure 17.27.
WellinControl Technology Development Co.,Ltd
17-42 Chapter 17 Report
Figure 17.27 Search of historical report – report property
The dialog box has three attributes sheets for defining parameters. They are
shows as the following:
Report property:
 Report: all report names on current picture are listed in the Report name list. You
can click pull down arrow to select a report what searched data are filled in.
 Cell: select starting position to fill searched data, Input numbers of row and
column.
 Attributes: specify a filling directions: horizontal and vertical
 Column: it has two options: show date and show time. If you need date and time
WellinControl Technology Development Co.,Ltd
Chapter 17 Report


17-43
of what data are acquired
Display tag description: Used to hide or display the tag description under the tag
name.
Display data when the system is off: controls device communication related to
tags, the tag quality stamp is destroyed and data is displayed when the system is
off. If this function is not selected, "---" will be displayed in report when there is
no tick in front of the last recorded data.
Note:
Pay attention to a relation between amount of data and numbers of row and
column, because data exceeding current number of row or number of column will
be truncated.
Time property: set time properties for searching data as the figure 17.28.
WellinControl Technology Development Co.,Ltd
17-44 Chapter 17 Report
Figure 17.28 Search of historical report – time property

Start time: define start time for searching historical data. it has start date
and start time. Two methods of modifying start date are shown as the
following:
1) Click a part in date editor that you want to modify, so the part is
highlighted. Then you input date value directly. For example, in
the figure 17.28, start date is May 24. Click June in start time
editor, it is highlighted. Then input May directly. Click “25”, then
change to 24.
2) Click pull down arrow at the right of date editor, the calendar
control appears as the figure 17.29. Click the arrows at the top of
the calendar to select the month. Then click a day directly.
WellinControl Technology Development Co.,Ltd
Chapter 17 Report


17-45
Two methods of modifying start time are shown as the following:
1. The first method is same as the above method to modify date.
2. Click a part in time editor that you want to modify, so the
part is highlighted. Then you click the increasing arrow or
decreasing arrow at the right of editor to change time.
End time: define end time for searching historical data. it has end date and
end time. The definition method is same as of start time.
Interval: a time interval between search data points when defining search
historical data. You may modify by inputting it directly or clicking the
Increase or Decrease buttons.
Figure 17.29 Use calendar to select date
WellinControl Technology Development Co.,Ltd
17-46 Chapter 17 Report
Tag property: define tag that you want to search for as the figure 17.30 shows.
Figure 17.30 Search of historical report – tag property
The querying historical data in report comes from historical database or
KingHistorian. Click button “KingView History Tags” to pop up dialog box “Tag
Property”, and select tag in the tag list, as shown in Figure 17.31.
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-47
Figure 17.31 Search of KingView historical database – tag property



Recording tags: all tags in current project for what historical records are
defined are listed in the list. The display way supports the tag group.
Selective tags: tags whose historical record you need to search for are listed
in the list.
Selecting tags arrows:
: Select a tag in the available tags list and click the button. Selected tag is
added in the Selected tags list at the right.
: Select a tag in the Selected tags list and click the button. Selected tag is
added back in the available tags list at the left.
>>: All tags in the available tags list at the left are added in the Selected tags
list at the right.
WellinControl Technology Development Co.,Ltd
17-48 Chapter 17 Report
<<: All tags in the Selected tags list at the right are added back n the
available tags list at the left.
Click OK button after selecting all tags, so searched data are filled in specified
reported.
Figure 17.32 Search result of KingView historical database
If the tag comes from KingHistorian, click “KingHistorian Tags”, the dialog box
“Select Tags” will pop up, and select accessible KingHistorian Server in the list, as
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-49
Figure 17.33 shows.
Figure 17.33 Select Tags
Click “Select” to select tag in the popped dialog box, as shown in Figure 17.34.
WellinControl Technology Development Co.,Ltd
17-50 Chapter 17 Report
Figure 17.34 Select Tags from KingHistorian
After selection, the selected tag will be listed in “Tags name that has been
selected”, as Figure 17.35 shows.
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-51
Figure 17.35 Tags selection result in KingHistorian
Click “OK”, and tags are listed to “Select Tags” properties page, as shown in
Figure 17.36.
Delete: Select existed tag in the dialog box, and click “Delete” to delete a tag. If
some KingHistorian Sever is selected, clicking “Delete” can delete all selected tags in
this server at once.
WellinControl Technology Development Co.,Ltd
17-52 Chapter 17 Report
Figure 17.36 Tags selection result
After setting, the query result of the historical report is shown in Figure 17.37.
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-53
Figure 17.37 Search result of historical report

Example: use the following function in scripts of the Search historical data
button:
ReportSetHistData2();
So the dialog box as the figure 17.27 appears in TouchView, and both start
row and start column of cell property are 1. If define the functions as the
following way:
ReportSetHistData2(2,1);
Default start row is 2, start column is 1.
4)ReportSetHistData3()
ReportSetHistData3("ReportName","TagName",StartTime, SepTime,
"szContent",bShowInvalidData);
 Function: Controls the failure of tags related to device communication, the
failure of quality stamps and displays the data when the system is off.
 Parameter: ReportName: Select the name of the report you wish to search.
SzTagName: The Tag name, which the report will be searched for.
StartTime: The start timethe search, which is set as long integral
type by the KingView function HTConvertTime as 8: 00: 00 1st
WellinControl Technology Development Co.,Ltd
17-54 Chapter 17 Report
Jan 1970. Users should ensure that the search start time is in long
integral type before using this function to search for historical data.
SepTime: Time interval, in seconds, for the data search.
SzContent: The cell which will display the search results.
bShowInvalidData: 0 data will not be displayed during device
communication failures or when the system is off, only display “--”; 1 display the last valid recorded data during device
communication failures or when the system is off.
5)ReportSetHistDataEx()
ReportSetHistDataEx("ReportName",QueryFrom,"ServerName", "TagName",
StartTime, SepTime, "szContent",bShowInvalidData);
 Function: Query historical data from KingView historical database or
KingHistorian according to the user-customized parameter, it is compatible with
ReportSetHistData, ReportSetHistData3.
 Parameter: ReportName: Select the name of the report you wish to search.
QueryFrom: When QueryFrom==2, query from KingHistorian;
when QueryFrom==1, query in historical database.
ServerName: KingHistorian node; remote node or “Local” when
querying from KingView historical database. If TagName is full
name, which is Node name\TagName, this item can be omitted when
querying from KingView historical database.
TagName: KingHistorian or KingView historical database tag name.
StartTime: The start timethe search, which is set as long integral
type by the KingView function HTConvertTime as 8: 00: 00 1st Jan
1970. Users should ensure that the search start time is in long
integral type before using this function to search for historical data.
SepTime: Time interval, in seconds, for the data search.
szContent: The cell which will display the search results
bShowInvalidData: 0 data will not be displayed during device
communication failures or when the system is off, only display “---”;
WellinControl Technology Development Co.,Ltd
Chapter 17 Report

17-55
1 display the last valid recorded data during device communication
failures or when the system is off.
Example: Insert the time interval since 13:27:00 July 3, 2007, set time interval as
2 seconds, set the filled area of the data report as “a2:a50” and the data comes
from “Local” historical database; set the filled area of the data report as “c2:c50”
and the data comes from KingHistorian in local.
long StartTime;
StartTime=HTConvertTime(2007, 7, 3, 13, 27, 0);
ReportSetHistDataEx("Report1",1,"local",
"nIODec50",
StartTime,
2,
"a2:a50",0);
ReportSetHistDataEx("Report1",2,"127.0.0.1",
"ZFYLYP_nIODec50.Value",
StartTime, 20, "c2:c50",0);
17.3.6 Report print functions
17.3.6.1 Report print function
Report print function has two using methods on demand: One, when executing
the function, the Print Properties dialog box appears automatically for users to set.
Then print a report. Two, when executing the function, print a report directly by
default setting, which is applied to auto-print report. The function prototype is shown
as the following:
ReportPrint2(String szRptName) Or
ReportPrint2(String szRptName, EV_LONG|EV_ANALOG|EV_DISC)
 Function: print specified report by print configuration.
 Parameters: szRptName: report name that you want to print
EV_LONG|EV_ANALOG|EV_DISC: a integer or a long or
discrete. Then the parameter is equal to 0, auto-print and
don’t display the Print properties dialog box. If it is 0, the
WellinControl Technology Development Co.,Ltd
17-56 Chapter 17 Report

dialog box appears.
Example: auto-print “Real time data report”: ReportPrint2(“Real time data
report”); or ReportPrint2(“Real time data report”, 1); when print manually,
the Print properties dialog box appears: ReportPrint2(“Real time data
report”, 0);
17.3.6.2 Report page setup function
You may make page setup using tolls in report toolbox in WindowMaker, but
you need to invoke page setup function in TouchView. The function prototype is
shown as the following:
ReportPageSetup(ReportName);
 Function: set report page properties, as page size, print directions, footer and
header. After executing the function, the Page setup dialog box appears as
the figure 17.9.
 Parameters: ReportName: name of a report that you want to print
 Example: make page setup for “Real time data report”:
ReportPageSetup(“Real time data report”);
17.3.6.3 Print preview function
After page setup in running, you may look print effect by Print preview. The
function prototype is shown as the following:
ReportPrintSetup(ReportName);
 Function: preview the specified report.
 Parameters: ReportName: name of a report that you want to preview
 Example: preview “Real time data report”: ReportPrintSetup(“Real time
data report”);
A system hides windows of WindowMaker and TouchView automatically in
preview, and restores to display windows when ending a preview.
17.4 Applied report template
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-57
In general, reports in projects of the same fields are same or analogous. If
engineers need to re-make a report (especially a complicated report) in each project,
out of question, it increased an amount of work and development time, because the
most of work is repetitious. Using an existing reports or making a bit change upon
them is a good way for quick and effective work.
KingView provides a report save function in WindowMaker and TouchView,
which is saving a designed report or report with data as a template file (its extension
is .rtl). If you need an analogous report, you only need to create a report window then
open the file in report toolbox. So saved report is loaded in project. If you don’t
satisfy with it, you may modify it or load another report file.
There are two ways to apply report template: one, use the Open button in report
toolbox as the figure 17.38 shows. Select an existing template file (*.rtl) in popup
Select file dialog box to open it. Then current report applies the template format
automatically. Refer to the section 17.2.2 for more.
Figure 17.38 Open button
Two, use Table style in Report design. Create some common styles firstly then
select table style directly for auto-applying template. Refer to the section 17.1.2 for
more.
17.5 Make real time data report
Real time data report is for displaying real time data. Besides displaying tags
values in report in real time, a report may real time refresh data in cells according to
functions or formula in cells. There are tow methods to display real time data of tags.
WellinControl Technology Development Co.,Ltd
17-58 Chapter 17 Report
17.5.1 Refer tags in cells directly
Input “=tag name” in report cell, so the tag value is displayed in the cell in
running. When the tag value changes, displayed value in the cell is refreshed in real
time. For example as the figure 17.39 shows, you want to display current login user
name in the cell B4 in real time. You need input “=\\local node name\\&user name” in
the cell B4, then switch to TouchView. So login user name is displayed in B4 in real
time. If “Administrator” is in log in, “Administrator” is displayed.
Figure 7.39 Citing tag
The way is acceptable for displaying data of fixed tag in cells. If you want to
display data of different tags or, it is better to choose Setting Cell functions.
Note: Only when report picture is open, data in it may be refreshed.
17.5.2 Use Setting Cell function
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-59
If displayed data in cells are from different tags or values of variable type, it is
better to use Setting Cell functions. Of course, it may use the way to display a tag
value. Setting Cell functions have: ReportSetCellValue(), ReportSetCellString(),
ReportSetCellValue2(), ReportSetCellString2(). Refer to the section 17.3.2 for using
method or to KingView functions guide. For example, you set user name in B4 in the
section 17.5.1. You may also use ReportSetCellString() in Data Change Scripts to set
data, as the figure 17.40. So when a system runs and user logs in successfully, user
name is filled in specified cell automatically.
Figure 17.40 Cell setup function
17.6 Make historical data report
Historical report records past productions data. It is important for users. The
WellinControl Technology Development Co.,Ltd
17-60 Chapter 17 Report
methods of making historical report are different depending on different data.
Introduce two methods here.
17.6.1 Real time add data in cells
For example, design a boiler power waste report. The report is generated in each
eight hours (analogous to class report), for recording data at last time of each hour.
And the report should be refreshed in real time when it is looked.
You may use the method of timing refreshing data in cells for the report. The
report is designed as the figure 17.41. Use the function ReportSetCellValue() to set a
tag value into different cells regularly in defined time. Data in cells may be refreshed
here and cells with functions may calculate automatically. When the time to make
relief is up, save current report filled with data as a report file, clear up filled data in
working, then continue to fill, so you finish the request. It is that an operator records
field data in record report once each hour, another operator begins to record in new
report after relief.
You may create another report window in running to call these saved reports for
looking for past records and searching historical data.
Figure 17.41 Boiler power report
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-61
The way of making report may be used for observing real time data, as well for
saving historical reports. You can refer to a real time report in KingView demo project.
17.6.2 Use searching historical data functions
Use searching historical data functions to search data of specified tags in
specified start time and interval form KingView historical database or KingHistorian.
Refer to the section 17.3.5 or KingView functions guide for using method
If you wish a popup dialog box to select different tags and time period for
searching
data,
you’d
better
to
use
the
function:
ReportSetHistData2(StartRow,StartCol). The function provides convenient and full
dialog boxes for users. But it fills all searched data in specified period into the report.
If the report is not large enough, a system adds report rows or columns automatically.
So it is not convenient for users who use uniform style reports, so you can use the
following method.
If you want a report for timing searching historical data without popup dialog
box or to add searched data into fixed report (historical report has the fixed format),
you can use the following functions: ReportSetHistData, ReportSetHistData3 or
ReportSetHistDataEx. When using these functions, you need to specify start time to
search, search interval and fill range of tag data.
KingView has rich and flexible report functions. You can use a report to save,
sum, convert data and other special operations. For example, save acquired data in
cells of a report, the gave data to a curve control for making a analysis curve, which
saves tags, predigest operation and reuse. In short word, a report is applied widely in
various fields, what you may use elastically in practical demand.
17.7 Function for locking the report’s rows and columns
in report
WellinControl Technology Development Co.,Ltd
17-62 Chapter 17 Report
Allows the rows and columns in a KingView report to be locked.
17.7.1 Locking rows and columns in a report
In the KingView report system, select the cells you wish to lock as shown in
Figure 17.42. Press {Ctrl L} to lock the area above and to the left of the selected cell,
as shown in Figure 17.43.
Figure 17.42 Unlocked rows and columns in a report
WellinControl Technology Development Co.,Ltd
Chapter 17 Report
17-63
Figure 17.43 Locked rows and columns in a report
Locked rows and columns do not move with the scroll bar. This means that
regardless of the position of either the bottom or side scroll bars the position of the
locked rows remains the same.
To lock rows only, lock the leftmost cell.
To lock columns only, lock the top cell.
Locked cell can not be edited and need to be unlocked before they can be edited.
17.7.2 Unlocking
To unlock rows and column, press {Ctrl U} in any cell.
Note:
No matter row and column are locked or unlocked, before pressing shortcut, you
should click cell in report, which makes focus locate in report; else operation is
invalid.
WellinControl Technology Development Co.,Ltd
18-1 Chapter 18 DDE between KingView and other applications
Chapter 18 DDE between
KingView and other applications
KingView supports DDE (dynamic data exchange), and can exchange data other
applications support DDE. Using DDE, you may use rich software resource to
enhance KingView. For example, read data from KingView database by spreadsheet
application and optimize production process then read the results by KingView to
control production parameters. You can use Visual Basic to develop service program
with acquiring data, media sound and light alarm, so you build a management system
of upper computer. In addition, you can communicate with database application,
artificial intelligence application and expert system.
Note:
It is similar with above that KingView exchanges data with the other
applications supporting DDE.
18.1 DDE
DDE is a whole communication protocol in Windows platform, supports
WellinControl Technology Development Co.,Ltd
18-2
Chapter 18 DDE between KingView and other applications
exchanging data and sending commands between two or more
applications supporting DDE. DDE exists between client and server
applications all along. May regard DDE process as dialog of two persons. One person
gives question and other answers. Who gives the question is called Client. Other is
Server. An application may be Client and Server at the same time. When it requests
other applications for data, it acts as Client. When it provides data, it acts as Server.
The contents of DDE is stipulated by three sign names.
 Application: the name of both sides doing DDE. The name of business
aplicaniton is contained in the production document. The name of TouchView is
“VIEW”, the name of Microsoft Excel is “Excel”. It is the name of executable fie
for Visual Basic.
 Topic: discussed data domain. The topic of KingView is “tagname”, the topic of
Excel is the name of spreadsheet as sheet1, sheet2, ….., the topic of Visual Basic
depends on the value of the property - LinkTopic of the Form.
 Item: discussed special data object. You should define I/O tags as well as the
project name (refer to the chapter Tag’s definition and management). The project
in Excel is a cell, as r1c2 (across first row and second column). For visual basic,
the project is a special textbox, a label and a picture box.
You must fill in three sign names of server application for client application
before creating DDE. The list is shown as the following for convenience.
Application
rule
KingView
Excel
VB
Example
VIEW
rule
Item
Example
tagname
Excel
Executable
file
Topic
vbdde
spreadsheet
LinkTopic
of the form
sheet1
Form1
Rule
Userdefined
Cell
The
name of
the
control
WellinControl Technology Development Co.,Ltd
Example
temperature
r2c2
Text
18-3 Chapter 18 DDE between KingView and other applications
18.2 Data exchange between KingView and Excel
You need to create I/O tag in tagname dictionary and register three sign names of
server application for DDE connection. When Excel as a Client sends request data to
KingView, you should input remote reference formula in the Excel cell.
=VIEW|TAGNAME!Device. Register
Device. Register indicates the device name and register name of the I/O tag in
tagname dictionary. Must keep the letter’s case of the names of the device and register
correct.
18.2.1 KingView access Excel data
Suppose that KingView accessed data of Excel in the example and KingView as
client requests Excel for data. The data stream is shown as the following.
You need set three sign names of server application Excel when you define I/O
tags for KingVies as client. The server application is Excel, the topic is the name of
spreadsheet, and the item is the name of the Excel cell. The detailed steps are shown
as the following.
1, Define DDE device in KingView
Select “Device\DDE” at the left content area of TouchExplorer, and double click
New at the right display area, the Device Configuration Wizard shows. Refer to
“Chapter 6 I/O device management” for more. All information of DDE devices is
displayed as below.
WellinControl Technology Development Co.,Ltd
Chapter 18 DDE between KingView and other applications
18-4
Figure 18.1 Define DDE device
The defined connection object is Excel (that is connected device name), what is
used when defining I/O tags.
2. Define Tags in KingView
Select “Database\Tagname dictionary” at the left content area of TouchExplorer,
and double click New at the right display area, Tag definition dialog box shows.
Create an I/O long tag in it as the figure 18.2. The tag name is fromExceltoView. The
project name is r2c1, which means the tag is connected with the cell across second
row and first column of Excel.
WellinControl Technology Development Co.,Ltd
18-5 Chapter 18 DDE between KingView and other applications
Figure 18.2 Define tag connected to Excel
3. Create KingView picture
Create a KingView picture and name it “test” as below.
Figure 18.3 Output tag in TouchExplorer
WellinControl Technology Development Co.,Ltd
Chapter 18 DDE between KingView and other applications
18-6
Set the analog output link for the text “#####” as the figure 18.4.
Figure 18.4 Define analog output link
Select the menu “File\Save all pictures” to save the picture after setting. Select
the menu “Configure\View” in TouchExplorer, TouchView Setting dialog box shows
Select the configuration sheet of main picture and set the picture – “test” as man
picture.
4. Start Application
Start Excel firstly then TouchView. TouchView will connect Excel automatically
after starting. Input data in cell A2 (across second row and first column). You can see
data synchronous change in KingView as the figure 18.5.
WellinControl Technology Development Co.,Ltd
18-7 Chapter 18 DDE between KingView and other applications
Figure 18.5 Data exchange of KingView and Excel
Specially, enter a value in the cell A1 of Excel and the formula =SQRT(A1) in
the A2.
The meaning of the formula is that the value of A2 is square root of A1.
Whenever any datum changes, the value of the formula will re-calculate by default on
Excel function. As the value of A1 changes, the value of A2 changes and is
transferred to the tag associated with it in KingView. The figure 18.6 shows it. You
can get the square root of the tag like KingView calculates independently. The way
extends KingView functions greatly.
There is a square root function in KingView. Only take Excel function for
example here.
WellinControl Technology Development Co.,Ltd
Chapter 18 DDE between KingView and other applications
18-8
Figure 18.6 Data exchange of KingView and Excel
18.2.2 Excel access KingView data
Suppose that KingView acquires data from lower computer through driver in
example and Excel requests KingView for data. KingView is the client of the driver
and the server of Excel. The data stream is shown as the following.
WellinControl Technology Development Co.,Ltd
18-9 Chapter 18 DDE between KingView and other applications
The detailed steps are shown as the following.
1. Define device in KingView
Select “Device” at the left content area of TouchExplorer, and double click New
at the right display area, the Device Configuration Wizard dialog box shows (refer to
the chapter 6 I/O device management for more. for example, create PLC of OMRON
here). All information of the configured devices is listed in the list as the figure 18.7.
Figure 18.7 Device configuration
Define the connected object name as OMRON (the name of connected device)
what is used when defining I/O tags.
2. Define I/O tags in KingView
Select “Database\Tagname dictionary” at the left content area of TouchExplorer,
and double click New at the right display area, the Tag Properties dialog box shows.
Create an I/O long tag in it as the figure 18.8. The tag name is fromViewtoExcel, what
must be defined by user. It must check the option “Allow accessing DDE”, which is
for that KingView may transfer acquired data to VB or Excel or other applications.
WellinControl Technology Development Co.,Ltd
Chapter 18 DDE between KingView and other applications
18-10
The project name is “OMRON.AR001”, the tag name is used in
KingView and the project name is in Excel. Connected device is
OMRON what is for defining information of server application.
Figure 18.8 Define IO tag
Note:
It must check the option “Allow accessing DDE” when defining a tag.
Otherwise, a client application cannot access the tag of KingView.
3. Create picture
Create a picture and name it “test1” in WindowMaker as the figure 18.9.
WellinControl Technology Development Co.,Ltd
18-11 Chapter 18 DDE between KingView and other applications
Figure 18.9 Tag output by Touchexplorer
Set the analog output link for the text “%%%%%” as the figure 18.10.
Figure 18.10 Analog output
Select the menu “File\Save all picture” to save the picture. Select the menu
“Configure\View” in TouchExplorer, the TouchView Configure dialog box shows
Select the configuration sheet of main picture and set the picture – “test1” as man
picture.
4. Start Application
Start TouchView. TouchView will connect automatically if there are I/O tags
defined in tagname dictionary. Then start Excel. Select any cell as r1c1 and input
remote formula:
=VIEW|tagname!OMRON.AR001
WellinControl Technology Development Co.,Ltd
Chapter 18 DDE between KingView and other applications
18-12
The figure 18.11 shows.
Figure 18.11 Citing KingView tag in Excel
VIEW and tagname are respectively the names of TouchView application and
topic. OMRON.AR001 is the project name of the KingView I/O tag FromViewToExcel. You only can use the project name in Excel but not the tag name.
After inputting, Excel begins to connect. If connection is successful, the value is
displayed in the cell as the figure 18.12.
WellinControl Technology Development Co.,Ltd
18-13 Chapter 18 DDE between KingView and other applications
Figure 18.12 Result in TouchView
18.3 Data exchange between KingView and VB
DDE is implemented through the propertied and methods of controls in Visual
Basic. You need to set three properties (LinkTopic, LinkItem, LinkMode) for textbox,
label or picture box as client.
control.LinkTopic=Sever Aplication|topic name
control.LinkItem=Item name
Control is the name of textbox, label or picture box.
control.LinkMode has four choices: 0 (close DDE), 1 (warm connect), 2 (cold
connect) and 3 (notify connect).
You need set three sign names of server application when you define I/O tags if
KingView as client requests VB for data. The name of application is of VB executable
file, the topic is the value of the property LinkTopic of the form, and the item is the
name of the VB control.
18.3.1 KingView access data of Excel
Suppose that KingView accessed data of VB in the example and KingView as
client requests VB for data. The data stream is shown as the following.
WellinControl Technology Development Co.,Ltd
Chapter 18 DDE between KingView and other applications
18-14
You need set three sign names of server application in KingView and the value
of LinkMode of the form providing data as 1 in VB in order to make VB Server.
1. Start Visual Basic
Select the menu “File\New Project” to show the new form Form1. Set the value
of LinkMode of Form1 as 1 (source), as the figure 18.13.
Figure 18.13 Form and control in VB
Modify properties of form and control in VB
The properties of Form1: LinkMode is set as 1 (source), LinkTopic is set as
FormTopic what is referred in KingView.
WellinControl Technology Development Co.,Ltd
18-15 Chapter 18 DDE between KingView and other applications
The properties of Text1: the name is set as Text_To_View what is
referred in KingView.
2. Generate the file vbdde.exe
Select the menu “File\Save Project” in VB. Name the project file as vbdde.exe,
which makes default executable file name vbdde.exe. Select the menu “File\Make
EXE File” to build vbdde.exe.
3. Define DDE device in KingView
Select “Device\DDE” at the left content area of TouchExplorer, and double click
New at the right display area, the Device Configuration Wizard shows. Refer to the
chapter 6 I/O device management for more. The messages of configured DDE devices
are displayed as the figure 18.14. The defined connection object is VBDDE (that is
connected device name), what is used when defining I/O tags.
Figure 18.14 Define DDE device
4. Define new tags in TouchExplorer
Define a new tag and name it as FromVBToView. Set the project name as the
WellinControl Technology Development Co.,Ltd
Chapter 18 DDE between KingView and other applications
name of control providing data in Server application, it is the textbox
Text_To_View and connected device is VBDDE here. Tag definition
dialog box is shown as the figure 18.15.
Figure 18.15 Define IO tag
5. Create KingView picture
Create a picture and name it as “test” in KingView as the figure 18.16.
WellinControl Technology Development Co.,Ltd
18-16
18-17 Chapter 18 DDE between KingView and other applications
Figure 18.16 Data output from VB
Set the analog output link for the object “#####” as the figure 18.17.
Figure 18.17 Create animation link for tag
Select the menu “File\Save all” to save the picture after setting. Select the menu
“Database\Configure main picture” and set the picture – “test” as man picture. So you
have finished setting DDE connection.
6. Execute the Application
Select the menu “Run\Start” in VB to run vbdde.exe. Input the value in the
textbox. Start KingView to get the value in VB as the figure 18.18 shows.
WellinControl Technology Development Co.,Ltd
Chapter 18 DDE between KingView and other applications
18-18
Figure 18.18 Data output
If the abnormality is encountered on running, select the menu “Special\Rebuild
failed connection” in TouchView. Then try the above application again.
18.3.2 VB access KingView data
Suppose that VB accesses KingView data. KingView acquires data from lower
computer through OMRON driver and VB as client requests KingView for data. The
data stream is shown as the following.
1. Define Device in KingView
WellinControl Technology Development Co.,Ltd
18-19 Chapter 18 DDE between KingView and other applications
Select “Device” at the left content area of TouchExplorer, and double
click New at the right display area, the Device Config Wizard dialog box
shows (refer to the chapter 6 I/O device management for more. for example, create
PLC of OMRON here). All information of the configured devices is listed in the list
as the figure 18.19.
Figure 18.19 Define device
Define the connected object name as OMRON (the name of connected device)
what is used when defining I/O tags.
2. Define I/O tags in KingView
Select “Database\Tagname dictionary” at the left content area of TouchExplorer,
and double click New at the right display area, the Tag definition dialog box shows.
Create an I/O long tag in it as the figure 18.20.
WellinControl Technology Development Co.,Ltd
Chapter 18 DDE between KingView and other applications
18-20
Figure 18.20 Define IO tag
The tag name is FromViewToVB, what is defined by users. The project name is
OMRON.HR001. Check the option “Allow accessing DDE”. The tag name is used
inside KingView, the project name is used for VB. Connected device is OMRON is
for defining information of server application and has been defined before.
3. Create picture
Create a picture and name it “test1” in WindowMaker as the figure 18.21.
WellinControl Technology Development Co.,Ltd
18-21 Chapter 18 DDE between KingView and other applications
Figure 18.21 Output tag
Set the analog output link for the text “%%%%%” as the figure 18.22.
Figure 18.22 Create animation link for tag
Select the menu “File\Save all” to save the picture. Select the menu
“Database\Configure Main Picture”, set the picture – “test1” as man picture.
4. Start Visual Basic
Continue to use the example of last section to design Form1 as the figure 18.23.
WellinControl Technology Development Co.,Ltd
Chapter 18 DDE between KingView and other applications
18-22
Figure 18.23 Form and controls in VB
5. Make Visual Basic Program
Double click the area of Form1 without controls, the window Form1.frm shows.
Write down the example sub-program Form_Load as the figure 18.24 shows.
Figure 18.24 Build a connection of control and tag in VB
6. Make Executable file
Select the menu “File\Save Project” in VB to save the result. Select the menu
“File\Make EXE File” to build vbdde.exe. Activate OMRON driver and TouchView.
Select the menu “Run\Start” in Visual Basic to execute vbdde.exe. The tag value is
displayed in the textbox Text2 of Form1 as the figure 18.25.
WellinControl Technology Development Co.,Ltd
18-23 Chapter 18 DDE between KingView and other applications
Figure 18.25 Data received by VB from KingView
18.4 Rebuild DDE connection
18.4.1 Menu command to Rebuild DDE connection
When TouchView starts, it connects DDE automatically. If it fails to connect, the
message is shown as the figure 18.26.
WellinControl Technology Development Co.,Ltd
Chapter 18 DDE between KingView and other applications
18-24
Figure 18.36 Failing prompt
The meaning of options in the dialog box:
Continue: give up the DDE connections then continue to create next connection.
Retry: retry to create the DDE connection. In general, the reason that it fails to create
DDE is that service application is not started in advance. At this time, you can press
Alt+Tab to switch the file manager then start service application. Return the dialog
box to select the button. You also may give up connection temporarily but open
TouchView and Select the menu “Special\Rebuild unsuccessful connection”.
Quit: it is to quit TouchView.
Close Message: it is to close the dialog box “fail to create DDE”. But current DDE
connection doesn’t succeed.
The menu correlative with DDE:
 Special\Rebuild DDE connection
After selecting the menu, KingView stops built connection firstly (if there is one),
then rebuild all connections of I/O tags and servi.ce applications.
 Special\Rebuild unsuccessful DDE connection
TouchView rebuilds unsuccessful DDE connection, which doesn’t affect
successful DDE connection.
18.4.2 Functions to rebuild DDE connection
There are two functions correlative with DDE: ReBuildDDE(); and
ReBuildConnectDDE();.
 ReBuildDDE();
WellinControl Technology Development Co.,Ltd
18-25 Chapter 18 DDE between KingView and other applications
It is for rebuilding DDE connection.
Using Format:
ReBuildDDE();
It has no parameter.
 ReBuildConnectDDE()
It is for rebuilding unsuccessful DDE connection.
Using Format:
ReBuildConnectDDE();
It has no parameter.
WellinControl Technology Development Co.,Ltd
Chapter 19 Access database (SQL)
19-1
Chapter 19 Access database (SQL)
KingView SQL access function is for transferring data between KingView and
other ODBC database, It contains KingView SQL access manager, configuring
connection with various database, connecting database examples and SQL functions.
KingView SQL access manager is to create a relation of database columns and
KingView tags. Create tables in database through table template whose information is
saved in the file SQL.DEF. Build a relation between table columns in database and
KingView through bind list, which allows KingView to operates data in database
directly. The relation is saved in the file BIND.DEF.
KingView can exchange data with other external database (supports ODBC
access interface). You need add database in system ODBC data source first, then
make all operations by KingView SQL access manager and SQL functions.
KingView SQL functions can be called in any scripts. You can create tables,
insert or delete records, edit table, clear or delete tables and search records by them.
19.1 KingView SQL access manager
KingView SQL access manager contains table template and bind list. When
executing SQLCreateTable(); instruction, define a structure of created table to used
table template. When executing SQLInsert(); SQLSelect(); or SQLUpdate();
instruction, associate tags in KingView and variables in tables of database according
WellinControl Technology Development Co.,Ltd
19-2 Chapter 19 Access database (SQL)
connection defined in bind list.
KingView provides integrated SQL access management. You can see the
KingView SQL access manager at the left in TouchExplorer as the figure 19.1.
WellinControl Technology Development Co.,Ltd
Chapter 19 Access database (SQL)
19-3
Figure 19.1 KingView SQL manager
19.1.1 Table Template
Select “SQL access manager\Table Template” at the left in TouchExplorer.
Double click New icon at the right of TouchExplorer. The dialog box as the figure
19.2 appears. It is for creating a new table template.
WellinControl Technology Development Co.,Ltd
19-4 Chapter 19 Access database (SQL)
Figure 19.2 Create table template





Table Template name: name of table template. It must be less than 32
characters.
Field name: name of created field in database table applied table template.
It must be less than 32 characters.
Tag type: type of created field in database table applied table template.
Click pull down list button, there are four types available: int, float,
unchangeable and changeable.
Tag length: when select unchangeable and changeable in Tag type, the text
box becomes black (valid) from grey (invalid). Enter a length of the field
what must be a positive integer less than 255.
Index type: Click pull down list button, there are three types available: only,
no only and no. Index is for speeding up searching and ordering fields in
database, but it might slow updating. Selecting “only” can forbid repeated
values in the field.
WellinControl Technology Development Co.,Ltd
Chapter 19 Access database (SQL)
19-5

Allow Null entry: if check it, the field can have null value when recording
data into a table of database, or else the field cannot have.
 Add item: after defining the above items, click Add item button to increase
a defined field into the list.
 Delete item: Select an existing field in the display list, click Delete Field
button to remove the selected field from the list.
 Modify item: Select an existing field in the display list, so all properties of
the field are displayed. Modify the properties then click Modify Field button,
so all modified properties are refreshed in the display list. After modifying,
must click OK to confirm saving changes.
 Move up: Select an existing field in the list, click Move up button to move
up the selected field. The position of the field in table of database will
change.
 Move down: Select an existing field in the list, click Move down button to
move down the selected field. The position of the field in table of database
will change.
Example: create a table template
Create a table template: table1.
Define three fields: salary (integer), name (fixed string with 127 characters),
age (integer). As the figure 19.3 shows it.
WellinControl Technology Development Co.,Ltd
19-6 Chapter 19 Access database (SQL)
Figure 19.3 Define table template table1
19.1.2 Bind List
Bind list is for associating tags in tagname dictionary of KingView and columns
in a table.
Select “SQL access manager\Table Template” in the left outline in
TouchExplorer. Double click New icon at eh right of TouchExplorer. The dialog box
as the figure 19.4 appears.
WellinControl Technology Development Co.,Ltd
Chapter 19 Access database (SQL)
19-7
Figure 19.4 Create bind list






Bind list: name of bind list. It must be less than 32 characters.
Field name: name of a column in database table. It must be less than 32
characters.
Tag: name of KingView tag associated with specified column in database
table. Click ? button at the right, the Select Tag dialog box appears. You can
select KingView tag from it.
Add item: after defining the Field names and KingView tags, click Add
item button to increase a defined field into the display list.
Delete item: Select an existing field in the list, click Delete item button to
remove the selected field from the display list.
Modify item: Select an existing field in the list, so the filed name and
corresponding KingView tag are displayed. Modify the properties then click
Modify item button, so all modified are refreshed in the list. After
modifying, must click OK to confirm saving changes.
WellinControl Technology Development Co.,Ltd
19-8 Chapter 19 Access database (SQL)

Move up: Select an existing field in the list, click Move up button to move
up the selected field.
 Move down: Select an existing field in the list, click Move down button to
move down the selected field.
Example: create a bind list
Define three KingView tags: record1 (memory long), name (memory string), age
(memory integer).
Create a bind list: BIND1.
Define three fields: salary (corresponding with Tag record1), name
(corresponding with Tag name), age (corresponding with Tag age). As the figure 19.3
shows it.
Figure 19.5 Create bind list BIND1
Note:
Keep the order of fields in bind list and in database table uniform.
WellinControl Technology Development Co.,Ltd
Chapter 19 Access database (SQL)
19-9
The maximum number of table template: 1024.
The maximum number of fields in table template: 1024.
The maximum number of bind list: 1024.
19.2 how to configure database connection
19.2.1 Define ODBC data source
KingView SQL access can communicate with other external database (support
ODBC interface) for transferring data. You must define relevant data source in system
ODBC data source before transferring data.
Enter Management tool in Control Panel, double click the Data source (ODBC)
option, the ODBC Data source administrator dialog box appears as the figure 19.6.
Figure 19.6 ODBC data source administrator
WellinControl Technology Development Co.,Ltd
19-10 Chapter 19 Access database (SQL)
Whether ODBC data source is written in English or in Chinese, which is
depended on a computer, their using method is same.
The first two sheets in ODBC data source administrator are respectively “User
DSN” and “System DSN”. Both they define data sources for saving information of
connecting with specified data providers, but they have some differences. Data source
in User DSN is visible only for current user in the computer, but one in system DSN is
visible for all users (include NT service). So you can create ODBC data source by a
range of database.
Take Microsoft Access database for example to create ODBC data source.
 Create a Microsoft Access database with name SQLDatabase.mdb in the
root directory of D disk.
 Double click Database (ODBC), the ODBC data source administrator dialog
box appears. Click the System DSN sheet as the figurer 19.7 shows.
 Click Add button at the right, the Create New Data source dialog box
appears. Select “Microsoft Access Driver (*.mdb)” as the figure 19.8 shows.
 Click Finish button to open the ODBC Microsoft Access setup dialog box as
the figure 19.9.
WellinControl Technology Development Co.,Ltd
Chapter 19 Access database (SQL)
Figure 19.7 System DSN
Figure 19.8 Create new data source
WellinControl Technology Development Co.,Ltd
19-11
19-12 Chapter 19 Access database (SQL)
Figure 19.9 ODBC Microsoft Access setup dialog box

Input the name of data source in Data Source: mine. Click Select button to
choose database from computer. When you finish selecting database, the
dialog box shows as the figure 19.10.
Figure 19.10 Configure ODBC Microsoft Access setup
WellinControl Technology Development Co.,Ltd
Chapter 19 Access database (SQL)
19-13

Click OK button to confirm definitions of data source and return to ODBC
data source administrator. Click OK button to close the ODBC data source
administrator.
So you finish definitions of ODBC data source of Microsoft access database. The
method of defining other types of database is analogous.
19.2.2 KingView supported database and its configuration.
19.2.2.1 Oracle6 Database
It is necessary to configure as the following for communicating with Oracle6.
 Configure Windows database client
 Start SQL*Net TSR and NETINIT.EXE
 Use the function - SQLConnect()to connect Oracle in KingView scripts.
Start SQL*Net TSR and NETINIT.EXE
You can access the Oracle database through installing Oracle’s SQL*Net in local
computer. Oracle’s SQL*Net includes SQL*Net TSR and NETINIT.EXE. You must
start them for connecting Oracle database. SQL*Net TSR must be started in DOS
before Windows runs. NETINIT.EXE runs in Windows.
SQLConnect()
The function is for connecting Oracle database. The syntax is shown as below:
SQLConnect(ConnectionID,“<attribute>=<value>;<attribute>=<value>; …”);
Next introduce properties used in Oracle:
Properties
UID
Value
Data source name configured in Microsoft
ODBC Manager
User name
PWD
Password
SRVR
Specified server and database
DSN
WellinControl Technology Development Co.,Ltd
19-14 Chapter 19 Access database (SQL)
For example:
SQLConnect(ConnectionID,“DSN=Oracle_Data;UID=asia;PWD=abcd;SRVR=
B:MKTG_SRV”);
Note:
It is hard to set SRVR. Setting values are different on different SQL*Net driver.
You can get the information from the document SQL*Net (or from the row
“remote=” of the file CONFIG.ORA)
Supported data types
It supports two data types for Oracle6. The type-char is corresponding to string
tag in KingView with a default value as 1. Oracle6 supports 255 characters at most.
The type number is corresponding to integer and long.
19.2.2.2 Oracle7.2 Database
It is necessary to configure as the following for communicating with Oracle7.2.
 Install Oracle Standard Client in the computer what KingView runs in.
 Start SQL_Net Easy and configure string for allocating SQL connection.
 Create a name of data source.
 Use SQLConnect() to connect.
Configure SQL_Net
1. Start SQL_Net Easy Configuration in Oracle
2. By a default, a server alias is wgs_ServerName_orcl what is used in the function
SQLConnect().
3. Modify the alias and click OK.
4. Click Modify Database Alias Select Network protocol. A naming pipe is name of
Oracle server computer.
Configure data source
WellinControl Technology Development Co.,Ltd
Chapter 19 Access database (SQL)
19-15
1. Start ODBC in control panel and click”System DSN” sheet. Click Add button,
“Create New Data Source” dialog box appears.
2. Select Oracle7 ODBC driver then click Finish. ODBC Oracle Driver Setup dialog
box appears. Type your Oracle server name in the Data Source Name textbox.
3. Click Advanced button to show the ODBC Oracle Advanced Driver Setup dialog
box. Click Close to return the ODBC Data Source Administrator dialog box as the
figure 19.11.
4. Click OK to confirm configuration.
Figure 19.11 Define Oracle7.2 data source
1.
2.
3.
4.
Configure date and time for Oracle data field
You must configure bind list for registering date and time.
Click bind list in SQL access manager of TouchExplorer. Create a bind list dialog
box appears.
Type the DATE_TIME delim() function in the Field name.
Type the tag that you want bind in Tag as the figure 19.12 shows.
Assign current date and time to the tag DATE_TIME_TAG in scripts.
WellinControl Technology Development Co.,Ltd
19-16 Chapter 19 Access database (SQL)
Figure 19.12 Configure bind list
19.2.2.3 SyBase or MS SQLServer database
It is necessary to configure as the following for communicating with SyBase or
MS SQLServer.
 Configure users of Windows database
 Use SQLConnect() function to connect.
Configure database
Open 32-bit ODBC data source administrator in control panel. Click Add then
select SQL Server, so ODBC SQL Server appears.
Type the name of data source in Data Source Name, the name of database server
in Server and accessed address of SQL server in Network Address. Click Option>>,
input the database name in Database as the figure 19.13 shows.
WellinControl Technology Development Co.,Ltd
Chapter 19 Access database (SQL)
19-17
Figure 19.13 Configure SQL Server database
Note:
Users must keep the name of SQL server and one on network uniform. The
concrete name is confirmed by SQL server managing program- SQL Enterprise
Manager.
Connecting format:
SQLConnect(ConnectionID,”<attribute>=<value>;<attribute>=<value>;…”);
The properties of SyBase and MS SQL Server are shown as the following:
Properties
Value
DSN
Data source defined in ODBC
UID
Login ID
PWD
Password, match case
SRVR
Computer name what a database is in
DATABASE
Database name accessed
For example:
WellinControl Technology Development Co.,Ltd
19-18 Chapter 19 Access database (SQL)
SQLConnect(ConnectionID,“DSN=wang;
DATABASE=kingivew;UID=user1;PWD= abcd”);
Supported data types by KingView recently
SQL Server
data type
Bigint
bit
char
datetime
decimal
float
KingView data
type
Memory long
Memory discrete
Memory string
Memory string
Memory long
Memory long
int
money
nchar
ntext
numeric
nvarchar
Memory integer
Memory integer
Memory string
Memory string
Memory long
Memory string
real
smalldatetime
smallint
smallmoney
sql_variant
text
tinyint
varchar
Memory long
Memory string
Memory integer
Memory integer
Memory string
Memory string
Memory integer
Memory string
Description
Exact value. Remark 1
I bit binary value
Fixed string
Date data
Exact value saved in character
Double precision floating
point
Integer
Currency
Fixed Unicode string
Variable length Unicode string
Exact value with sign
Unicode
Variable length
character stream
Floating point number
Yyyymmddhhmmss
Exact value 32768
Currency
Remark 1
Variable length characters
Integer,256
Variable length stream string
Non-Supported SQL Server data types temporarily y:
SQL Server data type
Description
WellinControl Technology Development Co.,Ltd
Chapter 19 Access database (SQL)
binary
image
varbinary
timestamp
uniqueidentifier
19-19
Binary
data
stream
Variable length
binary data
Variable length
binary
Binary
data
stream
GUID
global
unique sign
Remark: bigint,sql_variant supported since SQL SERVER 2000 SQL. Server
7.0 or former versions don’t support them. KingView supports them imperfectly.
Suggest better not use.
Note:
When using Sybase Database Server, data types (char, int, float) are match
case and must be in lowercase.
Sybase or Microsoft SQL Server only supports an active statement at the same
time. The names of column and table are match case. A table name must be
authorized fully by its owner, as dbo.MyTable
19.2.2.4 dBase database
Must execute SQLConnect() to connect dBASE.
SQLConnect(ConnectionID,“<attribute>=<value>;
<attribute>=<value>;…”);
The used properties of dBase are shown as the following. Mind you to comply
with listed order.
Properties
Value
DSN
Name of data source configured in Microsoft ODBC
WellinControl Technology Development Co.,Ltd
19-20 Chapter 19 Access database (SQL)
CS
Define format of data saved: IBM PC or ANSI. A default is IBMPC
DB
Specified path of saving dBASE. A default is current path.
FOC
LCK
A maximum number of files that are open but used.
CSZ
USF
MS
LCOMP
COMP
Define an access level of database record. Valid value is FILE or
RECORD. A default: NONE
A number of 64K modules for buffering database records. The
bigger the value is, the better the performance is. A default is 4. a
allowed maximum depends on valid system memory.
Define when the driver updates database. If it is 1, the driver
updates once in each COMMIT, which worsens a system
performance. A default is 0, which indicates that the driver updates
on file closing. But if the computer is broken down before file
closing, new records will be lost.
Define if support previous Q+E software. When MS=0, support. A
default is 1.
Define locked mode: compatible with dBASE or with Q+E
Support backward compatibility with Q+E. when COMP=DBASE,
is backward compatibility. COMP=ANSI, it is simple edition.
Supported data types
It supports three types of dBASE. The type-char (contains fixed string) is
corresponding with string tag in KingView. DBASE supports 254 characters at most.
The type-numeric and float are corresponding with integer or long tags. You must set
a tag length whose format is decimal.
19.2.2.5 MS Access database
Must execute SQLConnect() to connect Microsoft Access.
The syntax of SQLConnect():
SQLConnect(ConnectionID,“<attribute>=<value>;<attribute>=<value>; …” );
The used properties of Access are shown as the following.
WellinControl Technology Development Co.,Ltd
Chapter 19 Access database (SQL)
Property
DSN
19-21
Value
Name of data source defined in ODBC
Supported data types
It supports five types of Access. Valid data types are determined by ODBC
version that you use. The type-text (contains fixed string) is corresponding with string
tag in KingView. You must set parameters for it. Access supports 255 characters at
most.
19.3 Use KingView SQL
19.3.1 Create connection between KingView and database
You must create connection between KingView and database for data
communication. Next introduce how to connect KingView and database through an
example.
For example: create connection between KingView and Access database
 Use the example in the section 19.2.1 Define ODBC data source. Create a
database called “SQLdatabase.mdb” in the root directory of D disk and a
table called Kingview in it. Define a new tag in KingView tagname
dictionary what name is DeviceID and type is memory integer.
 Create a ODBC data source in local computer. For example a name of data
source is mine. Refer to the section 9.2.1 Define ODBC data source fro
more.
 Create a bind list in TouchExplorer. Define a field: name (corresponding
with memory string tag-name in KingView). Refer to the section 19.1.2
Bind list for more.
 Connect database. Create a picture “Connect Database” and draw a button
with the text “connect database” on it. Use SQLConnect() and SQLSelect()
to connect the database mine in “on key up” of animation link of the button.
WellinControl Technology Development Co.,Ltd
19-22 Chapter 19 Access database (SQL)
SQLConnect( DeviceID, "dsn=mine;uid=;pwd=");
/* Create connection with the database mine. DeviceID is a memory integer
variable create by user for saving a number value assigned by SQLConnect() to each
database. */
/*Note: before executing SQLDisconnect (the function to stop connection),
executing repeatedly SQLConnect() will increase DeviceID. The number of DeviceID
is 255 at most*/
SQLSelect(DeviceID, "kingview", "BIND", "", "");
/* SQLSelect(): access a database and return information of a table. You can
inquire, delete and clear the information. */
If you finish executing the above statements, you have created connection
between KingView and database.
19.3.2 Create table
You can create a table in database by KingView after connecting successfully
KingView and database. Next introduce how to create a table though an example.
For example, create a table in database



Create a table template-table1 in KingView and define three fields: salary
(integer), name (fixed string, has 255 characters), age (integer). Refer to the
section 19.1.1 table template for more.
Modify the scripts in “on key up” of animation link of the Connect Databse
button as the following shows.
SQLConnect( DeviceID, "dsn=mine;uid=;pwd=");
Create database table. Draw a button with text-“Create table” on the picture
“Connect database”. Use the function SQLCreateTable() in scripts of “on key
up” of animation link of the button.
SQLCreateTable( DeviceID, "KingTable", "table1" );
/*Create database table: KingTable*/
WellinControl Technology Development Co.,Ltd
Chapter 19 Access database (SQL)
19-23
The statement is for creating a table called KingTable in the database according
the format of a table template table1. There are three fields in auto-created table
KingTable. They are respectively: salary, name and age. Tag type, tag length and
index type of each field depend on definitions in the template table1.
19.3.3 Save data into database
You can save data in database tables after creating tables successfully.
Next introduce how to save data into a table though an example.
For example, save data into a table
 Create a bind list-BIND1 in KingView and define three fields: salary
(integer, corresponding with the tag record1), name (fixed string, has 255
characters and is corresponding with the tag name), age (integer,
corresponding with the tag age). Refer to the section 19.1.2 bind list for
more.
 Draw a button with the text “Insert record” on the picture Connect database.
Use the function SQLInsert() in scripts of “on key up” of animation link of
the button.
SQLInsert( DeviceID, "KingTable", "BIND1" );
The statement is to insert a new record in the table KingTable based on
connections defined in the bind list BIND1.
After executing the statement, KingView insert a current value of the variable
salary into the field- salary of last record in the table KingView of Access database.
Similarly, current values of the variables name and age are inserted respectively into
the fields name and age of last record. You can click the button at any time in running
to insert. So many new records are added in the database for saving real time value of
variables.
19.3.4 Search data
WellinControl Technology Development Co.,Ltd
19-24 Chapter 19 Access database (SQL)
You can search data in connected database by KingView in running. Next
introduce how to search data through an example.
For example, search data.
 Define tags in KingView to save records from database. “Record salary”:
memory analog, “Record name”: memory string, “Record age”: memory integer.
Define a bind list-BIND2 for specifying connection in searching below.
Figure 19.14 Bind list

Draw a button with the text “Get selection set” in the picture - Connect Database.
Use the SQL connection function in scripts of “on key up” of animation link of
the button for getting a selection set.
SQLSelect( DeviceID, "KingTable", "BIND2" ,"","");
The statement is for selecting all records satisfying conditions in the table
KingTable and returning first record in selection set according to connection defined
in BIND2. if you don’t define conditions, all records in the table are returned.
After executing the statement, KingView gives a value of the field salary of first
WellinControl Technology Development Co.,Ltd
Chapter 19 Access database (SQL)
19-25
record of selection set the KingView tag – “Record salary”. Similarly, values of the
fields name and age are given respectively to the tags “Record name” and “Record
age”.
 Display the searched values in the picture. Draw three text - “##” and define their
output values to connect with the tags “Record salary”, “Record name” and
“Record age” below.
Figure 19.15 Search interface
Return the first record of selection set firstly after executing SQLSelect(). “##” in
the picture is replaced by returned value.


Inquire record: draw four buttons on the picture Connect database.
Button text: First
On key up of animation link: SQLFirst(DeviceID);
Button text: Next
On key up of animation link: SQLNext( DeviceID );
Button text: Previous
On key up of animation link: SQLPrev( DeviceID );
Button text: Last
On key up of animation link: SQLLast( DeviceID );
Stop connection: draw a button with the text-Stop Connection on the picture
Connecting Database. On key up of animation link: SQLDisconnect(DeviceID);
The statement is to disconnect a database.
WellinControl Technology Development Co.,Ltd
19-26 Chapter 19 Access database (SQL)
The last picture is shown as the figure 19.16.
Figure 19.16 KingView SQL database access
Define complicated search
SQL access manager allows you to specify a complicated search and design own
SQL statements. These searched can be created dynamically or contained in external
files. In addition, they might include parameters than are converted to search in
running. SQL access manager API allow you execute SQL statements supported by
any user database and get search results. At the same time, saving process may be
executed availably but not supported fully.
Refer to the “Support saving process” for more.
You must call the function – SQLSetStatement for more complicated search.
Create dynamic search
You need two functions for dynamic search: SQLSetStatement() and
WellinControl Technology Development Co.,Ltd
Chapter 19 Access database (SQL)
19-27
SQLAppendStatement(). SQLSetStatement() is to begin a new SQL statement that is
any valid SQL statement (includes saving process). SQLAppendStatement() is to
append string into a statement because KingView only supports 131 characters.
For example:
ResultCode = SQLSetStatement ( ConnectionID, “Select LotNo, LotName,
LotDescription, LotQuantity from LotInfo, ProductionInfo” );
ResultCode = SQLAppendStatement ( ConnectionID, “where LotInfo.LotNo =
ProductionInfo.LotNo” );
ResultCode = SQLAppendStatement ( ConnectionID, “order by LotNo,
NotName, LotQuantity” );
So you can execute the statements.
Note: a lot of columns name and table names in database are match case.
Read SQL statements form file
You can create a search in other software as Microsoft Access or other database
tools, then use the function - SQLLoadStatement() to invoke the search.
For example:
ResultCode = SQLLoadStatement ( ConnectionID, “c:\myappdir\lotquery.sql” );
So you can execute the statements.
Modify extensible SQL statements
SQL Access Manager allow you specify a where statement including KingView
tags for full SQL functions. You need the following function for specifying SQL
parameters in running.
SQLPrepareStatement(),SQLSetParamType(), QLClearStatement(),
SQLClearParam();
For replacing SQL statements, if you want to specify parameter later, you can put
a ? in parameter position. The statement becomes a replace one. When a parameter is
set, it is executed.
WellinControl Technology Development Co.,Ltd
19-28 Chapter 19 Access database (SQL)
SQLPrepareStatement() is to prepare a statement for executing. It doesn’t
execute a statement but activate a statement for setting parameters.
For example:
ResultCode = SQLSetStatement ( ConnectionID, “select LotNo, LotName,
LotDescription, LotQuantity from LotInfo, ProductionInfo” );
ResultCode = SQLAppendStatement ( ConnectionID, “where LotInfo.LotNo
= ?”);
ResultCode = SQLAppendStatement ( ConnectionID, “order by LotNo,
LotName, LotQuantity”);
ResultCode = SQLPrepareStatement ( ConnectionID, SQLHandle );
ResultCode = SQLSetParameInt ( SQLHandle, 1, tagLotNumber );
So you can execute the statements.
Once the statement is executed and you no longer use a preparing statement, you
can invoke the function - SQLClearStatement() to release relevant resource.
Execute extensible SQL statements
You know that the statements can be created dynamically, read from files,
prepared and modified from the preceding content. Now you can execute the
statements. SQL access manager use the function – SQLExecute() to finish.
SQLExecute() execute current active statements or prepared statements handle.
For example 1:
ResultCode = SQLLoadStatement ( ConnectionID, “c:\sql\lotquery.sql” );
ResultCode = SQLExecute ( ConnectionID, “BIND1”, 0 );
For example 2:
ResultCode=SQLSetStatement( DeviceID, "select name from kingviewT");
/*SQL search statements: read the column – name from the table - kingviewT*/
ResultCode=SQLAppendStatement( DeviceID, "where salary = ?");
/*use ?what is evaluated late */
WellinControl Technology Development Co.,Ltd
Chapter 19 Access database (SQL)
19-29
ResultCode=SQLPrepareStatement( DeviceID, handle);
/* preparing statement*/
ResultCode=SQLSetParamInt(handle,1, value );
/* set parameter for . value is a memory integer*/
ResultCode=SQLExecute( DeviceID, "BIND1" , handle );
/* execute */
For example 3:
SQLSetStatement( ConnectID, “select agg from kingviewT” );
SQLExecute( ConnectID, 0 );
The statement in the example 3 has the handle as zero in the function SQLExecute(), does not need to invoke SQLPrepare() to prepare.
Support saving process
SQLExecute() supports saving process. If you create a process called
“LotInfoProc” (includes the statement: Select LotNo,LotName from LotInfo)