Codesys Beijer
Codesys Beijer
Codesys Beijer
10)
– FnIO-S Modbus RTU KI00378 2016-05
This document goes through the basic settings required and tips to quickly get started with iX
TxB SoftControl and Modbus RTU communication.
The terminal iX TxB SoftControl communicates with a remote I/O (Crevis FnIO-S Serie) in a
Modbus RTU network (NA-9173 and NA-9473).
All safety and accident prevention regulations relevant to your specific application must be observed in the
system design, installation, configuration, maintenance, servicing and testing of this product.
When making programs for this product make sure to leave sufficient CPU power for the HMI-part of the
product to be able to execute smoothly.
A good rule of thumb is to keep the CPU-load around or below 80%. The CPU load can be monitored by
looking at the SystemTagCPULoad system-tag found in the iX Developer environment.
1 (31)
Beijer Electronics Automation AB − a Beijer Electronics Group company
Head Office Subsidiaries
Normal.dotm, 130103
Use the following software and drivers in order to obtain a stable application:
Driver, CODESYS
• Modbus Com Ver 3.4.0.0, communication to Crevis remote I/O
• Modbus Master Ver 3.5.7.0, communication to Crevis remote I/O
• Modbus Slave Ver 3.5.4.0, communication to Crevis remote I/O
This document and other Start Up documents can be obtained from our homepage.
Please use the address [email protected] for feedback on our Start Up documents.
Normal.dotm, 070221
www.beijer.se 2 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
3 Table of Contents
1 Function and area of use ....................................................................................................................................... 1
2 About this Start Up document .............................................................................................................................. 1
3 Table of Contents ................................................................................................................................................... 3
4 First step! ................................................................................................................................................................ 4
5 Program example ................................................................................................................................................... 4
6 iX TxB SoftControl connections ........................................................................................................................... 5
7 Driver versions used in CODESYS ...................................................................................................................... 6
8 Configuration of CODESYS and Modbus RTU ................................................................................................. 7
Create a new CODESYS project................................................................................................................... 7
Adding Modbus RTU drivers ........................................................................................................................ 7
Modbus configuration settings ..................................................................................................................... 9
Modbus RTU Slave, NA-9173, Example ..................................................................................................... 11
Global Variable List (for programming and export to iX Developer) ........................................................ 12
I/O mapping, Modbus Slave ....................................................................................................................... 15
PLC Settings ............................................................................................................................................... 17
Write program ............................................................................................................................................ 18
Export Variables to iX Developer............................................................................................................... 20
Transfer CODESYS project to iX TxB SoftControl..................................................................................... 22
9 Configuration of iX Developer (iX TxB SoftControl) ....................................................................................... 24
Rename the driver....................................................................................................................................... 24
Import of variables ..................................................................................................................................... 25
iX driver help for SoftControl Direct Access .............................................................................................. 27
iX Developer project................................................................................................................................... 28
Download iX project to T7B SoftControl ................................................................................................... 28
10 Hardware iX TxB SoftControl, NA-9173 .......................................................................................................... 29
Installation.................................................................................................................................................. 29
Dip Switch setting, NA-9173 ...................................................................................................................... 30
Dip Switch setting, NA-9473 ...................................................................................................................... 31
Normal.dotm, 070221
www.beijer.se 3 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
4 First step!
For best understanding and easy working with iX TxB SoftControl we recommend:
• Read through StartUp document KI00375 (iX TxB SoftControl, Basic setting).
• Prepare the computer with the programming tools CODESYS and iX Developer.
• Basic knowledge of CODESYS. There is a quick start in CODESYS help file.
• Download manuals
• Install iX TxB SoftControl device description in CODESYS.
Note!
Always use the correct version of the drivers and software!
5 Program example
Supplied with this document there is a folder containing example program för iX Developer
and CODESYS. This is a program that can be opened and/or downloaded to the iX TxB
SoftControl panel for reference. Included is also a export folder to upload the project via
USB-memory.
Tip!
By importing the CODESYS project the installation of the iX TxB device and driver libraries
are automaticly made on your computer.
Normal.dotm, 070221
www.beijer.se 4 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
RTU
TCP
Ethernet
Modbus
EtherCAT
Note!
COM Ports 1, 2 and 3 are supported.
These ports are locked and can not be switched by the software:
COM 1 – RS232
COM 2 – RS485
COM 3 – RS232
www.beijer.se 5 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
A rule of thumb is that you should add the latest driver version but never go above the
runtime version.*
The version 3.5.6.0 is the correct version because this is the highest version available that’s
not above the runtime version, in this case 3.5.7.10:
This is the correct version because CODESYS 3.5.7.10 is/have been installed on the PC
* Exception to the rule is bugfixes made within the same CODESYS service pack (patches).
For example, using driver version 3.5.7.40 for runtime version 3.5.7.10 is OK.
Normal.dotm, 070221
www.beijer.se 6 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
It’s important to use the correct version! See chapter 7 for more details.
www.beijer.se 7 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
www.beijer.se 8 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
• In the same way, change settings for the Modbus Master COM Port, if needed.
Normal.dotm, 070221
www.beijer.se 9 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
Result
Normal.dotm, 070221
www.beijer.se 10 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
www.beijer.se 11 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
www.beijer.se 12 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
• Write global name for memory cells and register (volatile memory)
Normal.dotm, 070221
www.beijer.se 13 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
• Highlight Application.
• Right click and select Add Object.
• Choose Persistent Variables..
www.beijer.se 14 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
• Map the global variable list to the corresponding I/O’s, analog and digital.
• Starting with inputs:
Normal.dotm, 070221
www.beijer.se 15 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
• Outputs:
Note!
There are 3 ways of mapping I/Os:
1. Create variables in Global Variable list and connect the variables in I/O Mapping (above).
2. Create variables “on the fly” by typing directly into the I/O Mapping (a star symbol will
appear to notify that the variable has been created). The variables will be available just
like normal GVL.
3. Use IEC addressing. Usefulll in some special cases.
• Mark!
Always update variables and select Enable 2.
- All variables status are updated (even those not used in the program).
See Online Help for more information.
Note!
Not nessary if the Always update variables is set in PLC Settings (parent setting). This is
recommended and will be the general behaviour for the application.
Normal.dotm, 070221
www.beijer.se 16 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
PLC Settings
In the PLC Settings of the Device (double click Device) there are options related to the IO
handling that can be changed depending on application.
We recommend to change Always update variables to “Enabled 2”.
See CODESYS Online Help for detailed information (click F1 to open help).
Normal.dotm, 070221
www.beijer.se 17 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
Write program
Normal.dotm, 070221
www.beijer.se 18 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
Note!
• When Generate code is made there can be warning like the picture.
It´s only a warning. The project is working correct.
www.beijer.se 19 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
The xml file for iX Developer is created automaticly when you transfer the project to the iX
TxB SoftControl or when executing Generate code from Menu\Build. The file is saved in
same folder as the CODESYS project.
Normal.dotm, 070221
www.beijer.se 20 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
It’s important to note that the variables that are selected in the Symbol Configuration also
desides which variables that can be externaly accessed, for example iX Developer or other
devices/hardware using ARTI protocol.
Therefore, the Symbol Configuration have to be downloaded to the Device each time it has
been changed and a new xml-file will be created. The iX Developer taglist also have to match
the Symbol Configuration in order to connect to the variables.
If you are trying to access a tag that is not available in the Symbol Configuration you will get
a controller error message in the iX HMI application.
Normal.dotm, 070221
www.beijer.se 21 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
Note!
If you can’t find the device via Scan network, try to manually enter the IP address.
Normal.dotm, 070221
www.beijer.se 22 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
• Download the project to the device (TxB SoftControl) which was selected.
Menu\Online\Login.
www.beijer.se 23 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
• Click Next
• Enter the name and the path of the project
• Click Finish
www.beijer.se 24 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
Import of variables
At this stage, it’s time to import the xml-file that was exported from CODESYS.
• Go to the tab Tags.
• In the window, choose the Import tags to option and select the controller name.
• Select the xml file with the same name as the CODESYS project.
Tip! Check the option “Connect selected import file to project” to remember the connection.
• Click Import.
• A import dialog will appear, select All items and press OK
• The imported variable(s) should now be featured in the taglist
Normal.dotm, 070221
www.beijer.se 25 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
www.beijer.se 26 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
www.beijer.se 27 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
iX Developer project
Add and configure a project in iX Developer.
• You can copy from the example project
After download, the HMI application starts up and communicates with the SoftControl!
Normal.dotm, 070221
www.beijer.se 28 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
iX TxB-SC
NA-9173
120 Ω 120 Ω
iX TxB-SC NA-9473
120 Ω 120 Ω
www.beijer.se 29 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
www.beijer.se 30 (31)
iX TxB SoftControl (Codesys runtime 3.5.7.10) - FnIO-S Modbus RTU KI00375 2016-05
NOTE!
Byte Format are fixed to: 8 Bit, No Parity, 1 Stop Bit
Normal.dotm, 070221
www.beijer.se 31 (31)