M258 RS485 Serial Communications

GSNITZ

Member
Join Date
Jun 2017
Location
TULSA
Posts
30
I've been searching through the forums to see if I could find this question answered anywhere else without success. My apologies if this is a duplicate question. In a nut shell, I'm hoping someone out there can help me troubleshoot Modbus RTU via RS485.

We are using the Schneider M258 as the backbone for an injection control system. The exact model is TM258LF42DT. We use Modbus via TCP to communicate with a local HMI. I have become very familiar with how this side of the control system is set up over the last few months. Now our customer is asking us to support Modbus RTU via RS485 so they can pull live data to their SCADA. In order to support this I have done the following:

The serial line has been configured with the following parameters:
  • Baud Rate: 9600
  • Parity: Even
  • Data Bits: 8
  • Stop Bits: 1
  • Physical Medium: RS485
  • Polarisation Resistor: No

Modbus_Manager 4.0.0.2 has been added for the serial line configuration with the following parameters:
  • Mode: RTU
  • Addressing: Slave
  • Address: 1
  • Time between Frames: 10ms

I have been working for the last few hours trying to validate this set up using a computer and the free Modbus monitoring program qModMaster (I also tried using two other programs ModPoll & ModScan). When I configure qModMaster for TCP mode I am able to read the registers without any issue. However, when I configure the program for serial I am not getting any response from the controller. To this end I've been thinking it is an issue with my cabling.

I have tried using two different serial devices; this computer includes a serial port (quite an old machine) and I also have a serial to USB adapter. In both cases, I've made sure to adjust the settings in device manager so that the baud rates, data bits, parity, and stop bits are the same.

On the direct serial input:
I looked up the pinout diagram for this PLC and stripped apart an old ethernet cable. I connected the D1(A+) and D0(A-) leads to pins 5 and 9 of a serial cable. I have also tried flipping the wiring just in case there was some confusion on my end about which was actually +/-. I don't have an end termination resistor however I only have about 1m of ethernet cable and 0.5m of serial cable.

On the serial to USB input:
I've basically done the same thing as above except that the I've also connected the ground cable.

In Conclusion:
This is quite a long a detailed post. I'm hoping someone out there who has worked through this kind of mess before will have an idea of where I am going wrong or what I am missing.

I'm to the point where I'm thinking that the computer may not be acting like a proper Modbus master for serial communications but I do not have a lot of options for alternative master devices.

The other potential issue I've been considering is if my serial settings are causing an issue. I was considering trying a lower baud rate but I haven't gotten to that yet.

Hopefully there is a guru out there who can smile down upon a young padawan and lead me in the right direction. Thanks in advance!
 
Further Clarifications

The PLC firmware is V4.0.2.6.

The serial line configuration and Modbus Manager I mentioned were added to the PLC's program using SoMachine Logic Builder V4.1.

I'm wondering if maybe there is a way to communicate by RS485 with the controller itself using SoMachine as the driver?

There's also an RS485 adapter sold for the Modicon M258; the TWD XCA ISO. It has the RJ45 port for the connection to the PLC, and your standard 4 pin screw terminal for the trunk connection. I might go down this path to eliminate troubles that could be caused by my hacked together ethernet (RJ45) to serial (DB9) cable since it includes line termination and pre-polarisation. Wondering if a PLC mentor out there has used this product before.
 
I think you need an RS232 to RS485 converter. You can't just wire 485 directly to a USB to serial converter.

Advantech do some as do MOXA
 
Definitely a hardware bus issue - the PC is RS-232, the PLC module is RS-485.

The suggestion for an FTDI chipset in the RS-485 converter is a good suggestion, FTDI works well. FTDI registers with Microsoft so the driver installs well.

When you get the USB/RS-485 converter, you're likely to run into the problem that what one vendor calls the A line, another vendor calls the B line. A should connect to A, B to B, but sometimes you connect it and it doesn't work and will never work because the lines are connected backwards. Swap the lines and presto, it works. One of the reasons to prefer using Ethernet over RS-485.
 
Updates

Thanks for the responses! I didn't realize that RS232 was the standard I needed to follow for communicating with the PC.

I have a Electro Industries Gauge Tech UNICOM 2500 Opto Isolated RS485 / RS232 Converter that I've set up this morning.

The RS485 output from the PLC is listed as 2-wire and has the following pinout:
  • D1 (A+)
  • D0 (B-)
  • 5 VDC (200 mA)
  • 0 VDC

I have connected is to the converter as follows:
  • PLC D1(A+) connected to CONV RX+
  • PLC D0(B-) connected to CONV RX-
  • PLC 0VDC connected to CONV GND
  • PLC 5VDC not connected to CONV

I also have wire bridges between:
  • CONV RX+ and CONV TX+
  • CONV RX- and CONV TX-

The converter has a few switches on it. Bold indicates the current switch state.
  • DCE or DTE
  • Baud Rate 1200 2400 4800 9600 19.2K 38.4K 57.6K 115.2K
  • HD or FD

Even with this configuration, I am still receiving a timeout error. I looked up the manual for the UNICOM and verified that the toggle switches are set correctly and that the RX/TX bridges are required for 2-wire RS485. The unit has indicator lights indicating that the request is being received from the computer but there is no response from the PLC. I tried swapping the RX/TX D1/D0 landings without improvement.
 
Rs 485

Hello,
1. The physical medium can be RS485 or RS 232 on the Serial line port of the M258.

2. Please make sure in your Modbus manager the *Slave* setting is selected if the M258 is indeed a slave.

3. You can also select the polarization resistor in the software itself.

4. We recommend using a twisted pair shielded serial cable for RS485 communications. Schneider has a few , example: VW3A8306R10

Please check attached snapshots.

Hope this helps.

Thanks.

SerialLineConfig.jpg ModbusMgrConfig.jpg
 
what is a polarization resistor?

A termination resistor dissipates reflected power, typically 120 ohms for typical comm cable impedance.

Biasing pulls the drivers to known state in idle condition. Biasing should happen only at one point on a network.

But I have no idea what a polarization resistor is.
 
Thank you for your detailed response Ms. Mohua Ghosh!

I have updated the PLC program based on your recommendations. Polarisation Resistor is set to yes, Addressing is set to Slave, with address 10.

I also adjusted the scanning program to point to slave address 10 however I'm still receiving a timeout error when trying to read the holding registers.

In the long run, our customer will be needing a screw terminal for their 2-wire connection. I've been cobbling together this monstrousity of an adapter (RJ45 to 2-Wire w/ Terminating Resistor to RS485/RS232 Converter to D-Sub-9 Connector) simply as a way to verify that the software configuration will work in the field.

While we continue to troubleshoot what I must have done wrong, I also want to ask what your thoughts are on using the TWDXCAISO adapter with the VW3A8306R10 cable to provide a trouble free way to connect a typical shielded/twisted 2-wire interface for the customer? Is a there a better performing or more cost effective solution we could propose?

Thanks again in advance.
 
Thank you for your detailed response Ms. Mohua Ghosh!

I have updated the PLC program based on your recommendations. Polarisation Resistor is set to yes, Addressing is set to Slave, with address 10.

I also adjusted the scanning program to point to slave address 10 however I'm still receiving a timeout error when trying to read the holding registers.

In the long run, our customer will be needing a screw terminal for their 2-wire connection. I've been cobbling together this monstrousity of an adapter (RJ45 to 2-Wire w/ Terminating Resistor to RS485/RS232 Converter to D-Sub-9 Connector) simply as a way to verify that the software configuration will work in the field.

While we continue to troubleshoot what I must have done wrong, I also want to ask what your thoughts are on using the TWDXCAISO adapter with the VW3A8306R10 cable to provide a trouble free way to connect a typical shielded/twisted 2-wire interface for the customer? Is a there a better performing or more cost effective solution we could propose?

Thanks again in advance.
Hi,

1. You could use the TWD***AISO with the VW3... cable. Please keep in mind that if you have selected the polarization in SoMachine then disable it on the TWD or vice versa. Polarization should be ON only at one node.

2. To put this case to rest :-D I installed the QModMaster. From my PC I am using Cp2103 UART/USB/RS485 bridge with the VW3... cable to M258. And I was able to send a value of 21 to the M258 at %MW20. Please check attached pictures.

So, check your wiring and your Modbus RTU settings - Baud rate, Parity, Stop, Data on both Master and Slave.

Good luck!
Thanks.

QModMaster_PC_Settings.jpg QModMaster_To_M258.jpg
 
Same Topic Subthread - Post Configuration

I should have a better adapter soon. I went with a FTDI Interface Cable as suggested, along with an RJ45 pinout terminal. In the meantime, I had a follow-up question in the same vein.

Is it possible to adjust the slave address listed in Modbus Manager through the post-configuration file (Machine.cfg)?

I read the section of the M258 Programming Guide for direction on this front, but only saw options for Serial Line parameters, not Modbus Manager parameters.

Thanks!
 
To close the loop, got the hardware in yesterday and ran another test. Still had issues. On a whim I replaced the PLC with a new-in-box one and everything worked fine.

For reference for anyone looking to do something similar in the future, instead of the TWD***AISO, I went with an RJ45-to-Terminal interface adapter and it works flawlessly.

Ms. Ghosh, thank you for your support!
 

Similar Topics

Hey, i'm getting an error when i try to upload a program from a modicon M258 TM258LF42DT using eithernet. i tried using both SoMachine V4.1 and...
Replies
12
Views
1,221
i have plc modicon m258 its CANopen bus not running and give status on SoMachine v3.1 red triangle after i make download to it so please how...
Replies
4
Views
1,755
Hello All! I'm embarking on a new project and have been searching the forums to assist in what is looking to be a rather challenging task. We are...
Replies
3
Views
1,739
Hi friends, I am AVI , working on Schneider electric make M258 PLC. While communicating it with SO machine software v3.0, facing problem...
Replies
0
Views
1,295
I got brand new modicon M258, with extra DI, DO, AI, AO cards, part number TM258LD42DT4 willing to trade with ControlLogix 5000.
Replies
0
Views
1,280
Back
Top Bottom