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!


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

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.

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