LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

checking a result using limit lines that are different to the result

Solved!
Go to solution

Hi,

 

Can anyone help, I'm having writers block!

 

I have created a VI to create limit lines for a test.  The VI creates a MIN and MAX limit by a the user entering a frequency, minimum and maximum limit using a table.  The example I have is:

 

Frequency Min Max

2MHz        0    -10

3MHz        0    -10

3MHz        0    -12

4MHz        0    -12

 

This creates a limit line on my XY graph.

 

When the test has been performed I want the result to be checked to the limits stored.  So far I have displayed both result and limit line on the XY graph, but I am having difficulty in checking the result as the results array is different.  The example results I have are:

 

Frequency result

1MHz       -9

1.5MHz    -11

2MHz       -12

2.5MHz    -11

3MHz       -12

3.5MHz    -13

4MHz       -13

 

So to check the result visually I would skip the first 2 frequencies and check the others.  Is there a simple way of interpolating the arrays to compare or will I have to loop round the test frequencies checking whether to check the limit or not.  One idea I had was to calculate the test frequency increment, and then re-created the limit line array to match the result array.

 

Any help would be appreciated!

0 Kudos
Message 1 of 6
(3,354 Views)

Hi Marty,

 

There is an interpolate 1D array function in the array palette that should allow you to read out the y-values of an array based on the x-value. As the x-values are set programmatically, you can select which values you wish to read from based on what the user inputs, if you so wish.

 

Try using the Interpolate 1D array. If you are still having problems then post here again and I will be happy to help. If you like, I could take a look at your code to help you implement this feature.

 

Kind Regards,

Jas.W 

Jason W.
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 2 of 6
(3,294 Views)

Hi Jason,

 

Yes I was using the interpolate function, but I was having trouble with the algorithm to know when to interpolate or not and if there were any special cases.  I finally come up with a VI to do it now, and I have attached the code.  Do you think there is any way to simplify the code more?

 

Regards

Martin

Message Edited by Marty H on 12-02-2009 05:02 AM
Message Edited by Marty H on 12-02-2009 05:02 AM
0 Kudos
Message 3 of 6
(3,271 Views)
I must say that I am not completely sure what you are asking for. The numbers that you have in the fourm do not match the ones in your code. I have done what I think you are asking for much easier but I get a different value for the 3.5 point. Tank a look and see if this helps.
Tim
GHSP
0 Kudos
Message 4 of 6
(3,256 Views)

Hi Jason,

 

I can't view your code.  I am using version 8.6

 

Sorry about the test data.  The original test and limit data I put on the forum was made up and was not very helpful when I was programming.  I did change the data to the ones in the forum and came out with what I was expecting, but with a small error.  So I my new limit data is:

 

Frequency Max

2.0            -10

2.5            -10

3.0            -10 (should be -12) as in this case I should have taken thelowest limit point.

3.5            -12

4.0            -12

 

The 3.0 frequency is incorrect.  It should have taken the smallest value of -12.  Other than that all should be correct as 3.5 is between 3 and 4 and the middle of -12 to -12 is -12.

 

You might be confused about the test data.  I have not completed the VI yet to check the new interpolated limits with the test result.  All I have done is created new limit data so it will compare with the test data.  Hope this makes sense.

 

Thanks

Martin

 

Message Edited by Marty H on 12-02-2009 09:41 AM
0 Kudos
Message 5 of 6
(3,240 Views)
Solution
Accepted by topic author Marty_H
Try this it does all of the limit checking drawing graphs and everything that you want I think.
Tim
GHSP
Message 6 of 6
(3,232 Views)