daq.IsContinuous is not continuous

11 visualizaciones (últimos 30 días)
Aiveen
Aiveen el 6 de Ag. de 2014
Respondida: Ann Soniya m micheal el 23 de Nov. de 2021
If s.IsContinuous is set to true or to false, there is no difference in my results. The code does not seem to carry out the task of s.IsContinuous = true. It registers that I have set it to true, it just does not follow. It will only output the signal once. I am outputting an analog signal and read it off an oscilloscope.
My aim is to allow the square wave to run until I stop it as I require it for varying lengths of time. It is impractical to have to define the number of square waves using queueOutputData each time due to the varying number of waves necessary and it will also involve very large numbers.
I would appreciate any help.
I am using Matlab 2013a and NI 9269, below I show the simple code and Matlab's response.
Many thanks, Aiveen
CODE:
s=daq.createSession('ni');
s.addAnalogOutputChannel('cDAQ9181-1980EF4Mod1','ao0','Voltage');
s.Rate=25;
s.IsContinuous = true
s.queueOutputData(repmat([0 1],1,12).');
s.startBackground;
Also tried for s.queueOutputData(10*sin(linspace(0,2*pi,1000)).');
REPLY:
EDU>> ni6929_step1
s =
Data acquisition session using National Instruments hardware:
Will run continuously at 25 scans/second until stopped.
Number of channels: 1
index Type Device Channel MeasurementType Range Name
----- ---- -------------------- ------- --------------- ---------------- ----
1 ao cDAQ9181-1980EF4Mod1 ao0 Voltage (Diff) -10 to +10 Volts
Properties, Methods, Events
s.startBackground;

Respuestas (2)

Julian
Julian el 23 de Nov. de 2016
You need a listener to run continuous background generation. If you're still interested in a solution, or to whom it may concern, there is a example by mathworks:
Maybe, someone working on a similar problem can tell me, if using listeners can put slightly delays into the signal output of the NI Device (during re-buffering the signal for example).

Ann Soniya m micheal
Ann Soniya m micheal el 23 de Nov. de 2021
In legacy, can try
start(d,"Continuous"); to make it continuous.
In session try s.startBackground('continuous'); to make the back ground task continuous and stop the execution by deleting the listener

Categorías

Más información sobre Analog Input and Output en Help Center y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by