Controlling LCVR controller box by Matlab

2 visualizaciones (últimos 30 días)
Van Lam
Van Lam el 4 de En. de 2021
Respondida: Pratyush el 13 de Feb. de 2024
Hi All,
I would like to use Matlab to control the LCC25 box from Thorslab using "serialport" function. I wonder if anyone has experiences in this set up. I am very appreciated if you can spare sometimes sharing with me.
Van

Respuestas (1)

Pratyush
Pratyush el 13 de Feb. de 2024
Hi Van,
To control a Thorlabs LCC25 box in MATLAB using the "serialport" function:
Determine the correct COM port and communication settings (baud rate, data bits, stop bits, parity) from the LCC25 manual.
Establish Connection
port = "COM3"; % Replace with your COM port
baudrate = 115200; % Replace with the correct baud rate
serialObj = serialport(port, baudrate);
% Configure settings as needed
Send Commands and Read Responses
command = "your_command_here"; % Replace with LCC25 command
write(serialObj, command, "string");
response = readline(serialObj);
Close Connection
delete(serialObj);
clear serialObj;
Ensure you replace placeholders with actual commands and settings for the LCC25. Always refer to the device manual for accurate command syntax and communication settings.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by