01-30-2023 10:53 AM
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.
01-30-2023 11:45 AM
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)…
01-30-2023 11:50 AM
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
01-31-2023 12:51 AM
That was a very constructive reply. Thank you.
01-31-2023 02:12 AM
Which one?
What are you gonna do now?