Serial Communication command with carriage return and newline

4 views (last 30 days)
How to write the below statement that send command to serial port in visualbasic to MatLab?
Visual Basic: MSComm1.output = "POWER, OFF" & vbCrLf
below ways are tried but it seems not working (serial port had set up bfr this statement)
1) fwrite(ComHandle, 'POWER, ON')
2) fwrite(ComHandle, 'POWER, ON \r\n')
3) sc = strcat('POWER, ON' , char(13), char(10))
fwrite(ComHandle, sc)
none of them is working
what's going wrong on the above statement

Answers (0)

Categories

Find more on Language Fundamentals in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!