Hey everyone, I am working on controlling current sent to a pair of Helmholtz coils through Matlab with Data Acquisition Toolbox. Looking at related documentation, I was able to generate code that would queue desired signal to NI DAQ device and sustain it but what I want to do is the flexibility of changing the current I send to the device whenever desired. When the data queued with queueOutputData() is finished, the program seems to queue back whatever is in the listener. I actually want it to continue with whatever I queued until I change it and if I change it I want to continue with that. Do I have to update the listener and if so how can I do that? Also, I understand that when I queue a certain signal, I can't cancel it and replace with another signal before it's processed. Is there any way I can overcome it? Below I share the part of the code that generates desired signal, initiates a listener and queues some output data.
s.Rate = 20000;
lh=addlistener(s,'DataRequired', @(src, event) src.queueOutputData([out1_signal]));