From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

scaled vs binary

Hello,

is there a possibility to convert binary datas to scaled datas?
I have a file that contains binary datas (from binary-output of AI
READ.vi in AI.llb) and want to show the datas in scaled format.

Thanks,
Hans
0 Kudos
Message 1 of 4
(2,585 Views)
Basically you must divide the binary value by its maximum value (4096 for a 12-bit reading, 65536 for a 16-bit card) and then multiply by the full-scale reading of the analog input.
As an example, suppose your analog signal is 10 V = 300 A. A reading of 2000 (in a 12-bit card) stands for 2000/4096*300=146.484375 A.

Since LabVIEW permits you to divide and multiply an array by a value or another array, you can multiply the whole array by the result of (maximum reading in scaled value / maximum reading in bits) and that's all.

Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 4
(2,585 Views)
I've found that if you have your board in bipolar mode (+/- voltages), it uses one bit for the sign. Therefore, you would divide your binary value by the maximum value, and then divide that by two. (The negative number will be shown in Labview). Then multiply that by the range of your board (for +/- 10, you would multiply by 10), and then the scaling factor (if 1V = 30A, then multiply by 30).

Roberto's example is not quite right for 2 reasons. First, he makes the assumption that your board is set for 0-10 volts. Second, if it weren't set for 0-10 volts, the multiplication by 300 to convert to EU wouldn't be correct, either.

Mark
0 Kudos
Message 3 of 4
(2,585 Views)
When searching in the Resource library, I found this interesting document on that subject:
http://zone.ni.com/devzone/devzoneweb.nsf/opendoc?openagent&FAD997C661795F27862567E70057CD36&cat=99368070225FE073862567E6006C8DD7
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 4
(2,585 Views)