Circuit Signal on Empty Container
I'm building some circuit logic to set the train limit of an ore unloader station based on how much space is available in the unloading containers. It is working exactly as expected, using a combinator to assign the quantity of items in the containers '*' to a variable 'S', and another combinator to subtract 'S' from the capacity of the storage containers and assign that to a variable 'F' which is the free space available. I can then divide 'F' by the capacity of a 1-4 train to see how many trains should be called to this station. I then use a decider to determine if the station should call 0, 1, 2, 3, or 4 trains (I only have stackers to support 4 trains, never more) as variable 'L' which the station uses as its train limit.
PROBLEM: when all of the storage containers are completely empty, there is no signal on the wire, so the first combinator doesn't assign anything to variable 'S', which means there's nothing assigned to 'F', which means 'L' doesn't get assigned.
I'm sure I could do something with a 3rd decider at the end of the circuit, or maybe a decider at the beginning to say if '*' is null, then output '0' - but I haven't been able to find the right amount of caffeine to develop that solution yet. I've done some light searching and haven't been able to find anyone who's solved the same problem - though that could be a result of the aforementioned caffeine imbalance. Happy to share blueprints or screens if it would be helpful.
Posted Aug 24, 2021, 4:22 PM UTC