OWEN.DAVID
Member
We have an AB system that is connected to several CANbus networks via HMS gateways.
A CAN message is comprised of upto eight, eight-bit bytes. However, the program is setup with INT arrays (16bits) such that two adjoining message bytes are always combined into each INT. So for every CAN message of eight bytes the data ends up in four INTs in the PLC.
For example, a battery has eight voltage values which are sent on the CAN bus in one message. This is written to the PLC input array as four INTS. The logic then separates the values from the four INTs and we are able to read the eight voltages.
Would an array of SINTs be more appropriate for transferring the CANbus message bytes?
SINTs would allow the contents of each message byte to be easily identifiable when viewed in tag monitor, for example. It could simplify the associated logic as we have cases where one parameter is represented by a single byte, such that we have eight battery voltages per message, as above.
What is the guidance for transferring data between networks?
*To respect the format of the original network / CAN bus and use one SINT per message byte
*To align with the content of the messages, so if we are using two message bytes for each parameter we use INTs which minimises logic but reduces clarity in the input array.
What are there best practices in industry when it comes to handling data transfers?
A CAN message is comprised of upto eight, eight-bit bytes. However, the program is setup with INT arrays (16bits) such that two adjoining message bytes are always combined into each INT. So for every CAN message of eight bytes the data ends up in four INTs in the PLC.
For example, a battery has eight voltage values which are sent on the CAN bus in one message. This is written to the PLC input array as four INTS. The logic then separates the values from the four INTs and we are able to read the eight voltages.
Would an array of SINTs be more appropriate for transferring the CANbus message bytes?
SINTs would allow the contents of each message byte to be easily identifiable when viewed in tag monitor, for example. It could simplify the associated logic as we have cases where one parameter is represented by a single byte, such that we have eight battery voltages per message, as above.
What is the guidance for transferring data between networks?
*To respect the format of the original network / CAN bus and use one SINT per message byte
*To align with the content of the messages, so if we are using two message bytes for each parameter we use INTs which minimises logic but reduces clarity in the input array.
What are there best practices in industry when it comes to handling data transfers?