LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I simulate multiple channels?

OK, I think I figured out why I was confused.  The NI-DAQmx signal simulator uses the scale AND the min/max passed into the create channel VI.  The scale determines the allowable ranges for min and max (offset +- 10*slope).  The defaults for min/max are +- 5, no matter what the scale is.  I had been using a custom scale and used the default min/max assuming that they applied to the PRE-scaled values, not the scaled ones.  I see now in the help for the VI that min/max are for the scaled output.

 

It all makes sense to me now and I can generate the ranges of values for my app without resorting to the ugly simulator hack.  I'd still like to see (someday) a way to plug in a VI as a backend simulator for a NI-DAQmx devices (where a write in the sim VI sets the values for the app VI to read and vice versa).  Then I'd be able to do a much better job of testing a validating our models against reality.

 

Thanks everyone for your patience and help.

Keith.

 

0 Kudos
Message 11 of 12
(758 Views)

One clarification on simulated signals:

 

  • The signals always use the full range you enter, so if you pass in min -10 and max 3, the sine will be Vcc = 13, where the smallest value is -10 and the highest 3.
  • The given min and max values are settled by any given scale. So if you want to increase the min/max below/above -10/+10, you have to create a custom scale and pass that to the channel as seen as in my last screenshot.
  • The sine always displays a single period in your graph. This is true for values at "samples per channel" (default 1000) which are >= 10. Below 10, the sine is very misshaped and it may not cover a full period. This matches the suggestion from NI always to sample waveforms with a sample rate 10 times higher than the highest frequency in the signal.
  • If more than one channel is involved, due to the facts stated above, the signals are always the same frequency, but they can differ in amplitude. They always have a little shift in phase.
  • The MAX testpanel is not capable to set different min/max values for different channels even (many people don't know that) though you can acquire multiple channels in it. The channelname has to be entered like this in order to this: Dev1/ai0:3 (will acquire channel 0-3 in that order 0, 1, 2, 3, 0, 1, 2, 3, ....; the order is not very import though since DAQmx sorts the samples to the channels).


hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 12 of 12
(741 Views)