From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

register value to number conversion

Solved!
Go to solution

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.

Pic1(array of word).png

 

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?

ZeUs87_0-1622145297659.png

 

 

0 Kudos
Message 1 of 3
(1,446 Views)
Solution
Accepted by topic author ZeUs87

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 3
(1,433 Views)

@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! 🙂

0 Kudos
Message 3 of 3
(1,422 Views)