Reading data triggered by digital output

Hello,
I am an Igor newbie so pardon me in advance if this question seems trivial. I am currently using the NIDAQmx Pulse Train Generator with a NI 6229 board to drive a laser (BNC cable and PF01 digital pin). I would like to display the train of pulses that I am sending to IGOR since I have hooked up a photodiode to pick up these pulses(BNC). What is the easiest way to display the pulses of light that I am triggering through IGOR.
If you have a photodiode, then you must have a voltage somewhere corresponding to light intensity. Connect that output voltage from the photodiode to an analog input on your 6229 device, and use NIDAQ Tools MX to scan the input.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Thanks for the prompt reply. I tried using the NIDAQmxWaveScanProcs.ipf but I get an error saying names must start with a letter and contain letters,digits or " in this line SetVariable $CName, limits={-INF,INF,0}
Coincidentally, I also use a 6110 board and this doesn't bring up this error when I choose it over the 6229. Essentially I'd like to send a train of pulses with the pulse train generator and have igor display them; it doesn't necessarily have to be triggered.
I can't remember exactly how I set up the naming, but I do recall that it includes the device name. What is the name of your 6229 device, as shown in MAX? You may need to change it to something that plays better with Igor's naming. Try something like "NI6229".

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
You have not mentioned anything about the laser pulse width. If it is less than 100ns, you may run into bandwidth limitations from the maximum sampling rates of your NI cards in accurately displaying the stimulus pulse shape. The problem is worsened by the fact that the NI voltage inputs have high impedance, not well matched to typical short-pulse detectors with 50 Ohm ouput impedances. If a short-pulse laser stimulus creates a slower decaying experimental response, you are in better shape in detecting the response waveform.
epiphenom wrote:
but I get an error saying names must start with a letter


epiphenom wrote:
Right now the name is "1".


Sounds like you might want to rename the device.
The pulse width is on the order of milliseconds.
The board has been "1" for a while now and others have written scripts written that refer to it as that so I don't want to change it.

I am currently trying the 6110 board with this command
 DAQmx_CTR_OutputPulse /DEV="Dev2" /FREQ={50, 0.5}/NPLS=100 /OUT="/Dev2/PFI1" 1

but get an error :

Specified route cannot be satisfied, because the hardware does not support it.
Property: DAQmx_CO_Pulse_Term
Destination Device: Dev2
Destination Terminal: PFI1
Task Name: Dev2_CTR_1
Status Code: -89136
That error message means that you can't use PFI1 as the output for the counter on a 6110 device. On that device, you are only allowed to use GPCTR1_OUT or pin 40 as the output of counter 1. You shouldn't need to use /OUT because it will be connected already, since it is the only choice.

When you say the device name is "1", do you really mean literally "1", or is it "Dev1"? If it is literally "1", that could cause my code problems. l apologize, but that's a pretty uncommon name, and I didn't anticipate it!

But you seems to be writing your own code, so perhaps you could also write scanning code. You need the DAQmx_Scan operation.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
As John Weeks suggested, DAQmx_Scan is what you need. Here are some suggestions for the flag syntax to use (assuming you have, or have renamed, your board "dev1" and are using Counter 1):

/DEV="dev1"
/TRIG="/dev1/ctr1out"


With a little more effort, you can run in the /BKG mode and use /EOSH="my_scan_hook()" to optionally process or analyze the acquired wave on each scan with the hook function you create. Also, you can generate two output counters, with a delay between them, and Trigger your scan on the earlier counter and the laser on the later counter. This will let you get samples before the laser turns on, to fully capture the leading edge.
Thanks for all the suggestions so far.
In the 6110 I ran a cable between PFI13 and PFI0(split BNC) and connected the ouput BNC on an oscilloscope to see if I can manage to generate the traces.

I found that I was able to see the traces with this command:
 DAQmx_CTR_OutputPulse /DEV="Dev2" /FREQ={50, 0.5}/NPLS=100 /OUT="" 1

However, I'm having trouble telling Igor to start the traces when triggered on PFI0. I tried this :

 DAQmx_CTR_OutputPulse /DEV="Dev2" /FREQ={50, 0.5}/NPLS=100 /TRIG={ "/Dev2/PFI0"} /OUT="" 1

How can I go about triggering this? I've tried this but it doesn't work :

 fDAQmx_CTR_Start("/Dev2/pfi0",1)\

I would like to trigger PIN PFI13 on the 6110 board to generate the train of pulses I mentioned off of PFI0 on the 6229 board if possible.
epiphenom wrote:
I would like to trigger PIN PFI13 on the 6110 board to generate the train of pulses I mentioned off of PFI0 on the 6229 board if possible.

If you find it absolutely necessary to use both boards you should try communicating signals between them using the RTSI connections on the cards. As an example of typical syntax for labeling the RTSI connections:

DAQmx_CTR_outputPulse/MC={"/Dev1/RTSI7", 20e6}/DEV="dev1"/FREQ={50000,0.50}/NPLS=0 0

You should be able to do both the counter generation (pulse trigger to laser) and data acquisition (scan from sensor) from a single PCI-6110 without using any PFI pins. This assumes that your counter output(s) will be the master triggers to your apparatus and data acquisition. If this is not the case, posting a simple block diagram of what you want to accomplish would be helpful.


The reason I am using the digital pins to make the pulses is because I ultimately intend to use a simple USB NIDAQ board like the 6501;So this is, in effect, an exercise in characterizing the necessary commands that will be used to carry out what I described.
http://sine.ni.com/nips/cds/view/p/lang/en/nid/201630

Maybe it would be better to invest in a board with analog outputs to make this process easier.
http://sine.ni.com/nips/cds/view/p/lang/en/nid/201986
I don't know about the 6501 board, but on the PCI-6115 DIO is accomplished by using the operation DAQmx_DIO_Config() as in:

DAQmx_DIO_Config /DEV="Dev1" /CLK={GClockString,1} /DIR=1 /LGRP=0 /RPTC=1 /WAVE={wDIO}  "/dev1/port0/line0:7" GtaskNum = V_DAQmx_DIO_TaskNumber

to set up the DIO. Then perform the actual DIO signal generation using fDAQmx_DIO_Write(Device, TaskIndex, OutputValue)
Your posts have mixed together a bunch of different things: counters producing pulse trains, scanning analog inputs, and now DIO. Perhaps you should describe the ultimate goal, and we can help you figure out the best way to do it.

I applaud your effort to do simple things to learn before plowing into the full complexity of your eventual application. But you might need to investigate something else :)

I should caution you as well about the 6501 and 6008 devices: they do not support hardware-timed DIO. That may or may not be important to you; your posts to date suggest that you are investigating hardware-timed something or other.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Thanks again for all the comments. I 'm still trying to digest all the information.
What does the lack of the hardware-timed DIO prevent me from doing? Can I use this command below or would I have to find another source for the counter?
DAQmx_CTR_OutputPulse /DEV="Dev2" /FREQ={50, 0.5}/NPLS=100 /OUT="" 1
epiphenom wrote:
Thanks again for all the comments. I 'm still trying to digest all the information.
What does the lack of the hardware-timed DIO prevent me from doing? Can I use this command below or would I have to find another source for the counter?
DAQmx_CTR_OutputPulse /DEV="Dev2" /FREQ={50, 0.5}/NPLS=100 /OUT="" 1


That should be OK on most devices. At one point you mentioned the possibility of using a 6501 device- that has only one counter/timer, so you would have to use counter 0. That command uses counter 1. You also mentioned using a 6008 device. That one has a very limited counter that can only be used for counting digital edges; it cannot produce pulse trains.

My comment referred to digital I/O. That is simply inputs/outputs that can be set or read using digital voltage levels (hardware bits). Since you are talking about triggering and pulse trains, I thought it would be a good idea to mention the fact that the low-cost devices you were considering cannot do hardware-timed digital I/O.

It seems to me that you are confusing digital I/O ("DIO") with counter/timers producing pulse trains.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com