03-30-2012 01:59 PM
I have been trying to use a program to read a sequence of boolean values (0 and 1) to close and open valves. This is what I got so far:
The true statement would look like:
What I have been trying to do is continuously read a DAQ assistant to condition the case structure, but when I run my program in "Highlight Execution Mode" what I am seeing is that the DAQ Assistant Values do not go out of the while it is in until I stop the while loop.
How could I continuously condition the case structure with the DAQ Assistant?
Another thing is that I am running LabVIEW 2009 and it doesn't accept LabVIEW 2011 programs, so If you guys come up with a program, please place a screen shot in your response.
Thank you for helping me out,
03-30-2012 02:13 PM
Your images are being blocked because for some reason, you put them on some off-beat web site instead of attaching them to your post.
Of course nothing leaves a while loop until it stops. That is basic dataflow. In fact, it's pretty basic to all programming languages.
I don't understand what you mean by 'condition'. Do you mean you want to pass a Boolean output to a True/False selctor? If you have it soutside the while loop, place the case statement inside it.
03-30-2012 02:18 PM
Here, these might help. Hopefully your question will be answered. Thanks for the quick reply!
03-30-2012 02:49 PM
It makes no sense to have the while loop just around the DAQ Assistant unless you only want the program to run once. If so, just click the stop button.
I would never use dynamic data of any type and I would certainly never use it in the way you have. Are you only talking one sample with the DAQ Assistant? If not, do you know which sample is being used for the comparison? Is it all, just the first sample, just the last? I don't know.
03-30-2012 02:55 PM
Here is what I want it to do. I want the DAQ Assistant read a certain value of temperature or pressure, set a maximum value for such measurement, and if the measurement exceeds this value run an "emergency" sequence. I want the DAQ assist to continuously read samples and keep comparing them to a fixed maximum value and from there "condition" the case structure so it runs either a "true" sequence or a "false" sequence.
Also, I would be using just one measurement for the comparison, I would not be adding more measurement lines to the DAQ Assistant.
03-30-2012 03:12 PM
I did not ask about 'measurement lines'. I asked about number of samples you were taking with each read. If you are taking multiple samples, I would suggest doing something as basic as taking the mean of all the samples, getting the scalar value, and then doing the comparison. Once you move all of your code inside the while loop, it should work.
03-30-2012 03:22 PM
I apologize for my misunderstanding of your questions. I've been dealing with labview about 2 months now, so I do not consider myself as an expert.
I tried placing all of the code in the while loop before and what it does, it takes just one sample compares it and returns either the true or false structure and the for loop start running. After the for loop starts, the DAQ Assistant just stops reading samples.
Now, the mean value would not work for me because in my research, temperature is a huge factor, and if I go over a certain temperature there might be material failure. So I would need such "dynamic data", hopefully I am using the correct term, to give me a true or false statement.
03-30-2012 03:47 PM
No, you do not understand the term dynamic data. In LabVIEW, it is a specific data type. t does not mean data that is changing. It is that goofy blue wire returned from the DAQ Assistant. It can contain several different types of data and the exact type (numeric, numeric array, Boolean, etc) is unknown just by looking at it - unlike the other types of wires in LabVIEW. I really hate it and prefer to work with exact types.
I asked you a couple of times if your DAQ Assistant is taking multiple samples. The comparison function does NOT look to see if there is any value is over the threshold. I did some checking and it seems it only looks at the very last sample so if you are taking multiple samples, it's not doing you any good.
You would have to post your code (real code and not an image) so someone could see exactly what you are talking about with the while loop but yes, the DAQ Assistant would wait until the rest of the code in the loop finishes. If that is an issue, you should look at using the producer/consumer archicture as shown in the templates that come with LabVIEW.