08-24-2017 04:54 AM
Hi everyone,
I'm looking to create a VI where I can change the number of cases and their boundaries for a case structure from the front panel. I'll need roughly 10 different cases, ranging from 2 minutes to 24 hours, if that makes any difference.
Attached is what I have so far; the contents of each case are always the same, just with a different value. Any resources that you know of that might help me would be much appreciated.
Thank you
08-24-2017 05:50 AM
Make a lookup table that is an array of the start and end times for a range. Use Threshold 1D Array and Round To -Inf to get an index and then Index Array to get the values you actually want.
08-24-2017 06:33 AM - edited 08-24-2017 06:35 AM
Hi crossrulz, thank you for your help.
As I understand it the start and end times in the array will be in seconds and the Threshold 1D Array will compare the start and end times in the array to the current elapsed time and from that output whether it's in range 1/2/3 etc.
Will the case structure automatically update its number of cases as the number of ranges changes? Will I be able to change the number of ranges I want? This will be running on a machine without labVIEW so i just want to check there's no problem there.
Thank you
08-24-2017 06:57 AM - edited 08-24-2017 06:58 AM
No, a Case Structure is fixed. You cannot dynamically change the number of cases it has. That requires compiling. I am telling you to build your output values into an array that you can then index based on the value coming out of the Threshold 1D Array.
08-24-2017 09:45 AM
Hi crossrulz, thank you again for your help. Unfortunately I wasn't able to get the VI to work properly, it would continue what was defined in the 1st case for the subsequent cases as well.
Would you be able to look at the VI and see if there's any obvious mistake I've made? I've attached the setup I used as well. The spray control part of the VI is in the while loop in the bottom right.
It works fine if I manually enter the cases as, for example, 0-100s and ..-1,101.. with controls for spray and wait time for each case so it seems I haven't implemented something properly with this new method.
Thank you again