Question

I am required to talk back to the scale by making it PRINT programmatically.

The manual states that the print command is simply P ended with carriage return. I use the following code:

Byte[] bytes = {80, 13};
_sp.Write(bytes,0,bytes.Length);

But every other time I get ES code back from the scale which means error but it still prints. I just want to find out why even though it works, I am getting ES back.

Any ideas? Is the format of bytes[] correct?

Was it helpful?

Solution

The bytes are correct, according to what you say that the manual states.

Perhaps the manual is unclear (or has this specified elsewhere), and by "carriage return" actually means the CR+LF newline sequence that is used in some systems (e.g. MS-DOS). The bytes would then be:

Byte[] bytes = { 80, 13, 10 };
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top