hawkeyen2001
Member
Experimenting with an s7-200 to use for a high speed application, I downloaded a tip from the S7-200 Documentation CD (Tip 04 - Using High Speed Counters). In this example, a high speed pulse output (20kHz) is tide back into a high speed input. Using interrupts, the program goes through a series of counts. The example was originally written for a 216, but changed it for a 224XP. It ran well. And I experimented with changing the pulse output, etc...
I ran into an interesting problem when I added a normal counter in OB1 tied to the same high speed input. With the pulse output set for milliseconds, I could vary the high speed pulse output to 1 ms (2 ms - 50% duty cycle pulse) without losing any counts. I thought I might lose some counts at this speed (the scan time for the PLC was between 1 - 2 ms), but didn't. Changing the pulse output to microseconds, and testing it at 1000 microseconds (1 ms), I started losing counts, which was puzzling since I expected the output to be the same.
Does anybody know why this would be? I haven't put the output to an oscilliscope, but theoritically, the pulse should be the same length, and shape whether my setting is 1 ms or 1000 microseconds. I also experimented with the input settings, and latched the input for each scan and still had the same results. Out of 30,000 counts, lost between 100 and 200 counts each time.
I ran into an interesting problem when I added a normal counter in OB1 tied to the same high speed input. With the pulse output set for milliseconds, I could vary the high speed pulse output to 1 ms (2 ms - 50% duty cycle pulse) without losing any counts. I thought I might lose some counts at this speed (the scan time for the PLC was between 1 - 2 ms), but didn't. Changing the pulse output to microseconds, and testing it at 1000 microseconds (1 ms), I started losing counts, which was puzzling since I expected the output to be the same.
Does anybody know why this would be? I haven't put the output to an oscilliscope, but theoritically, the pulse should be the same length, and shape whether my setting is 1 ms or 1000 microseconds. I also experimented with the input settings, and latched the input for each scan and still had the same results. Out of 30,000 counts, lost between 100 and 200 counts each time.
Last edited: