08-13-2019 11:15 AM
Hello!
There is a range of X values that is equivalent for certain Y levels, for example from 500 to 1000 (X) equals 5 (Y), from 1001 to 1500 equals 4, 1501 to 2000 equals 3, 2001 to 2500 equals 2, 2501 to 3000 equals 1. If my X at 1400, level 4, changes to 1600. How do I get LabView to wait 10 seconds to see if X returns to the range 1001 to 1500, if it doens't go back to this range, change level Y to 3, and keep checking, always plotting that Y value.
Thanks!
.
08-13-2019 11:30 AM - edited 08-13-2019 11:43 AM
Please attach your VI. All we can tell from the picture is the presence of many coercion dots an duplicate scalar operations where arrays would simplify the code N times.
Where is your top-level loop? What is your architecture? In a state machine, a wait is just one of the states, right?
You have 11 terminals, but only two labels (x or y) shared by all. Very confusing! Why is the orange wire under the case structure?
08-13-2019 11:37 AM
Throwing out a wild guess...
"Threshold 1-D array" and "Interpolate 1-D Array" with the output of the "interpolate..." wired to "Round toward - infinity" may be useful...
Ben
08-13-2019 12:02 PM - edited 08-13-2019 12:02 PM
@Ben wrote:
Throwing out a wild guess...
"Threshold 1-D array" and "Interpolate 1-D Array" with the output of the "interpolate..." wired to "Round toward - infinity" may be useful...
Interpolate 1-D Array is not actually needed.
Though, if the ranges are evenly spaced, Quotient & Remainder would be a lot cleaner.
08-13-2019 12:10 PM
You'll need to define your conditions a bit more. Is this simply take a measurement, wait 10 seconds, take another measurement and compare to previous? Only wait if there was a level change? This would be pretty straight forward, but not particularly useful if your data can change relatively quickly. What happens if the level changes during the wait? Does this reset the counter?
08-13-2019 12:15 PM
@Ben wrote:
Throwing out a wild guess...
Except he also wants to light a consecutive subset of LEDs. A simpler solution would create code that does both at once. 😉
08-13-2019 12:20 PM
@altenbach wrote:
@Ben wrote:
Throwing out a wild guess...
Except he also wants to light a consecutive subset of LEDs. A simpler solution would create code that does both at once. 😉
I saw those LEDs as a quick test of his logic that will be tossed after debugging.
Ben
08-13-2019 12:22 PM - edited 08-13-2019 12:23 PM
Never mind. These are of course equal comparisons. I thought they were > comparison acting similar to a VU meter. Now I need to get some coffee. 😄
08-13-2019 12:40 PM
@altenbach wrote:
Never mind. These are of course equal comparisons. I thought they were > comparison acting similar to a VU meter. Now I need to get some coffee. 😄
Make the VU meter an integer?
Ben
08-21-2019 09:09 AM
Hi.
Thank you for your help. My program procedure has changed, so it is not necessary to identify the range of values because I can receive this information directly. Here is my old VI.