Ken Roach
Lifetime Supporting Member + Moderator
A nitpick; the sub-elements of a DINT or INT are bits, but they are not BOOL datatypes. Both a bit sub-element and a BOOL element are a way of representing a single bit of data, but they are not completely interchangeable.
What you have will work, but it would be easier to have a single INT tag called PhotoeyesStatus, rather than a 1-element array. Having an array with length of 1 is technically allowed but is a little confusing.
If it were me, I would make an INT array tag that is several words in length (like PE_Status_Data[8] ) and transmit that, so that I have extra data for future use. When you're transmitting over Ethernet, the amount of data payload has almost no effect on the time or resources required to move the data.
In particular, I like to transmit one extra word with a value that increments every second or so. That way the receiving device can tell if the transmissions are still arriving and can take action if they stop.
What you have will work, but it would be easier to have a single INT tag called PhotoeyesStatus, rather than a 1-element array. Having an array with length of 1 is technically allowed but is a little confusing.
If it were me, I would make an INT array tag that is several words in length (like PE_Status_Data[8] ) and transmit that, so that I have extra data for future use. When you're transmitting over Ethernet, the amount of data payload has almost no effect on the time or resources required to move the data.
In particular, I like to transmit one extra word with a value that increments every second or so. That way the receiving device can tell if the transmissions are still arriving and can take action if they stop.