Email or username:

Password:

Forgot your password?
Top-level
Dr.Implausible

@lynnesbian Shouldn't it be "equals or exceeds"?

Like, if it hits 256 on the counter and resets to zero, wouldn't it then be under-reporting the length of the train as L-256, which could still lead to issues?

(I dunno, maybe I'm not parsing this right, much like a Swiss axle-counter. Time for another eggnog latte.)

4 comments
Alan Bellingham

@drimplausible @lynnesbian IIRC it's perfectly okay to have 255 or 257 axles, because the relevant bit of code is only worried about if there is a train there or no train there. That 257 overflows to become 1 still shows up as a train

Ysegrim

@drimplausible @lynnesbian Axle Counters are not about reporting the length. They are about "The same number of axles and thus cars that went in on the beginning of the block left it at the end of the block". (Or even, on either side, in case of reversing / split trains). Which is equivalent to what we're interested in, namely, "There are no cars left in the block, and we can leave the next train in at full speed".

So as long as the counter doesn't remain at 0 when the full train is in, an overflow isn't much of a problem. (Bad edge case: The train stops after exactly 256 axles have been counted in)

@drimplausible @lynnesbian Axle Counters are not about reporting the length. They are about "The same number of axles and thus cars that went in on the beginning of the block left it at the end of the block". (Or even, on either side, in case of reversing / split trains). Which is equivalent to what we're interested in, namely, "There are no cars left in the block, and we can leave the next train in at full speed".

toni✨🧠

@drimplausible Yes, but that doesn’t matter. The next counter has the same bug and thus counts the same number of axles, so the result will be correct.

Let’s say it has 258 axles. First sensor will report “train with 2 axles has entered the segment”. Second sensor will report “train with 2 axles has left the segment, clear the signals.” Everything is fine.

Go Up