modbus:modbus-en
Differences
This shows you the differences between two versions of the page.
| — | modbus:modbus-en [2022/08/31 10:34] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Modbus TCP/IP ====== | ||
| + | [[: | ||
| + | [[: | ||
| + | * **[[: | ||
| + | {{http:// | ||
| + | \\ | ||
| + | =====Introduction===== | ||
| + | The Siemens LOGO! devices do support Modbus over TCP/IP. Those devices are helpful in case 230VAC must be switched in context of the model railroad.\\ | ||
| + | {{: | ||
| + | The Modbus protocol is very straight forward and therefor easy to implement.\\ | ||
| + | Serial Modbus devices can be connected by a gateway.\\ | ||
| + | |||
| + | // | ||
| + | \\ | ||
| + | |||
| + | =====Setup General===== | ||
| + | {{: | ||
| + | \\ | ||
| + | ====IP==== | ||
| + | The IP prefix. If not set, the IP of the Rocrail server will be used.\\ | ||
| + | ====Port==== | ||
| + | The default Modbus [[http:// | ||
| + | |||
| + | ====Poll options==== | ||
| + | |||
| + | ===Inputs=== | ||
| + | Poll discrete inputs.\\ | ||
| + | ===Holdings=== | ||
| + | Poll holding registers.\\ | ||
| + | ===Registers=== | ||
| + | Poll analog registers.\\ | ||
| + | ===Coils=== | ||
| + | Poll coil output state.\\ | ||
| + | ===Sleep=== | ||
| + | Pause in ms between the polling requests.\\ | ||
| + | |||
| + | |||
| + | \\ | ||
| + | =====Setup Devices===== | ||
| + | {{: | ||
| + | A device must be added if polling is required to specify which type and rage.\\ | ||
| + | ====Sub IP==== | ||
| + | The last part of the device its IP address.\\ | ||
| + | ====Unit-ID==== | ||
| + | Unit-ID connected to the slave.\\ | ||
| + | Range in Rocrail is 0...15.\\ | ||
| + | ====Input/ | ||
| + | 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 Rocrail object Bus/Node-ID will be used as IP suffix, for example if an output bus is **44**, the IP address will be **192.168.0.44**.\\ | ||
| + | Slaves are addressed by the Object port number.\\ | ||
| + | |||
| + | ====Sensor==== | ||
| + | |< >| | ||
| + | ^ Modbus ^ Rocrail ^ | ||
| + | | SubIP | NodeID | | ||
| + | | Module | High part of address | | ||
| + | | Address | Low part of address | | ||
| + | |||
| + | Rocrail sensor address = Module * 256 + Address\\ | ||
| + | |||
| + | ====Block Interface==== | ||
| + | The TrackDriver is addressed as follows: | ||
| + | |< >| | ||
| + | ^ Modbus ^ Rocrail ^ | ||
| + | | SubIP | NodeID | | ||
| + | | Module | Port | | ||
| + | | Register address | Address | | ||
| + | The 16bit register value range is 0...1000.\\ | ||
| + | The direction is defined by bit 15.\\ | ||
| + | |||
| + | |||
| + | \\ | ||
| + | |||
| + | =====Coils===== | ||
| + | A coil is a read/write output in the Modbus context, and is mapped to a Rocrail output/ | ||
| + | The output bus is the IP suffix, and the address is the coil address.\\ | ||
| + | |||
| + | \\ | ||
| + | |||
| + | =====Polling===== | ||
| + | Modbus inputs must be polled because of its master/ | ||
| + | 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 [[: | ||
| + | |||
| + | ====Coils==== | ||
| + | Coiuls are reported as output field events.\\ | ||
| + | |||
| + | ====Input Registers==== | ||
| + | Input registers are reported as [[: | ||
| + | |||
| + | ====Holding Registers==== | ||
| + | Holding registers are reported as [[: | ||
| + | \\ | ||
| + | |||
| + | =====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/ | ||
| + | | 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 | | ||
| + | |||
| + | |||
| + | \\ | ||
| + | |||
| + | =====Public Functions===== | ||
| + | {{: | ||
| + | |||
| + | \\ | ||
| + | =====Links===== | ||
| + | {{ : | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * http:// | ||