Can I use the result of addchannel and addline to read and write to specific channels?

1 view (last 30 days)
For example:
AnalogIn = analoginput('mcc');
ChIn = addchannel(AnalogIn,1,'ChSignal');
DigitalOut = digitalio('mcc',0);
ChOut = addline(DigitalOut, 0, 'ChOut');
It would be great if I could read from ChIn and write to ChOut but everything I have read indicates that I have to use AnalogIn and Digital out directly like:
putvalue(DigitalOut,[1 0]);
data = getdata(AnalogIn);
I feel like there MUST be some way to do this with the dioline/aichannel objects (like ChIn and ChOut in my example) but I can't figure it out. I don't like using DigitalOut and Analog in because they obscure which pins I am referencing on my DAQ. Can I use the dioline/aichannel objects to read and write in a way that makes my code easier to read? If so, how?

Answers (0)

Categories

Find more on Simultaneous and Synchronized Operations in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!