Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing a series of samples to an analog output channel where each sample is written upon receiving a digital trigger

Solved!
Go to solution

Does anyone have any ideas on how to accomplish this? Currently my code writes out the entire series of samples(in a array) upon receiving a digital trigger using WriteMultiSample from the AnalogMultiChannelWriter Class. I would like to somehow write a single sample per trigger. I'm kind of new to using daqmx and I'm trying to accomplish this in c#. Thanks so much for any advice!

0 Kudos
Message 1 of 6
(2,027 Views)
Solution
Accepted by johndoe9758

I'm a LabVIEW guy and don't know any of the C# syntax.

 

But in terms of NI's DAQmx *terminology*, it sounds like you want to configure your task to use the external signal as a "sample clock" rather than as a "trigger".   Many common DAQ devices support this, some of the more specialized ones may not.  What DAQ device will you be using?

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 2 of 6
(2,010 Views)

Hi, Thanks so much for the response! That makes a lot of sense, does it work similar to an internal clock where I set the rate? Like will it automatically know to use the digital triggers to write each individual sample? My DAQ device is the PCIe-6374. Thanks again!

0 Kudos
Message 3 of 6
(2,006 Views)

I managed to get it working 😄 thanks again!

0 Kudos
Message 4 of 6
(1,989 Views)

Dear Kevin, 

I have a similar question as the thread, which application need to send a AO voltage when receiving a rising TTL signal. through your post I understand I was doing the task in a wrong way (seen the attachment). Would you like to help to give a simple example on "use the external signals as a "sample clock" rather than as a "trigger" ". 
Thanks in advance and sorry for such naïve question.

Hei L 

0 Kudos
Message 5 of 6
(1,830 Views)

The main thing I see is that you should write the whole buffer of AO values to your task *before* starting it.  That's the normal procedure in a buffered task with a sample clock.

 

Otherwise, it appears that you *are* using the counter output as your AO sample clock, at least according to your comments about PFI3.  I don't know your whole app, but I'd venture that you might not need to configure a trigger for your AO task.  You're using the same signal as the sample clock and you're (correctly) starting the AO task before the counter task.  That alone will probably do what you need.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 6 of 6
(1,786 Views)