Compact Logix rung stuck?

JaxGTO

Member
Join Date
Apr 2009
Location
Kalieefornia
Posts
1,071
OK Compact Logix V21

I have a rung in a continious task where the button and the one shot got stuck.

Basic rung:


|--] [----[ONS]---MOV (A to B)-----(U)---|

The ] [ is PB, [ONS] is PBONS and the (U) is PB

I have a Wonderware that sets bit PB from a button. They were complaining that the data from A to B was not getting moved when they pressed the button.

Went online and both the PB and PBONS bits were on. I can't think of a single possibility how they could both be on at the same time. Neither is used in the program anywhere else and bot are bool type. I thought maybe if the PB was set when the PLC was in program mode, but even then first scan would fire the ONS and reset the PB.

Any thoughts? Jack.
 
Rungs don't get "stuck"

Post the actual code (zip it, forum rule) and we can advise
 
I can't speak to how it happened, but here's how every single SCADA/HMI PB interacts with any of my PLC's:
Code:
SCADA_PB_Example                SCADA_PB_Example     SCADA_Example
|------| |---------------------------( U )---------------(  )--|
I never use the SCADA_PB_Example tag anywhere else. I take the SCADA_Example tag and use it in as many places as I like, knowing it's only ever going to be on for one scan. Nice and neat, no oneshots, no possibility of a bit getting held on unintentionally.
 
I can't speak to how it happened, but here's how every single SCADA/HMI PB interacts with any of my PLC's:
Code:
SCADA_PB_Example                SCADA_PB_Example     SCADA_Example
|------| |---------------------------( U )---------------(  )--|
I never use the SCADA_PB_Example tag anywhere else. I take the SCADA_Example tag and use it in as many places as I like, knowing it's only ever going to be on for one scan. Nice and neat, no oneshots, no possibility of a bit getting held on unintentionally.

Exactly how I have done it for more years than I dare mention. Of course the SCADA/HMI button needs to be a "momentary" button

2017-02-15_013137.jpg
 
Exactly how I have done it for more years than I dare mention. Of course the SCADA/HMI button needs to be a "momentary" button

Well, not really. I use a "Set" button quite regularly - the only trick to be aware of is if you use a "toggle" or "latched" PB you have to make sure that it's reading the state of the bit back to know what state to set it to next, rather than just remembering internally what it did last time.
 
OK here is the actual run when I went online.

What I don't get is how did the PB and ONS bits both get on at the same time without doing the move or the unlatch. Very strange.

I should mention this is not my code, just helping the customer trouble-shoot a machine.

Jack.

StuckButton.jpg
 
Try a little experiment. Right before the LIM instruction, MOV HMIR_R01_SET to a dummy DINT.

A wild hunch.

Before this rung, HMIR_R01_SET is set to a value higher than 11.
On this rung, the PB has been pressed, and is ON as you can see. But the LIM instruction evaluates false, because HMIR_R01_SET is not between 0 and 11.
On a rung further down, HMIR_R01_SET is set to 7, and remains this way until the end of the program cycle, meaning that "7" is what you will see when you monitor. But, if you check the value of your dummy bit, you'll see what the value of HMIR_R01_SET was at the time the LIM instruction was evaluated.

The hunch is there because you'll notice that the MOV instruction hasn't been executed either (or if it has, something else further down is overwriting it).

Remember - you may already know this, but just in case - the fact that the OTU is lit up green does not mean that the coil has "power" on it. It means that the value of the tag HMIR_R01_SET_PB is a "1". You can test to see if this coil has "power" on it by putting a dummy OTL in parallel, and seeing if it ever gets turned on. Once again, I suspect it won't.
 
How is HMR_01_Set_pb being turned on from the HMI? Is it a set or momentary? Is it possible that the PB is being turned on again from the HMI after the OTU before the rung is scanned again?
 
Try a little experiment. Right before the LIM instruction, MOV HMIR_R01_SET to a dummy DINT.

A wild hunch.

Before this rung, HMIR_R01_SET is set to a value higher than 11.
On this rung, the PB has been pressed, and is ON as you can see. But the LIM instruction evaluates false, because HMIR_R01_SET is not between 0 and 11.
On a rung further down, HMIR_R01_SET is set to 7, and remains this way until the end of the program cycle, meaning that "7" is what you will see when you monitor. But, if you check the value of your dummy bit, you'll see what the value of HMIR_R01_SET was at the time the LIM instruction was evaluated.

The hunch is there because you'll notice that the MOV instruction hasn't been executed either (or if it has, something else further down is overwriting it).

Remember - you may already know this, but just in case - the fact that the OTU is lit up green does not mean that the coil has "power" on it. It means that the value of the tag HMIR_R01_SET_PB is a "1". You can test to see if this coil has "power" on it by putting a dummy OTL in parallel, and seeing if it ever gets turned on. Once again, I suspect it won't.

I don't see that what you explained matters...if the value was outside the LIM the first time the ONS wouldn't be active as the LIM box would be false. Next scan when the LIM was true and the PB still true the ONS would be active. There's no race condition involved with the LIM. Has to be that after the PB OTU it's being turned on again prior to the next scan.
 
OK Compact Logix V21
Went online and both the PB and PBONS bits were on. I can't think of a single possibility how they could both be on at the same time.

WW turns on PB. The rung gets scanned, and PB gets turned off. WW Turns on PB. The rung gets scanned. Since PB was on the previous scan, the ONS output is off, so the PB doesn't get turned off. ASF's code is a good way to go.

As an aside, I've seen both WW and RSView mess up where they were set up to turn the PB on with press, and off with release. They turned the 'stop bit' on, but the PLC never got the off command. In both cases, the PLC logic did not reset the HMI bit, so the 'stop bit' was 'stuck' on. I assumed there was a communication issue and the PLC never got the command from the HMI. The HMIs were set up so that if the 'stop bit' only worked when the motor was running, so pressing the stop wouldn't set and reset the bit. It was stuck on.
 
From the diagram in post #6 - place the Unlatch on a parallel branch below the ONS and the MOV.

Or just unlatch it immediately after the XIC of it, the rung will still be true to fire the oneshot....

EDIT : I don't see the need for the oneshot, either....

XIC PB, OTU PB, LIM 0 HMIR_R91_SET 11, MOV HMIR_R01_SET RackProfile[1]
 
Last edited:
Or just unlatch it immediately after the XIC of it, the rung will still be true to fire the oneshot....

EDIT : I don't see the need for the oneshot, either....

XIC PB, OTU PB, LIM 0 HMIR_R91_SET 11, MOV HMIR_R01_SET RackProfile[1]

The only reason that this wouldn't work is they are expecting that the "pushbutton" stay on UNTIL the HMIR is within the limits, then proceed with the move. Hard to say what exactly the OP is after.
 
The only reason that this wouldn't work is they are expecting that the "pushbutton" stay on UNTIL the HMIR is within the limits, then proceed with the move. Hard to say what exactly the OP is after.

XIC PB, LIM 0 HMIR_R91_SET 11, OTU PB, MOV HMIR_R01_SET RackProfile[1]
 
I'm not trying to fix it, I just want to figure out how it ended up in that state (which is stuck). It shouldn't be possible.

The first thing I did was see if any of the addresses in that rung were being used somewhere else, and they are not.

The WW has a single script with the line "HMIR_R01_SET_PB = 1;".
The LIM is checking the tag that is on a WW Data Entry field which is limited from 0 to 11.

This PLC has no other communications with anything else and there is just the one WW station that has 4 screens and no back ground type scripts. The WW xrf for that tag is just that one button.

Sorry but I think some of us (including myself) have a tendency to try and solve a problem before seeing what the question really was.
 

Similar Topics

Hello Everyone, I have a issue with communication between two different PLCs. So here is the facts, The Master PLC is Guard Logix 5069 with IP...
Replies
4
Views
71
gents, I am trying to configure communication with EMERSON PK300 controller through port A1 using generic ethernet communication module . I could...
Replies
0
Views
93
I've blown the Output Transistor on the Output Card of a Compact Logix 1769-L24ER-QBFC1B It says J378. Does anyone know the replacement part...
Replies
3
Views
198
I am having trouble with getting no control of my analog output signal. I am using the SCL function block to control my analog output. The logic...
Replies
11
Views
243
I was wanting to see if anyone had any information on setting up a cub5 meter and getting the data to a Allen bradley PLC. I think i have the set...
Replies
0
Views
129
Back
Top Bottom