LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interpolation of "Y" value based on a "X" value from a table..

I have a look up table as below of a non-linear function :

X-Value Y-Value(low) Y-Value(High)

500 5.6 6.0
1000 6.8 7.3
1500 6.9 7.3
2000 7.2 7.5
2500 7.5 8.0
3000 6.8 7.4
3500 6.3 7.0
4000 6.0 6.9


In real time I am plotting both X and Y values from the field. And for every X-value actual ( sampled once every 50ms),I have to use the above look up table to find if the Y-Value satisfies the condition

Y_Val(Low) < Y_Val(Actual) < Y_Val(High).

I have been reading other posts on interpolation in this forum also. And tried using the 1-D array interpolation with some gimmicks. But still the final and maybe an elegant solution eludes.

Thanks for your time.

Raghunathan
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
Message 1 of 4
(2,998 Views)
Hi Raghunathan

I had a similar problem recently.
The following .llb has two VIs. The SubVI calculates the interpolated Y values.
The main VI checks your actual Y value against these limits.
I've defaulted the values to those you supplied.

Hope that helps.
Message 2 of 4
(2,988 Views)
Correct me if I am wrong, but why do you need an interpolation if you only have a strict comparision?

For me it looks like a standard soft-triggering. If so, try to look into LV examples on triggering and you will find a lot of useful functions to do a soft-triggering for you.

hope it helps
Pawel
0 Kudos
Message 3 of 4
(2,983 Views)


@NeilR wrote:
Hi Raghunathan

I had a similar problem recently.
The following .llb has two VIs. The SubVI calculates the interpolated Y values.
The main VI checks your actual Y value against these limits.
I've defaulted the values to those you supplied.

Hope that helps.




Dear Neil,

Thank you so much.

I took the sample code that you had posted and just added upper and lower bound checking before I used it.

Does what it is supposed to do.

Regards

Raghunathan
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 4 of 4
(2,964 Views)