Can I Read 32 Bit Values from Modbus Holding Registers in LabVIEW?

Updated Nov 28, 2024

Reported In

Software

  • LabVIEW

Issue Details

The PLC that I am using sends out data values that require an unsigned 32 bit representation. By default, the Modbus read function in LabVIEW has an output which has a U16 representation. Can I modify this representation?
How can I read the values that need a U32 representation?

Solution

In case of Modbus, the holding registers have a data type of Unsigned Word (U16) and that is not configurable. However, in many cases, other devices, like PLCs, may generate data in types other than I16 format. These large data types are converted to registers. For example, a pressure sensor may split a 32-bit floating point value across two 16-bit registers. To make sense of these registers you will have to join the registers into an array and type cast them into meaningful values, as shown in the image below:

reading two registers.png