Semaphore Twinsoft Manual PDF
Semaphore Twinsoft Manual PDF
32
-
Getting started
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.
Copyright
© 1999-2004 by Techno Trade s.a. All rights reserved.
Edition: November 2, 2004 (original 8.32)
This manual helps you to understand the concept of A and to create basic configurations as:
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.
• 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.
figure 1
• 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.
In order to find the best way for you we offer different possibilities:
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
figure 4
figure 5
figure 6
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:
The status line indicates the type and status of the communication.
figure 8
• To communicate with your A in TCP/IP (typically with a A equipped with an
Ethernet card), you select the option ‘TCP/IP (Ethernet…). TWinSoft will then establish a
communication with the IP address specified in the tab ‘TCP/IP – LAN’ (see chapter 7: ‘RTU
Properties’).
• 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.
To compile without sending the TWinSoft document use the icon from the Main Toolbar, or
from the main menu bar: 'File' -> 'Compile' or directly the key <F9>.
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':
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.
It must be executed every time a modification is implemented within your document, in order to
apply it to the A.
If you don’t know the communication parameters of the A you are connected to, you will
not be able to communicate with it.
In order to set the A to a known configuration, you need to do a global reset of the
A(see mode 2 below).
The 3 digital outputs of the CPU are always reset (hardware reset)
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).
figure 9
7.1. General
If the Wizard was used, the information entered is displayed. Information can be updated.
figure 10
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.
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.
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.
• 64 totalizers
figure 13
figure 14
From the moment a A needs to communicate with other equipment, the latter become part
of its Resources. The A being Master and the Remote equipment Slave(s).
The A communicates to Remote equipment with the help of ‘Remote Tags’ (see chapter 14:
‘Remote Tags’).
When creating such equipment you must specify the following parameters:
Example for a ‘Remote TBox’:
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.
figure 17
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
Introduction
The Ladder programming operates in two different modes.
The first is display mode, which allows you to see the entire program, one page at a time. It is in
this mode that you can see the state or the value of variables in real time.
The second mode is edit mode, which allows inserting a new line anywhere in the Ladder, at the
beginning, at the end or between two existing lines. This mode also allows modifying an existing
line.
To see an example, load the TWinSoft document 'Ladder.tbox' that you find in the 'Samples'
directory of TWinSoft.
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.
When a jump (JUMP) is programmed, the jump’s 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.
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.
Display mode
Clicking one of the following icons lets you enter in the edit mode:
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 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')
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').
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).
The Ladder is executed from left to right and from top to bottom. Every contact, functions and
relay is treated when it is read. Be careful when using an output at different places of the
Ladder, unless you do SET and RESET. To help you, check the Cross reference of the Tags.
figure 19
According to the item you wish to use, select the proper icon in the Toolbar.
You type its name and press <ENTER> to create it. The Tag can be either
The Tag does not exist
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
- When a line is selected: to quit edit mode. Use also the icon .
<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 '??? '
Suppose we are controlling a Reservoir LEVEL. When it reaches the value 150, we start the
PUMP to remove water. At the same time, we start an INTEGRAL timer that memorizes the
number of minutes the pump has been working.
The PUMP can also be started manually.
When 6000 minutes are reached, the timer - status TIMER - is at 1 and activates the output
MAINTENANCE.
figure 20
3. Click the icon 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 to insert a digital contact, then click the comparison Function and close to
the left rail.
6. Enter the Tag name MANUAL or select it from the list of Tags.
7. Click the icon and draw a horizontal and vertical line to join the output of the comparison
Function.
8. Click the icon to insert an output relay, then click on the output of the comparison
Function. A horizontal line is automatically drawn to the right rail.
9. Enter the Tag name PUMP or select it from the list of Tags.
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 to compile the line. Doing this, the edition block is
ready to create the third line.
3rd line of Ladder:
14. Click the icon to insert a Positive edge trigger contact, then click close to the left rail..
15. Enter the Tag name TIMER.
16. Click the icon to insert a SET output relay, then click close to the left side of the contact
TIMER. A horizontal line is automatically drawn to the right rails.
17. Enter the Tag name MAINTENANCE or select it from the list of Tags.
18. Press the key <+>, or click the icon to compile the line. Doing this, the edition block is
ready to create the fourth line.
4th line of Ladder:
19. Click the icon 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).
24. Click the icon and draw a horizontal between the RESET contact and the reset timer
Function.
25. Click the icon to insert a MAINTENANCE output relay then click under the reset timer
Function. A horizontal line is automatically drawn to the right rail.
26. Enter the Tag name MAINTENANCE or select it from the list of Tags.
27. Click the icon and draw a horizontal and vertical line to join the input contact to the
output relay MAINTENANCE.
28. Press the key <+>, or click the icon to compile the line. Doing this, the edition block is
ready to create the next line.
29. Press <ESC> to come back in Display mode.
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' contains a copy of the value of 'B'
A = -B 'A' contains the invert value of 'B'
A = Low(B) 'A' contains a copy of the 8 lowest bits of 'B'
A = High(B) 'A' contains a copy of the 8 highest bits of 'B'
A = Abs (B) 'A' contains a copy of the absolute value of 'B'
A = Swap(B) 'A' contains the inversion of the 8 highest bits and the 8 lowest bits of 'B'
inc (A) increase the value of Tag 'A' by 1 bit
dec (A) decrease the value of Tag 'A' by 1 bit
Comparisons
BOOL = B == C 'BOOL' is TRUE if 'B' equal 'C', otherwise it is FALSE
BOOL = B < C 'BOOL' is TRUE if 'B' is smaller than 'C', otherwise it is FALSE
BOOL = B > C 'BOOL' is TRUE if 'B' is greater than 'C', otherwise it is FALSE
BOOL = B <= C 'BOOL' is TRUE if 'B' is smaller than or equal to 'C', otherwise it is
FALSE
BOOL = B >= C 'BOOL' is TRUE if 'B' is greater than or equal to 'C', otherwise it is
FALSE
BOOL = B <> C 'BOOL' is TRUE if 'B' and 'C' are different, otherwise it is FALSE
BOOL = odd B 'BOOL' is TRUE if the value of 'B' is odd, otherwise it is FALSE
A= conv 0/20 4/20 (B) 'A' is the conversion from 0..20mA to 4..20mA of 'B'. It is a
scaling in order to start binary counting at 4 mA instead of 0 mA
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
Bit = bit( A,BitNb) 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
NOTES:
1. PIDs require knowledge of this type of regulation.
2. An example is available on web site: www.tbox.biz -> Support -> Examples
'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.
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
For users accustomed to work with TSoft (the DOS editor), we have kept mathematical functions
in order to execute analog operations.
A POU program can call another POU Program that can call another POU Program etc...
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.
figure 24
Now you can create a Ladder Diagram for the Program you have defined.
- EN: 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.
Calling a POU Program is like calling a sub-routine. The program associated to it is executed at
the position where it is called.
Introduction
A POU Function is a user-defined piece of Ladder that executes a calculation ending in one
result. It is useful when a calculation you regularly need to execute does not exist in the list of
Standard Functions. You use it in POU Programs every time you need to execute the calculation.
It has one or many inputs and only one output. When a Function is used many times in a POU
Program, the same code is always executed.
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.
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.
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.
Delta, tmp0: local analog Tags used as temporary variables necessary to calculate the
scaling.
The Ladder :
- EN: 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.
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'.
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.
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.
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.
is a digital output. It will be connected to a motor, for instance when calling the Function
OUTPUT
Block.
is an analog input containing the number of seconds of the delay. It must be associated
DELAY
to the timer used in the Function Block.
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.
- EN: 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.
IMPORTANT:
1. The document must have been sent to TBox.with the last changes
2. If TWinSoft is opened after the document has been sent, the document must be compiled, to
allow TWinSoft assigning registers to the local Tags.
3. The complete path from the Program 'main' must be followed to access the FB. Example: 'Main'
-> 'Motors' -> FB 'Motor1'.
To debug the FB, while in 'Vizualization mode', double click the call of the FB from the POU
program it is used:
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.
It is a file with the extension .LIB saved by default in the directory of TWinSoft.
figure 29
Export is necessary if you wish to edit a POU in the current document that has been saved in a
Library.
1. You open a library ('File' -> 'Open'); the POUs appear in the top window.
2. You select the POU and export it ('Edit' -> 'Export'); you repeat this operation for each
POU.
3. The POUs are then available in the list of 'Programs', in the Project Workspace.
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'.
To remove a Library from the current TWinSoft document, select the Library and click 'Remove'.
This operation is available only if you don’t use POU of the concerned library in the current
document.
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).
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.
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 !
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 !
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’).
figure 33
To an e-mail address
figure 34
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.
Type Description
I Integer (-32768.. 32768)
W Word (0.. 65535)
C Choice (for example edges: POS, NEG or DEL)
S Text (comments, TEL number, scaled value of Terminal/.Minitel
Tags,…)
R Real (only Factor an Offset of Terminal/Minitel Tags)
B Byte (0.. 255, represented as 3 ASCII characters)
t Time (represented as 2 ASCII characters)
j Day of the week
m month
0 (zero) Byte represented in binary format
f Floating point
D Double word
- Character string
d Digital state (represented as 0/1)
o (small letter) Digital state (represented as ON/OFF)
# Digital state (represented as --------/########)
1.. 9, a.. f Digital state (according to the definition of digital states, only valid
from 1 to 15)
h Time: hh:mm
• 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.
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.
Up to 64 sampling tables can be created with one Tag for each table.
The database information recorded in the A can be retrieved with the use of SCADA
software such as TView or other HMI\Scada package with A specific driver or generic
RS-485 driver.
(please call your distributor)
figure 37
• Inhibition:
Enabled: always recorded.
Disabled: never recorded.
Power failure: disabled if the supply voltage (230VAC or 8 56VDC) is broken
down.
DisCRD: 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 56VDC) is broken
down.
DisCRA : disabled if the Special register ‘DisCRA’ is at 1.
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’.
Examples:
1. A or RM modules can be connected to a master in RS485 communication (via COM3 of
the A). This can be a multi-point network.
2. If A are distant to each other, the COM5 (modem Network) is used to establish
communication between a Master and Slaves. This can be a multi-point communication.
3. A can be connected to other ModBus equipment via RS232 port (COM1 or COM2).
This is a point-to-point network.
4. The communication can be established via the public telephone network with another A;
in this case, the A Master will wait until an alarm of the type 'ModBus -Master' is
activated to start the exchange with the slave. Stopping the communication is then handled by
the Ladder diagram using the special digital variable [HltM-x], or the call can be disconnected
automatically after a defined time delay (modifiable) in the field 'Auto Hang up' (located in the
A Master advanced parameters).
This will speed up communication between Master and Slave(s). For a block communication you
specify the first address you wish to read (or write) in the Slave and the first Tag of the Master
where you save the read value (or that you write in the Slave).
The addresses of the Slaves as well as the Tags of the Master must be successive ModBus
addresses. It is important to keep it in mind when you determine the cabling of the I/Os.
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).
6. Block communication is possible and advised whenever it is possible. This will speed up
communication between Master and Slave(s).
• Operation :
• 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:
If it is a Remote A: the choice is Analog or Digital. According to the operation, TWinSoft
selects automatically the proper ModBus function according to the operation.
If it is a RM module: the type is not available. TWinSoft selects automatically the proper ModBus
function according to the address.
- 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).
TTT r b c S Description.
DI x x x Digital input.
DI x x x 4m Test of an analog input.
DO x x x Digital output.
AIB x x x Analog input 8-bit resolution.
AIB x x x 4m Input 0 20mA converted to 4 20mA.
AIW x x x Analog input 12-bit resolution.
AOB x x x Analog output 8-bit resolution.
AOB x x x 4m Output 0 20mA converted to 4 20mA.
If it is a register:
TTT.nnnn
TTT: is the type of variable.
nnnn: register number.
TTT Description.
DIR Digital register.
AIR Analog register.
STO Storage 16 bits register.
STB Storage 8 bits register.
STD Storage digital register.
FLT Floating point register.
TOT Totalizer (32 bits).
ATP Timer preset.
ATV Time value.
DTI Timer status.
ACP Counter preset.
ACV Counter value.
DCN Counter status.
DSPE Digital Special register.
ASPE Analog Special register.
Examples:
DIR.1000: Digital register 1000.
AIR.128: Analog register 128.
DTI.20: Digital state of timer 20.
DSPE.2: Digital special variable 2.
TTT b c S Description.
DI 0 x Digital input (instantaneous).
DI 0 x S+ DI Latched on positive edge and reset by the
communication.
DI 0 x SM+ DI Latched on positive edge and reset by writing '0'.
DI 0 x S- DI Latched on negative edge and reset by the
communication.
DI 0 x SM- DI Latched on negative edge and reset by writing '0'.
DI 0 x V Test of the digital output.
DO 0 x Digital output.
AIW 0 x C 16-bit Totalizer of pulse on a DI.
AIW 1 x Analog input 16-bit resolution.
DI 1 x 4m Test of an analog input.
Examples:
DI.0.0: Digital input 0.
DO.0.1: Digital output 1.
DI.0.1.V: Test of the Digital output 1.
AIW.0.3.C: Totalizer of the pulse on DI 3.
AIW.1.0: 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.
TTT b c S Description.
DI x x Digital input (instantaneous).
DI x x S+ DI Latched on positive edge and reset by the
communication.
DI x x SM+ DI Latched on positive edge and reset by writing '0'.
DI x x S- DI Latched on negative edge and reset by the
communication.
DI x x SM- DI Latched on negative edge and reset by writing '0'.
DO 1 x Digital output.
DI 1 x Test of a Digital output.
AIW 0 x C 16-bit Totalizer of pulse on the 8 first DI.
AIW 2 x Analog input 16-bit resolution.
DI 3 x 4m Test of an analog input.
AOW 3 x Analog output.
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.
Report Studio can be started directly from the group of programs where TWinSoft is started
(by default ‘Techno Trade’) or from the folder ‘Web and Report files’ by clicking a ‘.trep’ file.
A report is associated to a TWinSoft document. In this way, the selection of Tags is made
very easy.
Inside the report, fields are declared to display dynamic data (Tags, alarms, databases, …)
The Tags can be printed as single fields or in a table.
By a single click, a list of alarms can be inserted.
By a single click, a list of historic data can be inserted.
Files can be attached to a report.
The database of A (alarm & historic) can be attached to a report (TBox mail feature).
2. Remote print through a modem port of the A. On an alarm condition, the report is sent.
The remote printer must be equipped with a specific modem (please call your distributor). (see
in TWinSoft 'Alarms' Recipient).
3. Sending a report through e-mail. On an alarm condition, the e-mail, with its associated report is
sent (see in TWinSoft 'Alarms' Recipient).
4. Display of the report with Microsoft Internet Explorer. This is one of the features of ' TBox
Web Server'. When connected to A, you type the URL of the report (see in TWinSoft
'Web & Report files').
Example: http://1.2.3.0/report.txt
For more information, start Report Studio and look at the online ‘Help’.
• 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).
figure 41
• 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).
This program generates a password that will be necessary to Login to the A (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.
• Access level : Three access levels are available:
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).
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.
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.
Logout
If the TWinSoft is connected to a protected port, the Logout sets TWinSoft in 'Read only' mode.
If the internal modem was declared protected, it will still be protected even after a global
reset. To deactivate protection, an unprotected TWinSoft document must be sent to A (see
next).
They allow to move or copy Ladder, Tags, Definition ...inside a document or to another
document.
It is then possible to open several sessions of TWinSoft to access different documents at the
same time, and to copy from one document to another document.
2. The creation of a new object is based on the name of the original object. TWinSoft looks for an
existing name of the same type (for Tags: digital or analog). In case it exists, TWinSoft uses it.
In case it does not exist, TWinSoft offers you to create the object.
Exceptions:
1. In case the name must be unique, TWinSoft creates a new object and increments the name.
Example: you copy ‘Register’ many times, TWinSoft will increment name and address
‘Register_1’, ‘Register_2’,…
2. In case a special register is already declared, it is used with its original name.
Example: <second> or <sec> if it concerns the ASPE - 0.
17.2. Examples
Following are examples how these features can be used in TWinSoft:
NOTES:
1. The I/O cannot be automatically created, only registers (DIR, AIR, ....).
2. The increment on number in a comment only applies if the number is the last character.
3. If the name does not include a number as last character, TWinSoft automatically creates and
increments a number.
Example: 'register' -> 'register_1' , 'register_2' , .....
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.
NOTES:
1. The sorting (by name, address, ...) only applies to the display of the list.
2. Drag’n’Drop in a list is not allowed in the list of Tags.
WARNING: do not make copy/paste between different types of POU. For instance from a
‘Program’ to a Function block’, or from a ‘Function’ to a ‘Program’, … Even if it is possible, it is
not allowed as the result is unpredictable.
This is very useful to edit list of configurations using an external software (Excel, Notepad, ...) or
even to create full configuration with 'text' files (see Export following).
The separator used in the CSV file depends on the regional settings configuration of windows.
Typically it is ' ; ' or ' , ' according to the language.
NOTE: Be careful when working on different PC that the regional settings (at least the separator)
are configured on the same way.
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
- 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, ...)
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 I/O Signed
value
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.
Signed
Yes or No.
With Register : determines the format. When nothing is mentionned, it is considered as a 'yes'.
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.
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
• Syntax
If you want to modify or create your own file, with the 'separator' between each field.
The syntax is
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.
• Syntax
If you want to modify or create your own file, with the 'separator' between each field.
The syntax is:
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)
• Syntax
If you want to modify or create your own file, with the 'separator' between each field.
The syntax is:
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).
If you want to modify or create your own file, with the ‘separator’ between each field.
The syntax is:
Index Tag Comment Write State1 State0 Min Max Meas. Meas. Conv. Conv. # Unit
allowed Min Max Min Max dec.
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.
Example:
8bits analog input (0..255) corresponds to 0..1000 mm
Measured: 0 ... 255
Converted: 0 ... 1000
# dec.
Number of decimals (maximum 3)
Unit
The text associated to analog Tag.
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.
Unit
The text associated to analog Tag.
Maximum 8 characters.
Syntax
If you want to modify or create your own file, with the 'separator' between each field.
The syntax is:
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.
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.
Import menu is available from the main menu of TWinSoft: 'File' -> 'Import'.
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.
• 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.
19.1. Presentation
Pack & Go is a tool that builds up one file with your complete project, including TWinSoft
document, WebForms, Reports, OS,...
The goal is to backup a complete project without missing files or to update a RTU with the
complete project without requiring advanced knowledge of TWinSoft.
All files are compressed and packed into one file with the extension .tpg (TWinSoft Pack & Go).
Once a project is packed, it can be unpacked and/or updated to the RTU from a double click on the
.tpg file.
19.2. Pack
19.3. Unpack
To open the Unpack window, double click a file with the extension .tpg.
1. Restore a project