I need some serious help with this. Here is the code I'm using to try and write the Bool to the PLC:
EthernetIPforMicro800Com1.Write("PROGRAMABLECONTROL.Segments[" & SegmentNumber.ToString & "].loop", CInt(SegmentSetpoints(index, 3).Equals("TRUE")))
The .loop address is my bit that I need to change and the rest is converting the integer value I have in the array into an equivalent Boolean value. However when I run the code i get this error:
An unhandled exception of type 'System.NullReferenceException' occurred in AdvancedHMI.exe
Additional information: Object reference not set to an instance of an object
.
What am I doing wrong here?
Any help would be appreciated