Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with external trigger to analog output

Hello,

 

I have the USB-6341 board and NI-DAQmx driver. 

I hope someone can give me an example about what I am trying to do using C#.

 

I want to increase one of the analog output from -10V up to +10V in such a way that each time the board receives external trigger it will increase the analog voltage 100mV. And after M times(when the output voltage becomes 10V) analog output again should go back to -10V. I would be very glad.

 

Can someone show me an implementation of this?

 

Kind regards

0 Kudos
Message 1 of 7
(1,171 Views)

I can give you an idea instead of implementation.

 

  1. Use the external trigger signal as a sample clock and use rising edge
  2. Load an array of values -10V to +10V at 100mV steps to AO. Wire the array size as the samples per channel count.
  3. Start the task
  4. Every time DAQ gets trigger edge, it will auto iterate to the next sample in the array.
  5. Once it reaches the +10V element of the array, next time it will wrap back to -10V due to the default regenerate property of DAQmx task
Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 7
(1,168 Views)

Thank you for the procedure. I guess you use  LabView. Maybe someone else show how to implement it in C# syntax. Thanks

0 Kudos
Message 3 of 7
(1,163 Views)

Hello again,

 

Can this be done with USB-6003 as well

https://www.ni.com/da-dk/support/model.usb-6003.html

0 Kudos
Message 4 of 7
(1,107 Views)

Unfortunately, you CANNOT use an external signal as a timebase/sample clock for USB-6003

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 5 of 7
(1,102 Views)

Thank you. I will go for 6341 then. You described a procedure for the original question and I need to increase one of the analog output in staircase way where for each external trigger rising edge from an external clock source(20kHz) cause analog output to increase 20mV.

 

So I saw two examples in under NI-DAQ\Examples\DotNET4.5\Analog Out\

 

One of them is: ContGenVoltageWfm_ExtClk

 

The other one: ContGenVoltageWfm_ExtClkDigStart

 

Which one should I use do you think? And those examples using sine wave as output. In my case I need DC analog output at each step.

Do you have any idea about it? 

0 Kudos
Message 6 of 7
(1,094 Views)

ContGenVoltageWfm_ExtClk would be the right example and replace the sine wave array with your ramp waveform array.

 

Wire your external trigger/clock to one of the PFI ports and select that PFI port as the Clock source in the UI/program.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 7 of 7
(1,072 Views)