LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loop Problems: data collection being halted by program excecution.

Sorry for the vague subject line, I'm finding it difficult to specify exactly what my problem is, so I'll start with what I want to happen. I'm working in a lab in which we are studying pain. The specifics are not mine to disclose but suffice it to say that based on certain input given by the subject we want to excecute a piece of hardware. The goal is to do this on a second to second basis, so if the subjects input warrants excecution in one second, the hardware will excecute for the next second, and will continue if the requirements continue to be met. I have programs both for recieving subject data, and for excecuting the hardware, the issue is that the conditions are being measured with a while loop, and the hardware is also excecuted with a while loop, so when the conditions are met the hardware activates and data stops being collected. I havnt figured out a way around this and I'm wondering if anyone can help me.

"There will be water if God wills it"
0 Kudos
Message 1 of 4
(2,417 Views)

To deal with getting both processes to run at the same time, if they're passing data back and forth, it sounds like you might want to look into "Producer/Consumer Architecture."

 

https://www.ni.com/en/support/documentation/supplemental/21/producer-consumer-architecture-in-labvie...

 

Would that address your concerns?

Ravi A.
National Instruments | Applications Engineer
0 Kudos
Message 2 of 4
(2,391 Views)

Ummm... It looks like it could work but its giving me some trouble. I'm trying to send a boolean value to the next loop but it doesnt seem to work, and when I tried using a string input that didnt work either. I guess I'm a little fuzzy on how to use the loops. But if i can get them to work these loops will excecute simultaneously right?

"There will be water if God wills it"
0 Kudos
Message 3 of 4
(2,382 Views)

Yeah, if you get the data flow to work right, these will run simultaneously. To get that information across loops, try using Local Variables. They can be memory-heavy if you use too many, but they could help you here.

 

https://www.ni.com/docs/en-US/bundle/labview/page/creating-local-variables.html

Ravi A.
National Instruments | Applications Engineer
0 Kudos
Message 4 of 4
(2,364 Views)