Parameters - Manual - SIMATIC AX - Instructions that can be used for Modbus-RTU communication. - Siemens.Simatic.S71500.CommunicationsProcessor.ModbusRtu,library

Siemens.Simatic.S71500.CommunicationsProcessor.ModbusRtu library

Portfolio
SIMATIC AX
Product
SIMATIC AX
Software version
1.0.2
Edition
11/2024
Language
English (original)
Package Name
@ax/simatic-1500-modbusrtu
Name Type Section Description
request BOOL Input Activates configuration of the port on rising edge
port WORD Input Communication port, Hardware Identifier
baud UINT Input Selection of the data transmission rate.
Valid values are: 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 76800, 115200 bit/s.
parity UINT Input Selection of parity:
  • 0 - None
  • 1 - Odd
  • 2 - Even
flowControl UINT Input Selection of flow control:
  • 0 – (default) no flow control
  • 1 – Hardware flow control with RTS always ON (not with RS422/485 CMs)
  • 2 – Hardware flow control with RTS switched (not with RS422/485 CMs)
rtsOnDelay UINT Input Selection RTS ON delay:
  • 0 – No delay from "RTS active" until the first character of the frame is sent.
  • 1 to 65535 – Delay in milliseconds from "RTS active" until the first character of the frame is sent (not with RS422/485 CMs). RTS delays must be used independent of the selection FLOW_CTRL.
rtsOffDelay UINT Input Selection RTS OFF delay:
  • 0 – No delay after transmission of last character until "RTS inactive"
  • 1 to 65535 – Delay in milliseconds after transmission of last character until "RTS inactive" (not with RS422/485 ports). RTS delays must be used independent of the selection FLOW_CTRL.
responseTimeout UINT Input Response timeout: 5 ms to 65535 ms - Time in milliseconds that ModbusMaster waits for a response from the slave.
MB_DB P2P_MB_BASE Input/Output A reference to the instance data struct of the ModbusMaster or ModbusSlave instructions.
done BOOL Output TRUE, if the instruction finished without error
error BOOL Output TRUE, for one cycle once the instruction has been completed with an error.
status WORD Output Error code. See Parameter Status.

ModbusCommonLoad is executed to configure a port for the Modbus RTU protocol. Once you have configured the port for the Modbus RTU protocol, it can only be used by the ModbusMaster or ModbusSlave instructions.

You have to run ModbusCommonLoad for the configuration of each communication port that is to be used for Modbus communication. You must assign a unique ModbusCommonLoad instance to each port that you use. Only run ModbusCommonLoad again if you need to change communication parameters, such as data transmission rate or parity, or in case the network has returned.

For example, an instance is assigned to the instruction if you add ModbusMaster or ModbusSlave to your program. You need to connect the MB_DB parameter of the ModbusCommonLoad instruction to the MB_DB parameter of the ModbusMaster or ModbusSlave instruction.