Arkhat Posted May 13, 2019 Report Posted May 13, 2019 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
MVP 2023 Flex727 Posted May 13, 2019 MVP 2023 Report Posted May 13, 2019 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.
MVP 2023 Ausman Posted May 14, 2019 MVP 2023 Report Posted May 14, 2019 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
Gabriel Franco Posted May 14, 2019 Report Posted May 14, 2019 I had same problem long time ago. Workaround was, to increase delay time between reading different devices when an offline device detected. 1
hotwires Posted May 15, 2019 Report Posted May 15, 2019 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.
AlexUT Posted May 15, 2019 Report Posted May 15, 2019 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.
Arkhat Posted May 17, 2019 Author Report Posted May 17, 2019 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! Updated with Timer and Retries V350 as a Master and 2 Slaves.vlp
MVP 2023 kratmel Posted May 17, 2019 MVP 2023 Report Posted May 17, 2019 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.
MVP 2023 Ausman Posted May 18, 2019 MVP 2023 Report Posted May 18, 2019 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now