Question

NI-DAQmx has a "simulated driver" feature. In the case of an AI, the returned signal is a noisy sine. Is it possible somehow to change this behavior in order to have any type of the signal?

And if not, are there some alternatives to simulate hardware?

Was it helpful?

Solution

I do not think it is possible to control the signal returned on a simulated device. A DAQmx simulated device is intended to allow you to check your data acquisition code works without having to have the actual hardware present as part of the development process.

If you need to provide a simulation of hardware with real data then using LabVIEW you could provide a vi that calculates (or load in) the required signal and passes this out to the main program. I have used this approach to provide a repeatable test for debugging by running the actual hardware and logging real data to a file then re-running the test with real data.

OTHER TIPS

The simulated devices output a sine wave with a frequency proportional to the sample rate specified. I believe the amplitude is also set to the range of the input voltage specified in the task.

If you want to input an arbitrary signal and make sure it is receive correctly through DaqMx then you could always use the Analog Out function of your hardware to generate a signal, then hook that output to the input you wish to test.

This has the added benefit of getting to test the DaqMx interface rather than just testing the data processing in your application.

As it is not possible to change behavior of simulated NI-DAQmx device, the best way is to use HAL - hardware abstraction layer - in your applications. Then, you could programm abstract classes for your device, and create behavior which you need. HAL approach has a lot of benefits, because it separates software from real hardware, and allows nicely and easily to modify hardware-related code, without touching main, core logic of the application.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top