Jump to content

HMI input staying locked in logic


jlofft

Recommended Posts

Hello,
I'm having some issues with understanding how Unitronics integrates the HMI inputs to the PLC inputs. This is a vague start, but I have a state machine going (this project is essentially done and I've made it through it with some work-around), that requires user input to move from one state to the next. I am currently using the Set/Reset on the HMI buttons but many of the buttons seem to get stuck in the ON state (the program has moved to the next sub-state in the program), even though the logic is no longer true. Why does it do this? I see suggestions in the forums about using the positive transition input, but how does this interact with the "Set bit" function of the HMI button? Does the HMI button reset?

Here's an example of the program:

        Subroutine 1
                State 1
                        Stuff happens
                        User pressed HMI button to move to state 2 (ON)
                        subroutine state = 2

               State 2
                        Stuff happens

And this is where I get a little confused on how this works because the User input to move to state 2 from state 1 will stay ON instead of resetting.
 

I've gotten around this my simply resetting everything (not-output to reset the HMI button) at the end of the process sequence , but this seems gimmicky Thanks for any input

Link to comment
Share on other sites

I can't see the program, so don't know if transition contacts would solve the problem. Post it if you can, or screenshots of area that troubles you.

About setting bit from HMI. Once bit is set it will remain ON until reset command. When you add action for button "Set bit" for trigger "Press", add one more action "Reset bit" for trigger "Release" if you want it to behave like in VisiLogic. Or reset it in ladder.

I wish there was an action "ON while hold", so bit would act like in good old VisiLogic.

Link to comment
Share on other sites

Hi Isakovic,

Thanks for the reply.  I'm posted a few pictures of the actions in question.

One of the buttons that does this is the "HMI_START_N2..." As you can see it's setup as a Set/Reset.

The second picture shows where/how this logic executes. The issue is the reset never seems to occur. This subroutine "pre-oxidation start" is called continuously also. So it looks like unilogic just stops executing the second "reset" command. 

I've had other buttons do this as well with the set/reset setup and the way I've gotten around it, as stated in the original post, by using a not-output to clear them when the process completes

So with this, I seem to be missing something on how unilogic executes the HMI commands vs. standard IO. Any other IO would have been false, but this stays true.

Screen Shot 2019-01-19 at 9.37.14 AM.png

Screen Shot 2019-01-19 at 9.39.13 AM.png

Screen Shot 2019-01-19 at 9.39.39 AM.png

Link to comment
Share on other sites

Hi Flex727,

The "positive transition contacts" suggestion in the OP actually came from a few of your older posts.

First question:

 Why doesn't the current logic work? As in, why doesn't it reset?

And with the positive transition contacts. I imagine the "Set" from the HMI is just like a latching input, so does the positive transition contact provide the "unlatch" portion as well. I see how it would work, but I like to try and understand why /how certain functions work. 

A better way of putting it, the positive transition stays on for one cycle when the input goes hi, what keeps the PLC from doing what it's doing here and just just not to turn it off?

Lastly, with the "positive transition contacts" I assume I can remove the reset part of the button.

Thanks for your help

Link to comment
Share on other sites

  • MVP 2023

You're conflating coils and contacts. A coil is what you use to change the status of a binary memory bit (0 or 1), a contact is what you use to perform an action based on the status of that bit. (apologies if you already know this but your comment indicated to me that you might be confused on this point)

"Setting" a coil is the same as latching it. It will stay on until it is unlatched (Reset). A positive transition contact will pass logic power flow for one PLC cycle when the the coil is energized (whether by direct or latching). That positive transition contact will not ever pass logic power again unless the coil turns off then on again.

42 minutes ago, jlofft said:

Why doesn't the current logic work? As in, why doesn't it reset?

It absolutely does (if you coded the button correctly), but with a direct contact instead of a positive transition contact, it can execute many times (maybe hundreds of times) before the reset occurs because of the time it takes to remove your finger from the button.

42 minutes ago, jlofft said:

so does the positive transition contact provide the "unlatch" portion as well

No, absolutely not.

42 minutes ago, jlofft said:

A better way of putting it, the positive transition stays on for one cycle when the input goes hi

Yes, correct.

42 minutes ago, jlofft said:

what keeps the PLC from doing what it's doing here and just just not to turn it off?

I don't know what you're asking here.

Link to comment
Share on other sites

Hello,

Thanks for the response. With regards to this

"It absolutely does (if you coded the button correctly), but with a direct contact instead of a positive transition contact, it can execute many times (maybe hundreds of times) before the reset occurs because of the time it takes to remove your finger from the button."

The contact is staying "true" even after the press has been released, so when the process restarts, it zips right past this section.

Now there may be one aspect that is causing this: the visibility of this button is linked to the "N2 purge ready" coil on the line above it. If this button is pressed it would move to the next state and thus the button on the HMI Button becomes invisible. Does this keep the PLC from evaluating the button state?

"what keeps the PLC from doing what it's doing here and just just not to turn it off?" Sorry, this was worded poorly. 

Would a positive transition contact be subject to the same issue due to invisibility (if this is the cause?). When the program transitions to the next state and the button becomes invisible, If the PLC stops evaluating the button state (N2_HMI_READY) and thinks it's permanently set is it possible the positive transition contact gets stuck in the off state (since the HMI button doesn't et reset) and I have the opposite issue.

Thanks for the responses, I do appreciate it.

 

Link to comment
Share on other sites

  • MVP 2023
Just now, jlofft said:

Now there may be one aspect that is causing this: the visibility of this button is linked to the "N2 purge ready" coil on the line above it. If this button is pressed it would move to the next state and thus the button on the HMI Button becomes invisible.

Yes, if the button goes away, you can't unpress (release) it! If you insist on hiding the button when pressed, then reset the coil in ladder logic.

3 minutes ago, jlofft said:

If the PLC stops evaluating the button state (N2_HMI_READY) and thinks it's permanently set is it possible the positive transition contact gets stuck in the off state (since the HMI button doesn't et reset) and I have the opposite issue.

I don't see "N2_HMI_READY" in your post, so I don't know.

Link to comment
Share on other sites

  • MVP 2023

As an aside, this is a classic instance of needing to understand the principle of how something slightly out of order for just one scan  can completely upset an expected result.  Sometimes they can be very hard to trace in complex programs. 

Although perhaps not relevant here, don't expect an element to do something.  If unfamiliar with a process, learn all about the correct way to use it through actual trials of the basics before incorporating it into something bigger.

cheers, Aus

Link to comment
Share on other sites

Thanks for the input everyone.

Flex727.

The coil in question is the last coil in the second picture "N2 Purge Ready."  Essentially, is it possible the Positive Transition Coil for the HMI input to get stuck in the off setting since the button becomes invisible and thus is never checked again for the return to off state (HMI button is always true since it never "resets")

Would a Positive Transition Contact resolve the issue discussed here? Seems like it would if the question above is false.

Ausman.

Yes, this is something I definitely try to be aware of when writing these because it's happened in previous code (probably to everyone). I would love to be able to simulate and test-play,  which is why it would be absolutely fantastic if Unitronics ever develops a simulation program because the amount of IO and wiring that needs to be installed/bypassed to test even these smaller aspects (invisibility and state transitions, as this programs required X,Y,Z to happen before states can move forward) can be significant time sinks.

It's also a little disappointing that Unitronics doesn't have a "momentary push button" option which is what the set/reset logic is supposed to emulate, and is virtually standard throughout all programming libraries except Unitronics. But, it looks like they sort of get around this with the Positive Transition Contact, however, it's far less than ideal.

I chose Unitronics on this project because of its smaller scope and features that come built-into the HMI, and would definitely use it again. But, ff I were doing something mission critical or needed to do significant prior testing I would probably use a software that had simulation tools so I can test out various aspects of the buttons, etc.

Thanks for the input everyone.

 

 

 

 

Link to comment
Share on other sites

  • MVP 2023
3 hours ago, jlofft said:

significant time sinks.

I respectfully disagree.  Often getting to know how to use something doesn't take a lot of ladderwork to simulate the particular operation you are trying to use, if you just stick to the single principle you are learning. 

And learning is the crucial word.  We all learn something new every day!  And sometimes something a little more complex takes a bit longer to rearrange the brain cells correctly, so an inevitable part of learning is the varying time spent doing so.

I have used simulators in the past and none of them could accommodate some of the things I work with.  It is a bit of a minefield because there are so many reactions possible to a plc instruction, and thus it is hard for the sim creators to cater for everything needed.

cheers, Aus

Link to comment
Share on other sites

  • MVP 2023

 

On 1/19/2019 at 2:40 PM, jlofft said:

If the PLC stops evaluating the button state (N2_HMI_READY) and thinks it's permanently set is it possible the positive transition contact gets stuck in the off state (since the HMI button doesn't et reset) and I have the opposite issue.

Your typo confused me. The bottom line is that the bit assigned to the HMI button will not Reset if you have the button action assigned to reset on release but the button is hidden before it can be released.

15 hours ago, jlofft said:

Essentially, is it possible the Positive Transition Coil for the HMI input to get stuck in the off setting since the button becomes invisible and thus is never checked again for the return to off state (HMI button is always true since it never "resets")

It would be helpful if you would be precise in your questions. There are lots of contact, coils, and HMI elements in your posts - and there's no such thing as a Positive Transition Coil.

The statement above (starting with "The bottom line...") along with what I mentioned before that Positive Transition Contacts are energized for exactly one PLC cycle when the associated coil is energized should answer all your questions. The positive Transition Contact will be re-evaluated on every scan, but the requirement for being energized is a positive transition of the coil, therefore it must see the coil turn off, then back on again to be energized again for one PLC scan.

If your question isn't answered yet, try to ask again in a different way and I'll try to help.

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