Read_var Modbus TCP/IP - Schneider M340

NiloRamirez

Member
Join Date
Feb 2018
Location
Rua da Misericórdia
Posts
5
Hi,

I'm using a PLC M340 (Master) to communicate with a M221 (Slave) PLC. To do this communication, I'm using "Read_var" and "Write_var" blocks.

The communication is working, but when I lose it, I can not communicate again. I have to reset my M340 (Master) to reestablish the communication.

I've seen in my "GEST" vector that when I lose communication, the "ModbusRead_Dig01_CP04[1].0" is aways 1. Picture "Stop".

I need an automactic reconnection.

Can anybody help me?

Thanks, Nilo Ramirez.

Stop.jpg
 
I've tried to reset the activation bit, it resets but my communication don't return.

My configuration is in the picture.

Just some brief observations:

- The first compare is used because I have 15 Read_var, so, I have a counter that counts from 0 to 14. In this case, when my counter is in 10 and the other contact is enabled, my communication starts.

- The second compare is to reset my "activity bit" because it freezes on "1" station when the communication stops.

Thanks, Nilo Ramirez.

Config.JPG
 
Do you have a timeout set? 3rd word of the management parameters. The default is zero which means wait infinitely on comms fail. See the help file.

When i detect a comms fail I write zeroes to the management parameters except for timeout and retrigger the read_var block
 
Hi

My Read_var was without a timeout.
So, I put 1000ms in the third position of my GEST, remove the gateway (the 2 after my IP), and reset the "Activity bit" as demonstrated.

It finally works.

Thank you all for help me.

Nilo Ramirez.
 
Activity bit can still jam to "1" state, making force reset for activity bit helps. (reset bit if at "1" state too long.
Zeroing whole gest parameter group and setting timeout to back also works.
(Jamming depends maybe of firmaware version)

On TCP comms you can have several comms active same time, it is sayed somewhere at manual. (you have as many gest parameter groups than you have TCP coms active at same time)

On serial side you can have only one query active same time/for one port. (And using only 1 gest parameter is only needed for serial)

Send new query only when activity bit is at "0" state.
I don't see if you use negated ModbusRead_2_CP04(1).0 bit before read_var block.
 
Last edited:

Similar Topics

Hi, I am trying to use READ VAR function block in Modicon M251 to read data from 1 unit of Modbus RTU slave. However the READ VAR return error...
Replies
0
Views
776
Hi Guy's, I have fully configured all my reads writes and sequeneced them as per my usual setup. However while configuring my code I found that...
Replies
3
Views
3,975
Hi everyone i have a customer, who wants to show an alarm on the machine, if the I/O forces are enabled and set, on at ControlLogix L81E with...
Replies
3
Views
138
Hi Iam using monitouch hmi(V9 soft) with omron plc cj2m (CX programmer). In this I want to read a data from hmi to plc. The data was like...
Replies
0
Views
73
Hi everyone. Quick questions. On UnityPro, I want to open and quickly read tags from a .STA files witouth opening the program. I have 30 plc...
Replies
2
Views
103
Back
Top Bottom