Any idea why my counter won't count?

gappvembe

Member
Join Date
May 2007
Location
MI
Posts
81
I just don't get it. I:1/6 when made should make the Accum of either C5:6 or C5:7 go up depending on if I:1/27 is made or not.
Here is what I do know, I:1/6 is changing state (it is a photoeye that I flag and when online with the PLC, I can see it change state, futhermore on the PLC itsself I see the LED light go on & off) as is the I:1/27 (which is a micro-switch).
:confused:
CountersADCO.jpg

Furthermore which is odd, is I made this progrom on a PLC in my office and tested it and it worked fine. What I don't get is why when implemented into the larger program, it doesn't work.
Any thoughts on this would be great. Thanks all.
 
First thought: Is this a subroutine and is the subroutine actually being scanned? A non-scanned subroutine will still accurately show the state of all IO, but none of the instructions are actually running.
 
Check to see if something else is reseting your counter, maybe they are already being used in the program.
 
Alaric said:
First thought: Is this a subroutine and is the subroutine actually being scanned? A non-scanned subroutine will still accurately show the state of all IO, but none of the instructions are actually running.
Yes this is. That is probably the problem. I've never really implemented a JSR. I actually haven't programmed that much, I had a class on PLCs about 5 years ago. All I normally do is change a timer, or troubleshoot I/O. I try sticking with running wires, test motors, etc. Unfortunalty I get stuck wit PLCs too. This site has been a big help.
 
You might try to enter a value in the Accumulator and see if it sticks or if it's being reset. You could also check for other Reset instructions (in RSLogix you can right click on the Reset instruction and do a Find All). For example.... if Rung 0006 true?
Also, if other rungs adjacent to this one are not toggling on and off you might have a subroutine or other control instruction issue.
 
DaleP said:
You might try to enter a value in the Accumulator and see if it sticks or if it's being reset. You could also check for other Reset instructions (in RSLogix you can right click on the Reset instruction and do a Find All). For example.... if Rung 0006 true?
Also, if other rungs adjacent to this one are not toggling on and off you might have a subroutine or other control instruction issue.
That is just it, I did find all for everthing - counter, timer, Inputs, outputs. These are it.
I manually put in the full Accumm [12].
I even forced on the outputs, each one at a time since it a double acting solenoid.
All in all, nothing happend.
I am going to try an JSR
 
gappvembe said:
Yes this is. That is probably the problem. I've never really implemented a JSR. I actually haven't programmed that much, I had a class on PLCs about 5 years ago. All I normally do is change a timer, or troubleshoot I/O. I try sticking with running wires, test motors, etc. Unfortunalty I get stuck wit PLCs too. This site has been a big help.

I'm assuming that you are using a SLC5/03 /04 or /05 since you are using 1746 IO cards. In the SLC platform routine 2 is your main routine. In routine 2 you need to insert an unconditional rung that has the JSR instruction on it and put this routine number in the JSR instruction. This will cause the program to jump over and process your new routine when the JSR is executed. After your new routine is done it will return to the calling JSR in the main program.



gappvembe said:
I even forced on the outputs, each one at a time since it a double acting solenoid.
All in all, nothing happend.

With the ouputs forced on you still must enable forces before they will actually come on.

A05292007-1.GIF
 
Last edited:
Alaric said:
I'm assuming that you are using a SLC5/03 /04 or /05 since you are using 1746 IO cards. In the SLC platform routine 2 is your main routine. In routine 2 you need to insert an unconditional rung that has the JSR instruction on it and put this routine number in the JSR instruction. This will cause the program to jump over and process your new routine when the JSR is executed. After your new routine is done it will return to the calling JSR in the main program.





With the ouputs forced on you still must enable forces before they will actually come on.

A05292007-1.GIF
Using the JSR worked!!!
Thanks all of you.
And yes I had to enable all forces for them to come on. Something I overlooked since normally anything I've come across already has that on.
Anyway as far as I can tell it will work like a charm. (The only reason it doesn't at the moment is I have to wait for a 24V Solenoid, since all we have here at the moment is 120V. :mad:
 

Similar Topics

I am trying to create an agnostic product queue builder using PLC ladder logic. I have a pallet conveyor and would like to be able to use a NO or...
Replies
18
Views
2,225
Hi all, I have been working on a tool for my company that handles a specific task our company runs into often related to PLC's. This is a tool I...
Replies
15
Views
2,874
I asked this question briefly in my previous post long post, I'm asking again here as the main point so it doesn't get buried. I am pretty new at...
Replies
3
Views
1,516
Everything worked fine until a program file was put in a box from another country, then I used it to fill in the gaps in the program, on my...
Replies
1
Views
1,013
Just wondering if anyone knows whose PLC this is?
Replies
40
Views
12,299
Back
Top Bottom