05-27-2021 02:46 PM - edited 05-27-2021 02:55 PM
Hi all,
I am working with IAI linear actuators. I have successfully coded a LabVIEW VI (MODBUS RTU) that does many other things along with reading the current location of the actuator. The current location value is stored within specific "registers" whose addresses are given in the IAI handbook. The 2 registers store (1) most significant digit (2) least significant digit
By default the "register values" are stored as an array of word (16bit integer). Check snapshot below.
According to the instruction handbook, the 2nd element of the array i.e. 4500 is nothing but 4500x0.01mm = 45mm. I have verified that by physically measuring the actuator position. The problem I am facing is converting this value into a decimal number programmatically. . Ideally, I am looking for "word integer to number" conversion. LabVIEW has the reverse available i.e. "number to word integer" available.
I am not sure if "typecasting" can do the conversion. If yes, I do not know how to do it.
Currently, I think I am doing it in a very crude way (snapshot below), is there a better way to do it?
Solved! Go to Solution.
05-27-2021 03:03 PM
First off, there is a "To Double" conversion which will convert a number to a double precision floating point number. It is polymorphic and the input will adapt to the numberic type wired into it.
Secondly, your posted solution works fine so I am not sure what you are looking for. I would remove the array to cluster and unbundle and simply use an Index array to pul the value from the array.
05-27-2021 03:09 PM
@Mark_Yedinak
Thanks for your reply. I was actually looking for a simpler solution.
"I would remove the array to cluster and unbundle and simply use an Index array to pul the value from the array." - This worked! 🙂