USB Relay Board Numato - Sending Commands

조회 수: 10 (최근 30일)
Fabien Jammes
Fabien Jammes 2017년 11월 6일
답변: rasp pie 2017년 12월 16일
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 !

답변 (2개)

andrea balestrero
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.

rasp pie
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!!!!

카테고리

Help CenterFile Exchange에서 Software Development Tools에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by