LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

continuously show counter data

Solved!
Go to solution

Hello everyone,

 

I need help in collecting the data from a counter input. I have a flow sensor that creates a frequency output up to 600 Hz. I connected it to one counter input on my DAQ device, and in Labview I connected the DAQ assistant to a waveform graph in a while-loop. When I run it, it runs till it is out of samples and then gives error 200284 and then shows the frequency over time on the graph. 

 

However, I would like to see the frequency over time in real time on the graph while it runs, and I also want to have it run continuously until I hit the stop button. Can someone explain how this is done?

 

Best regards,

Allard

0 Kudos
Message 1 of 6
(3,196 Views)

Allard,

 

it would help if you post what you currently have.

I fear that you configured a finite acquisition in the DAQ Assistent, which is not capable to do what you want.

You might want to dig into DAQmx and review examples to understand how to implement contiuous acquisitions which can provide the feature you are looking for...

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 6
(3,187 Views)

Attached is the file of what I currently have. In the same file I also tried to get it to work with DAQmx based on some examples I found, but I have no idea how to get it working.

 

Allard

0 Kudos
Message 3 of 6
(3,167 Views)

Hello Allard171,

 

Have you managed to get your application to work? Could you specify what issues are you having? 

 

Cheers,

Mikko

0 Kudos
Message 4 of 6
(3,100 Views)
Solution
Accepted by topic author Allard171

Allard,

 

you stop the acquistion in the loop. Hence you will acquire a single package (of 1000 samples) and then finish acquisition. After this, the loop runs without delay creating 100% CPU load on one core and essentially doing nothing except waiting for the stop button to be pressed.

Learn about shift registers to store the task and put the Stop Task outside the loop. In the loop, modify the stop terminal of the loop itself to stop if the stop button was pressed OR if an error in acquisition occurred.

 

Your current implementation will wait for 1000 samples and display this in the graph. The next update will completely replace the old plot. Depending on the speed of acquisition, you will get this behavior (@600Hz about once per 2 seconds). You can do the following:

  • Reduce number of samples to e.g. 100
  • Use a Waveform Chart instead of Waveform Graph (to have "history")

       or

 

  • Implement a ring buffer using a shift register to update a Waveform Graph similar to a Chart

 

Norbert

 

 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 6
(3,089 Views)

Thanks for the help!

 

I now use a single sample on demand in a while loop, and there are no issues anymore.

Also, the waveform chart was indeed what I was looking for.

0 Kudos
Message 6 of 6
(3,047 Views)