USB Relay Board Numato - Sending Commands
조회 수: 10 (최근 30일)
이전 댓글 표시
Dear all,
For our experimental setups, we have been using USB relay modules from Numato and use LabView to send the commands. It works fine. I would like to implement it in Matlab for my project. While I can connect to the device, writing the command 'relay on 1', to activate the first relay, does not work.
For instance:
obj = serial('COM8');
fopen(obj);
fprintf(obj,'relay on 1');
The code works but nothing happens. I wonder if I need to create a VISA for this, as in LabView the functions used are 'VISA write'. But if it is the case I don't know how to do it...
Thanks for your help !
댓글 수: 0
답변 (2개)
andrea balestrero
2017년 12월 4일
Hi, try to change the terminator parameter of the obj structure: obj.Terminator = 'CR' instead of 'LF', which should be the default one.
댓글 수: 0
rasp pie
2017년 12월 16일
Hi, To control the relay through serial you will need to define the serial comm parameters. I have used this relay board ncd.io USB Relay Board with this matlab example code Matlab USB Relay example You will need to change the command vales to make it work with your relay board. Hope this helps. Cheers!!!!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Software Development Tools에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!