Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronized pulse generation using two counters

Hi, I am using a PCI-6221 multifunction DAQ board with Windows XP and Labview 7.1.

Need: I am doing photon counting luminescence measurements following optical excitation. I need to output separate but synchronized digital signals to control an excitation light, PMT gate, and data acquisition device. I need the timing to be accurate down to ~tens of microseconds range. I need to output a digital pulse that I can vary the duration of (from microseconds to seconds) to the excitation light. After that pulse I need to send digital high to the PMT gate and a trigger pulse to the data acquisition device.

SOLN: I have been trying to use the two counters on the 6221 board to generate two digital pulses but I am having trouble getting them synchronized accurately. I can make my system work with two controllable digital pulses, three would be nice but I only have two counters on this board.

Another option I have tried without success is to output a digital waveform that I would input from a file. Any help would be greatly appreciated.

Also, in the future I will need to synchronize these pulses with a analog output waveform.

Thanks,
Brian
0 Kudos
Message 1 of 4
(2,878 Views)
Hello Brian. Thank you for contacting National Instruments. LabVIEW has a great Example Finder that can help you with your solution. It can be found in the Help menu under Find Examples. To synchronize two counters I would generate two digital pulses with the same digital trigger. (Hardware Input and Output>>DAQmx>>Generate Digital Pulses) Since you have an M Series board, you also have the option of correlating your digital output with your analog output. There is a great example on ni.com that shows how to do this:

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=DD535427AB1D5A53E034080020E74861&p_node=201225&p_source=External

Since you want to do three digital outputs, you would set the source for all of the digital outputs to be the same analog output sample clock. Please let me know if you have any questions. Have a great day!

Marni S.
National Instruments
0 Kudos
Message 2 of 4
(2,857 Views)
Thanks thanks for the help Marni. I think I have got the synchronized digital output to work for my needs. I would like to mention that there is no example using more than one counter in my Labview version 7.1 (even though the example description for several of them says two counters). So I am still having trouble synchronizing the counters.

Follow up question. Any suggestion on how to import eight line (port) digital data type from a spreadsheet or text files to be output. For example I would like to create an eight column file in excell and then import it into labview to be output on eight digital lines. Thanks again.

Brian
0 Kudos
Message 3 of 4
(2,852 Views)
Dear Brian,

The example that I recommended only uses one counter. However, you can copy and paste the VIs so that there are two counters in the same program. Just make sure you specify the same digital trigger.

The easiest way to read your Excel file into LabVIEW is to save the Excel file as a Text (tab delimited) file and then use the Read From Spreadsheet File.vi to read in the data. Your data will be read in as a 2-D array. From here you can send your data to a digital port. Please let me know if you have any questions. Have a great day!

Marni S.
National Instruments
0 Kudos
Message 4 of 4
(2,831 Views)