I am using MATLAB to change the values of my NIDAQ's digital outputs. The outputs are sent to the digital input of another device where they are recorded. Whenever the value of one of the output lines changes, the output lines defined in another fuction reset to 0.
I add 2 lines for a trigger using a function that contains the following code:
dio = digitalio('nidaq', 'Dev1');
trigger = addline(dio,13,0,'out'); % Port 0, Line 13
putvalue(trigger,0); % Reset trigger to start with
triggerAuto = addline(dio,4,0,'out'); % Port 0, Line 4
putvalue(triggerAuto,0); % Reset trigger to start with
Another function adds a line for an output that will send TTL pulses to a pump:
vr.dio = digitalio('nidaq','dev1');
vr.pump = addline(vr.dio,1,0,'out'); % port 0. line1
start(vr.dio);
putvalue(vr.pump,1); %
For example, if later the value of trigger is set to 1 ( putvalue(trigger,1); ) then the output signal of vr.pump will reset to zero. The MATLAB variable of vr.pump still shows "1" however my recording device shows that the output went down to zero.
Liekwise, if the value of vr.pump is changed using the putvalue function, then the output of trigger and triggerAuto will reset to zero (if they were not already at zero).
How can I change the value of one output line without resetting the output values of other output lines?
Thanks. Let me know if you want me to clarify anything further.