LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I start a loop before the DAQ Assistand outputs a value?

Hi everybody,

 

I created a VI (See attachment) to Measure the speed of a turning wheel. (A optical detector outputs pulses which are proportional to the speed) The DAQ Assistant measures the frequency and the values are written to a log file. To log every 100 ms the value into the table, there is a while loop with should be executet 10 times a second.

 

The first question:

I want to start measurement as soon as I press "RUN". In fact, my VI first begins to run and log data when the wheel turns and the frequency is not "0". But I want to log data too, if the speed is "0". How can I programm that in Labview?

 

The second problem:

Labview writes not continuely the values: Sometimes 7 values a second, sometimes 11 values.... (I can see that because i log the time too). But if the programm runs for some seconds its getting better and better.

 

How can I force Labview to run the loop exactly tacted? Is my Computer too slow? Or is my method to log continuely data simply wrong? I am relative new in Labview and would be thankful in getting help.

 

Markus

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

I would say right off hand from what you describe that the issue is not related to computer speed, but choice of operating system. Windows is not a deterministic operating system - this means you can't count on how long it will take to do anything.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 4
(2,315 Views)

The problem you are seeing is with the DAQmx. 

If there are NO pulses from your detector, the only thing DAQmx can do is sit a wait until 1) there comes a pulse or 2) it times out.

The number of times you are able to log is determent by how offend the pulses are coming.

If there are nearly no pulses, DAQmx has a hard time calculating the frequency, and therefore you can't log that offend.

 

The only two things I know how to get around this is:

  1. the wheel has to spin all the time
  2. Change to a real-time / FPGA solution
0 Kudos
Message 3 of 4
(2,309 Views)

Ok I understand what the problem is. Anyway I hope there is a solution for this problem. Buying new hardware with FPGA or turning the wheel continuely is not a practicable option for me.

 

Is it not possible to count the pulses for lets say 100 ms and devide this through a time constant. If the speed is 0, we would devide 0/time constant, the result would be also "0" which could be written into the table. (I want to measure some other things paraleel and log data, but the loop interrupts all the time, when speed is 0)

 

How could I programm that in LabView? Is there a example programm? (I am new to LabView)

 

Thank you very much again, Markus

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