Jump to content

Increment function wont increase value


Recommended Posts

Hi, currently I have it so that if either of the two HMI buttons are pressed either of them when pressed power the increment function which in turn is supposed to increment the value in the MI i have placed there but this does not happen.

I just want to simply display on the HMI a variable that shows how many times these buttons have been pressed.

I can force a value into the MI variable and this then displays on the HMI okay but the increment function will not manually increase the MI but perhaps I am using it in the wrong way

 

Any insight appreciated!

https://imgur.com/gallery/zFdqOjG

Link to comment
Share on other sites

it's hard to say with out seeing all the code but couple of questions and things to check

Is the increment done in a sub-routine or main routine?  if in a sub-routine are you calling that sub-routine? is MI 38 being reset or stored to somewhere else in the program?

 

Link to comment
Share on other sites

  • MVP 2023

Aaron, the issue is not hard to do, because when online any subroutine will still show power lines on operands that are active.  It is very easy to mistakenly believe the ladder area you are looking at is actually doing something. 

There are many references in the forum to this quirk, with various solutions/indicators done by users so that they can visually check the sub is actually running as they watch it.

cheers, Aus

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.