Warning
This package is DEPRECATED, please use the Modbus TCP/IP Interface package instead.
Siemens S7-1200: Usage as slave¶
Use the Siemens S7-1200 PLC to be controlled by a drag&bot program.
Send data to the PLC from drag&bot¶
The Siemens S7-1200 can also be used as a slave device being controlled by drag&bot. For this data needs to be sent from the drag&bot program to the PLC with one of the function blocks PLC - Send Data - *, where * can be one of the types Boolean, Float, Pose, Short, String or Word.
Information
- Integer values have a size of two bytes in TIA. Therefore, to avoid confusions with the regular definition of four bytes, these are called Short in the drag&bot function block.
- Float values in drag&bot correspond to the real datatype in TIA for floating-point numbers.
On the Siemens S7-1200 side one of the functions d&b_receive_[bool/int/pose/real/string/word]_data needs to accept the information. If no receiving function is in place then the sent data is lost after a timeout of one second.
d&b_receive_[bool/int/pose/real/string/word]_data¶
The d&b_receive_[bool/int/pose/real/string/word]_data function awaits and receives data sent by drag&bot.
Group | Parameter | Type | Description |
---|---|---|---|
Input | Name_Filter | String | Received data of the respective type is compared with this filter. If the filter is an empty string all received data of this type is accepted, otherwise only data with this name is accepted. |
Output | Success | Bool | Is true, if valid and matching data has been received. |
Name | String | The name of the received data. | |
Data | Bool/Int/Pose/Real/String/Word | The received data. | |
InOut | MB_Holding_Register | Variant | The linked Holding Register of the Modbus server. |
The d&b_receive_[bool/int/pose/real/string/word]_data function requires the Name_Filter input to select the correct data out of multiple of the same type. In the same cycle the Success output indicates a successful or unsuccessful reading from the respective Modbus register. When the data has been read successfully the outputs Name and Data return the received information.
d&b_receive_trigger¶
The d&b_receive_trigger function awaits and receives a trigger signal sent by drag&bot.
Group | Parameter | Type | Description |
---|---|---|---|
Input | Name_Filter | String | The received trigger name is compared with this filter. If the filter is an empty string all triggers are accepted. Otherwise just a trigger with the given filter is accepted. |
Output | Success | Bool | Is true, if a valid and matching trigger has been received. |
Name | String | The name of the received trigger. | |
InOut | MB_Holding_Register | Variant | The linked Holding Register of the Modbus server. |
The d&b_receive_trigger function requires the Name_Filter input to select the correct trigger out of multiple others. In the same cycle the Success output indicates a successful or unsuccessful reading from the respective Modbus register. When the data has been read successfully the output Name returns the received trigger name.