08-21-2008 04:44 AM
08-21-2008 05:02 AM
You may use rendezvous. See the example that ships with LabVIEW.
C:\Program Files\National Instruments\LabVIEW 8.5\examples\general\rendezvous.llb\Rendezvous with SubVIs.vi
In stead of subVIs you can use your parallel while loops.
08-21-2008 05:04 AM
Hi lordsathi...,
they will not run synchronous. If you place a 30min wait in one loop and only 10ms in the other, then there is a difference. Each loop will start a new iteration if the iteration before is executed.
Mike
08-21-2008 05:06 AM
Thanks Mike that cleared my doubts...
08-21-2008 05:09 AM - edited 08-21-2008 05:10 AM
Multiple loops run asynchronously. They are usually opened in different threads, that the operating system usually decides on. So the time that the loop takes to run is dependant on how much priority it is given
01-06-2011 04:23 AM
Hi,
I have a question concerning running two parallel loops when DAQ device is involved.
I have a few input channels, which are configured for sampling at fixed rate (it can be done before entering the while loops, since it's done for all channels).
Also, there are two counters, which I would like to output at DIFFERENT pulse rate. Right now, there is a while loop that includes one counter going high and low, sequentially, with the Start VI in the loop.
If I add another loop in parallel, calling to the second counter at a different rate (different points in time), can it work? Or will the fact that they address the same DAQ device cause failure?
Thanks a lot,
Michal
11-15-2018 04:37 AM
Hi mike,
I'm facing this exact situation right now, i'm doing daq for one second and insert those data into sql db only 5 mins once.
Current problem in my program is when i start running the program, daq takes place only once after that, daq paused next acquisition, and last data acquired is inserted into database at random speed.
Can you help me get out of this problem.
Thanks in advance
11-15-2018 05:44 AM - last edited on 08-19-2024 03:11 PM by Content Cleaner
@praveenrajk wrote:
I'm facing this exact situation right now,
You don't have parallel loops. Everything inside of that WHILE loop must complete before you can iterate again. So if you run into data base communication issues, everything will get slowed down. Look into using a Producer/Consumer. The idea is that you have one loop doing your acquisition and then another loop doing the processing on the data. This way the logging will not affect the acquisition.
11-15-2018 10:50 AM - edited 11-15-2018 11:35 AM
EDIT: sorry, I responded to the ancient post. did not see the date on it. It is usually better to start a new thread after such a long time...
@lordsathish wrote:
If there are two while loops in parallel, which do different operations...
...
i.e they will start a new ietration only after both of themhave finished the executing the
previous iteration...?
So why do you have two while loops then??? You get exactly the desired result if you combine the code from both loops into one single while loop, right? As soon as all code has finished, it will go to the next iteration... 😄 Nothing else needed.
11-16-2018 06:49 AM
I tired this technique but it quite hard to me, i'm missing something on code, can you help to get out of this problem.
My aim is to acquire data for time interval of 1 second once and insert those data into db for 5 sec once. I need only last sample of data to be inserted into db at period of 5 sec once.
Based on my knowledge i build producer consumer concept but it's not working.
Thanks in advance