You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old February 6th, 2018, 12:31 PM   #1
NiloRamirez
Member
Brazil

NiloRamirez is offline
 
Join Date: Feb 2018
Location: Rua da Misericórdia
Posts: 5
Read_var Modbus TCP/IP - Schneider M340

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.
Attached Images
File Type: jpg Stop.jpg (21.3 KB, 63 views)
  Reply With Quote
Old February 6th, 2018, 03:20 PM   #2
gclshortt
Member
Canada

gclshortt is offline
 
gclshortt's Avatar
 
Join Date: Dec 2014
Location: Cobourg
Posts: 2,596
http://www.plctalk.net/qanda/showthread.php?t=52962

The above thread may help you out.
Regards,
__________________
Garry
http://www.accautomation.ca
Connect with us on Facebook: facebook.com/accautomation/
  Reply With Quote
Old February 6th, 2018, 04:02 PM   #3
NiloRamirez
Member
Brazil

NiloRamirez is offline
 
Join Date: Feb 2018
Location: Rua da Misericórdia
Posts: 5
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.
Attached Images
File Type: jpg Config.JPG (29.4 KB, 62 views)
  Reply With Quote
Old February 7th, 2018, 05:19 AM   #4
NiloRamirez
Member
Brazil

NiloRamirez is offline
 
Join Date: Feb 2018
Location: Rua da Misericórdia
Posts: 5
Up
  Reply With Quote
Old February 7th, 2018, 11:54 AM   #5
Saffa
Member
New Zealand

Saffa is offline
 
Join Date: Feb 2012
Location: Bay of Plenty
Posts: 898
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
  Reply With Quote
Old February 7th, 2018, 02:31 PM   #6
NiloRamirez
Member
Brazil

NiloRamirez is offline
 
Join Date: Feb 2018
Location: Rua da Misericórdia
Posts: 5
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.
  Reply With Quote
Old February 7th, 2018, 05:31 PM   #7
Lare
Member
Finland

Lare is offline
 
Join Date: Jan 2006
Location: Finland
Posts: 1,035
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 by Lare; February 7th, 2018 at 05:38 PM.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Ethrnet IP, Ethernet TCP/ip, Modbus TCP/ip Steve_D LIVE PLC Questions And Answers 4 June 23rd, 2016 07:36 PM
Modbus TCP/IP Between S7-417-4H CPU & Schneider PLC sachin.patil LIVE PLC Questions And Answers 2 June 18th, 2015 03:56 AM
Reversing VSD ATV71 using Schneider M340 via modbus TCP/IP adrien LIVE PLC Questions And Answers 5 May 1st, 2014 09:28 PM
Programming M340 with Modbus TCP/IP Forrest LIVE PLC Questions And Answers 6 August 25th, 2011 01:57 PM


All times are GMT -5. The time now is 09:26 PM.


.