QUOTE(learning engineer @ Nov 28 2007, 02:54 PM) [snapback]62164[/snapback]
i have been trying to use the HSC on the ML1100 (using RsLogix500), but could not get any count. Can someone shoot me a sample program? I am trying to read from 2 different input; I:0/0 and I:0/1. the frequency is 50hz, and the max count is 50,000.
thanks
Here is a program I am in the process of re-writting. I am using a slot count photoeye on a rail that has a hole cut every 1/2". So each on/off on the photoeye is 1/2".
I did get the high speed counter to work. I don't have all my ENABLE bits and such working, so what I have right now is I go into the function file HSC, and I toggle the bits manually. Normally you have to do this in program mode, toggle your bits, then go into run mode.
For example to get the function to run I have toggled:
FE - Function Enable = 1
AS - Auto Start = 1
CE - Counting Enabled = 1
Ladder 10 had the counting. I am not really using Ladder 11, but you have to define a ladder in the HSC.
The way I see it, you can set it up two ways.
Set your HIP - High Preset to your count - then when the ACC - Accumulator hits this, it will excute your code in ladder 11. In an interrupt style fashion.
I set my HIP to 10,000, and scan normally and watch the ACC in normal scan. Ladder 10. My scan time is fast enough to read the a count, and I am only using the high speed for counting. I also when into advance I/O and changed the update input speed time.
If your scan time is not fast enough, I recommend you set your HIP to your count, and excute ladder on an interrupt bases in ladder 11. Basically when your HIP his pre-set, the scan jumps to ladder 11, resets your HIP, resumes to scan where it jumped from, then counts again.