July 15, 2006, 8:59 pm
I have what is bound to be a very simple question. I am using AB
SLC500's but the logic will be there regardless of what platform I
would be using.
I am trying to take a normally open switch such as a push button and
make it toggle a binary bit on and off. SImple butI can't seem to grasp
what I need to do. I am sure someone has done it before.
Thanks for any assistance.
Re: ladder logic question
Stanislaw Chmielarz wrote:
Don't you mean set-reset?
bakerjw2000,
Does the device repertoire not include a toggle switch? If not, you can
do what you want with two pushbuttons and either a set-reset flipflop or
a latching relay. (You can make a latching relay from a single two-pole
relay a normally-closed, and a normally-open pushbutton.)
Jerry
--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Re: ladder logic question
Stanislaw Chmielarz wrote:
...
Thanks for explaining. There are toggle flip-flops that aren't D types.
With your arrangement, I would demand an indicator output to make the
state of the toggle known. Working blind is not good practice.
Jerry
--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Re: ladder logic question
I arrange my branches differently, but the effect is the same (corrected
for SLC addressing & instructions). The trick is remembering that ladder
logic executes instructions one at a time.
SOR XIC I:1.0/0 OSR B3:0/10 OTE B3:0/11 EOR
SOR BST XIC B3:0/11 XIO B3:0/12 NXB XIO B3:0/11 XIC B3:0/12 BND OTE B3:0/12
EOR
SOR XIO B3:0/13 OTE B3:0/13 EOR
alternates on every scan.
Mike
Re: ladder logic question
With the advice of a flip flop, I was able to locate a forum that
addressed multiple methods of performing the operation that I was tring
to perform. i.e. Press a button and a contact turns on. Press it again
and the contact goes off.
Really need a monospace font to view the ladder.
PB Target R1
--] [-+-]/[--+--------------------( )-
| |
R1 | PB |
--] [-+-]/[--+
PB R1 Target
--]/[-+-] [--+--------------------( )-
| |
Target| PB |
--] [-+-] [--+
Thanks for all of the advice. It always helps to see multiple ways of
doing things.
Re: ladder logic question
B3:0/12
That's a good way to do it.
I thought that your method might save a word or two of memory, but both your
example and mine compile down to 13 instruction words (in a SLC500, anyway.)
Actually, doing it the following way uses only 10 words of memory, but by
the time you add a rung to examine C5:0.ACC/0 you are back up to 13 words,
and then you are using 3 rungs, so I generally avoid it.
SOR XIC B3:0/0 OSR B3:0/10 CTU C5:0 2 0 EOR
SOR XIC C5:0/DN RES C5:0 EOR
Thanks for the tip.
Re: ladder logic question
bakerjw2000 wrote:
I see you found one of the www.plcs.net threads on flip flops. Search
for tidbits and toggles too. There are many threads about this on
www.plcs.net because unlike you, the rookies can't search and think
they are the first to have this problem. BTW, beat this.
Output = Output xor ( Input and not LastInput )
LastInput = Input
This would translate into 4 instructions. You can get it down to 3 if
you change LastInput to NotLastInput
Output = Output xor ( Input and NotLastInput )
NotLastInput = not Input
This takes advantage of the fact that the not instruction can negate
and move at the same time. The downside is that NotLastInput must be
initialized at first scan. Perhaps initializing is necessary anyway.
Rockwell does not provide a bitwise xor or alternate function except on
the 5000 family. I use word or dword functions to process 16 or 32
bits at a time anyway instead of processing the bits one by one.
OT ladder logic question
DaveB wrote:
...
I often find that what at first seems like a dumb question is in fact a
deficient reading of the question. I'd embarass myself more often if I
didn't realize that.
Jerry
--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Site Timeline
- » Advantech drivers for PCL-711B control/DAQ ISA card
- — Next thread in » Industrial Control Group
-

- » I need an old PLC software - Can someone help me?
- — Previous thread in » Industrial Control Group
-

- » Measurement validation for process signals
- — Newest thread in » Industrial Control Group
-

- » A new attraction : "Velo-rail"
- — The site's Newest Thread. Posted in » Model railroading in the UK
-

- » DRMM 2012: Kein 35Mhz-B-Band
- — The site's Last Updated Thread. Posted in » RC and scale modeling (German)
-


Subject







