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

조회 수: 3 (최근 30일)
Noah
Noah 2013년 10월 9일
편집: Noah 2013년 10월 9일
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?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by