LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stopping parallel while loops in case

Hi all,

I have parallel while loops running (DAQmx continuous read) in a case (in a case structure). The cases are selected by messages in a message queue. What is the elagant and professional way to stop the loops and be able to switch to another case? As I understand, the case selector won't read the value while the inner loops are running, right? I would like to avoid involving a new queue to send the stop message to the wile loops.

Thanks for the advices in advance.

 

0 Kudos
Message 1 of 5
(891 Views)

Hi farkas,

 


@farkasb wrote:

I have parallel while loops running (DAQmx continuous read) in a case (in a case structure). The cases are selected by messages in a message queue.


Why are there several loops inside several cases of a case structure?

Which kind of program architecture did you choose?

 


@farkasb wrote:

What is the elagant and professional way to stop the loops and be able to switch to another case? As I understand, the case selector won't read the value while the inner loops are running, right?


You're right, you need to "OBEY DATAFLOW!"

The elegant way is not to bury several loops inside several cases of a case structure, but to employ some good architecture…

 


@farkasb wrote:

I would like to avoid involving a new queue to send the stop message to the wile loops.


So then start again with a better architecture!

 

Btw. yor forgot to attach your VI(s)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(878 Views)

You answered your own question.  To stop a Case that contains two While Loops operating in parallel, you only need to stop the two While Loops.  Surely you have Stop conditions for them, right?  Too bad we can't give you more advice about the architecture of your code-that-we-cannot-see ...

 

Bob Schor

0 Kudos
Message 3 of 5
(873 Views)

That was a very constructive reply. Thank you.

0 Kudos
Message 4 of 5
(813 Views)

Which one?

 

What are you gonna do now?

Greets, Dave
0 Kudos
Message 5 of 5
(792 Views)