2 OSR's same bit

I LIKE ONE RUNG PROBLEM SOLVERS -
CODE
1 2 2
|---| |----|/|---------( )-|
| 1 2 |
|-|/|----| |---|
| PB 3 1
|-| |---[OSR]-------( )-|

WHY DOESN'T A/B COME UP WITH A TOGGLE INSTRUCTION?
PB 1 2
|----| |-[TOG]--------------( )---|

MITSUBISHI HAS ONE......

"YOU CAN'T PAY ANY MORE AND GET ANY LESS"
 
KEN_KACEL said:
WHY DOESN'T A/B COME UP WITH A TOGGLE INSTRUCTION?
PB 1 2
|----| |-[TOG]--------------( )---|

MITSUBISHI HAS ONE......

"YOU CAN'T PAY ANY MORE AND GET ANY LESS"

See Ron's post above. I looked in the Mitsubi FX2N documentation and I didn't see a toggle instruction. I did see an ALT instruction. Mitsubishi's ALT instruction is a little cleaner as it incorporates a one shot and a XOR in one block.
 
Ooooohhhh, the ol' one-button on/off routine.

I know this thread didn't quite start out this way but...

It's always fun to go back and hit the same thing over, and over, and over...

Well, in this case, it is!

Let's see, how many different ways can the one-button routine be done... let me count the ways...

Nahhh, forget that.

Let's see, there's finesse, there's efficient and then there's... the maintenance way. The "maintenance way" ain't a bad idea. It's just that the HMI should "tell" the maintenance folks the problem. That's the programmers responsibility. The maintenance folks shouldn't have to go looking in the program for the problem in something as simple as this.

So, assuming that the HMI is more of an ornament... How can this code be written so as to give the maintenance folks have a chance of troubleshooting it?

One-shots are so elusive... you really can't expect to catch one on your display. The end effect can be seen, but the casual factors might be missed. So, how can this be put into a reasonable "steady state"? At least steady enough that the actions can be followed.

Here's one that I think makes it real easy to follow and to see what's going on.
One guy at the button, another at the display.


PB1 SKIP LT
---| |-------|/|---+---|/|---(SET LT) This is not a "SET"
|
| LT
+---| |---(RST LT) This is not a "RST"


.
When the Pushbutton is pressed, SKIP is OFF. The LT Output is either ON or OFF. If ON, turn ON the SET LT bit. If OFF turn ON the RST LT bit.

SET
LT PB1
---| |---+---| |-------(SKIP)
|
RST |
LT |
---| |---+
|
SKIP |
---| |---+


.
If either SET LT or RST LT are ON, it's because the PB is ON, so, latch SKIP.

SET RST
LT LT
---| |---+---|/|-------( LT )
|
LT |
---| |---+


.
If SET LT is ON then the LT Output is latched ON.
If RST LT is ON then the LT Output is unlatched (OFF).

At the top of the next scan, SKIP is ON, so SET LT and RST LT are disabled.

In the next rung SKIP will remain latched until the PB is released and detected by this rung.

The LT Output in the last rung continues to maintain the last commanded state.

When the PB is finally released, the first rung still shows SKIP to be ON in addition to the PB being OFF.

In the next rung, PB1 OFF unlatches SKIP.

The LT Output in the last rung continues to maintain the last commanded state.

When the PB is pressed again, the same routine happens, except, this time the PB causes RST LT to go ON. This turns the LT Output OFF.

When Maintenance folks fire-up the ol' computer they can pretty much see what's happening, or not happening, as the button is pushed and released. It would be good to hold the button pressed for a time to see the effect, or lack thereof.

Granted... the SET LT and RST LT bits act exactly like one-shots. But, if all three rungs are examined, the cause & effect can be determined.





Another one that occurred... a bit similar to some posted...


+-------+
PB1 | COUNT |
---| |-------| |---------(DUMMY)
| |
+-------+


.
When the Pushbutton is pressed, the count is incremented.

+-------+
CNT 2 | MOVW |
-----|>=|------| 0 |-------(DUMMY)
| COUNT |
+-------+


.
If the count is greater than or equal to 2, then the counter is reloaded with 0 immediately!

CNT 1
-----|=|-----------------------(LIGHT)


.
If the count equals 1 then turn the Light ON, else OFF.


BTW, KEN_KACEL...

You've been around long enough to know... please... Preview before posting!
And use the following technique to get your ladder code looking right...


[LADDER]

---| |---+---|/|-------( OUT )
|
---| |---+

[/LADDER]

 

Similar Topics

Just wondering if i can make my code look a little nicer and sharing storage bits like below https://imgur.com/a/SMNxOPu does this work or does...
Replies
9
Views
1,585
Hi all. Simple as simple can be, I don't understand what's happening. I'm toggling he OSR on, GX_LUB_PUMP1_LEAD should switch. It doesn't. The...
Replies
27
Views
674
Hello, I am having an issue with an OSR bit starting a rotary indexer. Running AB studio5000 on a 5069 L320ER v32.1 I have 13 inputs before an...
Replies
9
Views
2,370
We have a vendor that loves ONS logic. It does ok as long as things run as expected. Well we all no nothing runs as expected for very long. If the...
Replies
3
Views
1,345
I'm looking at an offline copy of a program that has these two rungs, in this order (see attachment). B3:16/3 is a OSR in the first rung and an...
Replies
9
Views
2,407
Back
Top Bottom