From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Decisions based on the data acquisition in Labview

what can i do so that the data inside the while can be made available outside the loop.

0 Kudos
Message 11 of 30
(955 Views)

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

0 Kudos
Message 12 of 30
(951 Views)

Ok so what exactly should I change in the code?

0 Kudos
Message 13 of 30
(947 Views)

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

0 Kudos
Message 14 of 30
(944 Views)

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

0 Kudos
Message 15 of 30
(942 Views)

This stuff is basic, I dont need to know that....Iam looking for a solution to my problem!

0 Kudos
Message 16 of 30
(931 Views)

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

Message 17 of 30
(916 Views)

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

0 Kudos
Message 18 of 30
(904 Views)

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

0 Kudos
Message 19 of 30
(899 Views)

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

0 Kudos
Message 20 of 30
(884 Views)