09-16-2021 07:25 PM
Hi all,
I am new to labview and to this forum. If my questions have been answered before, or if there is a better spot to post them, please let me know.
I am logging some load bridges and displacement values to calculate density changes with increasing normal loads. Normal load values are then sent to a PLC via modbus for control purposes. I have some questions around speeding it up and parallel loops in particular. In the concept image below, would my logging loop and processing loop run in parallel or am I killing that functionality with Loop 1?
Full .vi is attached (missing some sub vi's) if that helps clearing things up.
Thanks for your input!
09-16-2021 11:38 PM - edited 09-16-2021 11:43 PM
That wont work because a Queue can have many Enqueue but only have one Dequeue.
You basically have a race condition because once you dequeue an element from the queue it's gone.
So the first loop to dequeue gets it but the other loop will never see it.
09-17-2021 12:04 AM
Thanks for the pointer. I am currently enqueueing in the logging loop and dequeueing in the processing loop. That part works fine, am I missing anything there? Mostly I am not sure if my loops can run in parallel, and if not how to create parallel loops that can be called multiple times.
09-17-2021
05:53 AM
- last edited on
03-20-2025
02:47 PM
by
Content Cleaner
These are pretty basic and generic questions. If you post your actual code we can give more specific answers.
Whenever I need to send data between parallel loops, I nowadays do something like this. More on Channel wires here.
09-17-2021 09:08 AM
@Epictitus wrote:
Thanks for the pointer. I am currently enqueueing in the logging loop and dequeuing in the processing loop. That part works fine, am I missing anything there? Mostly I am not sure if my loops can run in parallel, and if not how to create parallel loops that can be called multiple times.
Well... In your concept it looked like you were splitting a Queue and sending it to two Consumer loops. That won't work because of the reason I gave.
I have found that I can combine my processing, logging, and display into one loop. Who cares if the logging gets behind?
I took a quick peak at your code and I think your architecture is not good and adding more parallel loops is not going to fix it.