LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

what is the best way to convert a 4-20ma signal

Solved!
Go to solution
 I am using field point AIO 600 module to receive the 4-20 ma signal from a 0-1000 psi pressure transmitter. How do I change this signal so that it reads the pressure on the front panel?
0 Kudos
Message 1 of 15
(8,706 Views)

I'm not sure I understand your question. Change it to what? The AIO 600 already has current inputs (4 to 20 mA compatible) so you can just wire it to the module. Have you taken a look at the shipping examples on acquiring data?

 

Is this the same as this other question you asked?

Message Edited by smercurio_fc on 06-10-2010 03:37 PM
0 Kudos
Message 2 of 15
(8,701 Views)

I've used this simple vi that I've written in the past.  Put in 1000 for X2 and 0 for X1.  Put in 20 for Y2 and 4 for y1.  Enter your mA reading in the Input box.  Run the vi.  The output will be the converted value.  To check it, if you put 12 (half way between 4 and 20) for the input, you should get 500 (half way between 0 and 1000) for the output. 

 

This will also convert your pressure reading to a 4-20 mA value.  Just reverse everything.  mA for X values and pressure for Y values.

 

There is probably a math function somewhere in labview that does this, but my VI is already written and usable.

 

 

 

Here is a snippet for those who don't have LV2009:

 

Interpolate.png

Message Edited by tbob on 06-10-2010 02:52 PM
- tbob

Inventor of the WORM Global
Message 3 of 15
(8,681 Views)
Solution
Accepted by topic author russell-p

Hi Russell,

 

The most efficient way to do this is to use the 'Polynomial Interpolation.vi' function from within LabVIEW.

Please see the image at the end.

 

I found that the NI Polynomial Interpolation VI executes considerably faster than tbobs example. Nothing against tbobs method as it is absolutely the correct mathematics to use. I used tbobs method for years until I benchmarked it against NIs Interpolation VIs.

 

You will ultimately learn much more from tbobs example than you will by just being given some VI to use

 

There are a few reasons to explain why the NI Polynomial Interpolation VI is many times faster. It is a re-entrant VI which calls a DLL function from any thread(as opposed to the default UI Thread which is where tbobs VI by executes in).  I think unless you are a serious enthusiast, I really wouldnt worry about this level of detail.

 

Wishing you success,

Davy.

Senior Software Engineer
www.Adansor.com
Message 4 of 15
(8,656 Views)

I knew there was a function to do this, but I was too lazy to go looking for it, especially since I had something already written, I don't care about the speed.  But thanx for the tip as to what that function is Davy.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 15
(8,609 Views)
If you use a Custom Scale (setup in MAX) you can achieve the conversion with no code.
Richard






0 Kudos
Message 6 of 15
(8,580 Views)
Thanks everyone for your help. One of the main issues that I am having is wiring the interpolation vi to the fieldpoint read vi so that the signal can be converted. I keep getting an error telling me that they cannot be wired together since they are different types of wires.
0 Kudos
Message 7 of 15
(8,545 Views)

What does the error message say about the types of wires?

 

Please post your VI so we can see them.

0 Kudos
Message 8 of 15
(8,533 Views)

Below is the error message. I am having trouble loading the VI without receiving an error message. I will keep trying. However, what I am trying to do is this:

 

I have a fieldpoint IO point wired to the input of the "fieldpoint read" vi. Then I try to wire the "fieldpoint read" values output to the "x" value input of the polynomial interpolation vi. That is where I get the broken wire and the error below. I have the x and y inputs of the polynomial interpolation vi wired each to a constant to input the current and pressure min/ max levels so that it will do the conversion and give me a pressure reading in a indicator on the output of the vi. I am not sure how to eliminate the error, unless the values from the "fp read vi" need to be wire to something else before going to the x value of the "PI vi". Hopefully that is somewhat clear. I know a picture says a thousand words so I will keep trying to load the vi.

 

These cannot be wired together because their data types (numeric, string, array, cluster, etc.) do not match. Show the Context Help window to see what data type is required.
The type of the source is 1-D array of
double [64-bit real (~15 digit precision)].
The type of the sink is double [64-bit real (~15 digit precision)].

 

Thanks

0 Kudos
Message 9 of 15
(8,494 Views)

There should be an attachment showing the vi

 

thanks

0 Kudos
Message 10 of 15
(8,484 Views)