Author Topic: Communicating with proprietary UART protocol  (Read 6303 times)

Bruceh

  • Newbie
  • Posts: 22
  • a llama no longer !!
    • View Profile
Communicating with proprietary UART protocol
« on: November 10, 2010, 01:43:58 PM »
I am having a few challenges getting my T100MD+ to communicate with an airconditioner control board.

The control board uses a proprietary RS485 protocol which is described as 'half duplex, each byte has 11 or 12 bits: 1 start bit, 8 data bits, 1 even parity check bit, 1 or 2 stop bits. Baud rate is 4800. Each message has 12 bytes: 1 header, 2 address, 2 command, 6 data & 1 check sum'

I  use the following commands to set  com port 3 at first scan

SETBAUD 3,42   (set RS485 to 8,1,e)
SETPROTOCOL 3,10   (No protocol)

and then use a series of OUTCOMM statements to transmit the required command strings

eg OUTCOMM 3,&H55   (send header 55H to airconditioner)
eg OUTCOMM 3,&H00   (send high address)
eg OUTCOMM 3,&H02   (send low address)
etc....

So far I have not been able to communicate with the control card. When I put an oscilliscope (PO Scope basic) on the RS485 I can decode all of the message except for the header which is being misinterpreted eg 80H instead of 55H
Am I missing the initial start bit because I am in 'no protocol'. Not sure of the implication of '1 or 2 stop bits' in the protocol

Any suggestions welcomed

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:Communicating with proprietary UART protocol
« Reply #1 on: November 10, 2010, 04:19:00 PM »
The SETBAUD table are shown in hexadecimal.

So it should be:

    SETBAUD 3,&H42  (set RS485 to 4800, 8,1,e)

Try to change to the above and test again.

Setting to No Protocol is fine since you are not using the COMM3 port as a slave port. It would not have affected the start bit.

If you have an RS485 interface (highly recommended e.g. Auto485 or U-485) you can use the PC to monitor the communication between the PLC and the airconditioner. That way you know what is being sent from the PLC and what is being sent from the air conditioner.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Bruceh

  • Newbie
  • Posts: 22
  • a llama no longer !!
    • View Profile
Re:Communicating with proprietary UART protocol
« Reply #2 on: November 10, 2010, 06:19:05 PM »
Thanks for that.
My programme is correct and does have
SETBAUD 3,&H42  (set RS485 to 4800, 8,1,e)

sorry I didn't put that detail in my post.

I do have a USB485. Can you please explain how to use the PC to monitor the traffic on the RS485 network?


support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:Communicating with proprietary UART protocol
« Reply #3 on: November 11, 2010, 11:44:50 AM »
If the communication is in ASCII you could use the HyperTerminal software which is included with Windows XP or earlier.

But since your protocol is in binary you will need to download a serial monitor software and what you do is to connect the PC's RS485 interface to the same RS485 wire between the PLC and the air conditioner, the PC will display any data exchange between the PLC and the air-conditioner and this is where you can see what's being sent from the PLC and what's being returned by the air conditioner (if it is two way comm). Google for a good one.

We normally use our own internally developed serial monitoring software (a java program) to monitor the communication. We can send that to you if you are our PLC user. You can email to support@tri-plc.com and supply your purchase record (e.g. invoice no.). If you have purchased the PLC from a distributor please make a request thru the distributor.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS