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?
22 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commento
Walter Roberson
il 27 Mag 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?
Risposte (1)
Dasharath Gulvady
il 28 Mag 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.
Please find the functions at the following links: http://www.mathworks.com/matlabcentral/fileexchange/27999-ssh-from-matlab-updated-+-sftpscp
Another alternative is to use plink as explanied below: http://www.mathworks.com/matlabcentral/answers/20353-controling-putty-through-matlab
1 Commento
Walter Roberson
il 28 Mag 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.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!