Modbus RTU on Flexy102

Hi folks!

Please can you help me configuring right tag address value on Flexy.

SETUP
I connected a Contrel PLC (Modbus address =4) to Flexy 485 serial port using modbus 485. IP address of Flexy is 172.27.214.181
I attach Contrel modbus registers. I try to get the value of phase Voltage L1-N, so I set Flexy tag address: 41002M,4,172.27.214.181

Looking on logs, I have smbs-Read TCP header failed
Also counters tell me there are Read TCP error

I’m new using Flexy and also configuring MODBUS, so sorry if my question could be stupid. Really apprechate who will help me

ModbusProtocolEMCIM154-Uv0.94.pdf (80.7 KB) register

I checked the status tag for the PLC, and it returns 2 (so Communication NOT OK). Have I to focus on cabling, PLC modbus settings or both?

Hi Irideos!

You wrote you are using Flexy with a:

This means you are using a Serial Connection (RS485) and Modbus RTU (not TCP)
if you are using serial Stuff you should not enter any IP addresses.
IP addresses are only for Modbus TCP servers (Devices that have an Ethernet port to communicate Modbus TCP)
If you enter an IP address in a Situation were you are really trying to talk on the serial Port and not the Ethenet Port this will cause it to use the wrong Port.
Using an IP address tells the Flexy you are trying to communicate with a Device that has an Ethernet Port and an IP address…

So no IP address in either the Tag address
and also not in the Modbus IO server Topics.
(If you need to communicate over the Serial Port)

br
Franziska

Hi Franziska, really appreciate your feedback.
So TAG/Modbus and COM configuration should be like this (see attached)

?

Hi Irideos,

I took a look at your EMC Device.
I’m not 100% sure if that is a Slave or a Master…
But I would lean more in the direction of Slave because it has a list of registers.
This is typical for a Slave.

Be careful that it is configured in RTU Mode not ASCII mode.

You need to actually choose a Register and try to interact with that.
try to read or write one of these Registers…

Here is a great webpage for the Basics of Modbus:
https://simplymodbus.ca/FC03.htm
I would recommend taking a look here.
It might be you slave gives it registers in hex code.
The Flexy uses the Modicon writing how to address Registers.
So Holding Register 0(hex) is 40001.

And here is the Basics on how to set that up in the Flexy:

Without having a Register you are trying to interact with the Status has nothing to go on…

br
Franziska

Hi Franziska

I’m focus on serial communication before get register from the PLC. PLC Status TAG is set to 2, so this should mean there is not communication. In addition Serial led is not flashing.
I’m checking realtime log and seems there are some problem on serial link (attached realtime log). I already check modbus parameters on both end (PLC and Ewond) and are the same.
What does means attached log?

Hi Irideos,

This looks to me like there is still something wrong, and you do not get an answer.

Reasons why you might not get an answer:

You said you use RS485. That is a little bit more complicated than RS232.
For Rs485, you need a termination resistor at the first and last device of the Bus.
120 Ohm between RS485 A and RS485 B.

The next problem is with RS485 that the A and B / + and - Line is not always labeled the same.
So each time I test something, I always switch A and B.
For Rs485, A should connect to A and
B should connect to B
Or RS485 + should connect to RS485+ in the same way.
Normally A = + but… well, there can be a wrong label, or it is just not as it is normally, so it is always good to switch it for every test… until you are sure. At least this is how I always find which should be put were ^^

Always double and triple-check how both devices are configured for Baudrate, Parity, and Stop bit.
if there is something like 7 or 8 bit > 8 bit

And the last thing why you may not get an answer: Modbus RTU slaves will only respond if the Master asks for them with the right node address (Modbus RTU address)

I can recommend to get a serial RS485 Port for your PC/Laptop and testing it on your PC. Tools like ‘Comtest Pro’ from Basblock are free Modbus Software (plays the Master/Client)
So if your device is a slave, you will be able to read out data directly to your pc and test the Device against a reference System.

br
Franziska

Thanks Franziska for your help

Can you also tell me what does mean the log Er/Wng -536893114?

Thanks

Hello Irideos,
As far as I understand this, the serial data is stored in some kind of queue/storage place.
I suspect this error means that when trying to access that storage place there was nothing inside so an error occurs and a generic 00 (for nothing I think) is displayed.

br
Franziska

Hi Franziska

Case is solved. Problem was a mix of problem, first switch A and B as you told, then I update PLC firmware. For what I understood, on log if you read Er/Wng -5368… is a cabling problem, normally just need to switch.

Thanks for your help

1 Like