09-06-2011 09:18 PM
what can i do so that the data inside the while can be made available outside the loop.
09-06-2011 09:43 PM
You need to understand dataflow. The way LV works is that any node (like a while loop or the DAQ Assistant) can only run when all the wires coming into it have data and the wires going out only have data on them after the node has completed execution.
So the way your program works is that the DAQ Assistant acquires data and it is displayed on Data 3 and Voltage Indicator 3 until stop is pressed. After that the final value(s) are presented to the >1 comparison AND NOWHERE ELSE. Then the for loop runs 10 or 20 times. As pointed out earlier the value of the Start Stop switch has a huge effect. Note also that changing the direction button after the for loop has started will do nothing.
Have you taken any basic LV training or worked through the on-line tutorials? Some of these questions are very fundamental to the way LV works.
To get access to the analog data in the digital output loop two things need to happen. The loop acquiring the data needs to run in parallel with the loop writing digital data with no data dependencies between the loops. And you need some way of transferring the data from one loop to the other without a wire, because a wire creates a data dependency. Queues or action engines are two good ways to transfer the data.
Look at the Design Patterns and examples for state machines and Producer/Consumer.
Lynn
09-06-2011 10:04 PM
Ok so what exactly should I change in the code?
09-06-2011 10:16 PM
I cannot do your program for you. Spend some time learning about some of the things I and others have suggested. When you get stuck, show us what you have done and ask for help with specific issues.
Lynn
09-06-2011 10:59 PM
I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
09-07-2011 01:19 AM
This stuff is basic, I dont need to know that....Iam looking for a solution to my problem!
09-07-2011 07:38 AM
I am setting up a consulting business. Do you want to hire me?
The forum is primarily to help people figure out how to do things in LV for themselves, not to do it for them. Your posts have seemed to show some reluctance to try the things people have suggested or to learn these basic elements. That is why some of us have begun to get more frustrated with trying to help you. If that is not your intention, show some good faith effort and you will likely get more help.
Lynn
09-07-2011 06:36 PM
Hello
Ok I have tried the producer consumer loop type and the problem Iam having is how to compare the data comming out of Que out in the producer loop and use the comparison function..Attached is the VI I have
09-07-2011 06:57 PM
You treat the data coming out of the Dequeue exactly the same as the data coming out of the DAQ Assistant while loop in your previous program. Compare it to a threshold and make a decision based on the result. The advantage over your earlier program is that now you get fresh data on every iteration of the consumer loop.
You should define the data type for the queue when you Obtain the Queue. Then data will come out in the same form as you put it in. The way you have it now the dequeue produces a variant but the program will not know how to interpret it.
Lynn
09-08-2011 03:08 PM
Hi Lynn
First of all I really appreciate you for giving me the hint on the consumer producer loop, that really helped to make a whole lot of sense.....
Another thing Iam trying to do is use queuing to write the row of the 2d boolean array to the boolean digital write VI... so Should I use the Flush Queue VI... what Iam saying is that Iam trying to write the boolean array to the digital port....this digital Write Vi I have is in the While loop....so Iam using this producer consumer pattern to get the row of the 2 dimensional array and write it to the port..
Attached is the screen shot I have