LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analyzing Code

I am trying to create a code similar to the one on this website: http://labviewwiki.org/Converting_a_Sensor_Voltage_Input_to_Physical_Units  .

 

However, I cannot figure out how to get the "Array constant Y and X axis".  I am able to get an array constant, but it does not have sections in it to put numbers in like the one on the website. (Ex. 0 and 100 for Y).  How do you make it so I can input the limits.

0 Kudos
Message 1 of 4
(3,526 Views)
Drop an Array Constant on the Block Diagram then drop a Numeric Constant into the Array Constant.  Change the representation to whatever datatype you want.

Example_VI_BD.png
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 4
(3,516 Views)

... or just right-click the input terminal to "linear fit" and select "create constant". 😄

 

(This guarantees that you get the right representation and dimensionality.) 

0 Kudos
Message 3 of 4
(3,507 Views)

This is a follow-up to the original question.

 

A note regarding the example on the wiki: be aware that's just an example. You should already know the slope and intercept based on the datasheet, so there's no point in calculating each time. You should measure the curve yourself for your device, since as the datasheet indicates, there is a range of offsets. As noted in the other thread, you can also just create a DAQmx scale so you will get the physical units directly. 

0 Kudos
Message 4 of 4
(3,493 Views)