LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Limit Testing for Log X Scale

I've been trying to create a vi to do limit testing of a signal. I've been able to successfully use the Limit Specification.vi in the Waveform Monitoring pallet to get what I need if the X axis is in linear mapping. I think this is because Limit Specification uses linear interpolation. The problem I'm having is I need to create (and display) a case where the X axis is in logarithmic mapping (scale). For the life of me I can't figure out how to create the limit either manually or using the Limit Specification.vi or the Limit Specification by Formula.vi such that I can test using Limit Testing.vi. My eventual project will need to test against both linear and logarithmic scales for different aspects so that it would be nice to use the same testing path which currently works in linear mode.

 

Any help would be appreciated. I've attached both a picture and hopefully the excel file of what I'm trying to create.

 

Limit.png

 

Thanks

Jim

0 Kudos
Message 1 of 4
(2,733 Views)

Skydyvr,

 

I was a little confused with the method by which you were plotting your graph in LabVIEW but this should be universal. In your block diagram, you can find the graph and right click it to make a property node:

 

Create>>Property Node>>X scale>>Mapping Mode

 

Drop this Property Node down somewhere and change it to write by right clicking the property node and clicking "Change all to Write". Wire in a 1 to make your x-scale logarithmic. 0 makes it linear. 

 

He is a community example that you can use a reference if needed:

 

https://decibel.ni.com/content/docs/DOC-9271

 

You can also do this by right clicking on the graph on the front panel and going into the properties. Under the "Scales" tab, the is a check box for "Log" to make the scale as such. 

 

Best,

 

-KP

Kurt P
Automated Test Software R&D
0 Kudos
Message 2 of 4
(2,691 Views)

Thanks Kurt for replying. I didn't really have time to write a detailed question on Friday before I had to go do other work. But yes, I know how to change from linear to log mapping both programmically and manually. I'm not sure how to do other things with the graph and hopefully I can cover them here in a detailed manner. I've got multiple issues I'm trying to deal with so lets break them up into small sections. But the end result is that I'm trying to create a graph like that displayed in the excel file I attached in the first post. I also need to test a signal to see if it falls in between the upper and lower limit. Finally I need to display the signal, limits, and failures on a graph that all the humans in our work area are used to looking at - meaning amplitude on the Y scale (in dB), frequency on the X scale displayed in logarithmic mode.

 

My first issue is how do you create a vertical limit as shown at 5 Hz and 2400 Hz on the lower limit in the excel file. I'm not sure how to attach code using the "Insert Code" button above so I will try and attach pictures of what I'm doing. Then maybe attach small files after I get done posting.

File1.png

Using the create limit, I'm able to get something close to what I need but still it isn't right. The upper limit can't cross over and below the lower limit. And that is probably not the right way to create vertical limits. So question 1) What would be the correct way to create a vertical limit. It looks like it should be possible looking at the little create icon. Smiley Wink

 

Question 2) Why does the upper limit cross over the lower limit? It shouldn't and doesn't in excel.

 

All of this is just while displaying in linear mapping. If I try and change to log mapping I get this:

File1.png

 

I understand why the lines are curved. The real issue here is that I need to be creating limits in this (logarithmic) domain and not the linear domain. So the limit lines need to be straight when displaying with a log axis (like they do in excel). And also again, the upper limit can't cross the lower limit. I'm doing all of this because eventually I was planning on using the Limit Testing.vi to test my signal to verify it is within the bounds of the limits I'm trying to create.

 

File1.png

I may be going about this all wrong. And if so, it is not too late to change. I would just need to know a better way to get where I want to go.

 

Thanks

Jim

 

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

Hey Jim,

 

I think what you need to do is interpolate the data point logarithmically. You can do this by sending your waveform Y data through a process like this:

 

1. Calculate the exponential of this array
B[I] = Exp(A[i]);
2. Then make the linear interpolation of array B
C[i+di] = Linear interpolation of B[i]
3. Then calculate the ln(C[i+di])
A[i+di] = ln(C[i+di]);

 

I found another forum post where someone ran into a similar issue. Fortunately, they documented what worked for them (as the last post) and hopefully it will be helpful to you. 

 

http://forums.ni.com/t5/LabVIEW/Linear-Plot-on-a-Log-axis/m-p/1138899#M501733

 

Best of luck,

 

-KP

Kurt P
Automated Test Software R&D
0 Kudos
Message 4 of 4
(2,656 Views)