From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a single hardware trigger for both Analog Input and Output on a PXIe-6361

I have been trying to set up this hardware trigger for the past couple weeks and i cannot seem to make it work. I am using a PXIe-6361 board to control an analog output voltage, which in turn controls the intensity of a laser, and I also want to read an analog input voltage coming from a detector which is proportional the intensity of the laser. I want to use a single hardware trigger to control the analog input and output. Basically, once the input voltage from the detector rises above 4V, i want the analog output to the laser to change to 0V, essentially killing the laser, and i want to read 200 samples from the detector in order to track the decay of the laser intensity.

 

I have tried looking at several examples and the closest ive come was using the "Multifunction Synchronization" found here: http://www.ni.com/white-paper/3615/en/#toc4

When i use this method, the analog input is read but i still get Error -200479 and the change to the analog output is not performed.

 

Any help would be appreciated

Thank You

0 Kudos
Message 1 of 3
(3,794 Views)

mleonte,

 

I believe the problem is that by default, the 1Chan 1Samp version DAQmx Write defaults the 'auto start' parameter to true.  Since this VI will start the task, your call to DAQmx Start Task is resulting in the -200479 you are seeing.  You can either set this parameter to false, or use the 1 Chan N samp version of write.

 

A few other things to take note of:

1) You set a buffer size of 2, but write only a single sample

2) the DAQmx Timing VI has a default value of 1000 for 'samples per channel'.  This means your AO task will attempt to output 1000 samples.

3).  You clear your AO task immediately after starting your AI task.  If you don't get a trigger almost simultaneously with your AI task starting, you will have cleared your AO task before you ever receive a trigger.  I would recommend you either use the error wire coming out of your AI Read, to sequence your AO's DAQmx Clear Task, or use the DAQmx Wait Until Done VI to ensure that your AO task completes before it is cleared.

 

Hope that helps,

Dan

0 Kudos
Message 2 of 3
(3,768 Views)

Thank you Dan, this has helpe a lot

0 Kudos
Message 3 of 3
(3,734 Views)