IO.WorkOnline

Driver Modicon Modbus

IO.WorkOnline

Top  Previous  Next

Type of Tag

I/O Tag

Type of Access

Reading or Writing

N1 Parameter

-1

N2 Parameter

0

N3 Parameter

0

N4 Parameter

4

String Configuration

IO.WorkOnline

 

This Tag informs Driver's current status and allows starting or stopping the physical layer.

·0 - Driver Offline: The physical layer is closed (stopped). This mode allows a dynamic configuration of Driver parameters using the IO.SetConfigurationParameters Tag

·1 - Driver Online: The physical layer is open (executing). While in Online mode, the physical layer can be connected or disconnected (its current status can be checked on the IO.PhysicalLayerStatus Tag)

 

In the next example (using E3), the Driver is configured to Offline mode, its COM port is changed, and then configured to Online mode again:

' Configure to Driver to Offline mode Driver.Write -1, 0, 0, 4, 0
' Change port to COM2
Driver.Write -1, 0, 0, 3, Array("IO.Serial.Port", 2)
' Configure Driver to Online mode
Driver.Write -1, 0, 0, 4, 1

 

The Write method can fail when configuring the Driver to Online mode (writing the value one). In this case, the Driver remains in Offline mode. The cause of failure can be:

·Type of physical layer incorrectly configured (probably an invalid value was configured in the IO.Type property)

·Driver may have run out of memory

·Physical layer probably did not create its working thread (search the log file for the message "Failed to create physical layer thread!")

·Physical layer could not start. The cause of failure depends on the type of physical layer. It can be an invalid serial port number, failure when starting Windows Sockets, failure when starting TAPI (modem), etc. This cause is recorded on the log file

 

IMPORTANT

Even if the configuration of a Driver to Online mode is successful, this does not necessarily mean the physical layer is ready to use (ready to execute input and output operations with an external device). The IO.PhysicalLayerStatus Tag must be checked to ensure the physical layer is connected and ready for communication.

 
Has this section of the documentation helped you configure this Driver?
Yes No
Comments (optional):