Variables and fieldbus: Difference between revisions
Line 7: | Line 7: | ||
==Fieldbus master== | ==Fieldbus master== | ||
When the device is configured as a fieldbus master (Modbus, CANopen, EtherCAT etc.), the basic concept relies on the mapping of PLC variables on the slave devices input and outputs datagrams.<br> | When the device is configured as a fieldbus master (Modbus, CANopen, EtherCAT etc.), the basic concept relies on the mapping of PLC variables on the slave devices input and outputs datagrams.<br> | ||
===Key | ===Key points=== | ||
The key points of fieldbus to PLC variables mapping are the following: | The key points of fieldbus to PLC variables mapping are the following: | ||
# the fieldbus master exchanges datagrams with the slave devices | # the fieldbus master exchanges datagrams with the slave devices |
Revision as of 23:24, 26 February 2018
Introduction
This article gives an overview of the relationship between the variables of a PLC application in the different fieldbus configurations either master or slave. The topics covered here mainly apply to the binary LLExec PLC runtime but can also be applied to most of the LogicLab PLC runtime portings.
Fieldbus master
When the device is configured as a fieldbus master (Modbus, CANopen, EtherCAT etc.), the basic concept relies on the mapping of PLC variables on the slave devices input and outputs datagrams.
Key points
The key points of fieldbus to PLC variables mapping are the following:
- the fieldbus master exchanges datagrams with the slave devices
- the datagrams can be input datagrams (from slave to master) or output datagrams (from master to slave)
- input datagrams contain values that are read from specific data objects of the slave device
- output datagrams contain values that are written into specific data objects of the slave device
- the configuration of the datagrams exchanged with each slave device are defined by means of the LogicLab embedded fieldbus configurator
- the values in the datagrams are mapped on PLC global variables using the fieldbus configurator
- at run-time the values of the PLC variables are automatically updated from/written into the datagrams by the fieldbus master stack
Mapping procedure
In the following description a Modbus TCP master example is used. The same concepts apply to almost all others fieldbus master configurations.
The goal of this example is to map two slave objects (ActualValue and StatusWord) onto two PLC variables using different procedures (new variable definition and existing variable mapping).
- enable the modbus TCP master stack on the Ethernet node
- add a slave node under the Modbus TCP master
- select the "Input" tab to configure the input datagram
- press the "Add" button to add a slave object to the input datagram
- select the desired object form the slave's object list
- to map a new variable on the datagram: type the name of the variable into the variable field of the record and choose its data type
- to map an existing PLC variable: press the "Assign" button and choose the variable from the list that will appear
A sample of PLC variables mapping is shown in the picture below:
Fieldbus slave
When the device is configured as a fieldbus slave (Modbus, CANopen, etc.), the basic concept relies on the defintion of the object dictionary of the PLC application.
The object dictonary is defined into the "Public objects" node of the device configuration.