Reading data triggered by digital output
epiphenom
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.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
August 21, 2012 at 12:44 pm - Permalink
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.
August 21, 2012 at 01:47 pm - Permalink
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
August 21, 2012 at 03:13 pm - Permalink
August 21, 2012 at 07:57 pm - Permalink
August 22, 2012 at 05:11 am - Permalink
Sounds like you might want to rename the device.
August 22, 2012 at 06:50 am - Permalink
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
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
August 22, 2012 at 09:30 am - Permalink
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
August 22, 2012 at 09:52 am - Permalink
/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.August 22, 2012 at 11:33 am - Permalink
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.
August 22, 2012 at 02:27 pm - Permalink
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.
August 23, 2012 at 03:20 am - Permalink
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
August 23, 2012 at 09:41 am - Permalink
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)
August 23, 2012 at 10:10 am - Permalink
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
August 23, 2012 at 01:39 pm - Permalink
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
August 24, 2012 at 10:51 am - Permalink
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
August 27, 2012 at 09:55 am - Permalink