Jump to content
Arkhat

V350 with multiple slaves frozes Modbus RTU Port

Recommended Posts

Hello,

I experience issue with V350 controlling two Modbus RTU Slaves – VFD and Flowmeter, connected in the same port. The code I attach works OK when both of the devices online.

 The main issue is when I disconnect one of the devices from the network, and Modbus port (Function in Progress) gets stack and the PLC polls only the device that has been out of connection, while the other one – keeps unscanned. For example, when I shutdown the flowmeter (subroutine 8_FLOWMETER), I don’t get any data from VFD though it is online and OK.

 Please advice how to organize Modbus network to avoid the port stuck on the offline device? Is there a way to terminate communication with offline Slave?

The software I use is 9.8.79 Build Beta 0, PLCs are V350 -35-TU24, VFD is Commander SK by Control Techniques, Modbus RTU via RS485 2-wire. Flowmeter is Russian SKG, manual is in Russian, so I didn’t attach it. Generally supports Modbus RTU, RS-485 2-wire

 

 

Share this post


Link to post
Share on other sites

I suspect you're trying to read too often. Create a self-resetting timer of at least 100 ms that SETs a bit to comm with a slave, and a RESET of that bit after the comm FB. Serial communications tend to be a bit slow, give it the time it needs to deal with all the overhead.

Share this post


Link to post
Share on other sites

And further to Flex's comment, don't forget the easy trap to fall into.  If your read isn't successful and you have a number of retries set up in your modbus config block specs, you need to allow for all those retries to run through at the specified port interval + a little bit more.

cheers, Aus

Share this post


Link to post
Share on other sites

It’s using up all it’s retries on the offline device. The polling interval needs to be (at least) timeout time in mS multiplied by the number of retries. 

Share this post


Link to post
Share on other sites

Hi,

It is recommended to use not so long timeout and set Retry counter to 0.

If device is disconnected, time delay to set "No Communication"status is TIMEOUT*4 (one transmit and 3 retries by default).

In case you set timeout to 10 sec, delay to communicate to next device is 10*4=40.

PLC will be pooled one time and Master PLC will communicate to next PLC.

Best Regards.

 

Share this post


Link to post
Share on other sites

Gentlemen,

thank you very much for your feedback. I changed # of retries to 0 and timeout to 500 ms, please see attcahed visilogic file. It works OK when both devices are online, but when I get the flowmeter off, I see the PLC scanning the VFD, but no reposnse comes from VFD. when I get the flowmeter back online, the VFD is online again.

So the issue with the PLC stack on scanning offline device is fized, but at the same time the PL doesnt get data from VFD, though it is scanned. and only when the flowmeter is up, everything works ass supposed.

may that be due to the VFD (Commander SK by Control Techniques)? there is parameter in the VFD called "Silent period extention" (parameter 11.26), please see attached scren shot of the manual. I dont see any other settings in the VFD other than this that can affect its reposne to the master...

 

thanks!

VFD Settings.JPG

Updated with Timer and Retries V350 as a Master and 2 Slaves.vlp

Share this post


Link to post
Share on other sites

I would recommend that you do the following steps and explain the results:
1) try to connect the two devices that are left with a separate twisted pair (Terminated on both end). Result?
2) try to see what is transmitted from controller to vfd and in the opposite direction in info mode. Result?
3) try to use port 2 for communication (it is advisable to use an isolated version of the additional communication card). Result?
4) If it is possible to turn off only the power supply of the flowmeter, leaving it connected to the communication line. Result?
5) Add another "virtual" device to the system - the V350 in slave mode - self connected to you network. This is explaned in visilogic sample project. (However, you also need an additional communication card). Result?

6) Try to setup only VFD connection in program, Then add in program  flowmeter reading only when all data from VFD is transmitted to OPLC.

This is maybe strange idea, but if VFD connection is lost then no flowmeter readings subroting present, and no transmission to flowmeter can return transmission to VFD.   

Generaly you must build counter that count and allow to transmission all communication subroutings sequantally.

Than you must read status off connection in step and if status is not OK after some delay you must go to next communication step.

Share this post


Link to post
Share on other sites

I've now had a quick look at your program and I think it needs a complete rethink.  I would be changing it so that you have only one modbus sub, and you then trigger the various reads/writes via a counter method that also changes the locations/references in the Modbus blocks by using MIs.  To me it is very clumsy bringing up essentially  the same thing all the time via sub calls, and the more complexity the harder it can become to fault find.

You also have some things that at a quick glance can be refined.  You are using many sets and resets in the Main routine that I think are not needed.  And set/resets can also be problematic.

Split out your rungs!!!  Line 14 in Main Routine is a classic example.  And also whilst at Line 14, have a look at Vector Fill, which can reset all those MBs far easier in one hit.  And you may not need them anyway!

cheers, Aus

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...