Sending <ESC> T over Serial port to Scale
16 views (last 30 days)
Show older comments
Hello dear community,
I have a scale from the company Sartorius. My task is to send commands to the scale, to get the weigth back or to tare the scale.
In the scale-menu I can choose between different modes: "SBI" (Standard-Sartorius Protocol), "SCIS" (another Sartorius Protocol) and "Secondscreen(SBI)" (the scale is sending the weigth continiously).
Over Putty I succesfully connected to the scale in running mode "Seconscreen(SBI)". So I could read the weigth but couldn't give commands. I also can recieve the weigth in Matlab via fscanf(s).
But I want to communicate with the scale, so there are in the manual the commands for the SBI protocol and there are commands for the SCIS protocol.
I tried both of them but without success. In the SBI-protocol f.e. if I want to tare the scale the command is "<ESC> T" (see link below on Page 154&155).
Manual - SBI commands (page 154 and 155)
I tried to send the ASCII "ESC" and the T with the following code:
s = serial('COM4');
s.Baudrate=9600;
s.DataBits=8;
s.StopBits=1;
s.Parity='none';
s.Terminator='CR/LF';
fopen(s);
pause(0.1);
%fprintf(s,'%X','1B');
%fprintf(s,'%s','T');
%fprintf(s,char(27)+'T');
fprintf(s,'%X','1B 54');
fclose(s);
Can somebody help me communicate with my scale in SBI or in SCIS?
Or can somebody atleast give me the correct code for sending "<ESC> T" to the scale?
Thanks,
Rob
0 Comments
Accepted Answer
Walter Roberson
on 15 Mar 2019
fprintf(s, '%cT', 27)
you might also need to send a terminator
2 Comments
Walter Roberson
on 16 Mar 2019
Set the serial Terminator property to 'CR/LF' and
fprintf(s, '%c %\n', 27);
The \n will automatically be converted to CR LF
More Answers (0)
See Also
Categories
Find more on Spreadsheets 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!