Joe W
Joe W

Reputation: 21

Code for RS232 not working for RS485 Communication

I'm using VBA for Excel to communicate with hardware via serial communication. The code uses API calls similar to this here: http://dev.emcelettronica.com/serial-port-communication-in-excel-vba.

I've been successful with rs232 but it isn't working with rs485. After sending data and reading back the response, the read times out and it reads the same data that was sent.

I have access to software that someone else developed and their software works, so I know that the hardware is ok. I used a serial port sniffer and their code seems to have a lot of redundancy but it looks like its using the same configuration and sending the same data as my code. But their code gets a valid response while mine doesn't.

Could someone share some basic troubleshooting tips for this type of problem?

Upvotes: 0

Views: 704

Answers (1)

Joe W
Joe W

Reputation: 21

A major difference between rs232 and rs485 is that rs485 has an additional configuration setting for wire mode. The rs485 can support 2-wire or 4-wire configurations, with 3 different 2-wire configurations. Once I selected the correct configuration, the same code that I used for rs232 worked for rs485.

Upvotes: 1

Related Questions