From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

timed loop

good morning to everyone!

I have to develop a program with LabVIEW to control a machine with rotating bending test.

the load on the load cell to be applied on the specimen under test is given by a pressure switch.

from the machine I can read the number of turns of the mandrel due to the acquisition card.

as the spindle rotates at 2800rpm counting laps on LabVIEW occurs only if the reading is done very quickly so between the properties of the DAQassistant I used:

Samples to read = 100

Rate [Hz] = 3.3k.

the problem now is to manage the pressure switch. In fact, I must try to do to get the pressure to a desired value of voltage on the specimen. I did this using a method of the percent error  so the pressure repeats until the error rate is zero. the problem is that working with the acquisition card

Samples to read = 100

Rate [Hz] = 3.3k.

the pressure switch fails to stabilize on a value but fluctuates. I saw instead that with the reading of 1 point per second the pressure converges to the desired value (but unfortunately can not count the number of revolutions of the spindle.)

so I have to use 2 timing conditions in my while loop. I have to acquire very quickly signals from the rpm counter  and contemporarily I have to give slowly signals to the pressure switch.

how to do? If I have to use a Timed Loop? I've never used it so clearer you are the better for me.

thank you in advance.

 

LV

0 Kudos
Message 1 of 4
(2,396 Views)

Either use two (timed) loops in parallel or place part of you code in a case structure that executes only at certain time intervals.

 

Placing a 2nd loop inside a loop will pause execution of the 1st loop untill 2nd loop finishes.

0 Kudos
Message 2 of 4
(2,386 Views)

thanks for your answer!

so I have to create 2 parallel timed loops? how to create parallel loops? it means 1st loop into the 2nd loop or it means 2 loops separated and connected?

I'm very new to labView and I've never used parallel loops or timed loops..

thanks in advance!

 

LV

0 Kudos
Message 3 of 4
(2,379 Views)

Parallel loops are separated, like this:

ParallelLoops.png

 

Do not wire outputs from one loop to an input of the other, this will cause the 2nd loop to wait on completion of the first.

Placing a loop within a loop will pause the outer loop untill the inner loop finishes.

Drag the above snippet int an empty VI and look at the loop speeds (flashers).

 

For more info on loops, I refer to the LabVIEW help & examples.

 

Hope this helps.

 

 

-- Edit -- : The snippet tool messed up the code a bit, I'll attach the VI.

0 Kudos
Message 4 of 4
(2,372 Views)