0
\$\begingroup\$

I am trying to connect a Unitronics Jazz2 PLC (JZ20-R16) and an Arduino Uno using the Modbus protocol, over RS232 interface.

I've got all the required connectors for both Arduino (TTL-RS232 MAX3232 converter as the one below) and Unitronics (JZ20-PRG with JZ10-22-CS10 RS232 connector).

enter image description here

The PLC is configured to be master, the Arduino is slave. Configuration is 8N1. Both units operate very well while connected to ModbusSimulators (from modbustools.com).

I connect these devices to the PC using a RS232-USB converter. The problem is that the PLC requires DTR and DSR signals. As you can see from the schematic, the TTL-RS232 converter I've used can't provide such signals.

Here's the screenshot of succesfull data stransfer between the PLC and a PC simulator:

enter image description here

As you can see, CH3/4 (DTR/DTS) are required to be high in order for the PLC to communicate over Modbus. But, as I've said, the TTL-RS232 converter can't give high DTR/DTS signals. Any idea if there is a chance to tweak this? I've tried to hook DTR/DTS pins of the PLC to +5 V, but no luck.

ocrdu
9,34123 gold badges33 silver badges43 bronze badges
asked Jul 18, 2017 at 12:05
\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

The standard technique is to loopback as shown below. This provides the missing signals.

enter image description here

Connector 1 Connector 2 Function
2 3 Rx --> Tx
3 2 Tx --> Rx
5 5 Signal ground
1 + 4 + 6 - DTR --> CD + DSR
- 1 + 4 + 6 DTR --> CD + DSR
7 + 8 - RTS --> CTS
- 7 + 8 RTS --> CTS

Source: Lammert Bies.

In your case you only need to loopback at the PC end.

answered Dec 31, 2017 at 13:15
\$\endgroup\$
0
\$\begingroup\$

Does the PLC and Arduino have the same ground level?

What does the signals look like on the oscilloscope when PLC and Arduino try to communicate?

In other words - are you sure that the DTR/DTS lines are the cause for the problem? Try to replicate the scenario that is seen when you connect the units to the PC, probe the communication lines, and check if they look the same.

answered Jul 18, 2017 at 14:17
\$\endgroup\$
6
  • \$\begingroup\$ Ground levels of both PLC and Arduino are the same due to "signal ground" pin (5) connected on both DB9 connectors. I've also managed to find out that the DTR/DTS lines are not used in the PLC I'm operating, they are used for powering up the rs232 module (MJ20-PRG). When I feed +5V to both of the lines, the PLC can communicate with PC using only TX/RX and "signal ground" lines. \$\endgroup\$ Commented Jul 19, 2017 at 14:59
  • \$\begingroup\$ But when I do the same but connect arduino, the communication can not happen. \$\endgroup\$ Commented Jul 19, 2017 at 14:59
  • \$\begingroup\$ So, it is not the handshake that is the problem. Try probing the lines when plc and Arduino is wired and tries to communicate. what does it look like? \$\endgroup\$ Commented Jul 20, 2017 at 21:23
  • \$\begingroup\$ Here is what's happening when the PLC and Arduino are wired: ibb.co/dftxqQ \$\endgroup\$ Commented Jul 21, 2017 at 16:12
  • \$\begingroup\$ Edit: I've powered CH3 and CH4 lines with +5V from Arduino (as those lines are used to power the communication module of PLC). \$\endgroup\$ Commented Jul 21, 2017 at 16:14

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.