1
Support Questions / Re: ModbusTCPCOM Timeout Issue
« on: June 19, 2019, 11:29:10 AM »
Thanks this is very informative! I have resolved the freezing issues by running on background threads. It took a lot of googling but it turns out I just needed to use the threadpool and a lambda statements in the "signal" write methods as shown below. I still see a delay a reaction from the hardware as the background threads do their thing but the Main Form doesn't freeze which is fine for this project.
My next task is to add a network connection diagram to the HMI which will involve changing the color of some lines based on the connection status of the PLCs. It sounds like the ConnectionEstablished, ConnectionClosed, and ComError events may be exactly what I need to do that.
Thanks Archie!
Code: [Select]
Public Sub WriteCLR(ByVal WriteValue As Integer)
System.Threading.ThreadPool.QueueUserWorkItem(Sub() _Connection.Write(_CLRaddress, WriteValue)) 'writes to signals color address
End Sub
Public Sub WritePWR(ByVal WriteValue As Integer)
System.Threading.ThreadPool.QueueUserWorkItem(Sub() _Connection.Write(PWRaddress, WriteValue)) 'writes to signals power address
End Sub
My next task is to add a network connection diagram to the HMI which will involve changing the color of some lines based on the connection status of the PLCs. It sounds like the ConnectionEstablished, ConnectionClosed, and ComError events may be exactly what I need to do that.
Thanks Archie!