This is an old revision of the document!
Table of Contents
Modbus TCP/IP
Introduction
Les appareils Siemens LOGO! supporte Modbus à travers TCP/IP. Ces appareils sont utile en cas de 230VAC doit être changé dans le contexte du modélisme ferroviaire.
Le protocole Modbus est très simple et donc facile à mettre en œuvre.
Les appareils série Modbus peuvent être connectés à une passerelle.
Configuration Général
IP
Le préfixe IP. Si non renseigné, l'adresse IP du serveur Rocrail sera utilisée.
Port
Le numéro de port par défaut Modbus enregistré 502 sera utilisé en cas de valeur égale à zéro.
Options de sondage
Entrées
Interroger les entrées discrètes.
Holdings
Interroger les registres d'exploitation.
Registres
Interroger les registres analogiques.
Coils
Interroger l'état de la sortie bobine.
Mise en veille
Pause en ms entre les requêtes de sondage.
Setup Devices
Sub IP
The last part of the device its IP address.
Input/Coil range
Both ranges are automatically adjusted to multiples of 8.
Ranges
If a range is set from zero to zero the polling for that type is disabled.
Addressing
The addressing is based on the IP address of the Rocrail server.
If the server hast IP address 192.168.0.120, the base IP prefix is 192.168.0.
The Rocrail object bus will be used as IP suffix, for example if an output bus is 44, the IP address will be 192.168.0.44.
Coils
A coil is a read/write output in the Modbus context, and is mapped to a Rocrail output/switch object.
The output bus is the IP suffix, and the address is the coil address.
Polling
Modbus inputs must be polled because of its master/slave architecture. (Originally RS485. Also new projects are based on RS485 like BiDiB where the GBMBoost master will do the polling.)
If a Rocrail sensor is defined for this Interface ID, the eight bit module range, 8, will be requested for this IP suffix at a fixed interval.
To activate polling the digint attribute fbpoll must be set to true. The psleep attribute is used for the polling interval in ms.
Discrete Inputs
Input registers are reported as sensor default type.
Coils
Coiuls are reported as output field events.
Input Registers
Input registers are reported as sensor register type.
Holding Registers
Holding registers are reported as sensor register type.
Service
If the port is set > 1024, a Modbus service will be started; Rocrail will accept Modbus request on this port.
Supported requests:
- Write Single Coil, this will be evaluated as an output field event.
For all other requests an exception response will be send back.
PLC Address Types
Mnemonic | Type | Size | Modbus | Rocrail |
---|---|---|---|---|
I | Digital Input | bit | Discrete Input | Sensor |
Q | Digital Output | bit | Coil | Output/Switch |
M | Memory | bit | Coil | Read Sensor, Write Output |
AI | Analog Input | word | Register | Sensor register type |
AQ | Analog Output | word | Register | Output analog port type |
AM | Memory | word | Holding Register | Sensor register type |