Hello all,
I am running into issues with my current project when it comes to checking the connection state of my PLC. I am currently using the ping command to ping the IP address of the PLC but that just checks if the PLC is on the network, not if the PLC is actually online and ready to send/receive data. Obviously, this causes exceptions as I currently have reads and writes happen only when the PLC is on the network. Is there a way through AdvancedHMI to check if a PLC is ready for data as opposed to if it is connected to a network? Here is a sample of what I currently use just for reference.
If My.Computer.Network.Ping(plcIP) = True Then
outputDataReals = EthernetIPforCLXCom1.Read("HMIIO.Input[0]", 500)
inputDataReals = EthernetIPforCLXCom1.Read("HMIIO.Output[0]", 500)
outputDataBits = EthernetIPforCLXCom1.Read("HMIIO.InputBits[0]", 500)
inputDataBits = EthernetIPforCLXCom1.Read("HMIIO.OutputBits[0]", 500)
outputDataRealsBuffer = EthernetIPforCLXCom1.Read("HMIIO.Input[0]", 500)
outputDataBitsBuffer = EthernetIPforCLXCom1.Read("HMIIO.InputBits[0]", 500)
Else
plcStatus = "Connection Lost"
Label1.Visible = True
Label1.Text = plcStatus
Label1.BackColor = Color.Red
End If
Thank you in advance for any help or advice,
Fuzydragon