Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

NIDAQmx equivalent to SCAN_Start() & Gain settings

I have some questions regarding multiple sampling (sequential, not simultaneous) for a 6251 card we have ordered.
I am translating my Trad. NIDAQ code into DAQmx. I saw that you can assign different "gains" to multiple channels within a task by configuring the same task handle for different physical channels independently. However, there doesn't seem to be much information on the timing for sequential sampling that would result from this.
1. Do the channels get sampled in the order in which they are configured?
2. If you choose a particular internal timebase and rate with DAQmxCfgSampClkTiming, will the sequential channel sampling adhere to the same timing?
3. If the answer to (2) is no, then how does one choose the data format which includes timing information (Waveform format?)?
4. Is it possible to get unscaled integer output that still contains timing information?

I also had a question about the input range settings that have replaced gain settings. I think the 625x cards use bipolar ranges. If I use min/max values of, for example, 6.0V/10.0V, would the internal scaling use +/-10V range or a +/-2V range with some kind of offset?

Thanks in advance,

Tanaya
0 Kudos
Message 1 of 4
(5,114 Views)

Hi Tanaya,

 

  1. Yes, the channels are sampled in ascending order – ai0, ai1, ai2, etc.
  2. Yes, simultaneous sampling on an M Series device means that the samples are multiplexed before going into the ADC; while they are not actually simultaneously sampled, it is very close to simultaneous.  The sample rate must be the same for all channels of a particular task.
  3. You can still choose to read the data back in an array or Waveform type.
  4. I’m not sure what you mean on this one – what do you mean by unscaled integer?

 

The input range for that example would be +/-10V, so it wouldn’t choose a smaller range with an offset.  However, you could add some external circuitry to provide your own offset and then use a more appropriate range for your application.

 

I hope this helps!

 

Ed W.

0 Kudos
Message 2 of 4
(5,099 Views)
Hello Ed,

Thanks very much for the clarifications.

At the moment I am running into another question about doing the equivalent of SCAN_Start(): in my traditional NIDAQ code, I was able to configure the trigger, configure the scan, call SCAN_Start(), and then use a digital output channel to apply a pulse to my trigger circuit. This would turn on a light to a photodetector and hence trigger the actual scan.

Using the mx task flow (adapted from the examples) and function DAQmxReadBinaryI16(), the option to "set up" the scan and then go off to call a write function on "/port0/line0", for example, doesn't seem to work. Someone on the forums has mentioned that the analog read functions are blocking functions, but their programming platform was sufficiently different from mine that I couldn't decode the answer. Could you help?

(I've included a pared-down version of my code. The parameters and functions seem oddly chosen because they're in a derived class based on trad. NIDAQ.)

Thanks again,

Tanaya
0 Kudos
Message 3 of 4
(5,091 Views)

Hi Tanaya,

 

You can set up different scan lists by creating global channels that correspond with physical channels in your task.  The following Knowledge Base article addresses this issue.

 

Can I Sample One Channel Multiple Times Before Switching to the Next Channel In My DAQ Channel List?

 

However, rather than sampling the same channel multiple times, you would simply be changing the order of your sampled channels by using the global channels.

 

I hope this helps!

 

Ed W.

0 Kudos
Message 4 of 4
(5,046 Views)