Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Queue digital analog Matlab

I am using Matlab 2019b with a NI DAQ6363 and cannot queue output data using both analog and digital outputs simultaneously. I am passing the daq  a file called "trial_sequence" with a matrix called flicker_info of 3 columns vectors of 0's and 1's, one column per channel. OutputSinglescan does not work for this application because the rewardpump attached to the digital channels requires a sead 100ms of signal from the ttl pulse. Any suggestions would be appreciated. 

    clear; clc;    %clear everything
    timeStarted = cputime;
    daqreset; %reset DAQ
    session_info = daq.createSession('ni');
    session_info.IsContinuous = true; %for continuous background
    sample_rate = 100000; %sample rate is 100k
    session_info.Rate = sample_rate; %pass the sample rate to the DAQ    
    addAnalogOutputChannel(session_info,'Dev1', [2 3], 'Voltage'); %AO2sound, AO3 for LEDs
   
    % add rewardpump channel where input 0 = off, 1 = 1
    addDigitalChannel(session_info,'Dev1','Port0/Line1', 'OutputOnly');


    filename = 'trial_sequence.mat';
    load(filename);
    queueOutputData(session_info, flicker_info);
    session_info.startBackground();

 

0 Kudos
Message 1 of 1
(2,032 Views)