Hi,
It looks like this is the message you're sending:
:1103006B00037E
That would be station 17, function 3, data 0, 107, 0, 3. The checksum looks OK to me, but I have no idea how your gateway is set up. What is the MCU connected to? It would be best to see the raw output of the MCU's serial port so you can see if the problem lies there or in your gateway setup.
Also, keep in mind that arrays in C are zero-indexed. If you declared ch[] as ch[17] then that last byte isn't going to be within the array. You should start with ch[0] unless there's a good reason not to. For simplicity you could define ch[] as:
char ch[] = ":1103006B00037E\r\n";
And since you're using Processor Expert for your serial interface, depending on your buffer setup and what mode you're using AS1 in, you should probably be checking the result of the SendChar call. I use something like this:
// Send character to serial port
void sci_outc(unsigned char c)
{
while (AS1_SendChar(c) == ERR_TXFULL) {};
}
I would also recommend using the PE functions (like AS1_TurnTxOn()) rather than accessing the SCI registers directly since you're already using PE.
What kind of RS-485 transceiver are you using? I used an ADM483 in my project and had a couple of I/O pins assigned to control the transceiver's receiver enable and driver enable pins as it switched between TX and RX mode. I think some of the MCUs at least can automatically control an external transceiver, but you'll need to make sure that part is set up properly.
Scott