Professional Documents
Culture Documents
32
Getting started
Table of Contents
1. INTRODUCTION ............................................................................................................................... 5
2. STARTING TWINSOFT .................................................................................................................... 6
2.1. System requirements ............................................................................................................ 6
2.2. Starting the CD-ROM of TWinSoft...................................................................................... 7
2.3. Programs of TWinSoft Suite ............................................................................................. 8
3. TWINSOFT PROTECTION ............................................................................................................... 9
3.1. The Evaluation mode ........................................................................................................... 9
3.2. The Dongle .......................................................................................................................... 9
3.3. The Code (License).............................................................................................................. 9
3.4. The TWinSoft LITE .............................................................................................................. 9
4. WIZARD......................................................................................................................................... 10
5. PRESENTATION ............................................................................................................................. 13
6. COMMUNICATION (PC SET UP) .................................................................................................... 14
6.1. Sending a program ............................................................................................................ 15
Compile + test of available memory. .................................................................................................15
Upload................................................................................................................................................15
10.4. Variables.......................................................................................................................... 29
Local Tags..........................................................................................................................................29
Global Tags ........................................................................................................................................29
The colors of the Tags........................................................................................................................29
Disclaimer
Every effort has been made to ensure the accuracy of the information in this guide. However, Techno Trade
S.A. assumes no responsibility for the accuracy of the information. Product information is subject to change
without notice.
is a registered trademark of Axeda.
MODBUS is a registered trademark of Gould Modicon.
TSOFT , TVIEW , TWinSoft, WebForm Studio and A are registered trademarks of Techno Trade s.a.
Windows 95, 98, NT, 2000, XP are trademarks of Microsoft Corp.
Internet Explorer is a trademark of Microsoft Corp.
AB
Copyright
1. Introduction
TWinSoft is the software necessary to create running application for A RTU and Low
Power RTU. It also allows communicating with your RTU to visualize its process.
This manual helps you to understand the concept of A and to create basic configurations as:
Tags (the variable of the A).
Programs (the automation programs in Ladder programming).
Alarms.
Data logging criteria.
Remote Tags.
A Access Security.
Concerning Low Power RTU a specific manual is available.
A is presented as the 6 in 1 Tele-control system. It means A can be configured for
all those features without needing supplementary software or hardware. What are those six
features?
1. A is a Web Server: TCP/IP has been implemented as standard protocol. A can
be called by a Browser to display HTML images, saved in the A. It is also able to
send e-mail through a provider and send a file to a FTP site. This feature is available
from versions TWinSoft 7.00 and OS 5400.
2. A is a multi-port system: A is equipped with different communication ports
that allow local communication with other equipment. A also allows remote
communication through different types of modems (ISDN, PSTN, GSM, Cellular,
Radio). A supports as standard, ModBus RTU protocol, TCP/IP protocol and
Minitel protocol on all ports. A is able to handle concurrent communications on
different ports in multi-tasking and at different speeds.
An Ethernet card is also available (10 Base/T).
3. A is a PLC: with the help of the IEC1131-3 standard Ladder programming,
automation programs can be developed; including mathematical functions, PID loops and
user definable function blocks.
4. A is an alarming system: on alarm conditions (digital and/or analog), A is able
to send messages to printer(s), to pager(s), GSM and other cellular systems, to call a
supervisor, to send email, etc
5. A is a Data logger: in order to memorize events of your process, you can define
criteria of recording values of Tags. Those values can be stored on event and/or
periodically. Recording can be FIFO (circular buffer continuous) and event driven.
6. A is protocol converter: with the help of external C drivers that you can write,
A can be used to translate a proprietary protocol to ModBus protocol for a
connection to a standard supervisor package or translate between devices of different
manufacture.
2. Starting TWinSoft
2.1. System requirements
Hardware: Pentium or higher.
Memory: 16-MB minimum. We recommend 32 MB.
Hard Disk: 10 MB required plus the application files.
Display: VGA, SVGA with a minimum resolution of 640 x 480. We recommend 800 x 600.
Mouse: any Windows compatible mouse.
Parallel port: required in case of dongle protection. (A software license is also available)
Serial port: required for a local connection to Aor for an external modem.
Modem: any PCMCIA or external modem properly configured in Windows.
Operating system: Windows 95, Windows 98 or Windows NT (service pack 3 or higher),
Windows 2000, Windows XP.
To Browse A:
Internet Browser: as ActiveX is used, Internet Explorer only can be used. Version 5.00 or higher
is recommended to take benefit of the dialer.
The CD-ROM of TWinSoft includes MSIE version 5.00.
TWinSoft 8.32
TWinSoft is the software required for developing an application for the A RTU. The
basis for configuring a A application is explained in this manual.
Installation of TWinSoft includes WebForm Studio: HTML editor dedicated to RTU),
Report studio: Report editor dedicated to RTU and WebForm Viewer: Internet Explorer
TBox Dialer and ActiveX (see next).
WebForm Viewer
This software contains the tool TBox Dial It ! used to dial a A with Internet Explorer.
It also contains the ActiveX used to display RTU dedicated objects.
It needs to be installed on the PC used by a operator to dial A with Internet Explorer,
when TWinSoft is not required.
TBox Mail
This software is used to display a Chart view from datalogging attached to an e-mail.
Acrobat Reader
Software needed to read our documentation.
Internet Explorer 5
Minimum version required to dial A and display properly the ActiveX.
figure 1
Other programs and menus:
TBox drivers: when 'C' custom drivers have been installed. The on line help of the driver
configuration is available in this folder.
Accessories: group containing the utility Password generator and Reset User preferences:
reset of registry information to restore the default configuration of TWinSoft.
Documentation: group containing the various documents associated to TWinSoft and RTU.
WebForm Studio: to start the HTML editor, dedicated to A when it is used as a Web
Server.
3. TWinSoft Protection
The software itself is not protected; it can be installed on any PC and used to develop TWinSoft
documents Offline or to monitor/control a running program locally or remotely.
The only protected operation is the insertion of an application in the A.
In order to find the best way for you we offer different possibilities:
4. Wizard
When starting TWinSoft the first time or when creating a new document, the Wizard helps you to
define the basic configuration:
figure 2
This configuration can be modified using the RTU properties dialog boxes.
Telephone information
the location where the
A will be placed.
According to this data
TwinSoft will dial
country, area code or
prefix when calling the
A.
figure 3
10
In case you have selected a modem (see previous page), the Wizard offers to define a connection
to an ISP, in order to send e-mail.
figure 4
figure 5
11
The Wizard then asks you whether you use an Ethernet card and offers to configure it.
figure 6
12
5. Presentation
Using TWinSoft, you can easily create all needed items such as Tags, alarm recipients, alarm conditions,
data logging criteria, and more using lists.
figure 7
To open a list of items, simply select the type of item you want to see in the project workspace (the tree in
the left panel of the main window). TWinSoft opens a view (new window) showing these items.
You can open several views to see more than one list at a time: In the Window menu, choose New.
The window in the bottom can be selected to display utility information. It can be opened (or closed) by
pressing the accelerator keys:
<ALT + 1>: Open / Close the Project Workspace.
<ALT + 2>: Build results (results of the compilation and use of the memory of the A).
<ALT + 3>: Watch (to display a custom design list of values of Tags).
<ALT + 4>: Cross-reference (gives complete information of 1 Tag).
The status line indicates the type and status of the communication.
TWinSoft: 8.32 Getting Started
13
configuration.
The Off line option is selected to avoid sampling a A that is not connected.
In case of a local connection, select the port of the PC that is used to communicate with the
A. The Baudrate must fit with the speed of the port of the A to which your PC is
connected. If you dont know the Baudrate of A, you can set it to a default
configuration (see chapter 6.3: Working modes of A)
figure 8
Communicating with your A using a modem is easier than ever since TWinSoft takes
full advantage of Windows' built-in modem support: Simply install your modem in the control
panel's Modems applet and you are ready to call your A.
After having selected the communication mode, you can check the communication doing a RTU
identification from the Communication menu.
For more information, click Help.
TWinSoft: 8.32 Getting Started
14
The result of compilation is available in the 'Results' window. This window is automatically
opened if the compilation fails, otherwise you can open it with the accelerator keys <ALT + 2>, or
from the main menu bar 'View' -> 'Build Results':
Information:
Warning:
Error:
Indicated in black
Indicated in bold dark green.
Indicated in bold red
Available information:
OS Version: TWinSoft reads the OS version of the A, to test if the TWinSoft
document fits with the material.
Program + Chrono: RAM memory available for Program, chronologies and Sampling
Tables.
Sampling Tables: RAM memory available for Sampling Tables.
ROM: EEPROM memory for the program sent by TWinSoft. When the A starts, a
part of program is copied in (battery-backed) RAM.
Upload
Upload means transferring information from the PC to the A, locally or remotely.
To access Upload features, click 'Communication' -> 'Upload' from the main menu bar.
Upload of the program.
The PC sends the current TWinSoft document (program) to the A. The document is first
compiled then sent to the A. It is carried out by the icon
pressing the keys <CTRL + F9>.
It must be executed every time a modification is implemented within your document, in order to
apply it to the A.
15
A is configured as follows:
COM1, COM2, COM3: 9600 baud + even parity + ModBus protocol (unprotected).
COM4: V22, PSTN (protected if it was programmed).
station address number: 1 (ModBus address).
TWinSoft: 8.32 Getting Started
16
17
7. RTU properties
Setting the parameters of the A to specific values has never been so easy thanks to a new set
of comprehensive dialog boxes. To open the RTU Properties dialog boxes, use the icon of the
Main Toolbar:
figure 9
7.1. General
If the Wizard was used, the information entered is displayed. Information can be updated.
figure 10
For more information, click Help.
18
figure 11
COM1 and COM2 are RS232 communication ports for any local connection to a supervisory PC,
printer, ModBus equipment, or to an external modem (PSTN, ISDN, GSM, RADIO, HF,). The
maximum distance is 12 m.
COM3 is an RS485 communication port for network connection to other A (maximum 32) to
RM modules (maximum 255) or to any other ModBus equipment having an RS 485 port. The
maximum distance, depending on line quality, can be up to 10 km.
COM4 is an option. An internal modem can be used on PSTN lines (in modes V21, V22, V22b or
V23) or on leased lines (in mode V22).
COM5 is an option that can be equipped with a PCMCIA modem (PSTN, ISDN or GSM) or with a
network modem for network connection of A (maximum 10). The maximum distance,
depending on the number of A and the line quality, can be up to 50 km.
TWinSoft can use any port for the visualization or sending of a document.
19
8. Creating Tags
Configuration is carried out using Tags. Tags are of all variables that the A program
recognizes : digital inputs to the CPU, analog outputs of an extension rack, a register,
To declare a Tag, open the list of Tags and click Add a Tag, and then choose Digital or Analog:
figure 12
Type: for physical input/output select I/O. Other types are internal registers of the CPU.
Select: opens from Resources, the list of variables associated to the current type. It allows
you to check easily which I/O or Registers are still free.
Address: it is the location of the physical I/O (rack number, card number and channel
number). For registers, it is the number of a specific register.
Export: allows export of the Tag definition in external, ASCII files, either in AB format or
in text format. This option is available while being in the Tags folder, click in the main bar
File Export. You can choose between:
All list: all the Tags.
Selection: only the Tags that have the option export checked (not implemented yet).
From the TAG definition box, any configuration requiring the Tag can be accessed, i.e. alarms,
data logging, etc.
For more information, click Help.
20
9. The Resources
The resources represent the list of all variables that are available for your application. It relates to
the I/O of your A and any extension racks or external equipment.
When starting a new document, the default startup only shows the variables of the CPU that are
available. Click Resources then CPU to list the variables.
Project workspace
Physical I/O
8 DIGITAL INPUTS.
Registers
2048 digital registers.
3 digital outputs.
21
Blocks of I/O
Rack4 and Rack8 are extension racks of the CPU
(local).
Multi I/O card is a custom design card within the
CPU (local).
RM-10 and RM-21 are remote modules (remote).
Remote TBox is a distant A (remote).
ModBus device is any ModBus equipment (remote).
figure 14
figure 15
Name: you type any name. It will be available in a list of available equipment when creating
Remote Tags.
Address: it is the ModBus address of the Remote equipment. It must be different from the
Master A and possible other equipment on the same network.
RTU Port: the communication port used by the Master to communicate with the equipment.
IP address: in case the communication port of the Master is COM6 (Ethernet card), the IP
address of the Remote equipment must be specified here.
Available for Remote A only.
TWinSoft: 8.32 Getting Started
22
Cards description
4 Analog inputs (8 bits full isolated).
2 Analog output card (8 bits full isolated)
8 Analog inputs (12 bits).
16 Digital inputs.
16 Digital outputs - (transistor/PNP)
16 Digital outputs (old) (transistor/NPN) No
longer available.
8 Digital output (Relays 250 VAC).
Figure 16
figure 17
23
10. Programs
10.1. Ladder Principle
Introduction
The principle of the Ladder diagram is based on an electrical description of the process or
machine, using relay logic. To the left of the screen are the inputs (they are conditions for which
an action will be undertaken) and to the right are the outputs (which result from these actions).
Inputs
All inputs, whether digital or analog, can be combined to create logical equations (two inputs
follow on the same line for an <AND>, and one above the other and linked by a vertical bar for an
<OR>). All analog comparison functions and/or digital inputs on the same program line will
represent true or false. The result defines the actions of the output (will or will not be performed).
The different types of Input conditions are accessible in the LD Toolbar.
Outputs
Digital output functions are engagements (SET relay) or disengagement (RESET relay), they can
be the image or the opposite of the result of the tested input conditions (OUTPUT relay and
NEGATIVE relay). Other functions have been introduced proper to telemetry like transmission of
alarms, data logging or sending of DTMF tone. To process analog outputs, many mathematical
functions and POU (Program Organization Units) functions have been implemented.
The selection of different types of outputs is accessible in the LD Toolbar.
figure 18
24
Cycle time
Ladder Logic is executed on a fixed basis; contacts, relays, functions; math calculations, etc are
executed while they are scanned (read).
Lines are scanned from left to right and from top to bottom. When bottom is reached, it starts
again from top.
The cycle time is displayed when doing a A Identification from the main Toolbar menu
'Communication'.
The cycle can never be greater than 1 second. If this occurs, an internal watchdog timer resets the
A automatically.
Display mode
To access the Ladder in Display mode, click in the Project Workspace on the 'Programs' folder.
The last Ladder that was opened is displayed. The white tab underneath indicates the active
program. The 'MAIN' tab is the main program, that is automatically executed by A; the
other POUs having to be called from the MAIN.
The Ladder diagram appears in red lines with the Tags associated at each input contact, output
relay or IN/OUT of functions.
The Comment lines appear as gray blocks.
When a jump (JUMP) is programmed, the jumps mnemonic appears at the right side of a double
arrow. The mnemonic is a LABEL that appears in black text.
A call to another program appears in a red block with one IN/OUT line.
The state of the digital input contacts is displayed as a green overlay if the condition represented
by the contact is true (in the case of a trigger contact, the result represents the last level attained).
Similarly, if the result of an analog comparison is true, a green overlay on the function is used.
Moreover, for digital outputs, the green overlay represents the status of the associated Tag.
When moving the cursor on analog Tags in Functions or Math blocks, the current value is
displayed in the bottom left corner of the screen. For digital gates the display indicates <On> or
<Off> according to the current value.
25
Edit mode
The Edit mode is used when inserting a new line or modifying an existing line.
To insert a line, use the LD Toolbar. Three types of lines can be inserted using the following
buttons:
The Ladder diagram is made of several lines that are numbered starting at 1. Only one line at a
time can be edited with only one rung (a rung is a set of Input conditions connected to only one
set of Outputs). When editing is finished, the line must be compiled to proceed with the next one:
To save and compile a line. If an error occurs, a dialog box informs you on the
error. The key <+> can also be used to save and compile a line.
If you were editing an existing line, you return to display mode.
If you were inserting a new line, you stay in edit mode.
To quit editing and discard changes. The key <ESC> can also be used.
To select any item (line, contact, relays or Functions) of a Ladder line. Once
selected it can be edited by a double click to replace Tags. You can also erase the
selected item by pressing the key <Delete> or insert a new contact, relay or Function
by selecting the proper icon in the LD Toolbar.
26
Display mode
Clicking one of the following icons lets you enter in the edit mode:
To insert a line of Ladder.
To insert a line of Comment.
To insert a Label that will be called by a JUMP.
27
Edit mode
To Select any item (line, contact, relays or Functions) of a Ladder line. Once
selected it can be edited by a double click to replace Tags. You can also erase the
selected item by pressing the key <Delete> or insert a new contact, relay or Function
by selecting the proper icon in the LD Toolbar.
To Save and Compile a line. If an error occurs, a dialog box informs you of the
error. The key <+ >can also be used to save and compile a line.
To Quit editing and discard changes. The key <ESC> can also be used.
To insert a Normal input contact for digital input. The condition will be true if the
input is active.
To insert an Invert input contact for digital input. The condition will be true if the
input is inactive.
To insert a Positive input trigger for digital input. The condition will be true only
once when the input passes from an inactive level to an active level.
To insert a Negative input trigger for digital input. The condition will be true only
once when the input passes from an active level to an inactive level.
To insert a Digital output normal. Output is activated if the results of the input
condition(s) are true.
To insert a Digital output inverted. Output is activated if the results of the input
condition(s) are false.
To insert a Digital output set. Output is set and memorized if the result of the input
condition(s) are true; this type of output is typically used with a 'trigger' input
To insert a Digital output reset. Output is reset and memorized if the result of the
input condition(s) are true; this type of output is typically used with a 'trigger' input
To draw continuous horizontal or vertical lines. To join inputs conditions together
to create logical equations and to possibly connect to many outputs.
WARNING: a set of inputs can only lead through one horizontal line to only one set
of outputs. It is called a rung.
To insert a Function or Function Block. A list opens with the standard Functions
(under the folder 'Standard') and with the user defined Functions (under the folder
'This file')
To insert a Mathematical block. In this block, mathematical functions can be
inserted by clicking on 'New Math Function' . See chapter 10.7 for a list of available
functions.
Initiates a Jump to the line whose label corresponds to the one that is entered here
(to enter a label, see above in the list of icons of 'Display mode').
28
10.4. Variables
Introduction
Variables can be physical I/O or internal registers: Analog registers (AIR, STO, and ASPE...)
Digital registers (DIR, DSPE...). Any variable is available, but only when it is declared, we
consider it as a Tag. According to the use we make of the variables in Ladder programming, there
are two families of Tags:
Local Tags
Global Tags
Local Tags
A Local Tag is a non-specific register used as temporary value in a calculation. When compiling
the TWinSoft document a free register (DIR, AIR or STO) is assigned to it according to the
registers that are already used.
Local Tags are only used in the POU where they have been created.
They appear in the list of Local Tags, above the Ladder diagram of the POU (see next).
Global Tags
A Global Tag can be of two types:
A specific register (DIR, AIR, and SPE...) that you wish to use.
A physical I/O of the CPU created in the List of Tags.
Global Tag-Names can be used in POU Program and in POU Function Block (see next).
29
figure 19
According to the item you wish to use, select the proper icon in the Toolbar.
30
Inserting items
When inserting an item, you must declare the variable(s) associated to it: Digital Tag for a contact
and a relay, Digital or Analog Tags for Functions. You have to work with Tags; it is not possible
to select the number of a register in the list of registers.
A Tag (local or global) can be created while inserting an item.
There are two possibilities to select a Tag:
- You know the name of the Tag: you type its name. TWinSoft is not case
sensitive, so you can type it in capital or small letters.
The Tag exists
- You dont know the name of the Tag: you click the button
to open the list
of Tags. You have the choice between Global Tag, Local Tag and Special
registers (see previous chapter Variables).
You type its name and press <ENTER> to create it. The Tag can be either
Local Tag or Global Tag (see previous chapter Variables).
According to the field you are in, you can select a Tag or type a constant. A constant
is a 16-bit variable that will be considered as Signed (-32768 -> 32767) or Unsigned (0 and
65535) according to the Function where it is used.
The Keys
<+>
<ESC>
- When an item is selected: to release the item and return to selection mode (arrow).
- When Tag box is opened: to carry on without specifying a Tag. '???' will be inserted
instead. To enter a Tag afterwards, double click '??? '
<DEL>
31
figure 20
We use the following Tags (see chapter 8 Creating Tags):
LEVEL
MANUAL
PUMP
TIMER
MAINTENANCE
RESET
analog input.
digital input.
digital output.
digital state of the timer (DTI.10)
digital output.
digital input.
32
to insert the function A>B then click close to the left Rail.
figure 21
4. Enter the Tag name LEVEL or select it from the list of Tags and then enter the constant 150.
5. Click the icon
the left rail.
to insert a digital contact, then click the comparison Function and close to
6. Enter the Tag name MANUAL or select it from the list of Tags.
7. Click the icon
Function.
and draw a horizontal and vertical line to join the output of the comparison
33
figure 22
11. Enter an ID number (between 0 and 255); in our example: 10, then the preset (number of
minutes), in our example 6000.
12. Click the icon
and draw a horizontal and vertical line to join the timer Function to the
right rail and to the output of the comparison Function.
13. Press the key <+>, or click the icon
ready to create the third line.
to insert a Positive edge trigger contact, then click close to the left rail..
to insert a Positive edge trigger contact, then click close to the left rail.
20. Enter the Tag name RESET or select it from the list of Tags.
21. Click the icon
to insert the reset timer Function, then click close to the contact RESET.
22. Enter 10, the ID of the timer to reset (in our example: 10).
34
and draw a horizontal between the RESET contact and the reset timer
35
of the LD
Introduction
There are 8 categories of mathematical functions available (to use in math blocks):
Assignment functions.
Arithmetic operations.
Comparisons.
Bit manipulations.
Boolean operations.
Conversion (PID, BCD, etc.), and indirect addressing.
Text and miscellaneous functions.
Floating point.
In the functions, the Arguments to replace by Tags (or constant) are represented as follows:
- A, B, C, and D:
Analog Tags.
- Ptr:
Pointer in indirect addressing; analog Tag.
- BOOL, Bit:
Digital Tag.
- Tot1, Tot2:
Analog double word.
- Flt:
Floating point
The equality operations are always executed from the right to the left. In other words, we have:
result = operation
or:
output = input (means the value of Input variable is copied in the Output
variable).
16 bit analog numbers on are always worked out as signed values in TBox, even if they have
been defined as 'Unsigned' Tags.
If used in 'Indirect addressing' functions, an analog variable of the pointer is considered as
'Unsigned', even if it appears 'Signed'.
In edit mode, to insert a 'Math function' between 2 functions in a Math block, place the
cursor at the position you want to insert the function, and press the key 'Insert' of keyboard.
Assignments
A = B
A = -B
A = Low(B)
A = High(B)
A = Abs (B)
A = Swap(B)
'A' contains the inversion of the 8 highest bits and the 8 lowest bits of 'B'
inc (A)
dec (A)
36
Arithmetic operations
A = B + C
A = B - C
A = B * C
A = B / C
A = B AND C
'A' is the result of the logical AND between 'B' and 'C'
Example:
0001000011111111
AND 0001100000001111
0001000000001111
A = B OR C
A = B XOR C
'A' is the result of the logical XOR between 'B' and 'C'
Example:
0000000011111111
XOR 1111000000001111
1111000011110000
A = B MOD C
Comparisons
BOOL = B == C
BOOL = B < C
BOOL = B > C
BOOL = B <= C
BOOL = B >= C
BOOL = B <> C
BOOL = odd B
A= conv 0/20
4/20 (B)
37
Bit manipulations
Wraparound means that the bits scrolling from one side of a byte (8 bits) or word (16 bits) are
replaced at the other side of the byte or word.
bit (A,BitNb) = Bit
The status of digital 'Bit' will be copied in the analog 'A' at the
position indicated by 'BitNb', starting with ' 0 ' for Lsb.
Example: Bit:
1
BitNb: 3
A:
0011010011001001
The status of the bit of the analog 'A' indicated by 'BitNb' will
be copied in the digital 'Bit', starting with ' 0 ' for Lsb.
Example: A:
1100101000010010
BitNb: 5
Bit:
0
A = shl(B,shift)
'A' has the number of Bits indicated by 'shift' shift to the left
(max. 15) of the word 'B'
(without wraparound).
Example: B:
0000000011111111
Shift: 4
A:
0000111111110000
A = shr(B,shift)
'A' has the number of Bits indicated by 'shift' shift to the right
(max. 15) of the word 'B'
(without wraparound).
Example: B:
0000000011111111
Shift: 4
A:
0000000000001111
A = rol byte(B,shift)
'A' has the number of Bits indicated by 'shift' shift to the left
(max. 7) of the byte 'B'
(with wraparound).
A = ror byte(B,shift)
'A' has the number of Bits indicated by 'shift' shift to the right
(max. 7) of the byte 'B'
(with wraparound).
A = rol word(B,shift)
'A' has the number of Bits indicated by 'shift' shift to the left
(max. 15) of the word 'B'
(with wraparound).
Example: B:
0000000011111111
Shift: 4
A:
0000111111110000
A = ror word(B,shift)
'A' has the number of Bits indicated by 'shift' shift to the right
(max. 15) of the word 'B'
(with wraparound).
Example: B:
0000000011111111
Shift: 4
A:
1111000000001111
38
Boolean operations
Bit = not(Bit)
the inverse of the digital Tag of the right is assigned to the digital
Tag of the left
the result of the logical AND between the two digital Tags of the
right is assigned to the digital Tag of the left
the result of the logical OR between the two digital Tags of the right
is assigned to the digital Tag of the left
the result of the logical XOR between the two digital Tags of the
right is assigned to the digital Tag of the left
A = B * C / D
(Unsigned)
'A' is the result of the 32 bits multiplication of Words 'B' and 'C'
then divided by 'D'
A = B * C / D (Signed)
A' is the result of the 32 bits multiplication of Integers 'B' and 'C'
then divided by 'D'
transforms the word 'B' to a BCD format and transfers the result to
the word 'A'. 'B' must be less than 10000 to prevent an overflow
condition.
A = 16 x (Bit)
16 x (Bit) = A
39
the status of the digital Tag 'Bit' will be copied in the digital
variable whose ModBus address is defined in the Tag or
Constant 'Ptr'.
Example:
to write the status of dir0 in the output 'Q2' of the CPU (ModBus
address 34):
Indirect (34): dir0.
A = indirect (Ptr)
indirect (Ptr) = A
the value of the analog Tag 'A' will be copied in the analog
variable whose ModBus address is defined in the Tag or
Constant 'Ptr'.
Example:
to write the value of ana0 of the CPU in the analog output: Rack
1, Card 1, Channel 0 (ModBus address 288):
Indirect (288) = ana0.
40
PID regulation
Function available in the group Conversion + Indirect addressing
Out = PID(Input, AIR,..)
Out:
Input:
AIR:
where:
y:
x:
w:
R:
TI:
TD:
(x-w) + TD * d(x-w) / dt
value of output.
value of the measurement.
value of set point.
proportional coefficient.
integral coefficient.
derivative coefficient.
NOTES:
1. PIDs require knowledge of this type of regulation.
2. An example is available on web site: www.tbox.biz -> Support -> Examples
Application of the PID to the TBox
The maximum number of PIDs per TBox is 64, but this number can be limited due to the size of
the memory A and the availability of analog registers. A PID in a mathematical formula
occupies 5 supplementary bytes for calculation. A PID is computed in less than one millisecond.
Values and coefficients are placed in variables and registers:
'Output' = y: output value, between -2047 and 2047.
'Input' = x:
input value, between -2047 and 2047.
'AIR' = w:
set point value, between -2047 and 2047.
'AIR+ 1' = R x 32: proportional coefficient, between 0 and 2047.
'AIR+ 2' = 1 / (1024 x TI): integral coefficient, between 0 and 2047.
'AIR+ 3' = TD x 8: derivative coefficient, between 0 and 2047.
Those 3 last calculations must be implemented in the Ladder diagram.
For example:
R=20
'AIR+ 1'=640
TI=0,0001
'AIR+ 2'=10
TD=100
'AIR+ 3'=800
'AIR', 'AIR+ 1', 'AIR+ 2', 'AIR+ 3' represent 4 analog internal registers of successive addresses. It
is therefore only necessary to enter the first of these registers in the mathematical function.
The PID is calculated every cycle for as long as the condition that precedes the mathematical block
in the Ladder diagram is true. It is therefore necessary to link the PID calculation to a timer to
obtain a time cycle different from that of the Ladder diagram. The PID can also be stopped or
single stepped. The fact that the proportional coefficients, integral, and derivative are stored in
internal registers allows dynamic modification following some conditional changes specified in the
Ladder diagram. Calculations have 24-bit precision, the intermediate results of each group
(proportional group, integral group and derivative group) are limited to the range -2047.+2047.
The global result has the same range limits.
TWinSoft: 8.32 Getting Started
41
Miscellaneous
Send Text: Text
COM1
2:
COM2
3:
COM3
Tot1 = Tot2
NOTE:
With Totalizer registers, supplementary mathematical functions, like arithmetic operation and
comparison, can be executed using the 'C' driver Fcthmath2.
See the web site: www.tbox.biz -> Support -> Drivers
42
43
For users accustomed to work with TSoft (the DOS editor), we have kept mathematical functions
in order to execute analog operations.
44
If you use POU Programs that call other POU Programs, be careful to avoid loops: like
Program 1 calling Program 2 calling Program 3 that calls Program 1.
The 'main'.
The POU program 'main' is the main Ladder program. This program must be unique and called
main, to be used to call other POU programs (sub-programs). It is the default POU program
when starting a new TWinSoft document.
figure 23
Double click 'Add a POU', type a Name (accents and space are not supported) and check
'Program'.
Click OK.
You have created a POU Program and it appears in the 'Programs' folder.
45
When you double click the name of the Program in the list, the window for Ladder programming
appears with a new Tab for the current Program.
figure 24
Now you can create a Ladder Diagram for the Program you have defined.
Enable Input: Connection to the Ladder line. EN must be TRUE to run the
Program. If it is connected directly to the left rail, it will be executed at each
cycle of the Ladder, otherwise it can be connected to an input condition.
- ENO:
Calling a POU Program is like calling a sub-routine. The program associated to it is executed at
the position where it is called.
46
Example:
You need regularly to execute the calculation: y= [(a+b) * (c+d)] /2.
You will not find this formula in the Standard Functions or in the Mathematical Function block.
You will then create your own Function that will execute your calculation every time you call
it.
According to the type of the output, there are 4 types of Functions:
BOOL: digital output.
WORD: analog output 16 bits unsigned.
LONG: analog output 16 bits signed.
FLOAT: floating point output.
An example of user defined Function is available in the TWinSoft document Ladder.tbox, in the
'Samples' directory of TWinSoft. The Function executes the scaling of an 8-bit analog input.
figure 25
Double click 'Add a POU', type a Name (accents and space are not supported) and check
'Function'.
Select the type of the output (result of the calculation): BOOL , WORD, LONG or FLOAT.
Click OK.
You have created a POU Function and it appears in the 'Programs' folder.
TWinSoft: 8.32 Getting Started
47
When you double click the name of the Function in the list, the window for Ladder programming
appears with a new Tab for the current Function.
figure 26
By default, the name of the Output is the name of the Function. You can rename the output
by using the context menu on its name (mouse right clicking on the name).
POU Functions can be exported in a Library to be used in other TWinSoft documents, using
the Library manager menu.
Now you can create Ladder Diagram for the Program you have defined.
48
Example of a Function
The following Function is an analog Function (it means the output is analog). It performs a
scaling of an 8-bit analog input.
figure 26A
The Tags :
Inputs and the Output of a Function are the arguments to be replaced when calling the Function.
The way a POU Function works, involves that one can define only local Tags in a POU
Function.
Scaled:
the output of the Function. It is unique and is the result of the calculation.
IN, MIN,MAX:
Delta, tmp0:
The Ladder :
A math block using 3 functions is used.
49
Enable Input: Connection to the Ladder line. EN must be TRUE to perform the Function. If
it is connected directly to the left rail, it will execute at each cycle of the Ladder, otherwise it
can be connected to an input condition.
- ENO:
Enable Output:
if the Function is Analog: it is the image of EN. If EN is TRUE, ENO is TRUE. It is
usually connected to the right rail but can be also connected to a contact or a relay, a
Mathematical block or another Function.
if the Function is Digital: ENO and the Output of the Function are linked inside the
Function. It is TRUE if the result of the calculation AND EN are TRUE. It must then be
connected to contact or a relay, a Mathematical block or another Function.
figure 26B
When calling the Function in a POU Program, you must assign to the (unique) Output a Tag and
for each Input a Tag or constant. All inputs are at the left side of the Function Block; the output at
the right side.
In this example, we wish to have an 8-bit analog input 'ANA0' scaled between MIN '0' and MAX
'1000'. The result is copied into the Internal Analog register 'AIR0'.
50
figure 27
Double click 'Add a POU', type a Name (accents and space are not supported) and check
'Function Block'.
Click OK.
You have created a POU Function Block and it appears in the 'Programs' folder.
51
When you double click the name of the Function Block in the list, the window for Ladder
programming appears with a new Tab for the current Function Block.
figure 28
POU Function Blocks can be exported in a Library to be used in other TWinSoft documents,
using the Library manager menu.
Now you can create Ladder Diagram for the Program you have defined.
52
figure 28A
The Tags:
Inputs and Outputs of a Function Block are the arguments to be replaced when calling the
Function Block.
INPUT
is a digital input that will start the OUTPUT after the DELAY.
OUTPUT
is a digital output. It will be connected to a motor, for instance when calling the Function
Block.
DELAY
is an analog input containing the number of seconds of the delay. It must be associated
to the timer used in the Function Block.
preset
timer
The Ladder :
The DELAY is copied in the preset of the timer.
When INPUT changes to 1, it starts the timer Single Shot with a base time in seconds
(SS_sec). (Note: when working with an external Preset (the local variable 'preset'), the Preset
of the timer can be set to any value; here 0).
When the timer has finished counting AND the INPUT is still active, the output is set to 1.
A negative edge on INPUT resets the OUTPUT.
TWinSoft: 8.32 Getting Started
53
Enable Input: Connection to the Ladder line. EN must be TRUE to perform the Function
Block. If it is connected directly to the left rail, it will execute at each cycle of the Ladder,
otherwise it can be connected to an input condition.
- ENO: Enable Output: it is the image of EN. If EN is TRUE, ENO is TRUE. It is usually connected
to the right rail but can be also connected to a contact or a relay, a Mathematical block or
another Function.
figure 28 B
When Calling the Function Block in a POU Program, you are asked to enter an 'FB Instance
name'. This name allows TWinSoft to distinguish between Function Blocks, when multiple calls of
similar Function Blocks are defined.
Afterwards you must assign to the Output(s) and Input(s) Tags or constant. All inputs are at the
left side of the Function Block, all outputs at the right side.
In this example, the FB is called Motor1, the input D0 activate the output Q2 with a delay of
5 seconds.
Each call of Function Block is unique and different from each other; local Tags of the Function
Block as well as timer ID and counter ID, will be assigned to free registers, timers and
counters when compiling.
When a Function Block is called many times in POU Program, its code is inserted every time
it is called. It makes development easier but it increases the code size.
Execute compilation regularly to test A memory.
54
The source code (Ladder) of the FB is then opened and dynamized according to its instance.
In the list of POU Tags, the column 'Value' displays values of each local Tag.
55
figure 29
Only POU Functions and Function Blocks can be saved in a library.
1. You select an existing library ('File' -> 'Open'), or you create a new library ('File' -> 'New').
2. You open the list of available POUs of the current document ('Edit' ->'Import POU...').
3. You select the POUs you wish to save in the Library; you repeat operations 2 and 3 for
each POU.
4. You save the Library ('File' -> 'Save').
Libraries can be protected by a password, so that it is impossible to Export it into a
TWinSoft document, to see the internal code.
56
figure 30
The Available Libraries are the Libraries present in the directory of the current TWinSoft
document or in the directory of TWinSoft. When a library appears in the list, all its POU
Functions, and POU Function Blocks are available to be used in Ladder programming: in the list
of Functions, the Libraries appear as Folders, each containing their own POUs.
To add a Library to the current TWinSoft document, select it from the list of Available Libraries
and click 'Add'.
The button 'Manager' jumps to the creation of Library menu.
To remove a Library from the current TWinSoft document, select the Library and click 'Remove'.
This operation is available only if you dont use POU of the concerned library in the current
document.
57
12. Alarms
12.1. Introduction
Alarm module of A is the gate to the outside world, through the different communication
ports. Via alarms, you are able to send messages to pagers, to print events, to call a SCADA...
With the alarm module, your process is 'under control' !
The initiation of alarms in the A relies on the variation of digital or analog Tags, or on a
combination of conditions defined in the Ladder diagram. For example, an intrusion contact or an
alarm level at a reservoir will send a message to the world beyond A. It is also possible to
remotely call a PC utilizing SCADA software, the latter can then monitor the A.
Alarms can be sent to a printer (local or remote) in order to print current events, or even a
complete report of activity, e.g. every day at midnight.
Alarms can be sent to different recipients depending on the day or hour (this is called time slice
management).
Recipients can be linked or chained.
There are two means of activating an alarm:
By a condition: an edge on a digital Tag or the value of an analog Tag that exceeds a
minimum or maximum threshold, with adjustable hysteresis.
By the Ladder diagram: a complex Ladder sequence generates an alarm through a
specific function.
The first option affords a simple and quick way to create alarms (a state change of a digital Tag or
the variation of an analog Tag value to activate the alarm).
The Ladder diagram allows you to create a complex automated alarm condition by using (for
example) priorities or a set of analog or Boolean conditions.
Each new alarm is immediately entered into a 48-alarm queue (maximum) and processed
according to its type (printer, pager etc...) and the communication port it uses. The order in which
these alarms will be processed will not necessarily be the order of their arrival. For example, if an
alarm requires the internal modem, it will need to wait until the modem is available before it can
be transmitted. If the alarm is time stamped, this data accompanies the alarm message.
58
figure 31
The Tag.
The type on which the alarm is going to be started (rising, falling or both).
The filter (the time in minutes and seconds, before the alarm is started, once the alarm
condition is present).
The inhibition (the alarm will always be started or disabled according to certain conditions).
SMS acknowledgment : from TWinSoft 7.10, alarms of type e-mail and Pager/SMS, may
be configured to be acknowledged from a SMS sent to A. This feature is handled by a
C driver (see RTU Properties Modules).
This type of acknowledgment is only possible with a A equipped with a GSM data
modem !
59
figure 32
The Tag.
Type: The maximum or minimum threshold for which the alarm will be started (if the value of
the analog Tag passes under or over this threshold, the alarm is started). If an alarm must be
generated for both a maximum and a minimum threshold, 2 alarms must be declared with the
same Tag.
Hysteresis: the amount that the value must fall or rise below or above the Max. or Min. set
point before an alarm can be re-started
Message: the value of a Tag can be sent within the message (see Message below)
Filter: the time in minutes and seconds, before the alarm is started, once the alarm condition is
present
It is always possible to choose a FILTER equal to '0 min. - 0 sec.', which means that the alarm will
be activated immediately.
Notify of the end of alarm: An alarm is automatically sent when the condition is over
SMS acknowledgment : from TWinSoft 7.10, alarms of type e-mail and Pager/SMS, may
be configured to be acknowledged from a SMS sent to A. This feature is handled by a
C driver (see RTU Properties Modules).
This type of acknowledgment is only possible with a A equipped with a GSM data
modem !
For more information, click Help.
TWinSoft: 8.32 Getting Started
60
12.4. Recipients
To access the definition of Recipients, click the folder 'Alarms' in the Project workspace and select
'Recipients'.
64 recipients can be declared, to different pager or GSM addresses, printer, SCADA, remote
A, with the help of any of the available communication ports (see Chapter 7 RTU
Properties).
According to the type of recipient, local or remote ports are available:
Internal: the alarm is saved in the alarm stack and not sent anywhere.
ModBus: it can be slave or master. The ports available are modems ports.
Pager/SMS: sending of a message to a pager or a GSM. The ports available are modems
ports.
Printer: sending of message(s) or report to a printer. The ports available are modems and
local ports.
Minitel: for France only. Calling of a Minitel. The ports available are modems ports.
E-mail: sending of e-mail. The only information needed is (are) the e-mail address(es); the
data of the ISP account are declared in the RTU Properties TCP/IP).
FTP: refreshing of a Portal (Web Site) with HTML pages, report,
Custom: sending of an alarm with the help of a custom driver.
61
figure 33
To an e-mail address
figure 34
TWinSoft: 8.32 Getting Started
62
12.6. Messages
To access the definition of Alarm messages, click the folder 'Alarms' in the Project workspace and
select 'Messages'. 256 different messages can be created.
figure 36
Message number : indicates the index of message (between 1 and 255). Type a message of
maximum 30 characters. This message is user specific.
If it is for a Digital Pager, it will consist only of numbers.
If it is for a Text Pager or for a GSM, it will not contain accent (, , , ...)
In all cases, a message can contain the value of a Tag. The syntax is the following:
~Xyyyyy ~
~ : The first character indicates that what follows is the value of a ModBus address. The
value sent is the value from the moment of the call.
X : represents the type of the variable:
Type
I
W
C
S
R
B
t
j
m
0 (zero)
f
D
d
o (small letter)
#
1.. 9, a.. f
h
Description
Integer (-32768.. 32768)
Word (0.. 65535)
Choice (for example edges: POS, NEG or DEL)
Text (comments, TEL number, scaled value of Terminal/.Minitel
Tags,)
Real (only Factor an Offset of Terminal/Minitel Tags)
Byte (0.. 255, represented as 3 ASCII characters)
Time (represented as 2 ASCII characters)
Day of the week
month
Byte represented in binary format
Floating point
Double word
Character string
Digital state (represented as 0/1)
Digital state (represented as ON/OFF)
Digital state (represented as --------/########)
Digital state (according to the definition of digital states, only valid
from 1 to 15)
Time: hh:mm
63
Messages sent
ANA0=234 too high
Register AIR0=24563
Motor is OFF
Next : Allows sending several successive messages (to a printer only). Specify the index
number of the message coming next. This feature allows you to define a number of lines to be
printed followed by an empty line (the last message of the chain) ; to separate each printing.
64
13. Datalogging
13.1. Introduction
Datalogging relies on the database in the A, it allows you to memorize events of your
process, in order to visualize historical data.
A contains 128 Kbytes of memory for its program and for recording events; the latter is
what we call the database of A.
A supplement of 512 Kbytes RAM is available in A as September 2002 and running OS
5512. This extended memory is only available for Sampling tables.
The Chronologies
Chronologies are 'On event' recordings, by mean of changes in variables. Each event is recorded
with the time, date, Tag and its status or value.
Two tables are available, one for the digital events, one for analog events with a maximum of 256
Tags in each table.
The minimum interval between two recordings is 1 second.
65
figure 37
Inhibition:
Enabled:
Disabled:
Power failure:
DisCRD:
always recorded.
never recorded.
disabled if the supply voltage (230VAC or 8 56VDC) is broken
down.
disabled if the Special register DisCRD is at 1.
figure 38
Variation: Recording in case of variation (higher or lower) in comparison with the previous
recording. The unit is expressed according to the binary format of the analog input,
independent of a possible scaling in the Ladder programming.
Inhibition:
Enabled : always recorded.
Disabled : never recorded.
Power failure : disabled if the supply voltage (230VAC or 8
down.
DisCRA : disabled if the Special register DisCRA is at 1.
56VDC) is broken
66
figure 39
Period: Period between 2 recordings. You may choose between 1sec; 2sec; 4sec; 5sec; 10sec;
15sec; 30sec; 1min; 2min; 4min; 5min; 10min; 15min; 30min; 1h; 2h; 4h; 6h; 12h. The
recording happens at 'birthday' time of the period selected.
Example: if you select as period 30 seconds, the recording will be done every minute
and minute 30 seconds: 9:25:00; 9:25:30; 9:26:00; 9:26:30...
To adjust the sizes check the available memory with the compile option (see chapter 6.1
Sending a program.
67
68
Speed
19200, N
19200,N
19200, N
9600, E
9600, E
9600, E
69
The variables to Read/write in the external equipment are declared using the Remote Tags
definition:
figure 40
Important points :
1. Remote Tags are Tags that you wish to write to the Slave(s), or that contain a status or a value
that you read from the Slave(s).
2. The Slave(s) do not need specific configuration, only of course the configuration of the port
used to communicate that must fit with the one of the Master.
3. Each creation of a Remote Tag definition represents a transaction with a slave (Query +
Response). The whole list of Remote Tags represents the table of TBox-master Network.
4. The table is permanently examined and transactions are carried out according to their 'Trigger'
configuration (if defined).
5. The transactions with slaves are asynchronous in regard to Ladder cycle.
6. Block communication is possible and advised whenever it is possible. This will speed up
communication between Master and Slave(s).
70
Operation :
OPERATIONS
READ
WRITE
MASTER (Tag)
SLAVE (Address)
Digital I/O
Analog I/O
Digital registers
IOD, Test4ma
IOB, IOW, I4M
DIR, STD
STB
AIR, STO
TOT, FLT
ATP, ATV, DTI
ACP, ACV, DCN
DSPE, ASPE
ECH
16
8
1600 (multiple of 8 for quantity, Tag
address and Remote address)
8
100
8
16
16
16
16
External Source : all the following parameters concern the Slave station:
Device: select an existing external device from the Resources. You can create one
with the button
Type: select the type of the external variable: Analog or Digital. See next:
71
Types
ModBus Functions
Read Digital
Digital Input
Read Digital
Coil
Read Analog
Analog Input
Read Analog
Holding Register
Coil
Holding Register
Coil
15
Holding Register
16
- Remote A.
1. The address can be typed with its ModBus address (see the list of ModBus addresses in the
Help menu).
Examples:
22016: seconds.
7:
digital input 7 of the CPU.
32:
digital output 0 of the CPU
20480: digital or analog register (according to the type).
2. The address can be typed according to a standard.
If it is a physical I/O:
TTT.r.b.c.S
TTT: is the type of variable.
r:
is the rack number..
b:
is the card number.
c:
is the channel number.
S:
supplementary type information.
TTT
DI
DI
DO
AIB
AIB
AIW
AOB
AOB
r
x
x
x
x
x
x
x
x
b
x
x
x
x
x
x
x
x
c
x
x
x
x
x
x
x
x
S
4m
4m
4m
Description.
Digital input.
Test of an analog input.
Digital output.
Analog input 8-bit resolution.
Input 0 20mA converted to 4 20mA.
Analog input 12-bit resolution.
Analog output 8-bit resolution.
Output 0 20mA converted to 4 20mA.
72
Examples:
DI.0.0.7:
DO.0.1.0:
AIB.0.2.1:
AIW.1.5.4:
DI.1.5.4.4m:
If it is a register:
TTT:
nnnn:
TTT.nnnn
is the type of variable.
register number.
TTT
DIR
AIR
STO
STB
STD
FLT
TOT
ATP
ATV
DTI
ACP
ACV
DCN
DSPE
ASPE
Description.
Digital register.
Analog register.
Storage 16 bits register.
Storage 8 bits register.
Storage digital register.
Floating point register.
Totalizer (32 bits).
Timer preset.
Time value.
Timer status.
Counter preset.
Counter value.
Counter status.
Digital Special register.
Analog Special register.
73
- RM 10.
1. Click the button
b
0
0
c
x
x
DI
DI
0
0
x
x
SM+
S-
DI
DI
DO
AIW
AIW
DI
0
0
0
0
1
1
x
x
x
x
x
x
SMV
S+
C
4m
Description.
Digital input (instantaneous).
DI Latched on positive edge and reset by the
communication.
DI Latched on positive edge and reset by writing '0'.
DI Latched on negative edge and reset by the
communication.
DI Latched on negative edge and reset by writing '0'.
Test of the digital output.
Digital output.
16-bit Totalizer of pulse on a DI.
Analog input 16-bit resolution.
Test of an analog input.
TTT
DI
DI
DO
b
2
2
2
c
0
1
2
Description
Temporary error on an output.
Outputs disconnected.
Re-initialize the outputs after a short circuit
Digital input 0.
Digital output 1.
Test of the Digital output 1.
Totalizer of the pulse on DI 3.
Analog input (16 bits) 0.
Auto-acknowledge: this feature concerns only the registers latched and reset by writing '0'
(with the switch 'SM'). You must check this option for A to execute automatically the
writing '0' to the RM.
74
- RM21.
1. Click the button
b
x
x
c
x
x
DI
DI
x
x
x
x
SM+
S-
DI
DO
DI
AIW
AIW
DI
AOW
x
1
1
0
2
3
3
x
x
x
x
x
x
x
SM-
S+
C
4m
Description.
Digital input (instantaneous).
DI Latched on positive edge and reset by the
communication.
DI Latched on positive edge and reset by writing '0'.
DI Latched on negative edge and reset by the
communication.
DI Latched on negative edge and reset by writing '0'.
Digital output.
Test of a Digital output.
16-bit Totalizer of pulse on the 8 first DI.
Analog input 16-bit resolution.
Test of an analog input.
Analog output.
TTT
AOB
B c
4 0
Description
Counter of resets of the RM21.
Examples:
DI.0.0:
DO.1.1:
DI.1.1.V:
AIW.0.3.C:
AIW.2.0:
AOW.3.1:
TTT
DI
DI
DO
DO
DI
B
5
5
5
5
5
c
0
1
2
4
7
Description
Temporary error on an output.
Outputs disconnected.
Re-initialize the outputs after a short circuit.
Reboot of the RM21.
Use of LEDs associated to DI:
0 : LEDs deactivated.
1 : LEDs used.
Digital input 0.
Digital output 1.
Test of the Digital output 1.
Totalizer of the pulse on DI 3.
Analog input (16 bits) 0.
Analog output (16 bits) 1.
Auto-acknowledge: this feature concerns only the registers latched and reset by writing '0'
(with the switch 'SM'). You must check this option for A to execute automatically the
writing '0' to the RM.
TWinSoft: 8.32 Getting Started
75
- ModBus device.
The address must be typed (see the manual of your ModBus equipment).
Trigger : Each transaction must be triggered to be executed. This operation can be done
automatically (you don't need to declare it and leave the box cleared. In this case, the A
will permanently execute the transaction). The triggering happens via a digital Internal register
(DIR). When it is in the condition programmed (see below), the transaction happens. If you
wish to select a condition yourself, check this box.
Tag : if Trigger is checked, select a Tag of a Digital Internal register multiple of 8
(DIR 0, DIR 8, DIR 16, ...).
Condition : if Trigger is checked, select a condition: Positive Edge, Negative Edge or
High State.
76
The Web files contained in this folder will be sent together with the TBox application.
Three types of file can be sent to A:
- HTM pages with their associated WebForm, created with the WebForm studio.
- Report files created with the Report Studio (see chapter 15.2: Report Studio)
- Any file (.gif, .bmp, )
TCP/IP).
2. From the Web & Report files folder, create the HTM images (see WebForm Studio Getting started manual). All the files contained in this folder comprise the Web Module.
3. When sending the TWinSoft application to A, all files comprising the Web Module are
also sent .
To dial-up A, use TBox Dial It! utility (see WebForm Studio - Getting started
manual).
77
For more information, start Report Studio and look at the online Help.
78
Level 1: Surveillance mode or VISUALIZATION MODE. The operator can view all A
values (local or remote), but can not execute any command.
Level 2: COMMAND MODE, the operator can view all the values and execute commands
(locally or remotely).
Level 3: ENGINEER MODE, the operator can view all the values and execute commands and
alter or send new TWinSoft documents (locally or remotely).
Security tab.
figure 41
For more information, click Help.
79
Access security: Check this box if you want to use access protection to the ports of the
A. If it is cleared, all the security features are disabled.
Global code: type in the code you used to generate the Access Codes with the utility
PASSWORD.EXE (see next). Type it a second time in the Confirmation field, to be sure.
Protected ports: Check the box of the COM port you want access protection. By default,
when selecting access security features, only COM4 (Internal modem) is protected.
The access codes are generated by the utility software Password (see next).
Global code: This hexadecimal code of 4 characters is the basis for password generation. It
will be entered in the RTU Properties Security menu of TWinSoft and sent to the
A. When a user TWinSoft, the latter checks if the NAME and PASSWORD entered fit
with the global code within A. This means that if different users with different access
levels must communicate with A, the global code used to generate passwords must be
the same.
User name: The name you use when logging in logs into TWinSoft.
When this information has been entered, click on the button "Get password".
Two codes have been created:
The PASSWORD: this password must be used toegether with the NAME when logging into
TWinSoft.
The USER ID: this number is available in a special analog variable when a user is
connected to a port of A that is protected.
80
16.3. Login/Logout
The Login feature allows users to connect to a protected port of the A according to their
own access level. If a port is unprotected, the access level is automatically 3: Engineer.
The Login/Logout can be executed from the main menu bar in the 'Tools'.
Login
When being connected to a port of A that is protected, you need to do a Login to get an
access level.
figure 42
You type the Name you used in the Password utility and the Password that was created (see
previous). According to those, you are in:
Read only mode
Read/write mode
Read/write + send TWinSoft document
It is displayed in the Status bar.
If 'Save password' is checked and TWinSoft is connected to a protected port: when
TWinSoft starts, it uses the access level corresponding to the password saved (see the status line).
If it is not checked and TWinSoft is connected to a protected port: TWinSoft starts in 'Read only'
mode. You need to do a Login to get your access level.
Logout
If the TWinSoft is connected to a protected port, the Logout sets TWinSoft in 'Read only' mode.
81
17.2. Examples
Following are examples how these features can be used in TWinSoft:
82
If Tags already exist, with similar names and addresses, the Ladder is created with the existing
Tags.
If the Tags of I/O with similar addresses exist but with other names, the Ladder is not created.
If the Tags of register with similar addresses exist, TWinSoft automatically creates Tags of
similar type and increments the address.
If the Tags do not exist, they are automatically created.
Copy entries of any list (Recipient, Alarm condition, Remote Tags, ...) from one
document to another document (Copy/Paste)
-
If Tags are needed and already exist, with similar names and addresses, the entries are created
with the existing Tags.
If Tags of I/O are needed and already exist with similar addresses but with other names, the
entries are not created.
If Tags of register are needed and already exist with similar addresses, TWinSoft automatically
creates Tags of similar type and increments the address.
If Tags are needed and do not exist, they are automatically created.
83
When working with an existing list that you wish to update with a file
To avoid conflict between indexes of the TWinSoft document and those of the file, we advise
you to follow the procedure:
Export
Modify/add
Import
84
18.1. Export
Export menu is available from the main menu of TWinSoft: 'File' -> 'Export'
Alarm condition
Alarm messages
Chronologies
Sampling tables
Web/Minitel/Terminal Tags
Analog Units
Digital States
Export of a list
You select the list you want to export
85
Example files
Example files are installed with TWinSoft. There are available from the sub-directory of
TWinSoft: \Samples\CSV:
-
Tags.csv
AlarmConditions.csv
AlarmMessages.csv
Chronologies.csv
SamplingTables.csv
TerminalTags.csv
AnalogUnits.csv
DigitalStates.csv
You can use them as basis for creating lists of configurations using external software (Excel,
Notepad, ...)
86
The following paragraphs give a detailed description of the syntax for creating your own file.
Export - Tags
You export all the Tags and groups.
Syntax
If you want to modify or create your own file, with the 'separator' between each field.
The syntax is:
Index
Tag
Address
Comment
Initial
value
I/O
Signed
Example:
Tag
*Index,Tag,Address,Comment,Initial Value,I/O,Signed
[\Tags]
0,Reg-0,AIR000,Analog Reg. 0,123,INPUT,NO
1,D0,DI.0.0.0,Digital Input 0 CPU,,INPUT,
2,ASPE000,Second,Second of CPU,,OUTPUT,NO
Title
The title must be at the first line and must be Tag.
* Line of Comment
Any complete line starting with ' * ' can be inserting anywhere in the file as comment. It will
not be imported.
Path
The path of the group where the Tags are located, starting with \Tags. The following Tags in the
file are member of this group.
Example: with a group 'Inputs', the path will be : [\Tags\Inputs]
Index
When creating a file, any index can be used. The index is re-calculated when imported in the
TWinSoft document.
Tag
The name of the Tag (maximum 15 characters). If it is a Tag of a card of an extension rack, the
card must be declared in the Resources of the TWinSoft document.
Address
Refer to the allowed address types (Help of TWinSoft)
Comment
The comment associated to the Tag.
WARNING: in case the comment includes the separator, it must be indicated bewteen brackets.
Example: This register, is my favorite
Initial value
If you wish to assign a value to the Tag at start-up of A.
87
I/O
Input or Output.
With Registers : determines the format.
With I/O : it is not used. The format depends of the physical address.
Signed
Yes or No.
With Register : determines the format. When nothing is mentionned, it is considered as a 'yes'.
Any field not needed must be left empty.
88
Syntax
If you want to modify or create your own file, with the 'separator' between each field.
The syntax is:
Index
Tag
Type
Threshold
(analog)
Recipient
Message
Filter
Hysteres
(analog)
Inhibit AutoEnd
Example:
AlarmCondition
*Index,Tag,Type,Threshold,Recipient,Message,Filter,Hyst,Inhibition,End
1,ON,POS,0,Motor,Motor is started,1:30:00,,0,Yes
2,FLOW1,Max,560,Temperature,Temperature above 55 degree,00:2:00,25,0,--
Title
The title must be at the first line and must be AlarmCondition.
* Line of Comment
Any complete line starting with ' * ' can be inserting anywhere in the file as comment. It will
not be imported.
Index
The index in the list of conditions. Maximum 256 digital and 256 analog conditions can be
defined.
Tag
Maximum 15 characters.
The Tag must exist in the TWinSoft document. Otherwise, the alarm condition cannot be
imported.
Type
POS or NEG
ANALOG : Max or Min
Threshold
DIGITAL : empty
ANALOG : the value generating the alarm
Recipient
The Recipient must exist in the TWinSoft document. Otherwise, the alarm condition cannot be
imported.
89
Message
The message can be:
- an index : a number between 1..256
- a text :
a message of 30 characters. It must be typed between brackets. (Ex:this is a text
message). If the message does not exist, it will be created.
- a report: if is not a message but a report. It must be typed between brackets.
(Ex:ThisReport.trep). The report must be declared in the folder Web & Report files.
Filter
without filter: empty
with filter: the time in MM:SS
Hysteresis
DIGITAL: empty
ANALOG: the value of hysteresis
Inhibit
0 Enabled (the alarm is always active)
1 Disabled (the alarm is always inhibited)
2 Power Failure (the alarm is inhibited when there is a main power failure)
3 Disabled if DisAla=1 (the alarm is inhibited when DisAla=1)
End
Yes or No
Any field not needed must be left empty.
90
Syntax
If you want to modify or create your own file, with the 'separator' between each field.
The syntax is
Index
Message
Next
Example:
AlarmMessage
*Index,Message,Next
1,D0 Input has been activated,
2,This is a long message to send ,3
3,on a printer,
Title
The title must be at the first line and must be AlarmMessage.
* Line of Comment
Any complete line starting with ' * ' can be inserting anywhere in the file as comment. It will
not be imported.
Index
The index in the list of messages. A maximum of 256 messages can be defined.
Message
The message can be of maximum 30 characters. When it is longer, it will be truncated during
import.
In case the message must includes the separator (',' for instance), the complete message must be
typed between brackets.
Example:.
2,"This message, includes a coma",0
Next
The index of the next message.
Available for message to be printed, or with some 'C' driver.
Any field not needed must be left empty.
91
Export - Chronologies
You export the list of Chronologies.
Syntax
If you want to modify or create your own file, with the 'separator' between each field.
The syntax is:
Index
Tag
Type
Var
Inhibit
Example:
Chronologies
*Index,Tag,Type,Var,Inhibition
1,D0
,DEL,,0
2,Level
,Var,5
,2
Title
The title must be at the first line and must be Chronologies.
* Line of Comment
Any complete line starting with ' * ' can be inserting anywhere in the file as comment. It will
not be imported.
Index
The index in the list of chronologies. Maximum 256 digital and 256 analog entries can be
defined.
Tag
Maximum 15 characters.
The Tag must exist in the TWinSoft document. Otherwise, the chronology cannot be imported.
Type
DIGITAL: POS, NEG ou DEL
ANALOG: Var (for Variation. See next)
Var (Variation)
DIGITAL: empty
ANALOG: Value of the variation
Inhibit
0 Enabled (the recording is always active)
1 Disabled (the recording is always inhibited)
2 Power Failure (the recording is inhibited when there is a main power failure)
3 DIGITAL : Disabled if DisCRD=1 (the recording is inhibited when DisCRD=1)
ANALOG : Disabled if DisCRA=1 (the recording is inhibited when DisCRA=1)
Any field not needed must be left empty.
92
Syntax
If you want to modify or create your own file, with the 'separator' between each field.
The syntax is:
Index
Tag
Type
Period
Size
Reset Tag
Example:
SamplingTable
*Index,Tag,Type,Period,Size,Reset Tag
1,FLOW1,Mean,00:30:00,180,yes
2,FLOW2,Max,00:03:00,1200,
3,FLOW3,Min,01:00:00,60,
Title
The title must be at the first line and must be SamplingTable.
* Line of Comment
Any complete line starting with ' * ' can be inserting anywhere in the file as comment. It will
not be imported.
Index
The index in the list of sampling tables. Maximum 64 sampling tables can be defined.
Tag
Analog Tag of maximum 15 characters.
The Tag must exist in the TWinSoft document. Otherwise, the sampling table cannot be
imported.
Type
Minimum:
Min
Maximum: Max
Average:
Mean
Instantaneous: Inst
Period
The period between 2 recordings. Check in the Sampling table configuration which are the
available period.
Size
The number of Records you wish to save in A.
Reset Tag
Yes or No
Determine whether the Tag is reset after recording (with registers only).
Any field not needed must be left empty.
93
Terminal Tags
Syntax
If you want to modify or create your own file, with the separator between each field.
The syntax is:
Index
Tag
Comment
Write
allowed
State1 State0
Min
Max
Meas.
Min
Meas.
Max
Conv.
Min
Conv.
Max
#
dec.
Unit
Example:
TerminalTagname
*Index,Tag,Comment,Read Only,State 1,State 0,Minimum,Maximum,Measured Min,Measured
Max,Converted Min,Converted Max,# dec.,Unit
1,ANA0,analog 0,No,,,0.000,1000.000,0,255,0.000,1000.000,3,m
2,ANA1,analog 1,No,,,0.00,1000.00,0,255,0.00,1000.00,2,liters
3,D0,Input 0,No,IN,OUT,,,,,,,,4,Q0,Pomp 0,Yes,ACTIVE,STOP,,,,,,,,
Title
The title must be at the first line and must be TerminalTagname.
* Line of Comment
Any complete line starting with ' * ' can be inserting anywhere in the file as comment. It will not
be imported.
Index
The index in the list of Web/Minitel/Terminal Tags.
Maximum 256.
Tag
Maximum 15 characters.
The Tag must exist in the TWinSoft document. Otherwise, the Terminal Tag cannot be imported.
Comment
The comment associated to the Tag
Write allowed
Yes: The Tag can be monitored
No: Write not allowed
State 1 / State 0
The text associated to the digital Tags.
State 1: the text when the Tag is '1'
State 0: the text when the Tag is '0'
If the states do not exist they are created.
Minimum / Maximum
When the option 'write allowed' is selected (see above), the range in which a value can be written
(analog Tags only).
The number of decimals depends on the quantity selected (see below). The decimals can be
omitted.
94
Analog Units
Syntax
If you want to modify or create your own file, with the 'separator' between each field.
The syntax is:
Index
Unit
Example:
TerminalAnalogUnit
*Index,Unit
1,m
2,liters
Title
The title must be at the first line and must be TerminalAnalogUnit.
* LINE OF COMMENT
Any complete line starting with ' * ' can be inserting anywhere in the file as comment. It will not
be imported.
Index
The index in the list of Analog units.
Maximum 256.
WARNING: An analog Tag Web/Minitel/Terminal refers to an index of an analog unit. If you
change the text of an index, it will be updated in the Terminal Tags.
Unit
The text associated to analog Tag.
Maximum 8 characters.
95
Digital States
Syntax
If you want to modify or create your own file, with the 'separator' between each field.
The syntax is:
Index
State 1
State 0
Example:
TerminalDigitalState
*Index,State 1,State 0
1,IN,OUT
2,ACTIVE,STOP
Title
The title must be at the first line and must be TerminalDigitalState.
* LINE OF COMMENT
Any complete line starting with ' * ' can be inserting anywhere in the file as comment. It will not
be imported.
Index
The index in the list of digital states.
Maximum 256.
WARNING: A digital Tag Web/Minitel/Terminal refers to an index of a digital state. If you
change the text of an index, it will be updated in the Terminal Tags.
State 1
The text associated to the digital Tags when it is at '1'.
Maximum 8 characters.
State 0
The text associated to the digital Tags when it is at '0'.
Maximum 8 characters.
Both states fields have to be filled.
96
18.2. Import
After you have exported files for modification (see previous), or you have created your own file,
you can Import them.
Import menu is available from the main menu of TWinSoft: 'File' -> 'Import'.
Import of Tags
When doing an import into an empty document Tags & groups are created from the file.
If the file contains I/O declared in extension blocks (Rack4 or Rack8), the racks and cards
must be first created in the 'Resources'.
Import of Messages
When doing an import into an empty document Messages are created from the file.
97
When doing an import, if the corresponding list in TWinSoft contains already at least one
configuration, the following options appear:
Exact replace
You want to erase an exiting list and replace it with the file.
The list of the TWinSoft document is replaced by the file. The list is first erased, and then replaced
by the file. Not with Tags (see following)
Be careful all indexes are re-defined according to the file.
With Tags
Tags within TWinSoft have an internal index, different from the one you see in the list of
Tags. This index is used as internal reference for every configuration where the Tag is used
(Alarm, Datalogging, Ladder, ...)
When importing a list of Tags, if within the file, a Tag name is the same than the one present
in the document, but with another index, the import cannot be done. A message box then
informs you.
That is why we advise you to always work with an Exported file.
Replace
You have modified some entries and/or have added some entries in the file.
The import will keep or modify the existing configuration, and add the new one.
Each time there is an existing configuration with the same index as the one in the file, you are
prompt to choose the one(s) you wish to save.
Append
You want to add some new entries to an existing list.
The entries are added to the existing list.
With Tags
The indexes you have defined in the file have no importance. It can even be the same for each
Tag.
Groups of Tags are also created.
If Tag names or addresses are already existing within the document, the import will be refused.
98
19.2. Pack
To access Pack & Go menu, select from the
main menu File Pack & Go
99
19.3. Unpack
To open the Unpack window, double click a file with the extension .tpg.
Unpack menu offers 2 features:
1. Restore a project
Extract a project into a directory
of your PC. This option is very
convenient for backing up a
project being sure you don't miss
any file.
Option available from the main
menu: Tools Unpack.
100
2. Update a RTU
Update a RTU with a complete
project, including the application,
OS, WebForms, report, ...from a
unique file.
The button PC Setup gives
you access to the configuration of
the PC, to communicate with the
RTU.
101