Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I synchronize an event in LabVIEW with an output counter?

I am outputting a counter through a DAQ which controls an external piece of hardware. I have another device which is controlled through a serial port, and I want to synchronize the timiong between these two devices. Is there a way to synchronize a labview event - in this case sending a serial command - to an output timer? Any help would be appreciated and I can provide more information if anything is not clear. Thanks!
0 Kudos
Message 1 of 7
(5,101 Views)
Hi Sobriquet,

As far as synchronizing a hardware output signal with other software function calls, the best way that I can recommend is using the Timed Loop structure in LabVIEW.  By using the DAQmx Create Timing Source.vi, you can configure the counter output to be used as the signal for iterating the loop.  In the block diagram screenshot below, a continuous pulse train is generated on counter 0 at a specified frequency.  I hope this helps.



Regards,
Andrew W
National Instruments

Message Edited by TheWoost on 04-16-2007 03:35 PM

Message 2 of 7
(5,083 Views)
Thanks for the help, I think this will work. However, I can't seem to get the counter working using the DAQmx vi's. Another version of the code works (without any synchronization) using the generate_pulse_train.vi from the Traditional DAQ vi's. Also, the counter works in the M&A explorer without a problem. Any idea why the CO Pulse Freq wouldn't work?
0 Kudos
Message 3 of 7
(5,056 Views)
Hi,

It sounds like your board may not be supported by the DAQmx driver.  If this is the case, there is no equivalent Traditional NI-DAQ VI for creating a timing source to use for the timed loop structure.  What device are you using?  To check driver compatibility for your device, you can check out the driver support page here.

Regards,
Andrew
0 Kudos
Message 4 of 7
(5,025 Views)
I am not sure, but I think it is an NI 6602 - I can't check until I'm back in the lab. However, I mentioned that the counter seems to work if I start it through the M&A Explorer, but I should clarify that it works this way using both Traditional and DAQmx drivers. Also, we are using a digital line output DAQmx vi and it works perfectly. Is there anything else I could be doing wrong to make the CO Pulse Freq not work?

If it turns out my DAQ is not compatible with the DAQmx drivers, do you have another suggestion for synchronizing these event?

Thank you again for all the help!
0 Kudos
Message 5 of 7
(5,024 Views)
Hi,

The 6602 is supported by the NI-DAQmx drivers.  You say that you are able to generate a pulse train using DAQmx in MAX with no problem, so I would expect that using the LabVIEW VIs for this functionality would not cause you problems either.  Can you try running the shipping example "Gen Dig Pulse Train-Continuous.vi" in the NI Example Finder and let us know the results you see?  You can find this by going to Help>>Find Examples and then browsing in Hardware Input and Output>>DAQmx>>Generating Digital Pulses.

Regards,
Andrew
0 Kudos
Message 6 of 7
(5,006 Views)
Thank you! After looking at the example I was able to get everything working.
0 Kudos
Message 7 of 7
(4,989 Views)