CSE-Semaphore TWinSoft Manual - ioSelect
CSE-Semaphore TWinSoft Manual - ioSelect
CSE-Semaphore TWinSoft Manual - ioSelect
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Revision: USA 8.32<br />
<strong>TWinSoft</strong> 8.32<br />
-<br />
Getting started
Table of Contents<br />
1. INTRODUCTION ............................................................................................................................... 5<br />
2. STARTING TWINSOFT .................................................................................................................... 6<br />
2.1. System requirements............................................................................................................6<br />
2.2. Starting the CD-ROM of <strong>TWinSoft</strong>......................................................................................7<br />
2.3. Programs of ‘<strong>TWinSoft</strong> Suite’ .............................................................................................8<br />
3. TWINSOFT PROTECTION ............................................................................................................... 9<br />
3.1. The Evaluation mode...........................................................................................................9<br />
3.2. The Dongle ..........................................................................................................................9<br />
3.3. The Code (License)..............................................................................................................9<br />
3.4. The <strong>TWinSoft</strong> LITE ..............................................................................................................9<br />
4. WIZARD......................................................................................................................................... 10<br />
5. PRESENTATION ............................................................................................................................. 13<br />
6. COMMUNICATION (PC SET UP) .................................................................................................... 14<br />
6.1. Sending a program ............................................................................................................15<br />
Compile + test of available memory. .................................................................................................15<br />
Upload................................................................................................................................................15<br />
6.2. Saving the source...............................................................................................................15<br />
6.3. Working modes of TBox....................................................................................................16<br />
Mode 1a: the program is running.......................................................................................................16<br />
Mode 1b: the program is running and in alarm mode ........................................................................16<br />
Mode 2: the program is stopped (Global Reset) ................................................................................16<br />
Mode 3: The Operating System is stopped ........................................................................................17<br />
7. RTU PROPERTIES ......................................................................................................................... 18<br />
7.1. General ..............................................................................................................................18<br />
7.2. Communication ports ........................................................................................................19<br />
8. CREATING TAGS ........................................................................................................................... 20<br />
9. THE RESOURCES........................................................................................................................... 21<br />
9.1. Creating a block of I/O......................................................................................................22<br />
Creating a Remote block of I/O: ........................................................................................................22<br />
Creating Remote modules RM-xx .....................................................................................................23<br />
9.2. Creating a card..................................................................................................................23<br />
9.3. Creating a Tag from a list of I/Os .....................................................................................23<br />
10. PROGRAMS.................................................................................................................................. 24<br />
10.1. Ladder – Principle...........................................................................................................24<br />
Inputs..................................................................................................................................................24<br />
Outputs...............................................................................................................................................24<br />
Cycle time ..........................................................................................................................................25<br />
10.2. Ladder - Modes................................................................................................................25<br />
Display mode .....................................................................................................................................25<br />
Edit mode ...........................................................................................................................................26<br />
10.3. Ladder - Toolbar .............................................................................................................27<br />
Display mode .....................................................................................................................................27<br />
Edit mode ...........................................................................................................................................28<br />
10.4. Variables..........................................................................................................................29<br />
Local Tags..........................................................................................................................................29<br />
Global Tags........................................................................................................................................29<br />
The colors of the Tags........................................................................................................................29<br />
10.5. Create Ladder Diagram ..................................................................................................30<br />
Inserting items....................................................................................................................................31<br />
The colors of the Tags........................................................................................................................31<br />
The Keys ............................................................................................................................................31<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 2
10.6. Step by step creating of Ladder .......................................................................................32<br />
10.7. Mathematical Block.........................................................................................................36<br />
Introduction........................................................................................................................................36<br />
Assignments .......................................................................................................................................36<br />
Arithmetic operations.........................................................................................................................37<br />
Comparisons.......................................................................................................................................37<br />
Bit manipulations ...............................................................................................................................38<br />
Boolean operations.............................................................................................................................39<br />
Conversion + Indirect addressing.......................................................................................................39<br />
PID regulation ....................................................................................................................................41<br />
Miscellaneous.....................................................................................................................................42<br />
Floating point functions .....................................................................................................................43<br />
10.8. POU (Program Organization Units)...............................................................................44<br />
10.8. POU (Program Organization Units)...............................................................................44<br />
10.9. POU – Program...............................................................................................................45<br />
The 'main'. ..........................................................................................................................................45<br />
Creating a POU Program ...................................................................................................................45<br />
Calling a POU Program in another Program......................................................................................46<br />
10.10. POU – Function.............................................................................................................47<br />
Creating a POU Function...................................................................................................................47<br />
Example of a Function .......................................................................................................................49<br />
Calling a POU Function in a POU Program ......................................................................................50<br />
10.11. POU - Function block....................................................................................................51<br />
Creating a POU Function Block ........................................................................................................51<br />
Example of a Function Block.............................................................................................................53<br />
Calling a POU Function Block in a POU Program............................................................................54<br />
Debugging of a Function block..........................................................................................................55<br />
11. LIBRARY MANAGEMENT............................................................................................................. 56<br />
11.1. Import of POUs (saving POUs in a Library) ..................................................................56<br />
11.2. Export of POUs (retrieval of POUs from a library) .......................................................57<br />
11.3. Use of a Library in a <strong>TWinSoft</strong> document .......................................................................57<br />
12. ALARMS ...................................................................................................................................... 58<br />
12.1. Introduction .....................................................................................................................58<br />
12.2. Digital Tag Condition......................................................................................................59<br />
12.3. Analog Tag Condition .....................................................................................................60<br />
12.4. Recipients.........................................................................................................................61<br />
12.5. Examples of recipients.....................................................................................................62<br />
To a GSM...........................................................................................................................................62<br />
To an e-mail address ..........................................................................................................................62<br />
13. DATALOGGING............................................................................................................................ 65<br />
13.1. Introduction .....................................................................................................................65<br />
13.2. The Chronologies ............................................................................................................66<br />
13.3. Sampling tables ...............................................................................................................67<br />
14. REMOTE TAG.............................................................................................................................. 68<br />
14.1. Introduction .....................................................................................................................68<br />
14.2. Block communication ......................................................................................................69<br />
14.3. Description of fields.........................................................................................................71<br />
15. WEB & REPORT FILES................................................................................................................ 77<br />
15.1. Procedure to work with TBox as a Web Server...............................................................77<br />
15.2. Report Studio ...................................................................................................................78<br />
Different ways to use a report ............................................................................................................78<br />
16. TBOX ACCESS SECURITY............................................................................................................ 79<br />
16.1. TBox configuration..........................................................................................................79<br />
16.2. Password utility ...............................................................................................................80<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 3
16.3. Login/Logout ...................................................................................................................81<br />
16.4. Deactivating protection ...................................................................................................81<br />
17. COPY/PASTE - DRAG'N'DROP .................................................................................................... 82<br />
17.1. General rules ...................................................................................................................82<br />
17.2. Examples..........................................................................................................................82<br />
Create Tags in the list of Tags (Copy/Paste)......................................................................................82<br />
Copy a POU in the same document (Copy/Paste)..............................................................................83<br />
Move or copy Ladder from one POU to another POU (Drag’n’Drop or Copy/Paste).......................83<br />
Copy Ladder from one document to another document (Drag’n’Drop) ............................................83<br />
Copy entries of any list (Recipient, Alarm condition, Remote Tags, ...) from one document to<br />
another document (Copy/Paste) .........................................................................................................83<br />
Modifying the sequence of the elements in all lists (Drag'n'Drop). ...................................................83<br />
18. IMPORT / EXPORT....................................................................................................................... 84<br />
18.1. Export ..............................................................................................................................85<br />
Example files......................................................................................................................................86<br />
Export - Tags......................................................................................................................................87<br />
Export - Alarm conditions..................................................................................................................89<br />
Export - Alarm message.....................................................................................................................91<br />
Export - Chronologies........................................................................................................................92<br />
Export - Sampling tables....................................................................................................................93<br />
Terminal Tags ....................................................................................................................................94<br />
Analog Units ......................................................................................................................................95<br />
Digital States ......................................................................................................................................96<br />
18.2. Import ..............................................................................................................................97<br />
Working with an Empty Document ...................................................................................................97<br />
Exact replace ......................................................................................................................................98<br />
Replace...............................................................................................................................................98<br />
Append...............................................................................................................................................98<br />
19. PACK & GO................................................................................................................................. 99<br />
19.1. Presentation.....................................................................................................................99<br />
19.2. Pack .................................................................................................................................99<br />
19.3. Unpack...........................................................................................................................100<br />
Disclaimer<br />
Every effort has been made to ensure the accuracy of the information in this guide. However, Techno Trade<br />
S.A. assumes no responsibility for the accuracy of the information. Product information is subject to change<br />
without notice.<br />
AB is a registered trademark of Axeda.<br />
MODBUS is a registered trademark of Gould Modicon.<br />
TSOFT , TVIEW , <strong>TWinSoft</strong>, WebForm Studio and A are registered trademarks of Techno Trade s.a.<br />
Windows ’95, ’98, NT, 2000, XP are trademarks of Microsoft Corp.<br />
Internet Explorer is a trademark of Microsoft Corp.<br />
Copyright<br />
© 1999-2004 by Techno Trade s.a. All rights reserved.<br />
Edition: November 2, 2004 (original 8.32)<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 4
1. Introduction<br />
<strong>TWinSoft</strong> is the software necessary to create running application for A RTU and Low<br />
Power RTU. It also allows communicating with your RTU to visualize its process.<br />
This manual helps you to understand the concept of A and to create basic configurations as:<br />
Tags (the variable of the A).<br />
Programs (the automation programs in Ladder programming).<br />
Alarms.<br />
Data logging criteria.<br />
Remote Tags.<br />
A Access Security.<br />
Concerning Low Power RTU a specific manual is available.<br />
A is presented as the “6 in 1” Tele-control system. It means A can be configured for<br />
all those features without needing supplementary software or hardware. What are those six<br />
features?<br />
1. A is a Web Server: TCP/IP has been implemented as standard protocol. A can<br />
be called by a Browser to display HTML images, saved in the A. It is also able to<br />
send e-mail through a provider and send a file to a FTP site. This feature is available<br />
from versions <strong>TWinSoft</strong> 7.00 and OS 5400.<br />
2. A is a multi-port system: A is equipped with different communication ports<br />
that allow local communication with other equipment. A also allows remote<br />
communication through different types of modems (ISDN, PSTN, GSM, Cellular,<br />
Radio…). A supports as standard, ModBus RTU protocol, TCP/IP protocol and<br />
Minitel protocol on all ports. A is able to handle concurrent communications on<br />
different ports in multi-tasking and at different speeds.<br />
An Ethernet card is also available (10 Base/T).<br />
3. A is a PLC: with the help of the IEC1131-3 standard Ladder programming,<br />
automation programs can be developed; including mathematical functions, PID loops and<br />
user definable function blocks.<br />
4. A is an alarming system: on alarm conditions (digital and/or analog), A is able<br />
to send messages to printer(s), to pager(s), GSM and other cellular systems, to call a<br />
supervisor, to send email, etc…<br />
5. A is a Data logger: in order to memorize events of your process, you can define<br />
criteria of recording values of Tags. Those values can be stored “on event” and/or<br />
periodically. Recording can be FIFO (circular buffer – continuous) and event driven.<br />
6. A is protocol converter: with the help of external “C” drivers that you can write,<br />
A can be used to translate a proprietary protocol to ModBus protocol for a<br />
connection to a standard supervisor package or translate between devices of different<br />
manufacture.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 5
2. Starting <strong>TWinSoft</strong><br />
2.1. System requirements<br />
Hardware: Pentium or higher.<br />
Memory: 16-MB minimum. We recommend 32 MB.<br />
Hard Disk: 10 MB required plus the application files.<br />
Display: VGA, SVGA with a minimum resolution of 640 x 480. We recommend 800 x 600.<br />
Mouse: any Windows compatible mouse.<br />
Parallel port: required in case of dongle protection. (A software license is also available)<br />
Serial port: required for a local connection to Aor for an external modem.<br />
Modem: any PCMCIA or external modem properly configured in Windows.<br />
Operating system: Windows 95, Windows 98 or Windows NT (service pack 3 or higher),<br />
Windows 2000, Windows XP.<br />
• To Browse A:<br />
Internet Browser: as ActiveX is used, Internet Explorer only can be used. Version 5.00 or higher<br />
is recommended to take benefit of the dialer.<br />
The CD-ROM of <strong>TWinSoft</strong> includes MSIE version 5.00.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 6
2.2. Starting the CD-ROM of <strong>TWinSoft</strong><br />
When inserting the CD-ROM of ‘<strong>TWinSoft</strong> Suite’ into the PC, the following software’s are<br />
available from the Setup:<br />
• <strong>TWinSoft</strong> 8.32<br />
<strong>TWinSoft</strong> is the software required for developing an application for the A RTU. The<br />
basis for configuring a A application is explained in this manual.<br />
Installation of <strong>TWinSoft</strong> includes ‘WebForm Studio’: HTML editor dedicated to RTU),<br />
‘Report studio’: Report editor dedicated to RTU and ‘WebForm Viewer’: Internet Explorer<br />
‘TBox Dialer’ and ActiveX (see next).<br />
• WebForm Viewer<br />
This software contains the tool TBox Dial It ! used to dial a A with Internet Explorer.<br />
It also contains the ‘ActiveX’ used to display RTU dedicated objects.<br />
It needs to be installed on the PC used by a operator to dial A with Internet Explorer,<br />
when <strong>TWinSoft</strong> is not required.<br />
• TBox Mail<br />
This software is used to display a Chart view from datalogging attached to an e-mail.<br />
• DreamWeaver Trial version<br />
• Report Studio for DreamWeaver<br />
Dreamweaver is a standard HTML editor. It can be used with the plug-in ‘Report Studio for<br />
Dreamweaver’ to develop standard HTML pages that do not use the ActiveX.<br />
• Acrobat Reader<br />
Software needed to read our documentation.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 7
• Internet Explorer 5<br />
Minimum version required to dial A and display properly the ActiveX.<br />
• Explore this CD-ROM<br />
You will find on the CD-ROM many information related to A and accessories:<br />
datasheets, manuals, …<br />
2.3. Programs of ‘<strong>TWinSoft</strong> Suite’<br />
During installation of <strong>TWinSoft</strong>, a group of programs is created where <strong>TWinSoft</strong> can be started.<br />
figure 1<br />
Other programs and menus:<br />
• TBox drivers: when 'C' custom drivers have been installed. The ‘on line’ help of the driver<br />
configuration is available in this folder.<br />
• Samples: group with <strong>TWinSoft</strong> documents installed as example.<br />
• Accessories: group containing the utility ‘Password generator’ and ‘Reset User preferences’:<br />
reset of registry information to restore the default configuration of <strong>TWinSoft</strong>.<br />
• Documentation: group containing the various documents associated to <strong>TWinSoft</strong> and RTU.<br />
• Report Studio: to create reports dedicated to A.<br />
• <strong>TWinSoft</strong>: to start <strong>TWinSoft</strong>.<br />
• WebForm Studio: to start the HTML editor, dedicated to A when it is used as a Web<br />
Server.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 8
3. <strong>TWinSoft</strong> Protection<br />
The software itself is not protected; it can be installed on any PC and used to develop <strong>TWinSoft</strong><br />
documents Offline or to monitor/control a running program locally or remotely.<br />
The only protected operation is the insertion of an application in the A.<br />
In order to find the best way for you we offer different possibilities:<br />
3.1. The Evaluation mode<br />
You don't need any software or hardware dongle. You are able to develop a complete <strong>TWinSoft</strong><br />
document without any restriction, but when you send the application to the A, it will stop<br />
after 2 hours. This is a good solution for testing programs or creating a demo.<br />
3.2. The Dongle<br />
It is a hardware device placed on the parallel port of your PC. <strong>TWinSoft</strong> regularly checks the<br />
presence of it. It allows you to send applications to as many A’s as you want, with any PC.<br />
3.3. The Code (License)<br />
Available from the menu ‘Help’ ‘License Register.’<br />
Using information of the PC (the Company name, the User name, the Serial Number), we create a<br />
code that you enter in the 'License' field. Once entered, you can send any application as if you had<br />
a dongle (see previous). The only restriction is that it must always be on the same PC.<br />
If you wish to use another PC, you have the possibility to remove registration on the first PC and<br />
register back on the second.<br />
3.4. The <strong>TWinSoft</strong> LITE<br />
Available from the menu ‘Help’ ‘<strong>TWinSoft</strong> LITE configuration.’<br />
This protection mode is ideal for users having one or two A units. The A dongle or a<br />
code might be too expensive. <strong>TWinSoft</strong> LITE code is linked to one A; it allows you to send<br />
an application to the A for which you have the code.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 9
4. Wizard<br />
When starting <strong>TWinSoft</strong> the first time or when creating a new document, the Wizard helps you to<br />
define the basic configuration:<br />
figure 2<br />
This configuration can be modified using the RTU properties dialog boxes.<br />
figure 3<br />
According to the hardware<br />
you want to program, select<br />
the proper type of RTU.<br />
Warning : you cannot<br />
change later from one type<br />
to another type :<br />
LP100 to LP200 for<br />
instance.<br />
Telephone information<br />
the location where the<br />
A will be placed.<br />
According to this data<br />
TwinSoft will dial<br />
country, area code or<br />
prefix when calling the<br />
A.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 10
In case you have selected a modem (see previous page), the Wizard offers to define a connection<br />
to an ISP, in order to send e-mail.<br />
figure 4<br />
figure 5<br />
Available ‘dial up entries’ to<br />
ISP existing on your PC.<br />
OR<br />
Select ‘New connection…’<br />
You type these data<br />
according to the information<br />
received from the ISP.<br />
Part of the data appear<br />
automatically according to<br />
the ‘dial up entry’.<br />
You type the other data<br />
according to the information<br />
received from the ISP.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 11
The Wizard then asks you whether you use an Ethernet card and offers to configure it.<br />
figure 6<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 12
5. Presentation<br />
Using <strong>TWinSoft</strong>, you can easily create all needed items such as Tags, alarm recipients, alarm conditions,<br />
data logging criteria, and more using lists.<br />
figure 7<br />
To open a list of items, simply select the type of item you want to see in the project workspace (the tree in<br />
the left panel of the main window). <strong>TWinSoft</strong> opens a view (new window) showing these items.<br />
You can open several views to see more than one list at a time: In the Window menu, choose New.<br />
The window in the bottom can be selected to display utility information. It can be opened (or closed) by<br />
pressing the accelerator keys:<br />
: Open / Close the Project Workspace.<br />
: Build results (results of the compilation and use of the memory of the A).<br />
: Watch (to display a custom design list of values of Tags).<br />
: Cross-reference (gives complete information of 1 Tag).<br />
The status line indicates the type and status of the communication.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 13
6. Communication (PC set up)<br />
Communicating with your A is necessary to send a program or to visualize the process. The<br />
development of a document can be done “off line”.<br />
A communication can be carried out locally or remotely. It is defined in the PC set up<br />
configuration.<br />
• The Off line option is selected to avoid sampling a A that is not connected.<br />
• In case of a local connection, select the port of the PC that is used to communicate with the<br />
A. The Baudrate must fit with the speed of the port of the A to which your PC is<br />
connected. If you don’t know the Baudrate of A, you can set it to a default<br />
configuration (see chapter 6.3: Working modes of A)<br />
figure 8<br />
• To communicate with your A in TCP/IP (typically with a A equipped with an<br />
Ethernet card), you select the option ‘TCP/IP (Ethernet…). <strong>TWinSoft</strong> will then establish a<br />
communication with the IP address specified in the tab ‘TCP/IP – LAN’ (see chapter 7: ‘RTU<br />
Properties’).<br />
• Communicating with your A using a modem is easier than ever since <strong>TWinSoft</strong> takes<br />
full advantage of Windows' built-in modem support: Simply install your modem in the control<br />
panel's Modems applet and you are ready to call your A.<br />
After having selected the communication mode, you can check the communication doing a ‘RTU<br />
identification’ from the ‘Communication’ menu.<br />
For more information, click ‘Help’.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 14
6.1. Sending a program<br />
Compile + test of available memory.<br />
Compile the program before sending to A. This can be done to test the integrity of a<br />
<strong>TWinSoft</strong> document or to check the memory available in the A<br />
To compile without sending the <strong>TWinSoft</strong> document use the icon from the Main Toolbar, or<br />
from the main menu bar: 'File' -> 'Compile' or directly the key .<br />
The result of compilation is available in the 'Results' window. This window is automatically<br />
opened if the compilation fails, otherwise you can open it with the accelerator keys , or<br />
from the main menu bar 'View' -> 'Build Results':<br />
Information: Indicated in black<br />
Warning: Indicated in bold dark green.<br />
Error: Indicated in bold red<br />
Available information:<br />
OS Version: <strong>TWinSoft</strong> reads the OS version of the A, to test if the <strong>TWinSoft</strong><br />
document fits with the material.<br />
Program + Chrono: RAM memory available for Program, chronologies and Sampling<br />
Tables.<br />
Sampling Tables: RAM memory available for Sampling Tables.<br />
ROM: EEPROM memory for the program sent by <strong>TWinSoft</strong>. When the A starts, a<br />
part of program is copied in (battery-backed) RAM.<br />
Upload<br />
Upload means transferring information from the PC to the A, locally or remotely.<br />
To access Upload features, click 'Communication' -> 'Upload' from the main menu bar.<br />
Upload of the program.<br />
The PC sends the current <strong>TWinSoft</strong> document (program) to the A. The document is first<br />
compiled then sent to the A. It is carried out by the icon on the main Toolbar or by<br />
pressing the keys .<br />
It must be executed every time a modification is implemented within your document, in order to<br />
apply it to the A.<br />
6.2. Saving the source<br />
The source is the <strong>TWinSoft</strong> document. It can be sent at the same time as the compiled program:<br />
check the box ‘Also upload Program source’ in the dialog box when sending a program (see<br />
previous). You can therefore have a back-up of the application saved inside the A.<br />
To copy it back to the PC, click from the main menu Bar: ‘Communication’ ‘Download’ <br />
‘Program source’.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 15
6.3. Working modes of TBox<br />
A has three working modes:<br />
The program is running.<br />
The program is running and in alarm mode.<br />
The program is stopped (via a global reset).<br />
The Operating System is stopped.<br />
If you don’t know the communication parameters of the A you are connected to, you will<br />
not be able to communicate with it.<br />
In order to set the A to a known configuration, you need to do a global reset of the<br />
A(see mode 2 below).<br />
Mode 1a: the program is running<br />
USR LED blinks twice per second<br />
If you wish to restart the program:<br />
• Press the RST button, and then release it.<br />
Restarting the program has the following effects:<br />
Current alarms are stopped and the stack is erased<br />
Data logging is maintained<br />
Values of counters are maintained<br />
Timers are reset<br />
Reset (to 0) of the DIR, AIR, STO, according to the start up conditions (see the ‘RTU<br />
properties’ dialog box ‘Advanced’ tab)<br />
Reset (to 0) or do not reset the physical digital outputs, according to the start up<br />
conditions<br />
The 3 digital outputs of the CPU are always reset (hardware reset)<br />
Mode 1b: the program is running and in alarm mode<br />
USR LED blinks 8 times / sec.<br />
There is currently one (or more) alarm(s) in A. Typically the sending of SMS, e-mail, call to<br />
a Supervisor, …<br />
Mode 2: the program is stopped (Global Reset)<br />
USR LED blinks once every 2 seconds<br />
A global reset is used to stop, but not erase, the program in the A. Pressing RST<br />
again restarts the program (see previous).<br />
Procedure to stop the program:<br />
• Hold the PGM button pressed<br />
• Then press and release the RST button<br />
• Wait for TxD and RxD to blink once, then release PGM<br />
A is configured as follows:<br />
COM1, COM2, COM3: 9600 baud + even parity + ModBus protocol (unprotected).<br />
COM4: V22, PSTN (protected if it was programmed).<br />
station address number: 1 (ModBus address).<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 16
Mode 3: The Operating System is stopped<br />
Lighted USR LED and blinking ERR LED<br />
The OS of the A contains all the features. In very rare situations it might be stopped.<br />
Procedure to stop the OS:<br />
• Hold the PGM button pressed.<br />
• Then press and release the RST button.<br />
• Wait for TxD and RxD to blink four times, then release PGM.<br />
The A is in 'loader' mode.<br />
A is configured as follows:<br />
COM1, COM2, COM3: 9600 baud + even parity + ModBus protocol.<br />
COM4: V22, PSTN (non protected).<br />
station address number: 1 (ModBus address).<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 17
7. RTU properties<br />
Setting the parameters of the A to specific values has never been so easy thanks to a new set<br />
of comprehensive dialog boxes. To open the RTU Properties dialog boxes, use the icon of the<br />
Main Toolbar:<br />
figure 9<br />
7.1. General<br />
If the Wizard was used, the information entered is displayed. Information can be updated.<br />
figure 10<br />
For more information, click ‘Help’.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 18
7.2. Communication ports<br />
Each communication port can be configured independently.<br />
figure 11<br />
• COM1 and COM2 are RS232 communication ports for any local connection to a supervisory PC,<br />
printer, ModBus equipment, or to an external modem (PSTN, ISDN, GSM, RADIO, HF,). The<br />
maximum distance is 12 m.<br />
• COM3 is an RS485 communication port for network connection to other A (maximum 32) to<br />
RM modules (maximum 255) or to any other ModBus equipment having an RS 485 port. The<br />
maximum distance, depending on line quality, can be up to 10 km.<br />
• COM4 is an option. An internal modem can be used on PSTN lines (in modes V21, V22, V22b or<br />
V23) or on leased lines (in mode V22).<br />
• COM5 is an option that can be equipped with a PCMCIA modem (PSTN, ISDN or GSM) or with a<br />
network modem for network connection of A (maximum 10). The maximum distance,<br />
depending on the number of A and the line quality, can be up to 50 km.<br />
• COM6 is an Ethernet interface. It allows to connect A to a Hub, Router, … in order to establish<br />
a local connection (LAN) or a remote connection (WAN). Click ‘Parameters’ to configure the Ethernet<br />
card.<br />
<strong>TWinSoft</strong> can use any port for the visualization or sending of a document.<br />
For more information, click ‘Help’.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 19
8. Creating Tags<br />
Configuration is carried out using Tags. Tags are of all variables that the A program<br />
recognizes : digital inputs to the CPU, analog outputs of an extension rack, a register, …<br />
To declare a Tag, open the list of ‘Tags’ and click ‘Add a Tag’, and then choose Digital or Analog:<br />
figure 12<br />
• Type: for physical input/output select I/O. Other types are internal registers of the CPU.<br />
• Select: opens from ‘Resources’, the list of variables associated to the current type. It allows<br />
you to check easily which I/O or Registers are still free.<br />
• Address: it is the location of the physical I/O (rack number, card number and channel<br />
number). For registers, it is the number of a specific register.<br />
• Format: According to the address selected, different formats are available.<br />
• Export: allows export of the Tag definition in external, ASCII files, either in AB format or<br />
in ‘text’ format. This option is available while being in the ‘Tags’ folder, click in the main bar<br />
‘File’ ‘Export’. You can choose between:<br />
All list: all the Tags.<br />
Selection: only the Tags that have the option ‘export’ checked (not implemented yet).<br />
From the TAG definition box, any configuration requiring the Tag can be accessed, i.e. alarms,<br />
data logging, etc.<br />
For more information, click ‘Help’.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 20
9. The Resources<br />
The resources represent the list of all variables that are available for your application. It relates to<br />
the I/O of your A and any extension racks or external equipment.<br />
When starting a new document, the default startup only shows the variables of the CPU that are<br />
available. Click ‘Resources’ then ‘CPU’ to list the variables.<br />
Project workspace Physical I/O Registers<br />
8 DIGITAL INPUTS. • 2048 digital registers.<br />
figure 13<br />
• 3 digital outputs.<br />
• 2 analog inputs (8 bits).<br />
• 1 external battery check<br />
• 1 internal lithium battery<br />
check<br />
The different groups of<br />
I/O of the CPU appear as<br />
cards. Click the card to see<br />
the list of I/Os.<br />
Clicking an I/O opens the<br />
box of ‘Creating a Tag’.<br />
• 256 analog registers.<br />
• 4096 storage digital registers.<br />
• 6144 storage analog registers<br />
(16 bits).<br />
• 64 Floating point registers.<br />
• 256 timers.<br />
• 256 counters.<br />
• Digital special registers.<br />
• Analog special registers.<br />
• 64 totalizers<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 21
9.1. Creating a block of I/O<br />
Under the folder ‘I/O’ you see the CPU as the default block of I/O. Double click ‘I/O’ to add<br />
additional blocks of I/O – as per your hardware configuration:<br />
List of I/O Blocks Blocks of I/O<br />
• Rack4 and Rack8 are extension racks of the CPU<br />
(local).<br />
• Multi I/O card is a custom design card within the<br />
CPU (local).<br />
• RM-10 and RM-21 are remote modules (remote).<br />
• Remote TBox is a distant A (remote).<br />
• ModBus device is any ModBus equipment (remote).<br />
figure 14<br />
Creating a Remote block of I/O:<br />
Remote blocks of I/O are equipment connected to A through a communication port (RS485,<br />
RS232, modem, …).<br />
From the moment a A needs to communicate with other equipment, the latter become part<br />
of its Resources. The A being Master and the Remote equipment Slave(s).<br />
The A communicates to Remote equipment with the help of ‘Remote Tags’ (see chapter 14:<br />
‘Remote Tags’).<br />
When creating such equipment you must specify the following parameters:<br />
Example for a ‘Remote TBox’:<br />
figure 15<br />
• Name: you type any name. It will be available in a list of available equipment when creating<br />
‘Remote Tags’.<br />
• Address: it is the ModBus address of the Remote equipment. It must be different from the<br />
Master A and possible other equipment on the same network.<br />
• RTU Port: the communication port used by the Master to communicate with the equipment.<br />
• IP address: in case the communication port of the Master is COM6 (Ethernet card), the IP<br />
address of the Remote equipment must be specified here.<br />
Available for Remote A only.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 22
Creating Remote modules RM-xx<br />
The different groups of I/O of the RM modules appear as cards. Click the card to see the I/O list.<br />
Double-clicking an I/O opens the ‘Creating a Tag’ box.<br />
9.2. Creating a card<br />
After having created an extension rack, click on it to create cards.<br />
List of cards Cards description<br />
• 4 Analog inputs (8 bits full isolated).<br />
• 2 Analog output card (8 bits full isolated)<br />
• 8 Analog inputs (12 bits).<br />
• 16 Digital inputs.<br />
• 16 Digital outputs - (transistor/PNP)<br />
• 16 Digital outputs (old) (transistor/NPN) No<br />
longer available.<br />
• 8 Digital output (Relays 250 VAC).<br />
Figure 16<br />
9.3. Creating a Tag from a list of I/Os<br />
Example of I/O of an 8 Analog Input card:<br />
figure 17<br />
For each channel 2 variables are available:<br />
• The I/O (analog).<br />
• Test the I/O (digital).<br />
Double-clicking an I/O opens the box of<br />
‘Creating a Tag’.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 23
10. Programs<br />
10.1. Ladder – Principle<br />
Introduction<br />
The principle of the Ladder diagram is based on an electrical description of the process or<br />
machine, using relay logic. To the left of the screen are the inputs (they are conditions for which<br />
an action will be undertaken) and to the right are the outputs (which result from these actions).<br />
Inputs<br />
All inputs, whether digital or analog, can be combined to create logical equations (two inputs<br />
follow on the same line for an , and one above the other and linked by a vertical bar for an<br />
). All analog comparison functions and/or digital inputs on the same program line will<br />
represent true or false. The result defines the actions of the output (will or will not be performed).<br />
The different types of Input conditions are accessible in the LD Toolbar.<br />
Outputs<br />
Digital output functions are engagements (SET relay) or disengagement (RESET relay), they can<br />
be the image or the opposite of the result of the tested input conditions (OUTPUT relay and<br />
NEGATIVE relay). Other functions have been introduced proper to telemetry like transmission of<br />
alarms, data logging or sending of DTMF tone. To process analog outputs, many mathematical<br />
functions and POU (Program Organization Units) functions have been implemented.<br />
The selection of different types of outputs is accessible in the LD Toolbar.<br />
figure 18<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 24
Cycle time<br />
Ladder Logic is executed on a fixed basis; contacts, relays, functions; math calculations, etc are<br />
executed while they are scanned (read).<br />
Lines are scanned from left to right and from top to bottom. When bottom is reached, it starts<br />
again from top.<br />
The cycle time is displayed when doing a A Identification from the main Toolbar menu<br />
'Communication'.<br />
The cycle can never be greater than 1 second. If this occurs, an internal watchdog timer resets the<br />
A automatically.<br />
10.2. Ladder - Modes<br />
Introduction<br />
The Ladder programming operates in two different modes.<br />
The first is display mode, which allows you to see the entire program, one page at a time. It is in<br />
this mode that you can see the state or the value of variables in real time.<br />
The second mode is edit mode, which allows inserting a new line anywhere in the Ladder, at the<br />
beginning, at the end or between two existing lines. This mode also allows modifying an existing<br />
line.<br />
To see an example, load the <strong>TWinSoft</strong> document 'Ladder.tbox' that you find in the 'Samples'<br />
directory of <strong>TWinSoft</strong>.<br />
Display mode<br />
To access the Ladder in Display mode, click in the Project Workspace on the 'Programs' folder.<br />
The last Ladder that was opened is displayed. The white tab underneath indicates the active<br />
program. The 'MAIN' tab is the main program, that is automatically executed by A; the<br />
other POUs having to be called from the ‘MAIN’.<br />
The Ladder diagram appears in red lines with the Tags associated at each input contact, output<br />
relay or IN/OUT of functions.<br />
The Comment lines appear as gray blocks.<br />
When a jump (JUMP) is programmed, the jump’s mnemonic appears at the right side of a double<br />
arrow. The mnemonic is a LABEL that appears in black text.<br />
A call to another program appears in a red block with one IN/OUT line.<br />
The state of the digital input contacts is displayed as a green overlay if the condition represented<br />
by the contact is true (in the case of a trigger contact, the result represents the last level attained).<br />
Similarly, if the result of an analog comparison is true, a green overlay on the function is used.<br />
Moreover, for digital outputs, the green overlay represents the status of the associated Tag.<br />
When moving the cursor on analog Tags in Functions or Math blocks, the current value is<br />
displayed in the bottom left corner of the screen. For digital gates the display indicates or<br />
according to the current value.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 25
Edit mode<br />
The Edit mode is used when inserting a new line or modifying an existing line.<br />
To insert a line, use the LD Toolbar. Three types of lines can be inserted using the following<br />
buttons:<br />
to insert a line of Ladder<br />
to insert a line of Comment<br />
to insert a Label that will be called by a JUMP<br />
The Ladder diagram is made of several lines that are numbered starting at 1. Only one line at a<br />
time can be edited with only one rung (a rung is a set of Input conditions connected to only one<br />
set of Outputs). When editing is finished, the line must be compiled to proceed with the next one:<br />
To save and compile a line. If an error occurs, a dialog box informs you on the<br />
error. The key can also be used to save and compile a line.<br />
If you were editing an existing line, you return to display mode.<br />
If you were inserting a new line, you stay in edit mode.<br />
To quit editing and discard changes. The key can also be used.<br />
To select any item (line, contact, relays or Functions) of a Ladder line. Once<br />
selected it can be edited by a double click to replace Tags. You can also erase the<br />
selected item by pressing the key or insert a new contact, relay or Function<br />
by selecting the proper icon in the LD Toolbar.<br />
Inserting a new line as last line<br />
To insert a new line as last line, place the cursor at the end of the last line and click the icon<br />
corresponding to the type of line you wish to insert.<br />
Inserting a new line between 2 existing lines<br />
To insert a line between 2 existing lines, place the cursor on the existing line that the new line will<br />
correspond to. The new line will move the existing line to next position after it is inserted. When<br />
a line is selected, it is surrounded. Then click the icon corresponding to the type of line you wish<br />
to insert. The line you placed the cursor on will be moved downwards. Using the keyboard UP<br />
and DOWN arrows moves the selected line.<br />
Modifying an existing line<br />
To modify an existing line, place the cursor on the line you wish to modify. Then double-click it.<br />
The arrow icon of the LD Toolbar is automatically selected.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 26
10.3. Ladder - Toolbar<br />
The LD Toolbar is the panel of tools necessary to edit Ladder. Different icons are active<br />
according to the current mode of Ladder:<br />
Display mode<br />
Clicking one of the following icons lets you enter in the edit mode:<br />
To insert a line of Ladder.<br />
To insert a line of Comment.<br />
To insert a Label that will be called by a JUMP.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 27
Edit mode<br />
To Select any item (line, contact, relays or Functions) of a Ladder line. Once<br />
selected it can be edited by a double click to replace Tags. You can also erase the<br />
selected item by pressing the key or insert a new contact, relay or Function<br />
by selecting the proper icon in the LD Toolbar.<br />
To Save and Compile a line. If an error occurs, a dialog box informs you of the<br />
error. The key can also be used to save and compile a line.<br />
To Quit editing and discard changes. The key can also be used.<br />
To insert a Normal input contact for digital input. The condition will be true if the<br />
input is active.<br />
To insert an Invert input contact for digital input. The condition will be true if the<br />
input is inactive.<br />
To insert a Positive input trigger for digital input. The condition will be true only<br />
once when the input passes from an inactive level to an active level.<br />
To insert a Negative input trigger for digital input. The condition will be true only<br />
once when the input passes from an active level to an inactive level.<br />
To insert a Digital output normal. Output is activated if the results of the input<br />
condition(s) are true.<br />
To insert a Digital output inverted. Output is activated if the results of the input<br />
condition(s) are false.<br />
To insert a Digital output set. Output is set and memorized if the result of the input<br />
condition(s) are true; this type of output is typically used with a 'trigger' input<br />
To insert a Digital output reset. Output is reset and memorized if the result of the<br />
input condition(s) are true; this type of output is typically used with a 'trigger' input<br />
To draw continuous horizontal or vertical lines. To join inputs conditions together<br />
to create logical equations and to possibly connect to many outputs.<br />
WARNING: a set of inputs can only lead through one horizontal line to only one set<br />
of outputs. It is called a rung.<br />
To insert a Function or Function Block. A list opens with the standard Functions<br />
(under the folder 'Standard') and with the user defined Functions (under the folder<br />
'This file')<br />
To insert a Mathematical block. In this block, mathematical functions can be<br />
inserted by clicking on 'New Math Function' . See chapter 10.7 for a list of available<br />
functions.<br />
Initiates a Jump to the line whose label corresponds to the one that is entered here<br />
(to enter a label, see above in the list of icons of 'Display mode').<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 28
10.4. Variables<br />
Introduction<br />
Variables can be physical I/O or internal registers: Analog registers (AIR, STO, and ASPE...)<br />
Digital registers (DIR, DSPE...). Any variable is available, but only when it is declared, we<br />
consider it as a Tag. According to the use we make of the variables in Ladder programming, there<br />
are two families of Tags:<br />
Local Tags<br />
Global Tags<br />
Local Tags<br />
A Local Tag is a non-specific register used as temporary value in a calculation. When compiling<br />
the <strong>TWinSoft</strong> document a free register (DIR, AIR or STO) is assigned to it according to the<br />
registers that are already used.<br />
Local Tags are only used in the POU where they have been created.<br />
They appear in the list of Local Tags, above the Ladder diagram of the POU (see next).<br />
Global Tags<br />
A Global Tag can be of two types:<br />
A specific register (DIR, AIR, and SPE...) that you wish to use.<br />
A physical I/O of the CPU created in the List of Tags.<br />
Global Tag-Names can be used in POU Program and in POU Function Block (see next).<br />
The colors of the Tags<br />
The color used to display the Tag in Ladder programming informs you of its type:<br />
Black: Global Tag.<br />
Blue: Local Tag.<br />
Brown: Special register (analog or digital) it is always considered as Global<br />
Tag<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 29
10.5. Create Ladder Diagram<br />
Introduction<br />
Creating Ladder diagram consists of 'drawing' program lines with input contacts or functions and<br />
output relays or functions placed between 2 vertical Power Rails. The two rails can be considered<br />
as electrical wires between which items are placed. The lines as a whole represent your local<br />
automation.<br />
In the LD Toolbar click - - to insert a new Ladder Line. In the window of Ladder<br />
programming, a rectangle appears with a line number. Only one line at a time can be edited with<br />
only one rung (a rung is a set of Input conditions connected to only one set of Outputs). The grid<br />
shows you the places where you can place contacts, relays and functions.<br />
The Ladder is executed from left to right and from top to bottom. Every contact, functions and<br />
relay is treated when it is read. Be careful when using an output at different places of the<br />
Ladder, unless you do SET and RESET. To help you, check the Cross reference of the Tags.<br />
figure 19<br />
According to the item you wish to use, select the proper icon in the Toolbar.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 30
Inserting items<br />
When inserting an item, you must declare the variable(s) associated to it: Digital Tag for a contact<br />
and a relay, Digital or Analog Tags for Functions. You have to work with Tags; it is not possible<br />
to select the number of a register in the list of registers.<br />
A Tag (local or global) can be created while inserting an item.<br />
There are two possibilities to select a Tag:<br />
The Tag exists<br />
The Tag does not exist<br />
- You know the name of the Tag: you type its name. <strong>TWinSoft</strong> is not case<br />
sensitive, so you can type it in capital or small letters.<br />
- You don’t know the name of the Tag: you click the button to open the list<br />
of Tags. You have the choice between Global Tag, Local Tag and Special<br />
registers (see previous chapter ‘Variables’).<br />
You type its name and press to create it. The Tag can be either<br />
Local Tag or Global Tag (see previous chapter ‘Variables’).<br />
According to the field you are in, you can select a Tag or type a constant. A constant<br />
is a 16-bit variable that will be considered as Signed (-32768 -> 32767) or Unsigned (0 and<br />
65535) according to the Function where it is used.<br />
The colors of the Tags<br />
The color used to display the Tag in Ladder programming informs you of its type:<br />
Black: Global Tag.<br />
Blue: Local Tag.<br />
Brown: Special register (analog or digital) it is always considered as Global<br />
Tag<br />
The Keys<br />
To compile a line. Use also the icon<br />
<br />
- When a line is selected: to quit edit mode. Use also the icon .<br />
- When an item is selected: to release the item and return to selection mode (arrow).<br />
- When Tag box is opened: to carry on without specifying a Tag. '???' will be inserted<br />
instead. To enter a Tag afterwards, double click '??? '<br />
To delete the selected item.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 31
10.6. Step by step creating of Ladder<br />
We assume that Tags already exist and that we work with global Tags.<br />
Suppose we are controlling a Reservoir LEVEL. When it reaches the value 150, we start the<br />
PUMP to remove water. At the same time, we start an INTEGRAL timer that memorizes the<br />
number of minutes the pump has been working.<br />
The PUMP can also be started manually.<br />
When 6000 minutes are reached, the timer - status TIMER - is at 1 and activates the output<br />
MAINTENANCE.<br />
We will create the following lines:<br />
figure 20<br />
We use the following Tags (see chapter 8 ‘Creating Tags’):<br />
LEVEL analog input.<br />
MANUAL digital input.<br />
PUMP digital output.<br />
TIMER digital state of the timer (DTI.10)<br />
MAINTENANCE digital output.<br />
RESET digital input.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 32
1 st line of Ladder:<br />
1. In the program ‘MAIN’, click the icon to insert a line of comment. Type you text and<br />
click ‘OK’.<br />
2 nd line of Ladder:<br />
2. Click the icon to insert a new line. The edit block is ready to create the second line. The<br />
grid shows the position where you can place the items.<br />
3. Click the icon to insert the function A>B then click close to the left Rail.<br />
figure 21<br />
4. Enter the Tag name LEVEL or select it from the list of Tags and then enter the constant 150.<br />
5. Click the icon to insert a digital contact, then click the comparison Function and close to<br />
the left rail.<br />
6. Enter the Tag name MANUAL or select it from the list of Tags.<br />
7. Click the icon and draw a horizontal and vertical line to join the output of the comparison<br />
Function.<br />
8. Click the icon to insert an output relay, then click on the output of the comparison<br />
Function. A horizontal line is automatically drawn to the right rail.<br />
9. Enter the Tag name PUMP or select it from the list of Tags.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 33
10. Click the icon to insert the timer Integral with a basis time in minutes (TI_min) then click<br />
under the relay PUMP.<br />
figure 22<br />
11. Enter an ID number (between 0 and 255); in our example: 10, then the preset (number of<br />
minutes), in our example 6000.<br />
12. Click the icon and draw a horizontal and vertical line to join the timer Function to the<br />
right rail and to the output of the comparison Function.<br />
13. Press the key , or click the icon to compile the line. Doing this, the edition block is<br />
ready to create the third line.<br />
3 rd line of Ladder:<br />
14. Click the icon to insert a Positive edge trigger contact, then click close to the left rail..<br />
15. Enter the Tag name TIMER.<br />
16. Click the icon to insert a SET output relay, then click close to the left side of the contact<br />
TIMER. A horizontal line is automatically drawn to the right rails.<br />
17. Enter the Tag name MAINTENANCE or select it from the list of Tags.<br />
18. Press the key , or click the icon to compile the line. Doing this, the edition block is<br />
ready to create the fourth line.<br />
4 th line of Ladder:<br />
19. Click the icon to insert a Positive edge trigger contact, then click close to the left rail.<br />
20. Enter the Tag name RESET or select it from the list of Tags.<br />
21. Click the icon to insert the reset timer Function, then click close to the contact RESET.<br />
22. Enter 10, the ID of the timer to reset (in our example: 10).<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 34
23. Click the icon to select and move the reset timer function, then click the reset timer<br />
Function and drag it on step to the right.<br />
24. Click the icon and draw a horizontal between the RESET contact and the reset timer<br />
Function.<br />
25. Click the icon to insert a MAINTENANCE output relay then click under the reset timer<br />
Function. A horizontal line is automatically drawn to the right rail.<br />
26. Enter the Tag name MAINTENANCE or select it from the list of Tags.<br />
27. Click the icon and draw a horizontal and vertical line to join the input contact to the<br />
output relay MAINTENANCE.<br />
28. Press the key , or click the icon to compile the line. Doing this, the edition block is<br />
ready to create the next line.<br />
29. Press to come back in Display mode.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 35
10.7. Mathematical Block<br />
A mathematical Block allows to carry out analog output operations like addition, subtraction,<br />
multiplication, division, bit manipulation, indirect addressing...<br />
To insert a Math block, in the edit mode of Ladder Programming, click the icon of the LD<br />
Toolbar.<br />
Introduction<br />
There are 8 categories of mathematical functions available (to use in math blocks):<br />
• Assignment functions.<br />
• Arithmetic operations.<br />
• Comparisons.<br />
• Bit manipulations.<br />
• Boolean operations.<br />
• Conversion (PID, BCD, etc.), and indirect addressing.<br />
• Text and miscellaneous functions.<br />
• Floating point.<br />
In the functions, the Arguments to replace by Tags (or constant) are represented as follows:<br />
- A, B, C, and D: Analog Tags.<br />
- Ptr: Pointer in indirect addressing; analog Tag.<br />
- BOOL, Bit: Digital Tag.<br />
- Tot1, Tot2: Analog double word.<br />
- Flt: Floating point<br />
The equality operations are always executed from the right to the left. In other words, we have:<br />
result = operation<br />
or: output = input (means the value of Input variable is copied in the Output<br />
variable).<br />
16 bit analog numbers on are always worked out as signed values in TBox, even if they have<br />
been defined as 'Unsigned' Tags.<br />
If used in 'Indirect addressing' functions, an analog variable of the pointer is considered as<br />
'Unsigned', even if it appears 'Signed'.<br />
In edit mode, to insert a 'Math function' between 2 functions in a Math block, place the<br />
cursor at the position you want to insert the function, and press the key 'Insert' of keyboard.<br />
Assignments<br />
A = B 'A' contains a copy of the value of 'B'<br />
A = -B 'A' contains the invert value of 'B'<br />
A = Low(B) 'A' contains a copy of the 8 lowest bits of 'B'<br />
A = High(B) 'A' contains a copy of the 8 highest bits of 'B'<br />
A = Abs (B) 'A' contains a copy of the absolute value of 'B'<br />
A = Swap(B) 'A' contains the inversion of the 8 highest bits and the 8 lowest bits of 'B'<br />
inc (A) increase the value of Tag 'A' by 1 bit<br />
dec (A) decrease the value of Tag 'A' by 1 bit<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 36
Arithmetic operations<br />
A = B + C 'A' is the addition of 'B' and 'C'<br />
A = B - C 'A' is the subtraction of 'B' and 'C'<br />
A = B * C 'A' is the multiplication of 'B' and 'C'<br />
A = B / C 'A' is the division of 'B' and 'C'<br />
A = B AND C 'A' is the result of the logical AND between 'B' and 'C'<br />
Example: 0001000011111111<br />
AND 0001100000001111<br />
0001000000001111<br />
A = B OR C 'A' is the result of the logical OR between 'B' and 'C'<br />
Example: 0000000011111111<br />
OR 1111000000001111<br />
1111000011111111<br />
A = B XOR C 'A' is the result of the logical XOR between 'B' and 'C'<br />
Example: 0000000011111111<br />
XOR 1111000000001111<br />
1111000011110000<br />
A = B MOD C 'A' contains the rest after the division of 'B' and ‘C’.<br />
Example: 2 = 17 MOD 3<br />
Comparisons<br />
BOOL = B == C 'BOOL' is TRUE if 'B' equal 'C', otherwise it is FALSE<br />
BOOL = B < C 'BOOL' is TRUE if 'B' is smaller than 'C', otherwise it is FALSE<br />
BOOL = B > C 'BOOL' is TRUE if 'B' is greater than 'C', otherwise it is FALSE<br />
BOOL = B = C 'BOOL' is TRUE if 'B' is greater than or equal to 'C', otherwise it is<br />
FALSE<br />
BOOL = B C 'BOOL' is TRUE if 'B' and 'C' are different, otherwise it is FALSE<br />
BOOL = odd B 'BOOL' is TRUE if the value of 'B' is odd, otherwise it is FALSE<br />
A= conv 0/20 4/20 (B) 'A' is the conversion from 0..20mA to 4..20mA of 'B'. It is a<br />
scaling in order to start binary counting at 4 mA instead of 0 mA<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 37
Bit manipulations<br />
Wraparound means that the bits scrolling from one side of a byte (8 bits) or word (16 bits) are<br />
replaced at the other side of the byte or word.<br />
bit (A,BitNb) = Bit The status of digital 'Bit' will be copied in the analog 'A' at the<br />
position indicated by 'BitNb', starting with ' 0 ' for Lsb.<br />
Example: Bit: 1<br />
BitNb: 3<br />
A: 0011010011001001<br />
Bit = bit( A,BitNb) The status of the bit of the analog 'A' indicated by 'BitNb' will<br />
be copied in the digital 'Bit', starting with ' 0 ' for Lsb.<br />
Example: A: 1100101000010010<br />
BitNb: 5<br />
Bit: 0<br />
A = shl(B,shift) 'A' has the number of Bits indicated by 'shift' shift to the left<br />
(max. 15) of the word 'B'<br />
(without wraparound).<br />
Example: B: 0000000011111111<br />
Shift: 4<br />
A: 0000111111110000<br />
A = shr(B,shift) 'A' has the number of Bits indicated by 'shift' shift to the right<br />
(max. 15) of the word 'B'<br />
(without wraparound).<br />
Example: B: 0000000011111111<br />
Shift: 4<br />
A: 0000000000001111<br />
A = rol byte(B,shift) 'A' has the number of Bits indicated by 'shift' shift to the left<br />
(max. 7) of the byte 'B'<br />
(with wraparound).<br />
A = ror byte(B,shift) 'A' has the number of Bits indicated by 'shift' shift to the right<br />
(max. 7) of the byte 'B'<br />
(with wraparound).<br />
A = rol word(B,shift) 'A' has the number of Bits indicated by 'shift' shift to the left<br />
(max. 15) of the word 'B'<br />
(with wraparound).<br />
Example: B: 0000000011111111<br />
Shift: 4<br />
A: 0000111111110000<br />
A = ror word(B,shift) 'A' has the number of Bits indicated by 'shift' shift to the right<br />
(max. 15) of the word 'B'<br />
(with wraparound).<br />
Example: B: 0000000011111111<br />
Shift: 4<br />
A: 1111000000001111<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 38
Boolean operations<br />
Bit = not(Bit) the inverse of the digital Tag of the right is assigned to the digital<br />
Tag of the left<br />
Bit = bit AND Bit the result of the logical AND between the two digital Tags of the<br />
right is assigned to the digital Tag of the left<br />
Bit = Bit OR Bit the result of the logical OR between the two digital Tags of the right<br />
is assigned to the digital Tag of the left<br />
Bit = Bit XOR Bit the result of the logical XOR between the two digital Tags of the<br />
right is assigned to the digital Tag of the left<br />
A = B * C / D<br />
(Unsigned)<br />
'A' is the result of the 32 bits multiplication of Words 'B' and 'C'<br />
then divided by 'D'<br />
A = B * C / D (Signed) A' is the result of the 32 bits multiplication of Integers 'B' and 'C'<br />
then divided by 'D'<br />
put Bit in dig chrono Writing of the digital Tag 'Bit' in the Digital Chronology.<br />
put A in ana chrono Writing of the analog Tag 'A' in the Analog Chronology.<br />
Conversion + Indirect addressing<br />
A = bcd(B) transforms the word 'B' to a BCD format and transfers the result to<br />
the word 'A'. 'B' must be less than 10000 to prevent an overflow<br />
condition.<br />
A = 16 x (Bit) places the 16 digital variables of successive addresses, starting with<br />
the digital Tag 'Bit' in the word' A'.<br />
Example:<br />
to copy 16 digital inputs of an extension card in a word.<br />
This function cannot be used with the 8 digital inputs of the CPU,<br />
because there is not 16 successive addresses, but 8. If it is needed,<br />
first copy the 8 inputs in successive registers that have 8 free registers<br />
after those used for the copy of the inputs<br />
16 x (Bit) = A places the 16 bits of the word 'A' in the 16 digital variables of<br />
successive addresses, starting with the digital Tag 'Bit'.<br />
Example:<br />
to SET or RESET 16 DO of an extension card using an analog<br />
variable.<br />
Bit = indirect (Ptr) the Tag or Constant 'Ptr' contains the absolute ModBus address of<br />
the digital variable that will have its status assigned to the digital Tag<br />
'Bit'.<br />
Example:<br />
to read the status of the output 'Q0' of the CPU (ModBus address 32):<br />
dir0 = indirect (32).<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 39
Indirect (Ptr) = Bit the status of the digital Tag 'Bit' will be copied in the digital<br />
variable whose ModBus address is defined in the Tag or<br />
Constant 'Ptr'.<br />
Example:<br />
to write the status of dir0 in the output 'Q2' of the CPU (ModBus<br />
address 34):<br />
Indirect (34): dir0.<br />
A = indirect (Ptr) the Tag or Constant 'Ptr' contains the absolute ModBus address<br />
of the analog variable that will have its value assigned to the<br />
analog Tag 'A'<br />
Example:<br />
to read the value of the input 'ana1' of the CPU (ModBus address<br />
65):<br />
air0 = indirect (65).<br />
indirect (Ptr) = A the value of the analog Tag 'A' will be copied in the analog<br />
variable whose ModBus address is defined in the Tag or<br />
Constant 'Ptr'.<br />
Example:<br />
to write the value of ana0 of the CPU in the analog output: Rack<br />
1, Card 1, Channel 0 (ModBus address 288):<br />
Indirect (288) = ana0.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 40
PID regulation<br />
Function available in the group ‘Conversion + Indirect addressing’<br />
Out = PID(Input, AIR,..)<br />
Out: Tag associated to the output of PID function.<br />
Input: Tag associated to the input of PID function.<br />
AIR: index number of the AIR associated to the 'Set-point'.<br />
This function performs a PID regulation according to the formula:<br />
y = R * (x-w) + 1/TI (x-w) + TD * d(x-w) / dt<br />
where:<br />
y: value of output.<br />
x: value of the measurement.<br />
w: value of set point.<br />
R: proportional coefficient.<br />
TI: integral coefficient.<br />
TD: derivative coefficient.<br />
NOTES:<br />
1. PIDs require knowledge of this type of regulation.<br />
2. An example is available on web site: www.tbox.biz -> Support -> Examples<br />
Application of the PID to the TBox<br />
The maximum number of PIDs per TBox is 64, but this number can be limited due to the size of<br />
the memory A and the availability of analog registers. A PID in a mathematical formula<br />
occupies 5 supplementary bytes for calculation. A PID is computed in less than one millisecond.<br />
Values and coefficients are placed in variables and registers:<br />
'Output' = y: output value, between -2047 and 2047.<br />
'Input' = x: input value, between -2047 and 2047.<br />
'AIR' = w: set point value, between -2047 and 2047.<br />
'AIR+ 1' = R x 32: proportional coefficient, between 0 and 2047.<br />
'AIR+ 2' = 1 / (1024 x TI): integral coefficient, between 0 and 2047.<br />
'AIR+ 3' = TD x 8: derivative coefficient, between 0 and 2047.<br />
Those 3 last calculations must be implemented in the Ladder diagram.<br />
For example:<br />
R=20 'AIR+ 1'=640<br />
TI=0,0001 'AIR+ 2'=10<br />
TD=100 'AIR+ 3'=800<br />
'AIR', 'AIR+ 1', 'AIR+ 2', 'AIR+ 3' represent 4 analog internal registers of successive addresses. It<br />
is therefore only necessary to enter the first of these registers in the mathematical function.<br />
The PID is calculated every cycle for as long as the condition that precedes the mathematical block<br />
in the Ladder diagram is true. It is therefore necessary to link the PID calculation to a timer to<br />
obtain a time cycle different from that of the Ladder diagram. The PID can also be stopped or<br />
single stepped. The fact that the proportional coefficients, integral, and derivative are stored in<br />
internal registers allows dynamic modification following some conditional changes specified in the<br />
Ladder diagram. Calculations have 24-bit precision, the intermediate results of each group<br />
(proportional group, integral group and derivative group) are limited to the range -2047.+2047.<br />
The global result has the same range limits.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 41
Miscellaneous<br />
Send Text: Text Sending of the text indicated in the field 'Text' to a<br />
communication port. The Latter must be specified with a<br />
mathematical function 'Select Port # Port' (see next function). The<br />
text is sent in ASCII protocol.<br />
Maximum: 30 characters<br />
It is possible to ,insert a control character into the string, for<br />
instance a LF or a CR.<br />
^M = CR<br />
^J = LF<br />
Select Port # Port Selection of a communication port for sending text (see previous<br />
function). The available ports are:<br />
1: COM1<br />
2: COM2<br />
3: COM3<br />
Call Driver With (A) call of the custom driver loaded in the TBox by passing it the<br />
ModBus address of the variable defined in ''A' as an argument. It<br />
allows to use 'A' as an input and/or an output.<br />
Clear Totalizer (Tot) sets to 0 the totalizer 'Tot'.<br />
You must, before calling this function, write in the Special Analog<br />
register the unique ID number of the driver.<br />
Inc Totalizer (Tot, A) increments the totalizer 'Tot' with the value contained in the<br />
analog Tag 'A'<br />
Tot1 = Tot2 copy of the value of totalizer 'Tot2' in the Totalizer 'Tot1'<br />
NOTE:<br />
With Totalizer registers, supplementary mathematical functions, like arithmetic operation and<br />
comparison, can be executed using the 'C' driver Fcthmath2.<br />
See the web site: www.tbox.biz -> Support -> Drivers<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 42
Floating point functions<br />
A = FloatToInt (Flt * 10 E Const) conversion from the Float 'Flt' to the Integer 'A'<br />
, with a possible scaling from 10E-4 to 10E+4.<br />
The exponent must be a constant:'Const'.<br />
Flt = IntToFloat (A) * 10 E Const) conversion from the Integer 'A' to the Float<br />
'Flt', with a possible scaling from 10E-4 to<br />
10E+4. The exponent must be a constant:'Const'.<br />
Flt A = Flt B + Flt C Float 'A' is the addition of Float 'B' and Float 'C'.<br />
Flt A = Flt B - Flt C Float 'A' is the subtraction of Float 'B' and Float 'C'.<br />
Flt A = Flt B * Flt C Float 'A' is the multiplication of Float 'B' and Float 'C'.<br />
Flt A = Flt B / Flt C Float 'A' is the division of Float 'B' and Float 'C'.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 43
10.8. POU (Program Organization Units)<br />
IEC1131-3 Ladder programming is organized not only with contacts and relays, but also with<br />
different POUs and functions. Three types of POU are available, all of which use the same Ladder<br />
programming tools:<br />
List of POU Equivalence in TSoft (DOS Editor)<br />
POU program: sub-program that is called in the ‘Main’ Modules<br />
program or any other POU program.<br />
POU function: standard functions (comparison, math.<br />
Functions, timers,...) or user defined functions.<br />
POU function block: user defined small 'applet' that<br />
performs a function (start of a pump, regulating<br />
temperature...)<br />
No equivalence<br />
Macros<br />
For users accustomed to work with TSoft (the DOS editor), we have kept mathematical functions<br />
in order to execute analog operations.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 44
10.9. POU – Program<br />
Introduction<br />
POU programs allow you to structure your Ladder program into several sub-programs.<br />
In practice, you have a main Ladder program, which calls sub-programs. These sub-programs<br />
contained within a Ladder diagram precisely define an action such as; start pump, intrusion<br />
control, alarms management...etc, and can be called from anywhere in the ‘Main’ program or any<br />
other POU program.<br />
They give you a clearer view of the whole automation program, they can be tested individually and<br />
allow you to make things easier for changing.<br />
A POU program can call another POU Program that can call another POU Program etc...<br />
If you use POU Programs that call other POU Programs, be careful to avoid loops: like<br />
Program 1 calling Program 2 calling Program 3 that calls Program 1.<br />
The 'main'.<br />
The POU program 'main' is the main Ladder program. This program must be unique and called<br />
‘main’, to be used to call other POU programs (sub-programs). It is the default POU program<br />
when starting a new <strong>TWinSoft</strong> document.<br />
Creating a POU Program<br />
To create a POU Program, click the 'Programs' folder in the Project Workspace. In the right<br />
window appears the list of existing POUs (all types of POU). When starting <strong>TWinSoft</strong> the first<br />
time, the only one is the 'main'.<br />
figure 23<br />
Double click 'Add a POU', type a Name (accents and space are not supported) and check<br />
'Program'.<br />
Click OK.<br />
You have created a POU Program and it appears in the 'Programs' folder.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 45
When you double click the name of the Program in the list, the window for Ladder programming<br />
appears with a new Tab for the current Program.<br />
figure 24<br />
Now you can create a Ladder Diagram for the Program you have defined.<br />
Calling a POU Program in another Program<br />
To call a POU Program, click the icon in the LD Toolbar. In the folder, 'This File' select the<br />
POU Program you wish to insert. All POU Programs have the following parameters:<br />
- EN:<br />
- ENO:<br />
Enable Input: Connection to the Ladder line. EN must be TRUE to run the<br />
Program. If it is connected directly to the left rail, it will be executed at each<br />
cycle of the Ladder, otherwise it can be connected to an input condition.<br />
Enable Output: it is the image of EN. If EN is TRUE, ENO is TRUE. It is<br />
usually connected to the right rail but can be also connected to a contact or a<br />
relay, a Mathematical block or a Function.<br />
Calling a POU Program is like calling a sub-routine. The program associated to it is executed at<br />
the position where it is called.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 46
10.10. POU – Function<br />
Introduction<br />
A POU Function is a user-defined piece of Ladder that executes a calculation ending in one<br />
result. It is useful when a calculation you regularly need to execute does not exist in the list of<br />
Standard Functions. You use it in POU Programs every time you need to execute the calculation.<br />
It has one or many inputs and only one output. When a Function is used many times in a POU<br />
Program, the same code is always executed.<br />
Example:<br />
You need regularly to execute the calculation: y= [(a+b) * (c+d)] /2.<br />
You will not find this formula in the Standard Functions or in the Mathematical Function block.<br />
You will then create your own Function that will execute your calculation every time you call<br />
it.<br />
According to the type of the output, there are 4 types of Functions:<br />
BOOL: digital output.<br />
WORD: analog output 16 bits unsigned.<br />
LONG: analog output 16 bits signed.<br />
FLOAT: floating point output.<br />
An example of user defined Function is available in the <strong>TWinSoft</strong> document ‘Ladder.tbox’, in the<br />
'Samples' directory of <strong>TWinSoft</strong>. The Function executes the scaling of an 8-bit analog input.<br />
Creating a POU Function<br />
To create a POU Function, click the 'Programs' folder in the Project Workspace. In the right<br />
window appears the list of existing POUs (all types of POU). When starting <strong>TWinSoft</strong> the first<br />
time, the only one is the 'main' POU Program.<br />
figure 25<br />
Double click 'Add a POU', type a Name (accents and space are not supported) and check<br />
'Function'.<br />
Select the type of the output (result of the calculation): BOOL , WORD, LONG or FLOAT.<br />
Click OK.<br />
You have created a POU Function and it appears in the 'Programs' folder.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 47
When you double click the name of the Function in the list, the window for Ladder programming<br />
appears with a new Tab for the current Function.<br />
figure 26<br />
By default, the name of the Output is the name of the Function. You can rename the output<br />
by using the context menu on its name (mouse right clicking on the name).<br />
POU Functions can be exported in a Library to be used in other <strong>TWinSoft</strong> documents, using<br />
the Library manager menu.<br />
Now you can create Ladder Diagram for the Program you have defined.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 48
Example of a Function<br />
The following Function is an analog Function (it means the output is analog). It performs a<br />
scaling of an 8-bit analog input.<br />
figure 26A<br />
The Tags :<br />
Inputs and the Output of a Function are the arguments to be replaced when calling the Function.<br />
The way a POU Function works, involves that one can define only local Tags in a POU<br />
Function.<br />
Scaled: the output of the Function. It is unique and is the result of the calculation.<br />
IN, MIN,MAX: are the Inputs of the Function.<br />
Delta, tmp0: local analog Tags used as temporary variables necessary to calculate the<br />
scaling.<br />
The Ladder :<br />
A math block using 3 functions is used.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 49
Calling a POU Function in a POU Program<br />
To call a Function, click the icon in the LD Toolbar. The folder, 'This File' contains Functions<br />
and Function Blocks created in the current document. If the Function owns to a Library, the latter<br />
appears as a Folder. Select the Function you wish to insert. All Functions have the following<br />
parameters:<br />
- EN:<br />
- ENO:<br />
Enable Input: Connection to the Ladder line. EN must be TRUE to perform the Function. If<br />
it is connected directly to the left rail, it will execute at each cycle of the Ladder, otherwise it<br />
can be connected to an input condition.<br />
Enable Output:<br />
if the Function is Analog: it is the image of EN. If EN is TRUE, ENO is TRUE. It is<br />
usually connected to the right rail but can be also connected to a contact or a relay, a<br />
Mathematical block or another Function.<br />
if the Function is Digital: ENO and the Output of the Function are linked inside the<br />
Function. It is TRUE if the result of the calculation AND EN are TRUE. It must then be<br />
connected to contact or a relay, a Mathematical block or another Function.<br />
figure 26B<br />
When calling the Function in a POU Program, you must assign to the (unique) Output a Tag and<br />
for each Input a Tag or constant. All inputs are at the left side of the Function Block; the output at<br />
the right side.<br />
In this example, we wish to have an 8-bit analog input 'ANA0' scaled between MIN '0' and MAX<br />
'1000'. The result is copied into the Internal Analog register 'AIR0'.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 50
10.11. POU - Function block<br />
Introduction<br />
POU function Blocks are user defined small 'applets' that performs a function (start of a pump,<br />
regulating temperature...). If this function is repetitive in your program & you don't wish to define<br />
it every time you need it, then you create it once, with Input and Output arguments and it is then<br />
a POU Function Block. You use it in POU Programs every time you need to execute the function<br />
and you assign Tags of the POU Program to it.<br />
We advise you against using POU Functions in a POU Function Block. In fact, a POU Function<br />
exists only once and always has the same variables that are used when inserting the POU Function.<br />
A POU Function Block has new Tags (local and global) assigned every time it is called in a POU<br />
Program.<br />
Creating a POU Function Block<br />
To create a POU Function Block, click the 'Programs' folder in the Project Workspace. In the right<br />
window appears the list of existing POUs (all types of POU). When starting <strong>TWinSoft</strong> the first<br />
time, the only one is the 'main' POU Program.<br />
figure 27<br />
Double click 'Add a POU', type a Name (accents and space are not supported) and check<br />
'Function Block'.<br />
Click OK.<br />
You have created a POU Function Block and it appears in the 'Programs' folder.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 51
When you double click the name of the Function Block in the list, the window for Ladder<br />
programming appears with a new Tab for the current Function Block.<br />
figure 28<br />
POU Function Blocks can be exported in a Library to be used in other <strong>TWinSoft</strong> documents,<br />
using the Library manager menu.<br />
Now you can create Ladder Diagram for the Program you have defined.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 52
Example of a Function Block<br />
The following Function Block performs the start of a digital output with a programmable delay.<br />
figure 28A<br />
The Tags:<br />
Inputs and Outputs of a Function Block are the arguments to be replaced when calling the<br />
Function Block.<br />
INPUT is a digital input that will start the OUTPUT after the DELAY.<br />
OUTPUT<br />
DELAY<br />
is a digital output. It will be connected to a motor, for instance when calling the Function<br />
Block.<br />
is an analog input containing the number of seconds of the delay. It must be associated<br />
to the timer used in the Function Block.<br />
preset is a Local analog Tag of the type 'Timer Preset'.<br />
timer is a Local digital Tag of the type 'Timer Status'.<br />
The Ladder :<br />
The DELAY is copied in the preset of the timer.<br />
When INPUT changes to 1, it starts the timer Single Shot with a base time in seconds<br />
(SS_sec). (Note: when working with an external Preset (the local variable 'preset'), the Preset<br />
of the timer can be set to any value; here 0).<br />
When the timer has finished counting AND the INPUT is still active, the output is set to 1.<br />
A negative edge on INPUT resets the OUTPUT.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 53
Calling a POU Function Block in a POU Program<br />
To call a Function Block, click the icon on the LD Toolbar. The folder, 'This File' contains<br />
Function Blocks and Functions created in the current document. If the Function Block owns to a<br />
Library, the latter appears as a Folder. Select the Function Block you wish to insert. All Function<br />
Blocks have the following parameters:<br />
- EN:<br />
- ENO:<br />
Enable Input: Connection to the Ladder line. EN must be TRUE to perform the Function<br />
Block. If it is connected directly to the left rail, it will execute at each cycle of the Ladder,<br />
otherwise it can be connected to an input condition.<br />
Enable Output: it is the image of EN. If EN is TRUE, ENO is TRUE. It is usually connected<br />
to the right rail but can be also connected to a contact or a relay, a Mathematical block or<br />
another Function.<br />
figure 28 B<br />
When Calling the Function Block in a POU Program, you are asked to enter an 'FB Instance<br />
name'. This name allows <strong>TWinSoft</strong> to distinguish between Function Blocks, when multiple calls of<br />
similar Function Blocks are defined.<br />
Afterwards you must assign to the Output(s) and Input(s) Tags or constant. All inputs are at the<br />
left side of the Function Block, all outputs at the right side.<br />
In this example, the FB is called ‘Motor1’, the input ‘D0’ activate the output ‘Q2’ with a delay of<br />
5 seconds.<br />
Each call of Function Block is unique and different from each other; local Tags of the Function<br />
Block as well as timer ID and counter ID, will be assigned to free registers, timers and<br />
counters when compiling.<br />
When a Function Block is called many times in POU Program, its code is inserted every time<br />
it is called. It makes development easier but it increases the code size.<br />
Execute compilation regularly to test A memory.<br />
A maximum of 16 timers and counters can be used in a POU function.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 54
Debugging of a Function block<br />
As explained above, the same piece of Ladder of the POU FB can be called several times (several<br />
instances).<br />
In order to debug a function block, to check values and status of the local Tags, it is not sufficient<br />
to enter the code of the FB, because <strong>TWinSoft</strong> needs to know which instance concerned is.<br />
IMPORTANT:<br />
1. The document must have been sent to TBox.with the last changes<br />
2. If <strong>TWinSoft</strong> is opened after the document has been sent, the document must be compiled, to<br />
allow <strong>TWinSoft</strong> assigning registers to the local Tags.<br />
3. The complete path from the Program 'main' must be followed to access the FB. Example: 'Main'<br />
-> 'Motors' -> FB 'Motor1'.<br />
To debug the FB, while in 'Vizualization mode', double click the call of the FB from the POU<br />
program it is used:<br />
The source code (Ladder) of the FB is then opened and dynamized according to its instance.<br />
In the list of POU Tags, the column 'Value' displays values of each local Tag.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 55
11. Library management<br />
<strong>TWinSoft</strong> offers the possibility to save POU Functions and POU Function Blocks in external files<br />
called ‘Libraries’ in order to use those POU in other <strong>TWinSoft</strong> documents. A library can contain<br />
several POUs. It corresponds for instance to a customer or to a category of functions.<br />
It is a file with the extension .LIB saved by default in the directory of <strong>TWinSoft</strong>.<br />
POU programs cannot be saved in a Library.<br />
11.1. Import of POUs (saving POUs in a Library)<br />
To access the Import menu, click 'Tools' on the main menu bar and select 'Library manager'<br />
figure 29<br />
Only POU Functions and Function Blocks can be saved in a library.<br />
1. You select an existing library ('File' -> 'Open'), or you create a new library ('File' -> 'New').<br />
2. You open the list of available POUs of the current document ('Edit' ->'Import POU...').<br />
3. You select the POUs you wish to save in the Library; you repeat operations 2 and 3 for<br />
each POU.<br />
4. You save the Library ('File' -> 'Save').<br />
Libraries can be protected by a password, so that it is impossible to ‘Export’ it into a<br />
<strong>TWinSoft</strong> document, to see the internal code.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 56
11.2. Export of POUs (retrieval of POUs from a library)<br />
To access the Export menu, click 'Tools' on the main menu bar and select 'Library manager' (see<br />
import of POUs here above)<br />
Export is necessary if you wish to edit a POU in the current document that has been saved in a<br />
Library.<br />
1. You open a library ('File' -> 'Open'); the POUs appear in the top window.<br />
2. You select the POU and export it ('Edit' -> 'Export'); you repeat this operation for each<br />
POU.<br />
3. The POUs are then available in the list of 'Programs', in the Project Workspace.<br />
11.3. Use of a Library in a <strong>TWinSoft</strong> document<br />
To access the 'Libraries' menu, click 'File' on the main menu bar and select 'Libraries...'<br />
figure 30<br />
The ‘Available Libraries’ are the Libraries present in the directory of the current <strong>TWinSoft</strong><br />
document or in the directory of <strong>TWinSoft</strong>. When a library appears in the list, all its POU<br />
Functions, and POU Function Blocks are available to be used in Ladder programming: in the list<br />
of Functions, the Libraries appear as Folders, each containing their own POUs.<br />
To add a Library to the current <strong>TWinSoft</strong> document, select it from the list of ‘Available Libraries’<br />
and click 'Add'.<br />
The button 'Manager' jumps to the creation of Library menu.<br />
To remove a Library from the current <strong>TWinSoft</strong> document, select the Library and click 'Remove'.<br />
This operation is available only if you don’t use POU of the concerned library in the current<br />
document.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 57
12. Alarms<br />
12.1. Introduction<br />
Alarm module of A is the gate to the outside world, through the different communication<br />
ports. Via alarms, you are able to send messages to pagers, to print events, to call a SCADA...<br />
With the alarm module, your process is 'under control' !<br />
The initiation of alarms in the A relies on the variation of digital or analog Tags, or on a<br />
combination of conditions defined in the Ladder diagram. For example, an intrusion contact or an<br />
alarm level at a reservoir will send a message to the world beyond A. It is also possible to<br />
remotely call a PC utilizing SCADA software, the latter can then monitor the A.<br />
Alarms can be sent to a printer (local or remote) in order to print current events, or even a<br />
complete report of activity, e.g. every day at midnight.<br />
Alarms can be sent to different recipients depending on the day or hour (this is called time slice<br />
management).<br />
Recipients can be linked or chained.<br />
There are two means of activating an alarm:<br />
By a condition: an edge on a digital Tag or the value of an analog Tag that exceeds a<br />
minimum or maximum threshold, with adjustable hysteresis.<br />
By the Ladder diagram: a complex Ladder sequence generates an alarm through a<br />
specific function.<br />
The first option affords a simple and quick way to create alarms (a state change of a digital Tag or<br />
the variation of an analog Tag value to activate the alarm).<br />
The Ladder diagram allows you to create a complex automated alarm condition by using (for<br />
example) priorities or a set of analog or Boolean conditions.<br />
Each new alarm is immediately entered into a 48-alarm queue (maximum) and processed<br />
according to its type (printer, pager etc...) and the communication port it uses. The order in which<br />
these alarms will be processed will not necessarily be the order of their arrival. For example, if an<br />
alarm requires the internal modem, it will need to wait until the modem is available before it can<br />
be transmitted. If the alarm is time stamped, this data accompanies the alarm message.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 58
12.2. Digital Tag Condition<br />
To access the definition of Conditions, click the folder 'Alarms' in the Project workspace and select<br />
'Conditions'.<br />
256 digital alarm conditions can be created.<br />
• The Tag.<br />
figure 31<br />
• The type on which the alarm is going to be started (rising, falling or both).<br />
• The recipient (printer, pager, e-mail, supervisor,…see below).<br />
• The message or report.<br />
• The filter (the time in minutes and seconds, before the alarm is started, once the alarm<br />
condition is present).<br />
• The inhibition (the alarm will always be started or disabled according to certain conditions).<br />
• SMS acknowledgment : from <strong>TWinSoft</strong> 7.10, alarms of type ‘e-mail’ and ‘Pager/SMS’, may<br />
be configured to be acknowledged from a SMS sent to A. This feature is handled by a<br />
‘C’ driver (see RTU Properties → ‘Modules’).<br />
This type of acknowledgment is only possible with a A equipped with a GSM data<br />
modem !<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 59
12.3. Analog Tag Condition<br />
256 analog alarm conditions can be created.<br />
• The Tag.<br />
figure 32<br />
• Type: The maximum or minimum threshold for which the alarm will be started (if the value of<br />
the analog Tag passes under or over this threshold, the alarm is started). If an alarm must be<br />
generated for both a maximum and a minimum threshold, 2 alarms must be declared with the<br />
same Tag.<br />
• Hysteresis: the amount that the value must fall or rise below or above the Max. or Min. set<br />
point before an alarm can be re-started<br />
• Recipient: printer, pager, e-mail, supervisor,…see below<br />
• Message: the value of a Tag can be sent within the message (see Message below)<br />
• Filter: the time in minutes and seconds, before the alarm is started, once the alarm condition is<br />
present<br />
It is always possible to choose a FILTER equal to '0 min. - 0 sec.', which means that the alarm will<br />
be activated immediately.<br />
• Inhibition: the alarm will be transmitted or inhibited according to certain conditions<br />
• Notify of the end of alarm: An alarm is automatically sent when the condition is over<br />
• SMS acknowledgment : from <strong>TWinSoft</strong> 7.10, alarms of type ‘e-mail’ and ‘Pager/SMS’, may<br />
be configured to be acknowledged from a SMS sent to A. This feature is handled by a<br />
‘C’ driver (see RTU Properties → ‘Modules’).<br />
This type of acknowledgment is only possible with a A equipped with a GSM data<br />
modem !<br />
For more information, click ‘Help’.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 60
12.4. Recipients<br />
To access the definition of Recipients, click the folder 'Alarms' in the Project workspace and select<br />
'Recipients'.<br />
64 recipients can be declared, to different pager or GSM addresses, printer, SCADA, remote<br />
A, with the help of any of the available communication ports (see Chapter 7 ‘RTU<br />
Properties’).<br />
According to the type of recipient, local or remote ports are available:<br />
Internal: the alarm is saved in the alarm stack and not sent anywhere.<br />
ModBus: it can be slave or master. The ports available are modems ports.<br />
Pager/SMS: sending of a message to a pager or a GSM. The ports available are modems<br />
ports.<br />
Printer: sending of message(s) or report to a printer. The ports available are modems and<br />
local ports.<br />
Minitel: for France only. Calling of a Minitel. The ports available are modems ports.<br />
E-mail: sending of e-mail. The only information needed is (are) the e-mail address(es); the<br />
data of the ISP account are declared in the ‘RTU Properties’ → ‘TCP/IP’).<br />
FTP: refreshing of a Portal (Web Site) with HTML pages, report, …<br />
Custom: sending of an alarm with the help of a custom driver.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 61
12.5. Examples of recipients<br />
To a GSM<br />
figure 33<br />
To an e-mail address<br />
figure 34<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 62
12.6. Messages<br />
To access the definition of Alarm messages, click the folder 'Alarms' in the Project workspace and<br />
select 'Messages'. 256 different messages can be created.<br />
figure 36<br />
• Message number : indicates the index of message (between 1 and 255). Type a message of<br />
maximum 30 characters. This message is user specific.<br />
If it is for a Digital Pager, it will consist only of numbers.<br />
If it is for a Text Pager or for a GSM, it will not contain accent (ü, é, à, ...)<br />
In all cases, a message can contain the value of a Tag. The syntax is the following:<br />
~Xyyyyy ~<br />
~ : The first character indicates that what follows is the value of a ModBus address. The<br />
value sent is the value from the moment of the call.<br />
X : represents the type of the variable:<br />
Type Description<br />
I Integer (-32768.. 32768)<br />
W Word (0.. 65535)<br />
C Choice (for example edges: POS, NEG or DEL)<br />
S Text (comments, TEL number, scaled value of Terminal/.Minitel<br />
Tags,…)<br />
R Real (only Factor an Offset of Terminal/Minitel Tags)<br />
B Byte (0.. 255, represented as 3 ASCII characters)<br />
t Time (represented as 2 ASCII characters)<br />
j Day of the week<br />
m month<br />
0 (zero) Byte represented in binary format<br />
f Floating point<br />
D Double word<br />
- Character string<br />
d Digital state (represented as 0/1)<br />
o (small letter) Digital state (represented as ON/OFF)<br />
# Digital state (represented as --------/########)<br />
1.. 9, a.. f Digital state (according to the definition of digital states, only valid<br />
from 1 to 15)<br />
h Time: hh:mm<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 63
yyyyy: represents the ModBus address of the variable.<br />
Examples of message Messages sent<br />
ANA0=~B64~too high ANA0=234 too high<br />
Register AIR0=~W20480~ Register AIR0=24563<br />
Motor is ~o32~ Motor is OFF<br />
• Next : Allows sending several successive messages (to a printer only). Specify the index<br />
number of the message coming next. This feature allows you to define a number of lines to be<br />
printed followed by an empty line (the last message of the chain) ; to separate each printing.<br />
For more information, click ‘Help’.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 64
13. Datalogging<br />
13.1. Introduction<br />
Datalogging relies on the database in the A, it allows you to memorize events of your<br />
process, in order to visualize historical data.<br />
A contains 128 Kbytes of memory for its program and for recording events; the latter is<br />
what we call the database of A.<br />
A supplement of 512 Kbytes RAM is available in A as September 2002 and running OS<br />
5512. This extended memory is only available for Sampling tables.<br />
There are two categories of databases:<br />
The Chronologies<br />
Chronologies are 'On event' recordings, by mean of changes in variables. Each event is recorded<br />
with the time, date, Tag and its status or value.<br />
Two tables are available, one for the digital events, one for analog events with a maximum of 256<br />
Tags in each table.<br />
The minimum interval between two recordings is 1 second.<br />
The Sampling Tables<br />
Recording in Sampling tables happens at regular intervals and does not depend on signal<br />
variations. Only the date and time of the last recording are stored, and they therefore require less<br />
memory than do chronologies.<br />
Up to 64 sampling tables can be created with one Tag for each table.<br />
The minimum period between two recordings is 1 second.<br />
The database information recorded in the A can be retrieved with the use of SCADA<br />
software such as TView or other HMI\Scada package with A specific driver or generic<br />
RS-485 driver.<br />
(please call your distributor)<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 65
13.2. The Chronologies<br />
Example of one Digital definition in the Digital chronology table.<br />
figure 37<br />
• Edges: recording on positive and (or) negative edge.<br />
• Inhibition:<br />
Enabled: always recorded.<br />
Disabled: never recorded.<br />
Power failure: disabled if the supply voltage (230VAC or 8 56VDC) is broken<br />
down.<br />
DisCRD: disabled if the Special register ‘DisCRD’ is at 1.<br />
Example of one Analog definition in the Analog chronology table.<br />
figure 38<br />
• Variation: Recording in case of variation (higher or lower) in comparison with the previous<br />
recording. The unit is expressed according to the binary format of the analog input,<br />
independent of a possible scaling in the Ladder programming.<br />
• Inhibition:<br />
Enabled : always recorded.<br />
Disabled : never recorded.<br />
Power failure : disabled if the supply voltage (230VAC or 8 56VDC) is broken<br />
down.<br />
DisCRA : disabled if the Special register ‘DisCRA’ is at 1.<br />
For more information, click ‘Help’.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 66
13.3. Sampling tables<br />
figure 39<br />
• Type: A is able to execute calculations on a minimum time-base of 1 second. The result<br />
of the calculation is written in the table according to the period. This value can be:<br />
Minimum : minimum value during the period.<br />
Maximum : maximum value during the period.<br />
Average : average value calculated during the period. For each period a new<br />
average is calculated<br />
Instantaneous : value at the moment of the recording.<br />
• Period: Period between 2 recordings. You may choose between 1sec; 2sec; 4sec; 5sec; 10sec;<br />
15sec; 30sec; 1min; 2min; 4min; 5min; 10min; 15min; 30min; 1h; 2h; 4h; 6h; 12h. The<br />
recording happens at 'birthday' time of the period selected.<br />
Example: if you select as period 30 seconds, the recording will be done every minute<br />
and minute 30 seconds: 9:25:00; 9:25:30; 9:26:00; 9:26:30...<br />
• Size: The size can be expressed on two ways:<br />
Size: the number of records of the table. The recording works on the FIFO<br />
principle. According to the size, the duration is updated (see next). It can be of<br />
maximum 32768 records.<br />
Duration : you may prefer to enter a number of days and hours, in this case the size<br />
is automatically updated<br />
To adjust the sizes check the available memory with the compile option (see chapter 6.1<br />
‘Sending a program’.<br />
For more information, click ‘Help’.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 67
14. Remote Tag<br />
14.1. Introduction<br />
The A-Master network allows the exchange of analog and digital information between two<br />
or more ModBus stations via communication ports. It can be a A to A’s or any other<br />
ModBus equipment.<br />
Remote Tags allow to define the information to be exchanged between equipment.<br />
It is called 'Master Network' because it is a Master/Slave communication: the Master executes<br />
reading and writing in slave(s). The A defined as the master reads and writes the<br />
variables of all other devices using the ModBus protocol (RTU).<br />
Any communication port can be used to establish a Master/Slave communication as long as there<br />
is only one master for each communication port.<br />
Examples:<br />
1. A or RM modules can be connected to a master in RS485 communication (via COM3 of<br />
the A). This can be a multi-point network.<br />
2. If A are distant to each other, the COM5 (modem Network) is used to establish<br />
communication between a Master and Slaves. This can be a multi-point communication.<br />
3. A can be connected to other ModBus equipment via RS232 port (COM1 or COM2).<br />
This is a point-to-point network.<br />
4. The communication can be established via the public telephone network with another A;<br />
in this case, the A Master will wait until an alarm of the type 'ModBus -Master' is<br />
activated to start the exchange with the slave. Stopping the communication is then handled by<br />
the Ladder diagram using the special digital variable [HltM-x], or the call can be disconnected<br />
automatically after a defined time delay (modifiable) in the field 'Auto Hang up' (located in the<br />
A Master advanced parameters).<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 68
14.2. Block communication<br />
Block communication means the reading (or writing) of multiple variables at a time. It is advised<br />
whenever it is possible.<br />
This will speed up communication between Master and Slave(s). For a block communication you<br />
specify the first address you wish to read (or write) in the Slave and the first Tag of the Master<br />
where you save the read value (or that you write in the Slave).<br />
The addresses of the Slaves as well as the Tags of the Master must be successive ModBus<br />
addresses. It is important to keep it in mind when you determine the cabling of the I/Os.<br />
Example of differences between Block and Single communication:<br />
Number of Tags Speed Time for Query/Response<br />
1 Tag analog (Single) 19200, N 8 msec.<br />
100 Tags analog (Single) 19200,N 800 msec.<br />
100 Tags analog (Block) 19200, N 245 msec.<br />
1 Tag digital (Single) 9600, E 17 msec.<br />
1000 Tags digital (Single) 9600, E 17000 msec.<br />
1000 Tags digital (Block) 9600, E 158 msec.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 69
The variables to Read/write in the external equipment are declared using the Remote Tags<br />
definition:<br />
figure 40<br />
Important points :<br />
1. Remote Tags are Tags that you wish to write to the Slave(s), or that contain a status or a value<br />
that you read from the Slave(s).<br />
2. The Slave(s) do not need specific configuration, only of course the configuration of the port<br />
used to communicate that must fit with the one of the Master.<br />
3. Each creation of a Remote Tag definition represents a transaction with a slave (Query +<br />
Response). The whole list of Remote Tags represents the table of TBox-master Network.<br />
4. The table is permanently examined and transactions are carried out according to their 'Trigger'<br />
configuration (if defined).<br />
5. The transactions with slaves are asynchronous in regard to Ladder cycle.<br />
6. Block communication is possible and advised whenever it is possible. This will speed up<br />
communication between Master and Slave(s).<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 70
14.3. Description of fields<br />
• Local Tag: Select an existing Tag by clicking on the button. If the Tag does not exist,<br />
you can create it after having clicked the button. It is the Tag of the Master; it contains the<br />
value you want to write in a Slave or it is a register that contains the value that Master reads in<br />
a Slave.<br />
In case of block communication (with a quantity > 1), this Tag is the one corresponding to the<br />
first ModBus address.<br />
• Operation :<br />
OPERATIONS MASTER (Tag) SLAVE (Address)<br />
READ<br />
WRITE<br />
Read : the Master executes a reading in the Slave.<br />
Write : the Master executes writing in the Slave.<br />
Quantity : number of variables of successive addresses that are read (or written) in the<br />
Slave.<br />
The maximum are:<br />
DESCRIPTION TYPE MAXIMUM QUANTITY<br />
Digital I/O IOD, Test4ma 16<br />
Analog I/O IOB, IOW, I4M 8<br />
Digital registers DIR, STD 1600 (multiple of 8 for quantity, Tag<br />
address and Remote address)<br />
Analog registers (8 bits) STB 8<br />
Analog registers (16 bits) AIR, STO 100<br />
Analog registers (32 bits) TOT, FLT 8<br />
Timers ATP, ATV, DTI 16<br />
Counters ACP, ACV, DCN 16<br />
Special registers DSPE, ASPE 16<br />
Register 'sampling table' ECH 16<br />
• External Source : all the following parameters concern the Slave station:<br />
Device: select an existing external device from the ‘Resources’. You can create one<br />
with the button<br />
Type: select the type of the external variable: Analog or Digital. See next:<br />
If it is a Remote A: the choice is Analog or Digital. According to the operation, <strong>TWinSoft</strong><br />
selects automatically the proper ModBus function according to the operation.<br />
If it is a RM module: the type is not available. <strong>TWinSoft</strong> selects automatically the proper ModBus<br />
function according to the address.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 71
If it is a ModBus Device: the types correspond to the following ModBus functions:<br />
Operations Types ModBus Functions<br />
Read Digital Digital Input 2<br />
Read Digital Coil 1<br />
Read Analog Analog Input 4<br />
Read Analog Holding Register 3<br />
Write Single Digital Coil 5<br />
Write Single Analog Holding Register 6<br />
Write Multiple Digital Coil 15<br />
Write Multiple Analog Holding Register 16<br />
Address : There are different possibilities according to the type of device:<br />
- Remote A.<br />
1. The address can be typed with its ModBus address (see the list of ModBus addresses in the<br />
‘Help’ menu).<br />
Examples:<br />
22016: seconds.<br />
7: digital input 7 of the CPU.<br />
32: digital output 0 of the CPU<br />
20480: digital or analog register (according to the type).<br />
2. The address can be typed according to a standard.<br />
If it is a physical I/O:<br />
TTT.r.b.c.S<br />
TTT: is the type of variable.<br />
r: is the rack number..<br />
b: is the card number.<br />
c: is the channel number.<br />
S: supplementary type information.<br />
TTT r b c S Description.<br />
DI x x x Digital input.<br />
DI x x x 4m Test of an analog input.<br />
DO x x x Digital output.<br />
AIB x x x Analog input 8-bit resolution.<br />
AIB x x x 4m Input 0 20mA converted to 4 20mA.<br />
AIW x x x Analog input 12-bit resolution.<br />
AOB x x x Analog output 8-bit resolution.<br />
AOB x x x 4m Output 0 20mA converted to 4 20mA.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 72
Examples:<br />
DI.0.0.7: Digital input 7 of the CPU.<br />
DO.0.1.0: Digital output 0 of the CPU.<br />
AIB.0.2.1: Analog input (8 bits) 1 of the CPU.<br />
AIW.1.5.4: Analog input (16 bits) rack 1, card 5, channel 4.<br />
DI.1.5.4.4m: Test of the analog input rack 1, card 5, channel 4.<br />
If it is a register:<br />
TTT.nnnn<br />
TTT: is the type of variable.<br />
nnnn: register number.<br />
TTT Description.<br />
DIR Digital register.<br />
AIR Analog register.<br />
STO Storage 16 bits register.<br />
STB Storage 8 bits register.<br />
STD Storage digital register.<br />
FLT Floating point register.<br />
TOT Totalizer (32 bits).<br />
ATP Timer preset.<br />
ATV Time value.<br />
DTI Timer status.<br />
ACP Counter preset.<br />
ACV Counter value.<br />
DCN Counter status.<br />
DSPE Digital Special register.<br />
ASPE Analog Special register.<br />
Leading Zeros can be omitted.<br />
Examples:<br />
DIR.1000: Digital register 1000.<br />
AIR.128: Analog register 128.<br />
DTI.20: Digital state of timer 20.<br />
DSPE.2: Digital special variable 2.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 73
- RM 10.<br />
1. Click the button to browse the list of available variables of the RM10.<br />
2. The address can be typed according to a standard:<br />
TTT.b.c.S<br />
TTT: is the type of variable.<br />
b: is the number of the block of I/O<br />
c: is the channel number.<br />
S: supplementary type information.<br />
TTT b c S Description.<br />
DI 0 x Digital input (instantaneous).<br />
DI 0 x S+ DI Latched on positive edge and reset by the<br />
communication.<br />
DI 0 x SM+ DI Latched on positive edge and reset by writing '0'.<br />
DI 0 x S- DI Latched on negative edge and reset by the<br />
communication.<br />
DI 0 x SM- DI Latched on negative edge and reset by writing '0'.<br />
DI 0 x V Test of the digital output.<br />
DO 0 x Digital output.<br />
AIW 0 x C 16-bit Totalizer of pulse on a DI.<br />
AIW 1 x Analog input 16-bit resolution.<br />
DI 1 x 4m Test of an analog input.<br />
Addressing the Digital Special registers<br />
DSPE TTT b c Description<br />
TmpError DI 2 0 Temporary error on an output.<br />
Shortcut DI 2 1 Outputs disconnected.<br />
RstShortcut DO 2 2 Re-initialize the outputs after a short circuit<br />
Examples:<br />
DI.0.0: Digital input 0.<br />
DO.0.1: Digital output 1.<br />
DI.0.1.V: Test of the Digital output 1.<br />
AIW.0.3.C: Totalizer of the pulse on DI 3.<br />
AIW.1.0: Analog input (16 bits) 0.<br />
Auto-acknowledge: this feature concerns only the registers latched and reset by writing '0'<br />
(with the switch 'SM'). You must check this option for A to execute automatically the<br />
writing '0' to the RM.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 74
- RM21.<br />
1. Click the button to browse the list of available variables of the RM21.<br />
2. The address can be typed according to a standard:<br />
TTT.b.c.S<br />
TTT: is the type of variable.<br />
b: is the number of I/O .<br />
c: is the channel number.<br />
S: supplementary type information.<br />
TTT b c S Description.<br />
DI x x Digital input (instantaneous).<br />
DI x x S+ DI Latched on positive edge and reset by the<br />
communication.<br />
DI x x SM+ DI Latched on positive edge and reset by writing '0'.<br />
DI x x S- DI Latched on negative edge and reset by the<br />
communication.<br />
DI x x SM- DI Latched on negative edge and reset by writing '0'.<br />
DO 1 x Digital output.<br />
DI 1 x Test of a Digital output.<br />
AIW 0 x C 16-bit Totalizer of pulse on the 8 first DI.<br />
AIW 2 x Analog input 16-bit resolution.<br />
DI 3 x 4m Test of an analog input.<br />
AOW 3 x Analog output.<br />
Addressing the Digital Analog register<br />
ASPE TTT B c Description<br />
RstCounter AOB 4 0 Counter of resets of the RM21.<br />
Addressing the Digital Special registers<br />
DSPE TTT B c Description<br />
TmpError DI 5 0 Temporary error on an output.<br />
Shortcut DI 5 1 Outputs disconnected.<br />
RstShortcut DO 5 2 Re-initialize the outputs after a short circuit.<br />
ReBoot DO 5 4 Reboot of the RM21.<br />
LEDs DI 5 7 Use of LEDs associated to DI:<br />
0 : LEDs deactivated.<br />
1 : LEDs used.<br />
Examples:<br />
DI.0.0: Digital input 0.<br />
DO.1.1: Digital output 1.<br />
DI.1.1.V: Test of the Digital output 1.<br />
AIW.0.3.C: Totalizer of the pulse on DI 3.<br />
AIW.2.0: Analog input (16 bits) 0.<br />
AOW.3.1: Analog output (16 bits) 1.<br />
Auto-acknowledge: this feature concerns only the registers latched and reset by writing '0'<br />
(with the switch 'SM'). You must check this option for A to execute automatically the<br />
writing '0' to the RM.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 75
- ModBus device.<br />
The address must be typed (see the manual of your ModBus equipment).<br />
• Trigger : Each transaction must be triggered to be executed. This operation can be done<br />
automatically (you don't need to declare it and leave the box cleared. In this case, the A<br />
will permanently execute the transaction). The triggering happens via a digital Internal register<br />
(DIR). When it is in the condition programmed (see below), the transaction happens. If you<br />
wish to select a condition yourself, check this box.<br />
Tag : if Trigger is checked, select a Tag of a Digital Internal register multiple of 8<br />
(DIR 0, DIR 8, DIR 16, ...).<br />
Condition : if Trigger is checked, select a condition: Positive Edge, Negative Edge or<br />
High State.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 76
15. Web & Report files<br />
A can be used as a Web Server, meaning it contains HTML pages that can be called from<br />
Internet Explorer browser.<br />
The ‘Web files’ contained in this folder will be sent together with the TBox application.<br />
Three types of file can be sent to A:<br />
- HTM pages with their associated WebForm, created with the WebForm studio.<br />
- Report files created with the Report Studio (see chapter 15.2: Report Studio)<br />
- Any file (.gif, .bmp, …)<br />
15.1. Procedure to work with TBox as a Web Server<br />
1. Define the TCP/IP properties of A (RTU properties TCP/IP).<br />
2. From the ‘Web & Report files’ folder, create the HTM images (see ‘WebForm Studio -<br />
Getting started’ manual). All the files contained in this folder comprise the ‘Web Module’.<br />
3. When sending the <strong>TWinSoft</strong> application to A, all files comprising the ‘Web Module’ are<br />
also sent .<br />
To dial-up A, use ‘TBox Dial It!’ utility (see ‘WebForm Studio - Getting started’<br />
manual).<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 77
15.2. Report Studio<br />
Report Studio, the report editor is available since version 7.10 of <strong>TWinSoft</strong>. Report Studio<br />
has been developed to make creation of reports dedicated to A easier than ever.<br />
Report Studio can be started directly from the group of programs where <strong>TWinSoft</strong> is started<br />
(by default ‘Techno Trade’) or from the folder ‘Web and Report files’ by clicking a ‘.trep’ file.<br />
Report Studio has the following features:<br />
A report is associated to a <strong>TWinSoft</strong> document. In this way, the selection of Tags is made<br />
very easy.<br />
Inside the report, fields are declared to display dynamic data (Tags, alarms, databases, …)<br />
The Tags can be printed as single fields or in a table.<br />
By a single click, a list of alarms can be inserted.<br />
By a single click, a list of historic data can be inserted.<br />
Files can be attached to a report.<br />
The database of A (alarm & historic) can be attached to a report (TBox mail feature).<br />
Different ways to use a report<br />
1. Local print via a RS232 port, COM1 or COM2, with protocol 'printer'. On an alarm condition,<br />
the report is printed (see in <strong>TWinSoft</strong> 'Alarms' Recipient).<br />
2. Remote print through a modem port of the A. On an alarm condition, the report is sent.<br />
The remote printer must be equipped with a specific modem (please call your distributor). (see<br />
in <strong>TWinSoft</strong> 'Alarms' Recipient).<br />
3. Sending a report through e-mail. On an alarm condition, the e-mail, with its associated report is<br />
sent (see in <strong>TWinSoft</strong> 'Alarms' Recipient).<br />
4. Display of the report with Microsoft Internet Explorer. This is one of the features of ' TBox<br />
Web Server'. When connected to A, you type the URL of the report (see in <strong>TWinSoft</strong><br />
'Web & Report files').<br />
Example: http://1.2.3.0/report.txt<br />
For more information, start Report Studio and look at the online ‘Help’.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 78
16. TBox Access security<br />
This (optional) access security of the A prevents non-authorized persons from accessing the<br />
A. If the Access security option is validated, each port of the A can be independently<br />
protected; usually COM4 (internal modem) is the default-protected port. The others will be<br />
protected only if it is necessary to prevent on-site access. The protection is based on a four-digit<br />
hexadecimal global code that is saved in the A. This allows different access codes related to<br />
different users having different access levels to the same A. Three authority levels are<br />
available:<br />
• Level 1: Surveillance mode or VISUALIZATION MODE. The operator can view all A<br />
values (local or remote), but can not execute any command.<br />
• Level 2: COMMAND MODE, the operator can view all the values and execute commands<br />
(locally or remotely).<br />
• Level 3: ENGINEER MODE, the operator can view all the values and execute commands and<br />
alter or send new <strong>TWinSoft</strong> documents (locally or remotely).<br />
16.1. TBox configuration<br />
To access the A configuration click ‘RTU Properties’ ‘Security’ tab.<br />
figure 41<br />
For more information, click ‘Help’.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 79
• Access security: Check this box if you want to use access protection to the ports of the<br />
A. If it is cleared, all the security features are disabled.<br />
• Global code: type in the code you used to generate the Access Codes with the utility<br />
PASSWORD.EXE (see next). Type it a second time in the Confirmation field, to be sure.<br />
• Protected ports: Check the box of the COM port you want access protection. By default,<br />
when selecting access security features, only COM4 (Internal modem) is protected.<br />
The access codes are generated by the utility software Password (see next).<br />
16.2. Password utility<br />
When installing <strong>TWinSoft</strong> a password-creation program named PASSWORD is installed in the<br />
same directory as <strong>TWinSoft</strong>. It can be started from the 'Start' button of Windows and is located in<br />
the group of programs “Techno Trade” → “Accessories” created while installing <strong>TWinSoft</strong>.<br />
This program generates a password that will be necessary to Login to the A (see next).<br />
This password is composed of 4 hexadecimal characters in response to information’s related to the<br />
user. It is based on a complex algorithm using the global code, the user’s name and the access<br />
level. The password is accompanied by a 5-digit number that identifies persons who have<br />
accessed the A station. This information can be used to trace users for example by inserting<br />
this number into a database, with the help of Special analog variables.<br />
• Global code: This hexadecimal code of 4 characters is the basis for password generation. It<br />
will be entered in the ‘RTU Properties’ → ‘Security’ menu of <strong>TWinSoft</strong> and sent to the<br />
A. When a user <strong>TWinSoft</strong>, the latter checks if the NAME and PASSWORD entered fit<br />
with the global code within A. This means that if different users with different access<br />
levels must communicate with A, the global code used to generate passwords must be<br />
the same.<br />
• User name: The name you use when logging in logs into <strong>TWinSoft</strong>.<br />
• Access level : Three access levels are available:<br />
Level 1: Surveillance mode or VISUALIZATION MODE. The operator can view all<br />
A values (local or remote), but can not execute any command.<br />
Level 2: COMMAND MODE, the operator can view all the values and execute commands<br />
(locally or remotely).<br />
Level 3: ENGINEER MODE, the operator can view all the values and execute commands<br />
and alter or send new <strong>TWinSoft</strong> documents (locally or remotely).<br />
When this information has been entered, click on the button "Get password".<br />
Two codes have been created:<br />
The PASSWORD: this password must be used toegether with the NAME when logging into<br />
<strong>TWinSoft</strong>.<br />
The USER ID: this number is available in a special analog variable when a user is<br />
connected to a port of A that is protected.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 80
16.3. Login/Logout<br />
The Login feature allows users to connect to a protected port of the A according to their<br />
own access level. If a port is unprotected, the access level is automatically 3: Engineer.<br />
The Login/Logout can be executed from the main menu bar in the 'Tools'.<br />
Login<br />
When being connected to a port of A that is protected, you need to do a Login to get an<br />
access level.<br />
figure 42<br />
You type the Name you used in the ‘Password’ utility and the Password that was created (see<br />
previous). According to those, you are in:<br />
Read only mode<br />
Read/write mode<br />
Read/write + send <strong>TWinSoft</strong> document<br />
It is displayed in the Status bar.<br />
If 'Save password' is checked and <strong>TWinSoft</strong> is connected to a protected port: when<br />
<strong>TWinSoft</strong> starts, it uses the access level corresponding to the password saved (see the status line).<br />
If it is not checked and <strong>TWinSoft</strong> is connected to a protected port: <strong>TWinSoft</strong> starts in 'Read only'<br />
mode. You need to do a Login to get your access level.<br />
Logout<br />
If the <strong>TWinSoft</strong> is connected to a protected port, the Logout sets <strong>TWinSoft</strong> in 'Read only' mode.<br />
16.4. Deactivating protection<br />
There are two methods of deactivating A access protection:<br />
Global reset (see chapter 6.3)<br />
The first method is by performing a global reset, which must be done on site. When the program<br />
has stopped, the local port is longer protected.<br />
If the internal modem was declared protected, it will still be protected even after a global<br />
reset. To deactivate protection, an unprotected <strong>TWinSoft</strong> document must be sent to A (see<br />
next).<br />
Sending an unprotected <strong>TWinSoft</strong> document<br />
The second method involves modifying the <strong>TWinSoft</strong> document and deactivating the Access<br />
Security option. The document must then be sent to the A after having done a Login as<br />
'Engineer'.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 81
17. Copy/Paste - Drag'n'Drop<br />
These standard functions of Windows are supported since version 7.10.<br />
They allow to move or copy Ladder, Tags, Definition ...inside a document or to another<br />
document.<br />
It is then possible to open several sessions of <strong>TWinSoft</strong> to access different documents at the<br />
same time, and to copy from one document to another document.<br />
17.1. General rules<br />
1. If the creation of a new object needs the creation of other objects, those are automatically<br />
created, except the creation of Resources (the I/O cards must already be declared).<br />
Example: you copy an alarm condition from one document to another: the recipient will be<br />
automatically created as well as the Tag used as condition (in case it is available in the<br />
Resources).<br />
2. The creation of a new object is based on the name of the original object. <strong>TWinSoft</strong> looks for an<br />
existing name of the same type (for Tags: digital or analog). In case it exists, <strong>TWinSoft</strong> uses it.<br />
In case it does not exist, <strong>TWinSoft</strong> offers you to create the object.<br />
Exceptions:<br />
1. In case the name must be unique, <strong>TWinSoft</strong> creates a new object and increments the name.<br />
Example: you copy ‘Register’ many times, <strong>TWinSoft</strong> will increment name and address<br />
‘Register_1’, ‘Register_2’,…<br />
2. In case a special register is already declared, it is used with its original name.<br />
Example: or if it concerns the ASPE - 0.<br />
17.2. Examples<br />
Following are examples how these features can be used in <strong>TWinSoft</strong>:<br />
Create Tags in the list of Tags (Copy/Paste)<br />
Tags can be copied with automatic increment of - addresses, -number in name, -number in<br />
comment . The sequence is:<br />
create the Tag (or select the Tag).<br />
Copy the Tag .<br />
Paste the new Tag .<br />
NOTES:<br />
1. The I/O cannot be automatically created, only registers (DIR, AIR, ....).<br />
2. The increment on number in a comment only applies if the number is the last character.<br />
3. If the name does not include a number as last character, <strong>TWinSoft</strong> automatically creates and<br />
increments a number.<br />
Example: 'register' -> 'register_1' , 'register_2' , .....<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 82
Copy a POU in the same document (Copy/Paste)<br />
The type of POU is the same and <strong>TWinSoft</strong> automatically increments the name.<br />
Example: 'My_Program' -> 'My_Program_1'<br />
Move or copy Ladder from one POU to another POU (Drag’n’Drop or<br />
Copy/Paste)<br />
NOTES:<br />
1. In case the types of POU are the same : The local Tags are automatically created in the list of<br />
'POU Tags' of the POU target.<br />
2. In case the types of POU are not the same, for instance from a 'Program' to a 'Function Block':<br />
The local Tags are automatically created in the list of the 'POU Tags', and the global Tags are<br />
created as they are. You have to edit the Ladder and change the type of the local Tags: Input,<br />
Output or local, and replace the global Tags with local Tags if needed.<br />
Copy Ladder from one document to another document (Drag’n’Drop)<br />
- If Tags already exist, with similar names and addresses, the Ladder is created with the existing<br />
Tags.<br />
- If the Tags of I/O with similar addresses exist but with other names, the Ladder is not created.<br />
- If the Tags of register with similar addresses exist, <strong>TWinSoft</strong> automatically creates Tags of<br />
similar type and increments the address.<br />
- If the Tags do not exist, they are automatically created.<br />
Copy entries of any list (Recipient, Alarm condition, Remote Tags, ...) from one<br />
document to another document (Copy/Paste)<br />
- If Tags are needed and already exist, with similar names and addresses, the entries are created<br />
with the existing Tags.<br />
- If Tags of I/O are needed and already exist with similar addresses but with other names, the<br />
entries are not created.<br />
- If Tags of register are needed and already exist with similar addresses, <strong>TWinSoft</strong> automatically<br />
creates Tags of similar type and increments the address.<br />
- If Tags are needed and do not exist, they are automatically created.<br />
Modifying the sequence of the elements in all lists (Drag'n'Drop).<br />
It allows changing the sequence of entries in a list. This can be particular useful in the List of<br />
Remote Tags, as they are executed in the sequence of the indexes in the list.<br />
NOTES:<br />
1. The sorting (by name, address, ...) only applies to the display of the list.<br />
2. Drag’n’Drop in a list is not allowed in the list of Tags.<br />
WARNING: do not make copy/paste between different types of POU. For instance from a<br />
‘Program’ to a Function block’, or from a ‘Function’ to a ‘Program’, … Even if it is possible, it is<br />
not allowed as the result is unpredictable.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 83
18. Import / Export<br />
<strong>TWinSoft</strong> supports since version 8.10 Import / Export of configuration file, in CSV format.<br />
This is very useful to edit list of configurations using an external software (Excel, Notepad, ...) or<br />
even to create full configuration with 'text' files (see Export following).<br />
The separator used in the CSV file depends on the regional settings configuration of windows.<br />
Typically it is ' ; ' or ' , ' according to the language.<br />
NOTE: Be careful when working on different PC that the regional settings (at least the separator)<br />
are configured on the same way.<br />
When working with an existing list that you wish to update with a file<br />
To avoid conflict between indexes of the <strong>TWinSoft</strong> document and those of the file, we advise<br />
you to follow the procedure:<br />
Export<br />
Modify/add<br />
Import<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 84
18.1. Export<br />
Export menu is available from the main menu of <strong>TWinSoft</strong>: 'File' -> 'Export'<br />
The different possibilities are:<br />
• Export current view<br />
You export the information contained in the list opened. The available lists are:<br />
Tags:<br />
When exporting Tags and groups of Tags, From the group where you are: all the Tags, groups<br />
and sub-groups are exported.<br />
The above group(s) are not exported.<br />
Alarm condition<br />
Alarm messages<br />
Chronologies<br />
Sampling tables<br />
Web/Minitel/Terminal Tags<br />
Analog Units<br />
Digital States<br />
• Export current selection<br />
You export the lines you have selected (a serie of Tags, of alarm conditions, ...).<br />
• Export of a list<br />
You select the list you want to export<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 85
Example files<br />
Example files are installed with <strong>TWinSoft</strong>. There are available from the sub-directory of<br />
<strong>TWinSoft</strong>: \Samples\CSV:<br />
- Tags.csv<br />
- AlarmConditions.csv<br />
- AlarmMessages.csv<br />
- Chronologies.csv<br />
- SamplingTables.csv<br />
- TerminalTags.csv<br />
- AnalogUnits.csv<br />
- DigitalStates.csv<br />
You can use them as basis for creating lists of configurations using external software (Excel,<br />
Notepad, ...)<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 86
The following paragraphs give a detailed description of the syntax for creating your own file.<br />
Export - Tags<br />
You export all the Tags and groups.<br />
• Syntax<br />
If you want to modify or create your own file, with the 'separator' between each field.<br />
The syntax is:<br />
Example:<br />
Index Tag Address Comment Initial<br />
value<br />
Tag<br />
*Index,Tag,Address,Comment,Initial Value,I/O,Signed<br />
[\Tags]<br />
0,Reg-0,AIR000,Analog Reg. 0,123,INPUT,NO<br />
1,D0,DI.0.0.0,Digital Input 0 CPU,,INPUT,<br />
2,ASPE000,Second,Second of CPU,,OUTPUT,NO<br />
Title<br />
The title must be at the first line and must be Tag.<br />
I/O Signed<br />
* Line of Comment<br />
Any complete line starting with ' * ' can be inserting anywhere in the file as comment. It will<br />
not be imported.<br />
Path<br />
The path of the group where the Tags are located, starting with \Tags. The following Tags in the<br />
file are member of this group.<br />
Example: with a group 'Inputs', the path will be : [\Tags\Inputs]<br />
Index<br />
When creating a file, any index can be used. The index is re-calculated when imported in the<br />
<strong>TWinSoft</strong> document.<br />
Tag<br />
The name of the Tag (maximum 15 characters). If it is a Tag of a card of an extension rack, the<br />
card must be declared in the ‘Resources’ of the <strong>TWinSoft</strong> document.<br />
Address<br />
Refer to the allowed address types (Help of <strong>TWinSoft</strong>)<br />
Comment<br />
The comment associated to the Tag.<br />
WARNING: in case the comment includes the separator, it must be indicated bewteen brackets.<br />
Example: “This register, is my favorite”<br />
Initial value<br />
If you wish to assign a value to the Tag at start-up of A.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 87
I/O<br />
Input or Output.<br />
With Registers : determines the format.<br />
With I/O : it is not used. The format depends of the physical address.<br />
Signed<br />
Yes or No.<br />
With Register : determines the format. When nothing is mentionned, it is considered as a 'yes'.<br />
Any field not needed must be left empty.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 88
Export - Alarm conditions<br />
You export the list of Alarm conditions.<br />
• Syntax<br />
If you want to modify or create your own file, with the 'separator' between each field.<br />
The syntax is:<br />
Index Tag Type Threshold<br />
(analog)<br />
Example:<br />
Recipient Message Filter Hysteres<br />
(analog)<br />
Inhibit AutoEnd<br />
AlarmCondition<br />
*Index,Tag,Type,Threshold,Recipient,Message,Filter,Hyst,Inhibition,End<br />
1,ON,POS,0,Motor,”Motor is started”,1:30:00,,0,Yes<br />
2,FLOW1,Max,560,Temperature,”Temperature above 55 degree”,00:2:00,25,0,--<br />
Title<br />
The title must be at the first line and must be AlarmCondition.<br />
* Line of Comment<br />
Any complete line starting with ' * ' can be inserting anywhere in the file as comment. It will<br />
not be imported.<br />
Index<br />
The index in the list of conditions. Maximum 256 digital and 256 analog conditions can be<br />
defined.<br />
Tag<br />
Maximum 15 characters.<br />
The Tag must exist in the <strong>TWinSoft</strong> document. Otherwise, the alarm condition cannot be<br />
imported.<br />
Type<br />
POS or NEG<br />
ANALOG : Max or Min<br />
Threshold<br />
DIGITAL : empty<br />
ANALOG : the value generating the alarm<br />
Recipient<br />
The Recipient must exist in the <strong>TWinSoft</strong> document. Otherwise, the alarm condition cannot be<br />
imported.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 89
Message<br />
The message can be:<br />
- an index : a number between 1..256<br />
- a text : a message of 30 characters. It must be typed between brackets. (Ex:“this is a text<br />
message”). If the message does not exist, it will be created.<br />
- a report: if is not a message but a report. It must be typed between brackets.<br />
(Ex:“ThisReport.trep”). The report must be declared in the folder ‘Web & Report files’.<br />
Filter<br />
without filter: empty<br />
with filter: the time in MM:SS<br />
Hysteresis<br />
DIGITAL: empty<br />
ANALOG: the value of hysteresis<br />
Inhibit<br />
0 Enabled (the alarm is always active)<br />
1 Disabled (the alarm is always inhibited)<br />
2 Power Failure (the alarm is inhibited when there is a main power failure)<br />
3 Disabled if DisAla=1 (the alarm is inhibited when DisAla=1)<br />
End<br />
Yes or No<br />
Any field not needed must be left empty.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 90
Export - Alarm message<br />
You export the Alarm messages.<br />
• Syntax<br />
If you want to modify or create your own file, with the 'separator' between each field.<br />
The syntax is<br />
Example:<br />
Index Message Next<br />
AlarmMessage<br />
*Index,Message,Next<br />
1,D0 Input has been activated,<br />
2,This is a long message to send ,3<br />
3,on a printer,<br />
Title<br />
The title must be at the first line and must be AlarmMessage.<br />
* Line of Comment<br />
Any complete line starting with ' * ' can be inserting anywhere in the file as comment. It will<br />
not be imported.<br />
Index<br />
The index in the list of messages. A maximum of 256 messages can be defined.<br />
Message<br />
The message can be of maximum 30 characters. When it is longer, it will be truncated during<br />
import.<br />
In case the message must includes the separator (',' for instance), the complete message must be<br />
typed between brackets.<br />
Example:.<br />
2,"This message, includes a coma",0<br />
Next<br />
The index of the next message.<br />
Available for message to be printed, or with some 'C' driver.<br />
Any field not needed must be left empty.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 91
Export - Chronologies<br />
You export the list of Chronologies.<br />
• Syntax<br />
If you want to modify or create your own file, with the 'separator' between each field.<br />
The syntax is:<br />
Example:<br />
Index Tag Type Var Inhibit<br />
Chronologies<br />
*Index,Tag,Type,Var,Inhibition<br />
1,D0 ,DEL,,0<br />
2,Level ,Var,5 ,2<br />
Title<br />
The title must be at the first line and must be Chronologies.<br />
* Line of Comment<br />
Any complete line starting with ' * ' can be inserting anywhere in the file as comment. It will<br />
not be imported.<br />
Index<br />
The index in the list of chronologies. Maximum 256 digital and 256 analog entries can be<br />
defined.<br />
Tag<br />
Maximum 15 characters.<br />
The Tag must exist in the <strong>TWinSoft</strong> document. Otherwise, the chronology cannot be imported.<br />
Type<br />
DIGITAL: POS, NEG ou DEL<br />
ANALOG: Var (for Variation. See next)<br />
Var (Variation)<br />
DIGITAL: empty<br />
ANALOG: Value of the variation<br />
Inhibit<br />
0 Enabled (the recording is always active)<br />
1 Disabled (the recording is always inhibited)<br />
2 Power Failure (the recording is inhibited when there is a main power failure)<br />
3 DIGITAL : Disabled if DisCRD=1 (the recording is inhibited when DisCRD=1)<br />
ANALOG : Disabled if DisCRA=1 (the recording is inhibited when DisCRA=1)<br />
Any field not needed must be left empty.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 92
Export - Sampling tables<br />
You export the list of Sampling tables.<br />
• Syntax<br />
If you want to modify or create your own file, with the 'separator' between each field.<br />
The syntax is:<br />
Example:<br />
Index Tag Type Period Size Reset Tag<br />
SamplingTable<br />
*Index,Tag,Type,Period,Size,Reset Tag<br />
1,FLOW1,Mean,00:30:00,180,yes<br />
2,FLOW2,Max,00:03:00,1200,<br />
3,FLOW3,Min,01:00:00,60,<br />
Title<br />
The title must be at the first line and must be SamplingTable.<br />
* Line of Comment<br />
Any complete line starting with ' * ' can be inserting anywhere in the file as comment. It will<br />
not be imported.<br />
Index<br />
The index in the list of sampling tables. Maximum 64 sampling tables can be defined.<br />
Tag<br />
Analog Tag of maximum 15 characters.<br />
The Tag must exist in the <strong>TWinSoft</strong> document. Otherwise, the sampling table cannot be<br />
imported.<br />
Type<br />
Minimum: Min<br />
Maximum: Max<br />
Average: Mean<br />
Instantaneous: Inst<br />
Period<br />
The period between 2 recordings. Check in the Sampling table configuration which are the<br />
available period.<br />
Size<br />
The number of Records you wish to save in A.<br />
Reset Tag<br />
Yes or No<br />
Determine whether the Tag is reset after recording (with registers only).<br />
Any field not needed must be left empty.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 93
Terminal Tags<br />
Syntax<br />
If you want to modify or create your own file, with the ‘separator’ between each field.<br />
The syntax is:<br />
Index Tag Comment Write<br />
allowed<br />
Example:<br />
State1 State0 Min Max Meas.<br />
Min<br />
Meas.<br />
Max<br />
Conv.<br />
Min<br />
Conv.<br />
Max<br />
#<br />
dec.<br />
TerminalTagname<br />
*Index,Tag,Comment,Read Only,State 1,State 0,Minimum,Maximum,Measured Min,Measured<br />
Max,Converted Min,Converted Max,# dec.,Unit<br />
1,ANA0,analog 0,No,,,0.000,1000.000,0,255,0.000,1000.000,3,m³<br />
2,ANA1,analog 1,No,,,0.00,1000.00,0,255,0.00,1000.00,2,liters<br />
3,D0,Input 0,No,IN,OUT,,,,,,,,4,Q0,Pomp 0,Yes,ACTIVE,STOP,,,,,,,,<br />
Title<br />
The title must be at the first line and must be TerminalTagname.<br />
* Line of Comment<br />
Any complete line starting with ' * ' can be inserting anywhere in the file as comment. It will not<br />
be imported.<br />
Index<br />
The index in the list of Web/Minitel/Terminal Tags.<br />
Maximum 256.<br />
Tag<br />
Maximum 15 characters.<br />
The Tag must exist in the <strong>TWinSoft</strong> document. Otherwise, the Terminal Tag cannot be imported.<br />
Comment<br />
The comment associated to the Tag<br />
Write allowed<br />
Yes: The Tag can be monitored<br />
No: Write not allowed<br />
State 1 / State 0<br />
The text associated to the digital Tags.<br />
State 1: the text when the Tag is '1'<br />
State 0: the text when the Tag is '0'<br />
If the states do not exist they are created.<br />
Minimum / Maximum<br />
When the option 'write allowed' is selected (see above), the range in which a value can be written<br />
(analog Tags only).<br />
The number of decimals depends on the quantity selected (see below). The decimals can be<br />
omitted.<br />
Unit<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 94
Measured Min / Max<br />
Converted Min / Max<br />
To define a scaling converting a physical range (measured) to a real range (converted).<br />
Example:<br />
8bits analog input (0..255) corresponds to 0..1000 mm<br />
Measured: 0 ... 255<br />
Converted: 0 ... 1000<br />
# dec.<br />
Number of decimals (maximum 3)<br />
Unit<br />
The text associated to analog Tag.<br />
Any field not needed must be left empty.<br />
Analog Units<br />
Syntax<br />
If you want to modify or create your own file, with the 'separator' between each field.<br />
The syntax is:<br />
Example:<br />
Index Unit<br />
TerminalAnalogUnit<br />
*Index,Unit<br />
1,m³<br />
2,liters<br />
Title<br />
The title must be at the first line and must be TerminalAnalogUnit.<br />
* LINE OF COMMENT<br />
Any complete line starting with ' * ' can be inserting anywhere in the file as comment. It will not<br />
be imported.<br />
Index<br />
The index in the list of Analog units.<br />
Maximum 256.<br />
WARNING: An analog Tag Web/Minitel/Terminal refers to an index of an analog unit. If you<br />
change the text of an index, it will be updated in the Terminal Tags.<br />
Unit<br />
The text associated to analog Tag.<br />
Maximum 8 characters.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 95
Digital States<br />
Syntax<br />
If you want to modify or create your own file, with the 'separator' between each field.<br />
The syntax is:<br />
Example:<br />
TerminalDigitalState<br />
*Index,State 1,State 0<br />
1,IN,OUT<br />
2,ACTIVE,STOP<br />
Index State 1 State 0<br />
Title<br />
The title must be at the first line and must be TerminalDigitalState.<br />
* LINE OF COMMENT<br />
Any complete line starting with ' * ' can be inserting anywhere in the file as comment. It will not<br />
be imported.<br />
Index<br />
The index in the list of digital states.<br />
Maximum 256.<br />
WARNING: A digital Tag Web/Minitel/Terminal refers to an index of a digital state. If you<br />
change the text of an index, it will be updated in the Terminal Tags.<br />
State 1<br />
The text associated to the digital Tags when it is at '1'.<br />
Maximum 8 characters.<br />
State 0<br />
The text associated to the digital Tags when it is at '0'.<br />
Maximum 8 characters.<br />
Both states fields have to be filled.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 96
18.2. Import<br />
After you have exported files for modification (see previous), or you have created your own file,<br />
you can Import them.<br />
Import menu is available from the main menu of <strong>TWinSoft</strong>: 'File' -> 'Import'.<br />
The lists you can import are:<br />
Tags<br />
Alarm condition<br />
Alarm messages<br />
Chronologies<br />
Sampling tables<br />
Web/Minitel/Terminal Tags<br />
Analog Units<br />
Digital States<br />
Working with an Empty Document<br />
• Import of Tags<br />
When doing an import into an empty document Tags & groups are created from the file.<br />
If the file contains I/O declared in extension blocks (Rack4 or Rack8), the racks and cards<br />
must be first created in the 'Resources'.<br />
• Import of Messages<br />
When doing an import into an empty document Messages are created from the file.<br />
• With Chronologies and Sampling tables<br />
The import is only possible when Tags exist.<br />
• With Alarm Condition<br />
The import in only possible when Tags and Recipient exist. The Message are created.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 97
When doing an import, if the corresponding list in <strong>TWinSoft</strong> contains already at least one<br />
configuration, the following options appear:<br />
Exact replace<br />
You want to erase an exiting list and replace it with the file.<br />
The list of the <strong>TWinSoft</strong> document is replaced by the file. The list is first erased, and then replaced<br />
by the file. Not with Tags (see following)<br />
Be careful all indexes are re-defined according to the file.<br />
• With Tags<br />
Tags within <strong>TWinSoft</strong> have an internal index, different from the one you see in the list of<br />
Tags. This index is used as internal reference for every configuration where the Tag is used<br />
(Alarm, Datalogging, Ladder, ...)<br />
When importing a list of Tags, if within the file, a Tag name is the same than the one present<br />
in the document, but with another index, the import cannot be done. A message box then<br />
informs you.<br />
That is why we advise you to always work with an Exported file.<br />
Replace<br />
You have modified some entries and/or have added some entries in the file.<br />
The import will keep or modify the existing configuration, and add the new one.<br />
Each time there is an existing configuration with the same index as the one in the file, you are<br />
prompt to choose the one(s) you wish to save.<br />
Append<br />
You want to add some new entries to an existing list.<br />
The entries are added to the existing list.<br />
• With Tags<br />
The indexes you have defined in the file have no importance. It can even be the same for each<br />
Tag.<br />
Groups of Tags are also created.<br />
If Tag names or addresses are already existing within the document, the import will be refused.<br />
• With Messages, Alarm condition, Chronologies, Sampling tables<br />
Check the last index in the <strong>TWinSoft</strong> document and use the next one when creating the file.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 98
19. Pack & Go<br />
19.1. Presentation<br />
Pack & Go is a tool that builds up one file with your complete project, including <strong>TWinSoft</strong><br />
document, WebForms, Reports, OS,...<br />
The goal is to backup a complete project without missing files or to update a RTU with the<br />
complete project without requiring advanced knowledge of <strong>TWinSoft</strong>.<br />
All files are compressed and packed into one file with the extension .tpg (<strong>TWinSoft</strong> Pack & Go).<br />
Once a project is packed, it can be unpacked and/or updated to the RTU from a double click on the<br />
.tpg file.<br />
19.2. Pack<br />
To access Pack & Go menu, select from the<br />
main menu ‘File’ ‘Pack & Go…’<br />
Select the button ‘Pack …’<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 99
All Files of the project, <strong>TWinSoft</strong><br />
document, WebForm, html pages,<br />
OS, … are packed in one file,<br />
with the extension .tpg<br />
19.3. Unpack<br />
To open the Unpack window, double click a file with the extension .tpg.<br />
Unpack menu offers 2 features:<br />
1. Restore a project<br />
Extract a project into a directory<br />
of your PC. This option is very<br />
convenient for backing up a<br />
project being sure you don't miss<br />
any file.<br />
Option available from the main<br />
menu: ‘Tools’ Unpack.<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 100
2. Update a RTU<br />
Update a RTU with a complete<br />
project, including the application,<br />
OS, WebForms, report, ...from a<br />
unique file.<br />
The button ‘PC Setup…’ gives<br />
you access to the configuration of<br />
the PC, to communicate with the<br />
RTU.<br />
The button ‘Update RTU’<br />
sends the project and OS to the<br />
RTU.<br />
Languages supported are English, French and German.<br />
It cannot be selected from 'Unpack' menu but changed from <strong>TWinSoft</strong> main menu: 'Tools'<br />
'Language'<br />
<strong>TWinSoft</strong>: 8.32 – Getting Started 101