06-10-2010 03:26 PM
Solved! Go to Solution.
06-10-2010 03:35 PM - edited 06-10-2010 03:37 PM
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?
06-10-2010 04:50 PM - edited 06-10-2010 04:52 PM
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:
06-10-2010 08:47 PM
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 tbob’s example. Nothing against tbob’s method as it is absolutely the correct mathematics to use. I used tbob’s method for years until I benchmarked it against NI’s Interpolation VI’s.
You will ultimately learn much more from tbob’s 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 tbob’s VI by executes in). I think unless you are a serious enthusiast, I really wouldn’t worry about this level of detail.
Wishing you success,
Davy.
06-11-2010 11:43 AM
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.
06-11-2010 02:15 PM
06-12-2010 07:19 AM
06-12-2010 10:07 AM
What does the error message say about the types of wires?
Please post your VI so we can see them.
06-13-2010 10:00 AM
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
06-13-2010 10:29 AM
There should be an attachment showing the vi
thanks