07-25-2013 03:18 AM
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
07-25-2013 03:42 AM
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.
07-25-2013 03:54 AM
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
07-25-2013 06:24 AM - edited 07-25-2013 06:27 AM
Parallel loops are separated, like this:
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.