Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

daqmx: Output analog signal and digital counter with varying frequency simultaneously

Solved!
Go to solution

Dear all,

 

DAQmx provides a nice API to output a sequence of samples to one or more analog outputs (DAQmxWriteAnalogF64) and digital counters (DAQmxWriteCtrTicks, DAQmxWriteCtrFreq). 

 

I'm am wondering whether this functionality can be used simultaneously, for instance to output a stream of analog samples at medium frequency (e.g. 10 Khz) along with a counter output, whose frequency varies over time (and which is at much higher frequency, e.g. 10 Mhz)? I wasn't able to find any examples that are included with the DAQmx development SDK that use such functionality.

 

Essentially I'm wondering whether the following is legal:

 

task = DAQmxCreateTask(..);

analog_out = DAQmxCreateAOVoltageChan(..);

counter_out = DAQmxCreateCOPulseChanFreq(..);

 

/* Write a sequence of analog samples */

DAQmxWriteAnalogF64(..);

 

/* Write a sequence of counter frequencies */

DAQmxWriteCtrFreq(..);

 

/* Now send everything to the device */

DAQmxStartTask(..).

 

Any suggestions or alternative methods would be greatly appreciated.

 

Best,
Wenzel

0 Kudos
Message 1 of 4
(3,337 Views)

Only a subset of DAQ boards support the ability to pre-define a buffer of varying frequencies for a counter to generate with precise hardware timing.   (An example of such support can be found in the popular X-series MIO boards.)

 

Most other boards with counters support changing a pulse train frequency on-the-fly (without stopping and making a gap in time with no pulses).  The instants when these changes occur are subject to the vagaries of software timing, though the pulses themselves retain precision hardware-controlled timing.

 

*No* boards support the notion of combining analog output and counter output as part of a single task.

 

Many boards support the possibility of *synchronizing* two distinct tasks that operate in parallel, one each for analog output and counter output.  Since you'd have one constant rate task and one variable rate task, you'd likely need to sync via Start Trigger.

 

So, what board(s) do you have for this app and what is the purpose of this simultaneous generation of a fixed-rate AO with a variable-rate CO?

 

 

-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 4
(3,320 Views)

I'm still trying to decide what DAQ device would fit the bill. I am currently considering the NI USB-6363 with BNC Termination. The application is to control a galvo-mirror (analog output) that redirects the output of a pulsed laser (counter output) to deliver varying amounts of energy to different locations on a surface.

 

Are there any API examples on how to specify a sequence of pulse frequencies and synchronize to analog output via a trigger? I'd like to know that this is really feasible before getting the necessary hardware.

0 Kudos
Message 3 of 4
(3,318 Views)
Solution
Accepted by topic author wjakob

Personally, I'm much more a fan of desktop PCIe boards than USB whenever an installation can accomodate it.  I expect you can do what you want with the USB-6363, but a desktop board will give you lower latency and higher bandwidth if you need it for future work.

 

I don't know your whole app, but you *might* find that the sync you really want can be accomplished by using the counter pulse train as the AO sample clock. 

 

I don't know that you'll find a shipping example that incorporates *all* the features at once.  Search the site here and you might get lucky, but otherwise you'll probably at least find examples where CO is generated with a pre-defined buffer and then other examples where AO and (a simpler kind of) CO are synced via start trigger.  It would then be pretty straightforward to merge the two.

 

 

-Kevin P

-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 4 of 4
(3,303 Views)