0
\$\begingroup\$

I am trying to connect Unitronics Jazz2 PLC (JZ20-R16) and an Arduino Uno using 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 PLC is confogured to be Master, Arduiuno - 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 require DTR and DSR signals. As you can see from the schematic, the TTL-RS232 converter I've used can not 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 PLC to communicate over the modbus.But, as I've daid, the TTL-RS232 converter can not 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 +5V , no luck.

\$\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.

\$\endgroup\$
  • \$\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\$ – Svjatoslavs Krasnikovs Jul 19 '17 at 14:59
  • \$\begingroup\$ But when I do the same but connect arduino, the communication can not happen. \$\endgroup\$ – Svjatoslavs Krasnikovs Jul 19 '17 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\$ – MrGerber Jul 20 '17 at 21:23
  • \$\begingroup\$ Here is what's happening when the PLC and Arduino are wired: ibb.co/dftxqQ \$\endgroup\$ – Svjatoslavs Krasnikovs Jul 21 '17 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\$ – Svjatoslavs Krasnikovs Jul 21 '17 at 16:14
0
\$\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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.