To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This example wires 32-bit Single value into input of Swapped Value
Description
LabVIEW provides the Swap Words Function that swaps the high-order 16 bits and the low-order 16 bits for every long integer input to the function. This function does not work for floating point numbers though. To get around this you can use the Type Cast function to cast the value to a 1D array of bytes. Then use the Reverse 1D Array function and type cast it back to a floating-point number. This is relavant when working with Modbus because 32-bit single values are stored in two 16-bit registers. The issue is discussed in this KB. The picture below shows what the subVI will be performing.
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Block Diagram
**This document has been updated to meet the current required format for the NI Code Exchange.**
Description-Separate-2
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
hi i am getting data from my power meter EMS6400 but while fetching the WH reading it's shows difference of 106 and same time while checked with mod bus test tool showing same as on meter. please fine my codes as below. data on register 3123 and swapped float value