LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Number of pulses generated by counter?

I am using a counter to generate a simple pulse train (aka see here).

 

Is there a way to query the counter (via LabVIEW) to see how many pulses have been generated (while executing)?

 

For example, if I am doing a DO task, I can use the DAQmsx Write property noed to query for TotalSamplesPerChannelGenerated to count how many point have been written.  Is there anything similar for a counter?  I want to know because the device which is receiving the pulse appears to be missing some of the pulses.  And I want to double-check.

http://www.medicollector.com
0 Kudos
Message 1 of 4
(3,578 Views)

Using the DAQmx counter functions in LabVIEW will allow you to find out how many pulses the counter received.  Use the DAQ Assistant to set it up.

 

Note that for the counter to count the pulse, it must meet the input criterion for your hardware.  If the pulse is attenuated, too short, too high a frequency, etc, it could be missed.

 

If this does not help, please tell us what hardware you are using and post your software so we can take a look.

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

A few things to clarify:

 

I am generating a repetive pulse train.  Not measuring one.  It is a very simple pulse used to trigger the shutter on a firewire camera.  For example,  If I want the camera to record at 50 frames per second, my pulse will be high for 1 ms and low for 19 ms.  That is basically a 50 Hz pulse with a high-time of 1 ms.

 

Challenge:  I just want to be able to know (from LabVIEW) how many pulses have been sent.  If I were doing this using a DO task, it would be easy.  I could use the TotalSamplesPerChannelGenerated property.  But I do not find anything similar using the counter. 

 

Hardware = X-Series USB-6351

Software = LV2011 64bit on Win7 64bit with DAQmx9.3.5

 

http://www.medicollector.com
Message 3 of 4
(3,562 Views)

I do not believe there is such a property for counters (using non-buffered generation).  If you're using buffered generation, you can probably query DAQmxWritePropertyNode->Status->TotalSamplesPerChannelGenerated.  Note, I believe this will return the number of samples that have been transferred from the host computer to the device, which would include samples that were in the device's FIFO which have not yet been output.  If you have an unused counter, you could certainly use one counter to count edges on another.  This can be done without any external connections by setting the DAQmxChannelPropertyNode->CountEdges->InputTerminal to /DevX/CtrYInternalOutput, where Y is the counter performing pulse generation.

 

Hope that helps,

Dan

Message 4 of 4
(3,555 Views)