Creates AI task object
obj = mdaqAITask()
This function creates AI task object which gathers all functions used for data acquisition from analog inputs. The function does not introduce new functionality, it wraps existing API into an object-like code and allows to write more readable and compact code. In order to get function list which can be used with object display its content.
The following calling convention applies:
obj.start(): Starts data acquisition - mdaqAIScanStart()
obj.init(): Initialize analog input data acquisistion - mdaqAIScanInit()
obj.read(): Read acquired data - mdaqAIScanRead()
obj.stop(): Stop data acquisition - mdaqAIScanStop()
obj.trigger(): Configure analog input start scan trigger - mdaqAIScanTrigger()
Acquire data from AI1 for one second with 1000 samples per second rate
ai = mdaqAITask(); ai.init(1, [-10, 10], %f, 1000, 1); ai.start(); data = ai.read(1000, 2); plot(data) | ![]() | ![]() |
Start data acquisition from AI1 analog input when DIO8 is high. Acquire data for one second with 1000 samples per second rate
ai = mdaqAITask(); ai.init(1, [-10, 10], %f, 1000, 1); ai.trigger("dioPattern", "xxxxxxx1"); ai.start(); data = ai.read(1000, 2); plot(data) | ![]() | ![]() |