09-21-2018 10:04 AM
Hi All,
I'm working on a project where I wont have the physical hardware available for a while. But I know exactly what my incoming data is going to look like. I'll be making some current measurements through a NI 9203 and I have a simulated cDAQ setup in MAX with all my modules in it. The simulated device is working fine for debugging and letting my code run through but by default the simulated device only registers a sine wave. Is there a way I can control what the simulated device outputs? Perhaps turn a dial and have it output a corresponding signal between 4-20mA?
Any help will be greatly appreciated!
09-21-2018 10:47 AM
09-21-2018 10:53 AM
Nope. But please go give this idea a kudo: Interactive DAQmx simulation interface
09-21-2018 01:00 PM
I'd love to Kudo it but it won't let me 😞
09-21-2018 01:35 PM
As a general note to make it so you don't have to add too much else to your code, you should know that you can check whether a DAQmx device is simulated.
Before running the "read" code, drop down a DAQmx Device property node (found in the palettes under "Measurement I/O → NI-DAQmx → Advanced → System Setup → Device Node"). Pull it down so there are two properties visible. The first one should be "Active device" as an input and the second is "Device is simulated" as an output. Wire in your device reference to the first node, and then with the Boolean output from the second property, use that to have your program do "something different" when it's True to output what your data should look like.
Doing it this way is much easier than trying to run a "simulation?" wire everywhere throughout all of your VIs and subVIs, or adding globals everywhere.
09-22-2018 12:29 PM
Kyle,
A very clever idea, get MAX to tell you whether or not you have a Real or Simulated device connected.
Often, when I'm doing development with fairly low-speed DAQ devices (1kHz samples, say), I have a Constant (sometimes a Global) called "Simulated" that either does, for example, a 1000-point DAQmx Read (if False) or generates 1000 numbers + a 1000 ms Wait (if True). But then I have to remember to "flip the switch" ...
Bob Schor