02-10-2021 05:37 AM
I would like to know, as at the output of the block, "Read Holding Register" there are data "[U16]" how to do the conversion to Float32. Because the Modbus Slave data I receive from my instrument is Float32 type.
02-10-2021 07:14 AM
First you need to know how the data is stored in your device.
[U16] is not something to do with LabVIEW, it is Modbus that only can store values in 16 bit format.
You get an array out of that function, and to be able to convert to single precision float, you need to read 2 registers.
To convert, look at this document: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YHcACAW&l=da-DK
02-10-2021 07:29 AM
Thanks for your reply but the images are not visible in the link
02-10-2021 07:42 AM
The important images are, and there are instructions on what you need at the end.
02-10-2021 08:02 AM
The quick answer is to use Type Cast. But depending on how you did the read, you will likely have to use Reverse 1D Array before the type cast in order to put the words in the correct order.
02-11-2021 01:27 AM
Thanks for the answer, even if I didn't understand much about type cast. I'll try with the link method that was posted to me at the top. I hope to be able to convert the data [U16] to Float32 to read it like I do on modsim32.