LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parallel loops & data logging

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?

 

Tuesday5_0-1631838222846.png

Full .vi is attached (missing some sub vi's) if that helps clearing things up.

 

Thanks for your input!

0 Kudos
Message 1 of 5
(1,330 Views)

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.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 5
(1,291 Views)

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.

0 Kudos
Message 3 of 5
(1,279 Views)

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.

 

Certified LabVIEW Architect
Message 4 of 5
(1,258 Views)

@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.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 5
(1,235 Views)