LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

timing

Hello everyone!

I have a problem with my LabView program.

I have a while loop in which I have a DAQ Assistant who has a Samples to read = 100 and a Rate [Hz] = 3.3k then collects a lot of data in a short time.This why I included a counter to detect the number of rpm of the mandrel which swings very quickly.

also in this while loop  I must command a pressure switch which, however, high processing speed does not converge to the desired pressure value but fluctuates a lot, whereas at low speed converges to the desired value (while the tachometer does not work).

I wanted to find out how, within the same cycle, be able to work the DAQ assistant and pressure to two different rates? I have to use timers? what?

attached screennshot the program.

thanks in advance

 

LV

 

 

Download All
0 Kudos
Message 1 of 4
(2,316 Views)

Can't you split the code into two parrallel loops with different speeds?

 

Or...

You can put some of your code in a case structure that will only execute whenever x amount of time has passed.

 

Here's an example of a while loop that executes every 100ms with a case that executes every 1000 ms:

TimedTrigger.png

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

Hi Lucavilla,


Your while loop seem to be very huge!
I see many parts of your while loop they are executed in parallel. You should link the error clusters of your express VIs in order to control the dataflow.
You should be careful with using local variables. I saw that you have many writers for the same variable so it is possible you have some race conditions.


For your application, Express VIs are not recommended.


I was wondering at what rate you want to control your pressure switch.
Could you tell me as well what DAQ device do you use?


With those information I will give you some sample code sample in order to build a well-organised application Smiley Happy  

 

Alexandre
0 Kudos
Message 3 of 4
(2,260 Views)

I try to explain better.

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.

I use a NI-USB 6008

thank you in advance.

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