How to Generate a single pulse using NI USB 6210 Matlab code?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Arkadeep Deb
am 24 Jan. 2024
Beantwortet: SAI SRUJAN
am 30 Jan. 2024
I have written a code as shown below: -
clear d;
clear;
clc;
p = 5e-3; % Period of the pulse train (in seconds)
clockFreq = 1/p; % Frequency of the pulse train (in Hz)
ton = 2.5e-3; % Pulse width for the first pulse (in seconds)
duty = ton/p;
d = daq("ni");
ch = addoutput(d,"Dev1","ctr0","PulseGeneration");
ch.Frequency = clockFreq;
ch.InitialDelay = 0;
ch.DutyCycle = duty;
d.Rate = 1/p;
start(d,"Continuous");
stop(d);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1599501/image.jpeg)
This is what I am getting. However, I only want one pulse to be generated.
Can anyone help me?
0 Kommentare
Akzeptierte Antwort
SAI SRUJAN
am 30 Jan. 2024
Hi Arkadeep,
I understand that you are trying to generate a single pulse using NI USB 6210 in MATLAB.
To achieve the generation of a single pulse with the NI USB 6210 using MATLAB, it is essential to properly configure the 'start' function parameters. Utilize either 'start(d, "Duration", span)' or 'start(d, "NumScans", span)' to initiate a finite background input acquisition based on a specified duration or number of scans.
For a comprehensive understanding of the 'start' function in MATLAB, please refer to the following documentation.
I hope this helps!
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Waveform Generation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!