SoftwareSerial-Need help

I need to send data from an Arduino Uno to a PLC which requires 8E1 byte format. I can read requests from the PLC using SoftwareSerial library, but when sending PLC rejects the packs and byte format is the only problem I can see. Can anyone help me to achieve this or does anybody knows a better library?

PS: I'm using a MAX485 to achieve RS485 communication with the PLC. Thanx in advice!

I did a search for "arduino software serial parity" and go many hits. The gist is that you will need to change the software serial library to handle parity. There are instructions in some posts.

PS: I'm using a MAX485 to achieve RS485 communication with the PLC. Thanx in advice!

Can you lets know which PLC using ; if you using Siemens PLC you get RS232;RS485 stack ;The test working fine with modbus communication

You need to send Arduino Code & Setup function in PLC side for receiving data from Arduino

OpiLau:
I need to send data from an Arduino Uno to a PLC which requires 8E1 byte format.

If you can't find a ready made solution you should be able to modify the code in yet another software serial to meet your requirement.

...R

Is there a reason you're not using HardwareSerial ?

That handles 8E1 just fine.

Ian.

ian332isport:
Is there a reason you're not using HardwareSerial ?

That handles 8E1 just fine.

Ian.

Honestly because I really don't get the differences between them..I can't find when are used each..

OpiLau:
Honestly because I really don't get the differences between them..I can't find when are used each..

HardwareSerial uses the serial port that's part of the actual Atmega chip itself. SoftwareSerial does a similar job, but is purely in software and doesn't have all the functionality of the hardware serial port.

I personally try to use the HardwareSerial port to communicate with other devices, and SortwareSerial for less critical things like debug messages etc.

Ian.

ian332isport:
HardwareSerial uses the serial port that's part of the actual Atmega chip itself. SoftwareSerial does a similar job, but is purely in software and doesn't have all the functionality of the hardware serial port.

I personally try to use the HardwareSerial port to communicate with other devices, and SortwareSerial for less critical things like debug messages etc.

Ian.

That means using a MAX485 transciever does not allow me to use HardwareSerial right?

When using SoftwareSerial library I'm facing exactly this problem: http://forum.arduino.cc/index.php?topic=311138.0

OpiLau:
That means using a MAX485 transciever does not allow me to use HardwareSerial right?

The Max485 will have no idea whether it is connected to Hardware- or SoftwareSerial.

The main reason SoftwareSerial is used is because the Uno only has one HardwareSerial port and that is normally used to communicate with the PC. The Mega has 4 HardwareSerial ports and the Leonardo's is available as Serial1 because it is not used to communicate with the PC.

If you have a USB-serialTTL converter (aka an FTDI cable) you can use it and SoftwareSerial to communicate with the PC and free up HardwareSerial on an Uno.

...R