I have been reading up on how to construct loops.
I have made numerous attempts but not making much progress.
Here is what I have done....
Added a datasubsriber.
Added this code to form.....
If Alarm_Data.PLCAddressValueItems(0).LastValue = True Then
ModbusTCPCom1.Write(40300.0, 1)
Else
ModbusTCPCom1.Write(40300.0, 0)
End If
If Alarm_Data.PLCAddressValueItems(1).LastValue = True Then
ModbusTCPCom1.Write(40300.1, 1)
Else
ModbusTCPCom1.Write(40300.1, 0)
End If
etc.....
etc.....
If Alarm_Data.PLCAddressValueItems(15).LastValue = True Then
ModbusTCPCom1.Write(40300.15, 1)
Else
ModbusTCPCom1.Write(40300.15, 0)
End If
etc.....
etc.....
If Alarm_Data.PLCAddressValueItems(31).LastValue = True Then
ModbusTCPCom1.Write(40301.15, 1)
Else
ModbusTCPCom1.Write(40301.15, 0)
End If
This code works as expected.
Can This be converted to loops, or am I just spinning my wheels?
Thanks,
Gene