LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

scaling a range of values

I am trying to take dbl precison array of data values and graph them and scale a 2nd y-scale on the right side of an xy graph that matches the example graph I have.  The scale goes from 0-0.1 where the ticks are every .01 thousandth, then once it is past 0.1, the ticks go to every .04 thousandths until it reaches 0.5.

 

The scale values to be set to, to get the proper spacing of what we want for the customer, is 0-10.

I went into the comparison pallet on LV 2010, put in the "Select" where you have an x, y, and a boolean input with one output, the triangle. On the true side I multiply by 50 to get the values to fall into 0-5 that are less than or equal to .1 for everything above .1, I multiply by 20. All of this inside a for loop.

 

What I am finding, is that where that transition of .1 (scaled by every .01 thousandth) jumps to be scaled to .14, there is something screwy going on with the curve on the xy graph. Like sharp points in the data, not smooth like in the example graph I have.

 

After explaining all of that, I want to scale it differently between .1 and .14 Multiply it by a different number.

 

I was thinking something like 0.1 < x < .14

 

Is there away to do a range of values like that in Labview?

 

Any ideas?

0 Kudos
Message 1 of 5
(3,980 Views)

EDIT:

 

I should have said .14< x < .1, I think. I want to take any number that falls in that range and scale it different than I have in what I explained in my first post.

0 Kudos
Message 2 of 5
(3,974 Views)

Post your VI so we can see what you are doing.  It would be a lot easier to help you in that case than trying to decode what you are trying to say in words.

0 Kudos
Message 3 of 5
(3,952 Views)

Hey M Boat,

 

If I'm correctly interpreting what you're saying, you want to check if your data is within a certain range (between 0.1 and 0.14) and then perform different operations based on whether it is over, under, or within that range.

 

A relatively simple (and probably the best) way of doing this would be to use nested case structures. A great example of this can be found here: http://decibel.ni.com/content/docs/DOC-3507 (Nesting Case Structures). This example seems to be almost exactly what you want to do, with the first case structure checking whether a number is less than a certain value and the second checks if those numbers that are less than the initial cutoff value are greater than a second cutoff value. 

 

If you are very keen on using the Select Function (mentioned above), it may be possible to complete this task using three Select Functions in series. This could only be an effective method if the operations you are performing on the data are relatively simple. An example of how this might look is shown below.

 

RangeComparisonVI.PNG

I hope that helps!

 

-Matt

Matt
NI Community Team
National Instruments
0 Kudos
Message 4 of 5
(3,911 Views)

My boss and I worked it out over the phone. Here is what we came up with:

0 Kudos
Message 5 of 5
(3,891 Views)