a little help with PLC programming

dana123

Member
Join Date
May 2006
Location
california
Posts
12
Hello,
I was wondering if I could ask a question about programming....
I am VERY new to writing PLC but not troubleshooting. Anyway, I am trying to learn on a Micrologix 1000, using a PC and RSLogix 500.
I want to write a program to count up binary, on about 5 lights, using as an input a toggle switch.It should be a simple program, but I cannot get past a small problem. When I throw the switch, it keeps counting. I only want 1 pulse with the switch up, so it counts up slowly. I need to like de-bounce the switch, sort of. Any ideas???

Thanks,
Dana
 
You could use an upcounter instead of a timer, then it will only increment on each positive transistion. CTU instruction I do believe
 
Maybe if you share with us your current code, we can tell you what is wrong with it....
 
my attempt

This is what I have so far. I used the CTU, because I could not
get the OSR to work.
It counts up to 8 but I cannot add any more sub rungs the way it is. Is there a limit on sub rungs?

Dana
 
Hmm... I think I just figured it out...
A-B does have a couple of quirks, and one of them is the way you branch around things in the code. Take a look at THIS post, specifically posts 4, 6, and 9. I think that'll answer your question about rungs.

If not, let me know, and we'll help you out some more.
 
that works

Thanks Tom,
That works. There is probably a better way to do this,
but it works. ;)
I never would have found that quirk out.
Thanks again.

Dana
 
Hehe... yes... It's definitely the "brute force" method.

Maybe for your next project you can come up with a "pattern" based method rather than a "memory" based method.

Good job with your first project! And welcome aboard......
 
tom is right, but it's good to see that somone tries to do the job.

if you look closer at C5:0.ACC (hint switch to binary view) you will see that count is already stored in right format, you just have to pick bits you need...

cnt.gif
 
that's awesome!!!

Thats what I'm talking about....
I will try this, this evening. This looks WAY to easy.:)
This will really do the same thing????

Dana
 

Similar Topics

I would like a little help ID'ing a HMI - PLC combo unit. I have looked this thing over really well, and I have yet to find a brand name on it. I...
Replies
5
Views
2,189
Hello everyone, I'm really interested in playing with PLCs, i'm thinking of picking up a TECO GENIE II SG2, its relatively inexpensive. As for the...
Replies
14
Views
3,440
We lost a plc 5 processor this morning and in our stock room we have a replacemnet that looks like it cam from the rockwell exchange service at...
Replies
3
Views
2,000
Hi, I have a couple more questions. Along with the GE stuff that I received I need to buy a few more simple PLC's for a couple of projects. These...
Replies
2
Views
1,901
to get straight to the point im working with a PLC-5/20 programmable controller, is mounted on a 1771 a3b1 12 slot chassis. it has 1771 ofe and...
Replies
8
Views
8,292
Back
Top Bottom