How to remove time gaps between subsequent 'readwrite'?

I would like to generate signals for two channels. These signals should be alternatives. That is, if one signal is on, the another should be off.
To do it, I made the below code.
addoutput(dq, "dev1", 1:2, "voltage")
data = readwrite(dq, scandata1, 'OutputFormat', 'Matrix');
removechannel(dq, 3)
addoutput(dq, "dev1", "ao1", "voltage")
data1 = readwrite(dq, scandata2, 'OutputFormat', 'Matrix');
But, the problem was a time gap due to 'removechannel' and another 'addoutput'.
Could you give some advice on it?

4 Comments

Is it necessary that the voltage be free-floating during the time of no signal, or could you instead drive it to a particular value (say 0) ? So emit (say) 0 on the channel not in use (and discard any data), and emit appropriate data on the channel that is in use ?
Hello Walter, Thank you very much for your reply. The voltage should be free-floating during the time of no signal. In order to do it, I filled 'NaN', but it was not working.
Now, I am doing an experiment with muscle. One channel is for length and another is for force. We would like to control length and then to control force. While controlling length, we want to see how force changes and then vice versa. Therefore, I think it should be free-floating.
In the force case, force 0 should work instead of having it free-floating, except in the case where the accutator can detect free-floating.
The length case is less clear to me.
Is there any way to make matrix for free-floating when we make 'scandata' for 'analog output' channels? 'NaN' was not working for it.

Sign in to comment.

Answers (0)

Categories

Tags

Asked:

on 2 Sep 2020

Commented:

on 2 Sep 2020

Community Treasure Hunt

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

Start Hunting!