MATLAB: Sending T over Serial port to Scale

asciibalancecomMATLABsartoriussbiscalescisserial

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

Best Answer

fprintf(s, '%cT', 27)
you might also need to send a terminator
Related Question