In Listen Node, a socket server can be established and be connected by an external device to communicate according to the defined protocol. All the functions available in Expression Editor can also be executed in Listen Node.
- Send Message: When entering this node, it will initiate a message
- Print Log: Enable Communication Log (shown on the right panel )
- Connection Timeout: When entering this node, if more than the Connection Timeout (milliseconds) passes without connecting, it will timeout. If value ≤ 0 ie. no timeout.
- Data Timeout: When connected, the timeout will be exceeded if no communication packet arrives in Data Timeout milliseconds. If value ≤ 0 ie. no timeout.
Socket Server is set up after the project is running and closed after the project is stopped. When the Socket Server is successfully established, the IP and Port will be displayed in the Notice Log window on the right.
IP : HMI –> System –> Network –> IP Address
Port : 5890
When the process enters the Listen Node, it stays in the Listen Node until it triggers and leaves with the exit condition.
Pass : Executes ScriptExit() or item stopped
Fail :
- Connection Timeout
- Data Timeout
- Before the Socket Server been established successfully, the flow process has entered the Listen Node
The commands received by the listen node will be executed in order. If the command is not valid, an error message will be returned carrying the line number with errors. If the command is valid, it will be executed.
The commands can be divided into two categories. The first category is commands which can be accomplished in instances, like assigning variable values. The second category is commands that need to be executed in sequence, like motion commands and IO value assignment. The second category command will be placed in the queue and executed in order. Refer to the manual Expression Editor and Listen Node for details on commands and communication format.