- Ensure that the baud rate, stop bits, and data bits match the specifications required by your VFD display.
- Some devices require a specific terminator (e.g., carriage return \r, newline \n, or both) to recognize the end of a command. Check if your VFD display requires this.
- Verify that the USB to RS-485 converter is installed correctly and that its settings are compatible with the VFD display.
serial communication to VFD displays
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
hi sir am trying to send serial data to the VFD Display (CU20045SCPB-T31A) through USB to RS-485 converter using following code
s=serial('COM3','Baudrate',19200)
set(s,'stopbits,1')
set(s,'databits',8)
fopen(s)
fwrite(s,'HELLO')
my objective is to receive HELLO in the display but am receving different sysmbols in the display....can u please help me
0 commentaires
Réponses (1)
Amish
le 13 Fév 2025
Hi Dinesh,
When sending serial data to a device like a VFD display through a USB to RS-485 converter, it's important to ensure that the serial communication settings match the requirements of both the converter and the display. If you're seeing different symbols instead of the expected text, it could be due to several reasons. Some of them are:
Based on some of my obersvation, I have slighlty modified your code. You may try running te same:
% Create a serial object and open it
s = serial('COM3', 'BaudRate', 19200, 'StopBits', 1, 'DataBits', 8);
fopen(s);
% Write data to the serial port
% If a terminator is needed, append it to the string
fwrite(s, 'HELLO'); % Try 'HELLO\n' or 'HELLO\r\n' if a terminator is required
fclose(s);
delete(s);
clear s;
Additonally, you can consider using a terminal program like PuTTY to manually send data to the VFD display. This can help determine if the issue is with the MATLAB code or elsewhere in the setup.
Hope this helps!
0 commentaires
Voir également
Catégories
En savoir plus sur MATLAB Compiler SDK dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!