Step counter

Hauke David

Member
Join Date
Sep 2002
Posts
3
I have just gained access to a plc at work and already struggle with the step counters in the ladder diagramm.
Are there any rules or methods to understand the usage of step counters.
Please bear in mind that I am a beginner.
Any advice will be appreciated.
 
RTFM

Go to AB.com and select Support. From Support, select Online Manuals.
Find the Control Processor manual for the SLC instruction set. (I'd post a link, but I think they make you register first.

Read the section on CTUs.

The only important things:
  • They increment on a low-to-high transition (so there's no need to put a one-shot in front of them). But that also means that the input condition must go from high-to-low for them to "see" the next puls.
  • They need to be reset at some point to go back to zero. That's the RES command.

If you have more specific questions, post again.
 
I'm going to stick my neck out on this one. What do you mean by "step counter"? I'm not familiar with that term. My best guesses:

(1) you're asking how the CTU (count up) instructions work. (If so then Allen's post should help a bunch).

(2) you're asking about some programming technique which has been documented as a "step counter" by a previous programmer.

If you're asking about this last item, then you'll probably have to give us an example of the program structure that's puzzling you.
 
I am curious now, is this a spot welder and the item or welder moves down a line? I saw something like that done before, the counter was to count when the welds were made (in my case it wasnt welding but same principle) then the item moved which increased count to activate next step. Once it reaches final count then it resets to begin again, either returns to start or waits for new piece.

Can you describe the system pertaining to the "STEPS"?
 
Hauke David,

You said you are confused with how the “step counter” functions. I’m just guessing here but I think that you might actually be confused with the “symbols” which the original programmer has used for the “step counters”. In case you are not familiar with Allen-Bradley symbols, let me give you a few tips which may help. A “symbol” is a “nickname”. In other words, when the original programmer used the symbol “S2STEP_CTR.ACC” as “Source A” in an EQU (equal to) box, he was actually using the “nickname” for a regular-old, run-of-the-mill type CTU counter. Try this:

In RSLogix500, right-click on an EMPTY area of the ladder display window. A small window should pop up with “Properties” as one of the selections. Click “Properties” and then go to the “Comment Display” tab on the window which opens next. Near the bottom of this window, turn on the selection for “Show Symbol & Address” then click the “OK” button.

Now when you look at the same rungs which you showed in your previous post, you should see the “symbol” (example: S2STEP_CTR.ACC” above the EQU box. Inside the EQU box, you will see the actual address of the counter (example: C5:0.ACC). Once again, I’m just guessing here, but I’ll bet that when you see the address displayed this way, then your “step counters” will start making more sense to you. When you look at the “output coils” on the end of your rungs (let’s use your rung number 0177 for example) you will see the symbol/nickname “S2STEP_1” above the coil – and you should also see an address too. Since I don’t have your complete program, I can’t tell what that address will be – so I’ll just use “B3/1” as an example.

Let’s go a little further. Using C5:0 as an example, the “symbol/nickname” (example: S2STEP_CTR) actually applies just to the counter C5:0. Notice (very important) that this time I did NOT type “.ACC” on the end of the symbol. That part of the address refers to the Accumulated value inside the counter. In other words, “How high has this counter counted?” I’ll bet that there is a CTU (count up) counter somewhere in your program which is being used to keep track of what “step” has been reached in your welding process. Here’s how to track down that counter. At the top of the RSLogix screen is a white entry area. It’s not really marked but it is located just to the left of some little binocular icons. Click in that box and type the address of the counter you’re looking for. In my example, I’d type “C5:0” – you might have to type a different address. Use the counter which your original programmer used in the EQU box. And DO NOT type “.ACC” at the end of the address - and don’t type the quote marks either - work with me here. Now click the little binocular icon which has a file behind it. This is for “Find All”. A window should open giving you a list of all of the places where this counter is used in your program. (Important note: if the “Find All” feature won’t work at all, just click somewhere (anywhere) on the ladder display window and then try the “Find All” feature again. The ladder display window must have “focus” before the “Find All” will work. It’s a Windows thing).

Now scroll down through the list and click the line which has CTU on it. Your program display should instantly shift to the rung which controls the “step counter”. If you know enough about ladder logic to interpret the conditions in this rung, you should be able to figure out what makes your “step counter” advance.

Here’s how to interpret the rungs which you posted. I’ll use your rung number 0177 and counter C5:0, and bit B3/1 as examples).

Using the examples I mentioned, rung 0177 says: If the value in counter C5:0’s Accumulator is EQUal to 1, then bit B3/1 will be ON. But if the value in counter C5:0’s Accumulator is NOT equal to 1, then bit B3/1 will be OFF.

Again I’m just guessing, but I’ll bet that your “S2STEP_1” bit (example: B3/1) is used throughout the rest of your program to turn things (like clamps, actuators, etc.) off and on as the steps of your welding process advance. It should be easy to find where this bit is used. You could type it into the “search for” entry window just like you did the counter’s address – or just try this: Go back to your rung 0177 – right click the “output coil” S2STEP_1 – then click “Find All” from the window which pops up. You should be able to click on each line in the list and find all of the places in your program which use this bit address.

You should be able to figure out how the other “step” bits in your program work. They just come on and off based on different values in the “Step Counter’s” Accumulator.

I hope I’ve guessed correctly as to what is confusing you. If not, please post again and let us know where you’re having trouble. You’re probably going to have to be pretty specific in describing your confusion. And yes, I know that’s a pretty steep order, but it’s hard for us to cover EVERYTHING about a program which we can’t really see. In fact, you might want to consider zipping your .RSS program file and attaching it to any future posts.
 
Excellent explanation Ron. I just wanted to add....

The logic you are showing is not entirely necessary. What I mean is.. you could use the Equal instruction every time you needed to check for the appropriate step to be true. This logic is mapping it to coils just for convenience. It is much easier to use -| |- rather than EQU everywhere you want to examine whether a step has been satisfied or not.
 

Similar Topics

can you help me with this one guys using fluid sim. This is for my bring home exam. providing a problem description, schematic...
Replies
5
Views
2,462
Hello Guys, I am new the forums ad well as a novice programmer/troubleshooter. My software is Siemens S-7 for a 300 PLC. My problem: Coding, I...
Replies
3
Views
1,691
I need to set a Z_RUECK counter using data from HMI: in particular, the ZW input must be set by user (this data is saved in DB7). What is the data...
Replies
2
Views
1,482
I have a problem with a resolver connected to a ET200s counter module. I want to convert the value from the resolver to 0-->359 degrees and then...
Replies
9
Views
4,122
Hello I need to have a variable PV for a counter in Siemens Step 7. I need to fill in a variable such as C#5 as PV. Where 5 is the number of...
Replies
3
Views
5,370
Back
Top Bottom