🚧Siemens S7 (WIP)
Introduction to Siemens S7 Protocol
The Siemens S7 protocol, also known as the S7comm protocol, is a communication protocol designed for Siemens PLCs (Programmable Logic Controllers). It allows for data exchange between PLCs and other devices within the same network, facilitating industrial automation processes. By utilising the S7 protocol, users can efficiently monitor, control, and retrieve data from their automation systems.
Siemens S7 instance management
Creating an S7 instance
Simply drag the create function onto the board, name your instance and trigger.

Deleting an S7 instance
Drag the delete function onto the board, insert the name of the instance to be deleted and trigger it.

Siemens S7 functions
Get connection status
With the getStatus function, you can read out the current connection status of the S7 connector.
Initiate a connection
To establish a connection to a PLC use the initiateConnection function. There are a few parameters available for the connection.
host
String
The host to be contacted for the S7 connection.
port
102
number
The connection port. Change this if your endpoint is not using the standard port.
rack
0
number
slot
2
number
timeout
5000
number
Connection timeout in ms.
Disconnect from the PLC
To drop the connection to the PLC, drag the dropConnection function onto the board and trigger it. This function simply terminates the TLC connection.
setAddressDictionary
Add items to internal read polling
The addItems function adds items to the internal read polling list. If items includes the value _COMMERR it will return the current communication status. Items can be a string or an array of strings.
Remove items from internal read polling
The removeItems function removes items from the internal read polling list. Items can be a string or an array of strings.
If the items box is left empty, all items will be removed
Write item-value pairs
Write items to the PLC with the writeItems function. If items is a single string, values should then be a single item. If items is an array of strings, values must also be an array of values of the same length.
The function returns true if the write was successful and false if it wasn't.
Read out all item values
With the readAllItems function, you can read out all items on the read polling list. They will be returned as key value pairs.
Last updated