How to call putty directly from matlab and write script that I can write on putty to control an actuator (UV LED power) through USB?

40 visualizaciones (últimos 30 días)
To control the actuator (UV LED intensity) remotely using USB I need putty and write script. But the control signal should be based on some feedback information and it can be processed by MATLAB to get certain value. I know I can calibrate the feedback signal to analog or digital input using matlab. But my confusion is, how I can execute the calculated control signal from matlab to putty without automatically? Is that possible? if possible what code I should write in matlab to call putty directly. My problem is, the actuator I got only controlled through USB and remotely accessed by script written through putty.
Thank you in advance,
  1 comentario
Walter Roberson
Walter Roberson el 27 de Mayo de 2015
You are connecting via USB? Is it operating as a virtual serial port (COM port), or is it emulating a network layer such as TCP/IP with SSH?

Iniciar sesión para comentar.

Respuestas (1)

Dasharath Gulvady
Dasharath Gulvady el 28 de Mayo de 2015
You may be able to control the actuator without using PuTTY and directly from MATLAB.
There are few functions available on MATLAB Central which allow users to execute commands on remote machines from a MATLAB session using SSH.
Another alternative is to use plink as explanied below:
  1 comentario
Walter Roberson
Walter Roberson el 28 de Mayo de 2015
It is not very common to connect TCP/IP devices via USB, though it does happen. I say TCP/IP because ssh is a layer over TCP/IP, TCP port 22 typically. So if you are using putty for ssh purposes you can normally skip putty and use ssh over tcp directly from within MATLAB, such as is suggested at the links Dasharath posted.
But putty is also used for pure serial communications, as a terminal emulator. And if that is the use in this situation then ssh becomes irrelevant, and what becomes relevant is just fopen()'ing the COM port and using fread() and fprintf() and fgetl() and the like to talk to the resulting virtual serial port. USB devices emulating serial ports are common.

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by