Hi
I'm a novice when it comes to this and I need help. I am trying to read this scale
QAL Scale
using RS232
I am using a ESP32, this one -> FireBeetle ESP32-E
and I got a rs232-to-ttl adapter hooked up to it on pin 16 & 17, GND and 33V.
I found a code example online but I'm getting nothing.
#define RXD2 16
#define TXD2 17
void setup() {
// Note the format for setting a serial port is as follows: Serial2.begin(baud-rate, protocol, RX pin, TX pin);
Serial.begin(115200);
Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2);
Serial.println("Serial Txd is on pin: "+String(TX));
Serial.println("Serial Rxd is on pin: "+String(RX));
}
void loop() { //Choose Serial1 or Serial2 as required
while (Serial2.available()) {
Serial.print(char(Serial2.read()));
}
}
The manual for the scale has the following section. I have checked on the scale and the baudrate is set to 9600 and Mode 1.
SECTION 5 RS-232 OUTPUT
Specifications: RS-232 output of weighing data, 1200/2400/4800/9600/19200 bps,1 stop bit, 8 data bits, No Parity.
Mode 1: Continue output
ST,GS 0.119,kg ST for stable; US for unstable ; GS for gross weight; NT for net weight ; 0.119 for weighing value; kg for unit (kg, lb); HEX 0d and HEX oa : HEX for hex; 0d for enter; 0a for next line.
Mode 2: Automatic output
Automatic output mode is same as continue output. The only difference is:
After weighing, when take away the goods display returns to zero, then transfers.
Mode 3: Print output
There are two kinds of formats which could be selected as Lab 1 and Lab 2.
Data Format for normal weighing operations. Examples as follow.
Any help would be appreciated