06-25-2015 09:04 AM
I am currently working on a LabVIEW program that utilizes a PI actuator and a Keithley 2000 multimeter.
I am trying to make the actuator operate on true and fase conditions in a case structure. These conditions should be determined by the voltage value being read by the multimeter. If the voltage is under a certain value, the condition should be true, and vice versa. I tried comparing the "measurement" (orange) output of the Keithley 2000 to a constant using "Less Or = ?" and wiring the output to the case structure with no success. I had the comparison in a while loop.
The actuator does work in the case structure. It functions the way it should when the case structure is linked to a "True Constant" or a "False Constant", so I am convinced that the error is a result of how I set up the comparison.
Any advice? Also, thank you in advance for the support.
06-25-2015 09:07 AM
Right click the >= select "Compare Aggrigates"
Although this may not be what you want since the discription is vague. post a snippet.
06-25-2015 09:29 AM
Unfortunately, that did not work. I attached a snippet of the portion of the block diagram in question. The true/false case surronding the movement control of the actuator is determined by the "Less Or =" comparing the data from the Keithley 2000 to a constant, which is 0.0003 in this case.
06-25-2015 09:42 AM
That is because your loop has to stop before the boolean output tunnel becomes valid. Is that case structure at the top of the picture also supposed to be in a loop that runs in parallel with your acquisition?
06-25-2015 10:05 AM
Do you mean that the "Less Or =" comparison will only outuput a true/false when the while loop it is in stops? Is there a way to make it output true/false continously?
The outermost case structure at the top is dependent on whether or not the axes are referenced successfully. The inner one is the one is the one that is dependent on whether or not the "Less Or =" comparison is true or not. I am not sure whether or not it runs parallel with the data acquisition from the multimeter, is there a way to tell? I'm assuming that it would have to be in parallel if I want the behavior of the actuator to depend on the output of the "Less Or =" comparison.
I apologize for any confusion, I am still new to LabVIEW.
06-25-2015 10:10 AM - edited 06-25-2015 10:13 AM
@KFod wrote:
I apologize for any confusion, I am still new to LabVIEW.
First thing you need to learn the basics of dataflow. Did you do any tutorials?
Secondly, you should attach your actual VI, because it is impossible to give good suggestions if we only see a trucanted fraction of the block diagram.
Is the upper code in some while loop or does it execute only once? As a first learning step, stop using stacked sequences!
You either need to do everthing in one loop or you need to use parallel loops and communicate between the locations (action engine, local variable, queues, etc.).
06-25-2015 10:12 AM
KFod wrote: is there a way to tell?
DATA FLOW.
Rule #1 of data flow: a function, loop, case structure, etc will not run until ALL of its inputs are availalbe.
Rule #2 of data flow: a function, loop, case structure, etc. will not make any of its outputs available until it has fully completed.
So what does this mean? The output of your comparison is going to the tunnel on the While loop. That tunnel cannot make any data available (ie to your case structure) until that loop has fully completed (ie stopped). Therefore, your case structure is actually happening in series with the acquisition loop.
But the real question is do you want it to? Or is everything supposed to run as the same rate of your acquisition?
06-25-2015 10:30 AM
Adding on to the others, you NEED to learn to use the language before attempting to put something together this "complex." Odds are, you're complicating things where they needn't be. Stacked sequence structures (which you shouldn't be using, anywhere) inside of loops inside of more loops is a mess waiting to happen.
The dataflow they're harping on relates to your loop. Functions/structures/nodes do not start in LV until they receive all of their inputs. Similarly, they don't make any of their outputs available until they complete. At which point, they make all of their outputs available. In the code you showed, your top while loop will not start until it receives the boolean. The bottom loop won't make that boolean available until it completes. The two will never run in parallel.
Is there a way to make the two loops talk to each other? Yes. There are numerous ways. Some are lossy. Some are lossless. But, I'd prefer see what I'm working with to see if this is really the way you want to go or if you're doing more things that make this harder on yourself. You've already shown three things that make this a questionable architecture.
06-25-2015 12:22 PM
I attached a copy of the program I am trying to write. To answer crossrulz's question, the top and bottom loop should be running in parallel, with the top one recieving boolean (true/false) inputs simultaneously with the data acquisition. Natasftw described the problem quite well.
So, how would one go about fixing this problem and possibly avoiding future issues from the stacked sequence structure?
06-25-2015 12:28 PM
@KFod wrote:
...he top and bottom loop should be running in parallel...
There is only one loop.