Variables and fieldbus

From Axel Public Wiki
Jump to navigation Jump to search

Introduction

This article gives an overview of the relationship between the variables of a PLC application and the different fieldbus either in master or slave configuration. 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.
The key points of fieldbus PLC variables mapping are the following:

  1. the fieldbus master exchanges datagrams with the slave devices
  2. the datagrams can be input datagrams (from slave to master) or output datagrams (from master to slave)
  3. input datagrams contain values that are read from specific data objects of the slave device
  4. output datagrams contain values that are written into specific data objects of the slave device
  5. the configuration of the datagrams exchanged with each slave device are defined by means of the LogicLab embedded fieldbus configurator
  6. the values in the datagrams are mapped on PLC global variables using the fieldbus configurator
  7. at run-time the values of the PLC variables are automatically updated from/written into the datagrams by the fieldbus master stack

FieldbusMapping.png

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).

  1. enable the modbus TCP master stack on the Ethernet node
  2. add a slave node under the Modbus TCP master
  3. select the "Input" tab to configure the input datagram
  4. press the "Add" button to add a slave object to the input datagram
  5. select the desired object form the slave's object list
Map 01.png


  1. 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
  2. Map 04.png

  3. to map an existing PLC variable: press the "Assign" button and choose the variable from the list that will appear
Map 03.png


A sample of PLC variables mapping is shown in the picture below:

Map 05.png


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.