Simple explanation of program

mgruber

Member
Join Date
Jun 2009
Location
dallas
Posts
12
I have a slc 502 processor in a seven slot rack with HSCE high speed counter module. I am trying to configure it to count up from zero to 1000 and 1000 down to zero.. if I turn the encoder clockwise it will count from zero to 200 and reset back to zero and then count zero to 200 again, now if I turn the encoder counterclockwise it will count down to zero and start at 1000 counting back to 800 and reset back to 1000 and then back down to 800 again. Rotating clockwise or counterclockwise gives me a different result. I am trying to count from zero to 1000 in one direction and 1000 to zero in the opposite direction. But that is not what is happening I was hoping someone could give me a simple explanation of what might be the problem. I have loaded a zip file with my program in the attachment. I was hoping someone could look and please explain what they believe might be happening. Any and all help would be appreciated. Thank you PS. This is a very short ladder logic program.
 
Well, the program that you loaded does very little. It appears that you deleted a bunch of rungs and left only what you thought applied to your question. I hope you did not delete something important to your question!

Rung 000: On the First Scan of the PLC (after power-up or after switching from PROGRAM to RUN mode), the COP (Copy) instruction copys data from Memory Locations N11:0 up to N11:41 (Length of 42 words) and puts it in the High Speed Counter module memory M0:6.0 to M0:6.41.

N11:34 contains the value "1000", but most of the other locations are 0. I assume that these numbers are some type of setup for the High Speed Counter Module in Slot 6 of your PLC, because the HSCE has a Control File MO of Length 42 (look under menus "Controller", "IO Configuration").

Also, during the First Scan, the branch Latch instruction sets bit M0:6:1/12 in the HSCE module to "1". Find out what this is supposed to do. Again, you need the manual for your specific HSCE module.

Rung 001: The MOV (Move) instruction reads a value from the High Speed Counter module, Input I:6.0, and saves it to PLC memory location N7:0. The Input I:6.0 may or may not be correct, because it appears that the HSCE module has inputs I:6.0 to I:6.7. You need to get a copy of the HSCE manual from Rockwell Automation, and see how the inputs are configured, and what each one is used for. Usually there are several different ways of counting using one of these modules.

Rung 002: This rung looks at value of N7:0 (now containing value of I:6.0). If this value is less than 1000, then Output O:3.0 is turned ON.

Rung 003: This is the END statement, always the last rung.

If you get a copy of the manual for the HSCE, you can probably figure out what values to put into M0.6 to make it count like you want.
 
Last edited:
Thank you ..
this was exactly what I was hoping for. I found the slick 502 processor and hsce high speed controller in a derelict piece of equipment, I was able to go online and upload the program after establishing communication.
I worked with a slc 500 plc in the past ..I was curious about the high speed controller module . I would like to use this for an application that requires the module to start at zero and count up to 1000 in one direction and count down from 1000 to zero in the opposite direction. All I am really trying to do is reference the position of the encoder to a preset value in a compare statement. Very similar to the output in the program. I would greatly appreciate if you could explain how to make the encoder counts up and one direction and down in the other. And thank you again for your assistance. It is greatly appreciated.
 
M0:6:1/12 is the 'Counter Enable' bit. it is being set appropriately.
I:6.1 is the appropriate register for the current count of the counter.

You can see the configuration in the I/O configuration while offline. Click on the High Speed Counter. Click Adv Config. In the next window click on "Configure'.

You can see that the counter is set as a ring counter. In one direction it would normally count up to 1000 then rollover to zero then continue on. In the other direction it goes the opposite way. But note that Reset Mode 'Z' is set. This implies a marker pulse from the encoder. I bet the encoder is a 200 pulse per revolution encoder. it is resetting to zero each time the Off-To-On edge of the marker is encountered. Try turning off that selection and re-downloading.

Edit - as a note, because 'Rate' is selected the frequency of the incoming signal, updated each second, will be available in I:6.3
 
Last edited:

Similar Topics

Hello and welcome I want simple explanation how to use recipe with HMI delta. All i have got knowing its just making memory registers with its...
Replies
1
Views
6,012
Hello Folks, OK, while going through a program at work yesterday, I came accross this symbol -]p[-, and found out it was for positive edge? That...
Replies
3
Views
4,536
Hi all, Writng a FB in ST on Beckhoff TC for a pulser which turns on and off on a cycle, is paused by turning bControlInput to FALSE, but resumes...
Replies
6
Views
245
I'm trying to build my Classic Step 7 programming skills this weekend. I get stuck on little things that are not covered in YouTube tutorials. I'm...
Replies
7
Views
311
I have a program that does a 7 second "scan" sensor calibration routine whenever a setting (setting is called assistance level or "AL" and ranges...
Replies
3
Views
207
Back
Top Bottom