Jump to content

Compile Warning Confusion


Recommended Posts

I have a Visilogic program that I wrote a few years ago that has been working great until now... The following rungs (hopefully they attach OK) are part of some logic that is used to rapidly increment and decrement a set point in the program when either the up or down arrows are pressed and held. Our end customer did not want the keypad used for numeric entry (except passwords) since the number keys are all used for other functions. Anyway, the logic has worked perfectly since day 1 but now I get a compile warning. I never got this warning before with any other version. I can still download correctly and the logic still works (I guess because these are warnings and not errors). Can anyone see anything wrong with what I am doing?

I know there are several other ways (probably more efficient, too) to achieve what I am doing. I'd just like to know what changed in Visilogic. I am using version 9.2.0 on Windows 7 64 but using compatibility mode XP. I tried the version swapper, but all I got were more run-time errors when I tried to use an older version. Can anyone duplicate nets like this and see if you get an error?

Link to comment
Share on other sites

  • External Moderators

Hi Toddster

Since the beginning, Unitronics has always recommended that a contact bit not be referenced in the same net as it's related output. Just recently, they added this as a warning condition in Visilogic, just to raise awareness of it.

The reason for this has to do with how ladder nets are processed. When a net is processed, all input bits are evaluated, then output bits are set accordingly.

If you set an output bit for MB 0 in net 10 (for instance), and use an input for the same bit in net 11, MB0 in net 11 will show as being energized, because it was set in the preceeding net.

By contrast, if you set MB0 in net 10, then use a contact for MB0 as well within net 10, then the input bit will not show energized until the NEXT ladder scan, when the input bits of net 10 are checked again.

As long as the logic works and causes no trouble, then all's good. But when you reach the point in your programming where you need things to take place in sequence within a single ladder scan, it can cause racing conditions and major headaches, because the processing does not behave in the manner you expect.

For this reason, Unitronics recommends you avoid it entirely by breaking the net up and not using a bit in the same net as it's coil.

TM

Link to comment
Share on other sites

Tim,

Thanks for the explanation. I understand the "footrace". In my project, I went ahead and broke the rungs apart and everything seems to work the same. For what I am using it for, the rung evaluation race is no problem. All I needed to do was to change a set point by several hundred degrees as quickly as possible without using keypad entry. In the logic that I didn't show in my original post, I have the ability to change the set point one degree at a time by a single button press/release, but if the button is pressed and held for .5 seconds, then it switches to "rapid increase" (or decrease, depending on which button is pressed) mode, much like a solid state temperature control. I did more investigating in Visilogic and came up with the following logic to basically do the "rapid increase" using system timers.

Thanks again. Have a nice day everyone!

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