LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to take out pressure readings from a while loop

Hello everybody,


I am having trouble taking the pressure readings out of a while loop. I know it is not possible unless you're using Queue or Global Variables but I do not know how to integrate them in my code.

What I want to do is take these readings and put them in another while loop (that has a case structure inside which also has a event structure inside) and compare the readings with some preset values. When the pressure reads a certain value I need to go to the next case of the case structure and so on.

I am not sure that this is the easiest approach but it is the only one I've came up with.

Do you have any suggestions ?

George.
0 Kudos
Message 1 of 5
(3,075 Views)

George,

You are not passing data out of your while loop in the example vi.

To get an idea on how to go about it, in LabVIEW, Go to Find Examples>>Optimizing applications>>Synchronizing tasks Folder and take a look at how data is passed between while loops in same vi's/subvi's  using Queues, Notifiers, semaphores with Global variables etc

Try incorporating the same logic in your code

After that, if you are still unable to do what you want, do not hesitate to ask us

Regards,

Dev

Message 2 of 5
(3,066 Views)
Thanks Dev,

After going through the examples I was able to implement global variables in the code.

I will let you know if I'll have any other problems.

George.
0 Kudos
Message 3 of 5
(3,041 Views)

Hi there,

 

I am trying to do a very similar thing to George (who's name is strangely enough the same as mine!). I am trying to pass a true/false boolean signal out of a while loop before the loop has been stopped, and i have looked through the example codes that you suggested but i am still confused. I wonder if you could help me?

 

George

0 Kudos
Message 4 of 5
(2,782 Views)

A LV programming architecture that is very useful is the producer/consumer design pattern.  Read about it HERE.

Jim

LV 2020
0 Kudos
Message 5 of 5
(2,767 Views)