External Moderators tmoulder Posted March 22, 2011 External Moderators Report Share Posted March 22, 2011 I've cooked up a little Modbus IP Master module, and it works like a champ as a stand-alone. After I import it into my program though, the Busy bit configured in the Modbus IP Config FB never turns on. It doesn't matter what bit I use. I cannot change the bit from Visilogic by set and reset, so something is governing it. Data-wise, it seems to be working just fine. After several tests, the only thing I can think of is the scan time. This is a very large program and it shows a 6 mS ladder scan. Since Ethernet is such a fast protocol, I'm thinking the entire data exchange may be finishing before the ladder rescans the IP Config block, and so the busy bit is never set. Is this a possiblity? Thanks, TM Link to comment Share on other sites More sharing options...
Emil Posted March 22, 2011 Report Share Posted March 22, 2011 Hi Tim, Yes, it's possible. Also - if it's active for one scan only - it's quite posible that you will never "see" it. You can make a simple net - right after modbus command - N.O contact of Function in progress bit to increase any counter. This way you can catch if this bit is going high at all! Link to comment Share on other sites More sharing options...
External Moderators tmoulder Posted March 22, 2011 Author External Moderators Report Share Posted March 22, 2011 I moved the subroutine call for the Modbus Send / Receive to the last net of the main program, so the config is at the start of the ladder and the Tx/Rx is at the end. This left very little time for the data exchange to finish before the config FB was rescanned. Lo and behold, the busy bit works now. Not sure how I feel about this - the impression given by looking at the screen indicators is that "busy status" is never achieved. It would be nice to have this latched on for a minimum of one ladder scan. On the other hand, with a 6mS scan time, this would have the effect of slowing communications, so - I don't know. Just a tidbit I discovered the hard way. Tim Moulder - extreme PLC programmer Link to comment Share on other sites More sharing options...
External Moderators tmoulder Posted March 22, 2011 Author External Moderators Report Share Posted March 22, 2011 Hi Emil, looks like we cross-posted. Yeah, I've used a TE timer in conjunction with the Busy bit before to debounce the display value. The problem is, in this scenario, the busy bit never comes on at all. This opens an interesting can of worms. If the busy bit never comes on, how can I use it to manage traffic? Thanks! TM Link to comment Share on other sites More sharing options...
Damian Posted March 22, 2011 Report Share Posted March 22, 2011 Hi Tim, I always found that you had to look for not only the "busy" bit, but also the "status", "sessions", and "acknowledgements". As you mention, the busy may or may not ever be seen. However, if your acks have increased you know something is going on. If your sessions have increased and you don't have any comm errors you pretty much know that the you blew by your "busy" The code below has yet to fail me. XI2 is my sequence indexer. I have a watchdog checking to see if it gets stuck and to take corrective action when possible. Link to comment Share on other sites More sharing options...
External Moderators tmoulder Posted March 22, 2011 Author External Moderators Report Share Posted March 22, 2011 Thanks Damian, that gives me a good work-around. But I'd still like to examine the busy bit behavior a little further. The busy bit is designated in the Config FB, and thereafter is controlled by the operating system. Since the bit is turned off when the command is completed, asynchronous to the ladder, does it turn on immediately when a command is issued? I wonder if the value could be trapped somehow. Emil seems to hint at that earlier, if I understood correctly. Thanks again, TM Link to comment Share on other sites More sharing options...
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