Hi everyone,
I am trying to collect the "telegrams" sent by a Thies Laser Precipitation Monitor (LPM) using a CR6 (OS Std.09.02).
These are long ASCII strings (in my case 2212 bytes long), terminated by a ETX character = CHR(3). In my case, the sensors releases them upon a polling command.
Using a CR1000, I successfully used one of its serial ComPort and a RS232-RS485 adapter (the LPM output is a RS485), with a simple sequence like this:
SerialOpen (LPM_COM_PORT, LPM_BR, 0, 0, 2212*2+1) ... SendCommand ("TR", TELEGRAM_FMT) ' Request telegram by polling. SerialIn (telegram, LPM_COM_PORT, 50, ETX, 3000)
The logger gets smoothly the whole 2212 bytes string without any problem
On the CR6, I am using the native RS485 full-duplex input (C1-C4), which I open like that:
SerialOpen (LPM_COM_PORT, LPM_BR, 16, 0, 2212*2+1, 5) ' Logic 1 high; N-8-1
The port works, as the logger can correctly communicate with the device, sending commands and receiving replies.
However, when I poll the 2212 bytes long telegram using the usual sequence:
SendCommand ("TR", TELEGRAM_FMT) ' Request telegram by polling. SerialIn (telegram, LPM_COM_PORT, 0, ETX, 3000)
I am only able to get the last 1831 characters. This repeats consistently every cycle, no matter of the buffer length
However, sniffing at the RS485 traffic, I can see that all the telegrams have the correct lenght of 2212 bytes.
QUESTION: Has the CR6 any limit/bug in serial buffer length, which truncates my string to 1831 characters?
Best, Andrea
Add a SerialFlush() before sending out the command. You also might need to increase the timeout for SerialIn().