Troubleshooting
Why converted CompactLogix timer ACC values jump after SLC migration
Short answer
A 20 to 70 ms timer ACC spread after converting SLC 500 logic to a CompactLogix is expected, not a fault: Logix timers count in 1 ms while SLC timers counted in 10 ms steps, and every prox edge is quantized by the input module's RPI plus the task interval. Budget roughly 40 ms of wander on a period-pair difference, then fix one-shot mapping, input buffering and SCP limits carried over in the wrong units.
On this page
The 20-70 spread is the new platform's measurement floor, not a fault, and no amount of SCP tuning will remove it. The converted program still measures the knife prox period and the proofer prox period with two TON instructions and compares the accumulators, but three things changed at once: the counts went from 10 ms each to 1 ms each, the inputs now arrive asynchronously at the module's RPI instead of at a scan boundary, and each timer only advances when its task scans the rung. A difference that read 1-2 on the SLC was already 10-20 ms of real desynchronization. Fix the one-shot mapping and the scaling units, then accept what remains as quantization.
What the conversion changed #
The hardware questions were settled before the code ran — sizing a CompactLogix to replace four SLC 500 processors is its own job. The timer symptom lives in three differences between the platforms.
Timebase. An SLC 500 timer offers a 0.01 s or a 1 s timebase, nothing else. A Logix TON counts PRE and ACC in 1 ms with no option, and the conversion multiplies timer presets by ten. Presets usually survive the translation; the values downstream of them — compare limits, math performed on ACC, SCP input limits derived from old counts — are where a factor of ten hides.
I/O timing. The SLC reads inputs at the start of the scan and writes outputs at the end, so an edge locks to a scan boundary and the scan time sets the jitter; some SLC input modules can also trigger an interrupt routine directly on an edge. This CompactLogix arrangement has no input-edge interrupt, and input data updates at the RPI, asynchronous to the logic. The controller sees the edge when the data arrives, between 0 and one RPI after the physical event.
Task timing. A Logix TON adds the time elapsed since its rung last executed, so a timer in a periodic task moves only once per period — the same discipline that running Logix 5000 PID loops in a periodic task establishes for loop timing. The earliest instant the logic can react to an edge is the later of the next RPI update and the next task execution.
Symptoms and first checks #
Confirm the unit first: taken as raw Logix ACC, 20-70 means 20-70 ms, the equivalent of 2-7 of the old 0.01 s counts — worse than before, but the same order of magnitude, and explained by RPI plus task timing.
| Symptom on the panel | Likely cause | First check |
|---|---|---|
| ACC values near 10x the old readings | Timer values still expressed in 0.01 s units | Compare PRE and ACC between both programs; confirm every preset, compare and limit is in ms |
| Difference moves in steps close to the RPI | Each edge quantized by the input update | Read the RPI in the discrete input module properties |
| Spread wider than the RPI explains | Timer in a periodic task or a long scan | Right-click the task, choose Monitor, read scan time and interval |
| Spread tightens once OSR becomes ONS | One-shot semantics mis-mapped | Audit every converted one-shot, not only the sync rungs |
| Knife-to-proofer gap reads about 6 Hz instead of 10 Hz | SCP limits in SLC-era units, or an offset | Re-derive the limits, then log two recipes |
| Adjusting SCP max fixes one recipe and breaks another | Offset or noisy input, not a gain error | Fit slope and offset from logged data at two recipes |
Budgeting the spread for two prox periods at this RPI #
Inputs, with units and where each comes from:
- Discrete input module RPI: 20 ms, the configured value on this machine.
- Old SLC reading: a difference of 1-2 counts on the 0.01 s timebase.
- Converted reading: 20-70, raw ACC in ms.
- Production rate at the test recipe: 65 cpm, knife about 43 Hz, proofer about 33 Hz.
- Assumption: sync rungs in the continuous task with scan time well under the RPI. If they sit in a periodic task, add that period to the budget below.
The rule in words: an edge is stamped by the arrival of its input data, 0 to one RPI after the physical event. A period between two edges carries the difference of two arrival delays. A difference of two periods carries four.
The arithmetic:
- Old platform in real time: 1 count × 10 ms = 10 ms per count, so the 1-2 count reading was one to two of those. The SLC was already reporting real desynchronization, delivered in 10 ms coins.
- One measured period: with start delay a and end delay b, each between 0 and one RPI, the reading is off by b − a, landing within ±one RPI.
- Difference of two periods: (b − a) − (d − c), worst case four arrival delays stacked, giving ±40 ms, an 80 ms band.
- The observed band: 70 − 20 = 50 ms wide, inside the 80 ms budget. The wander is the floor, not a machine change.
- Scale of the measurement: knife period = 1000 ms ÷ 43 Hz = 23.3 ms; proofer period = 1000 ms ÷ 33 Hz = 30.3 ms. One RPI is 86% of the knife period (23.3 × 0.86 ≈ 20). The update grid is nearly as coarse as the period it measures, so single-period frequency readings smear.
Decision: at this RPI, expect a period-pair difference no tighter than about ±40 ms and treat single readings at these speeds as mostly quantization. At periods of 23-30 ms, scanned TONs cannot hold a 10 Hz knife-to-proofer gap — switch to timestamp capture with averaging, and fix the scaling limits separately. Single-cycle accuracy at these speeds requires the edge counted in hardware.
Fix the one-shots and input handling first #
- Audit every converted one-shot. The SLC OSR is an inline input instruction; its Logix counterpart is ONS. The Logix OSR is an output instruction with a storage bit and an output bit, and it does not reproduce the SLC behavior mid-rung. Swapping OSR for ONS tightened this machine — check every instance, not only the sync rungs.
- Buffer the prox bits. Copy both input bits to internal tags once, at the top of the routine, and use only the copies. Asynchronous updates can change an input between rungs and split one edge across two scans.
- Put the sync rungs where they execute often: the continuous task, or a periodic task with a period well below the RPI. Read the actual scan and interval figures from the task monitor.
- Take the divide-by-ten out of the comparison. Work in milliseconds end to end. If something must be scaled down, divide into a REAL destination so the result is not truncated to integer counts.
- Lower the prox module's RPI to the smallest value the link supports, and check the module's input filter time, which adds its own delay to every edge.
Make these changes at reduced speed with the knife guard closed: a knife cutting out of synchronization is a personnel hazard, not only a scrap source.
Rebuild the SCP scaling in milliseconds #
At the test recipe the gap between knife and proofer speed should hold about 10 Hz and instead reads about 6 Hz. Replacing SCP with the function-block SCL produced the same number, which settles it: the instruction is not the fault, the values feeding it are.
- SCP max sets the slope only. A max that tunes one recipe and breaks another means the error is an offset or a noisy input, and no single value will hold across recipes.
- Re-derive the input limits in Logix units. Any min or max copied from SLC logic that consumed a 0.01 s timer value is off by a factor of ten.
- Re-derive the output limits from the new analog module's data format. SLC analog counts and Logix analog counts for the same signal are not the same numbers.
- Verify with two recipes: log the raw input and the scaled output at each, then fit slope and offset. A matching slope with a differing offset points at the period source, not the gain.
Replace the TONs with timestamp capture #
A TON is the wrong instrument for period capture at these speeds. The controller clock runs in microseconds and a GSV instruction reads it: capture the clock on each rising edge of the buffered prox bit and subtract the previous capture to get the period, free of timer and scan quantization. Check the GSV instruction help for the exact class and attribute names the installed firmware exposes rather than copying them from an example.
Timestamps remove the quantization, not the latency: the edge is still detected when its data arrives. Averaging the period over several cycles removes the random part of what remains without hardware changes, and it is the right move when the speed loop does not need a fresh value every cycle. To beat the RPI outright, the edge has to be captured in hardware — a high-speed counter or period-measurement input, where the platform offers one.
Questions asked
Did the conversion scale my timer presets correctly?
It multiplies timer presets by ten moving from the SLC 0.01 s timebase to the Logix 1 ms base, so a PRE of 20 becomes 200. The factor that bites hides downstream instead: compare limits, math performed on ACC values, and SCP input limits derived from the old counts. Audit those by hand against the ms-based readings before touching any tuning.
How tight can the difference reading get on this platform?
No tighter than about one RPI of uncertainty per edge. One period reading wanders up to ±one RPI and a difference of two periods up to ±40 ms, so a 20-70 reading sits inside the budget. If your readings come in tighter than that, the module is updating faster than the configured RPI or the edges are being captured in hardware.
Why did replacing OSR with ONS tighten the spread?
The Logix instruction set also contains an OSR, so a conversion can carry the name across without flagging it. The Logix OSR is an output instruction with separate storage and output bits, and mid-rung it does not reproduce the SLC OSR's inline behavior. Edges end up detected on a different pattern, which shows up as noise in every period the logic measures.
Where do I read the actual scan and interval times?
In Studio 5000, right-click the task and choose Monitor; it shows scan times and intervals for that task. On the SLC side, status word S:4 holds the scan time, and its units depend on the model — a MicroLogix 1100, for instance, counts 10 kHz ticks there.
Will lowering the RPI fix the knife-to-proofer speed gap?
It narrows the wander, not the gap. Halving the RPI to 10 ms halves the per-edge error, but a 10 Hz gap that reads about 6 Hz across recipes is a scaling problem — limits in SLC-era units, or an offset. Re-derive the SCP limits first; you may find you never needed the faster update rate.