Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Simultaneous PWM and analog output from PCIe-6361

I need to drive an XY galvo and control the intensity of a laser with PWM. So the (X,Y,PWM) triplet must be synchronized. I've been using a Measurement Computing PCI-2517 card that has a 12MHz digital clock speed and 1MHz analog output, but if anlog output is enabled at the same time as a digital output, then the output frequency on both the digital and analog channels is limited to 1MHz. 

 

 I'd like resolution of the PWM to be be 100nsecs ie 10MHz. and the analog X,Y outputs should be at 1Mz. So the analog channels and PWM line are going at different rates... Can the PCIe-6361 do this? The hardware specs say "Yes", but are there any nasty surprises in the the actual implementation as with the Measurement Computing board?

0 Kudos
Message 1 of 4
(2,025 Views)

Shouldn't be any "nasty" surprises like you had with the MC board.  Specs for AI speed and Counter speed on NI's boards are independent of whether you're using both simultaneously.

 

The simplest way to sync up the tasks is by triggering both off a common signal.  They won't drift since both will derive their timing from a common internal board clock.

 

Now here's the tricky part:  while it's easy to change PWM on-the-fly, such an approach will depend on software timing.  It'll be impossible to correlate or predict exactly where within your XY map the PWM change will occur.

 

You've got 2 options to consider, both should be possible but not exactly trivial.

1. Pre-define the PWM specs alongside the predefined AO samples.  Use buffered pulse train output to generate it.  Each sample worth of low time and high time must represent the same total period.  I can't quite tell whether that'll be 1 microsec or 0.1 microsec for you.

2. Use software timing to occasionally change PWM duty cycle on a global basis, maybe once every few millisec max.  Then configure a counter input task that can measure the PWM while staying correlated to the AO sample clock.  Counter input tasks need to use an "Arm Start Trigger" found in the DAQmx Trigger property node rather than the standard "Start Trigger".

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW?
0 Kudos
Message 2 of 4
(1,990 Views)

Thanks Kevin,

We are already buffering the PWM. We produce a full PWM train and then stream out the precalculated (X,Y,PWM) coordinates list.....the minimum high time for us is 0.1microsec and the longest will be 39 microsec.

 

The issue with MCC board is that if you are doing digital and analog output canning you have to use a DaqOutScan function which limit the rate to 1MHz....the individual DoutScan goes at 12MHz and the AOutScan goes at 1MHz. 

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

Ok, sounds like you're already well on your way.  There must be some details I don't understand though b/c the straight reading of the numbers (variable 0.1 to 39 microsec high time for PWM, in a buffer that correlates to 1 MHz AO samples) doesn't match up straightforwardly.

 

Whatever the high and low times, the PWM *resolution* should be in the order of 10 nanosec because the timing derives from the 100 MHz internal timebase.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW?
0 Kudos
Message 4 of 4
(1,969 Views)