Jump to content

Recommended Posts

  • External Moderators

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

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

  • External Moderators

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 :P

Link to comment
Share on other sites

  • External Moderators

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

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.

gallery_93_13_23393.jpg

Link to comment
Share on other sites

  • External Moderators

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

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...