Logic circuit

For the logic circuit I used:1 Logic switch (as button)4 Logic IO (2 writers, 2 readers)1 Logic Processor (as compare unit)The logic units settings:Connect everything to everyting - it's not the most efficient way, however it is the easiest one.Logic Reader 1 - Input: Stacker; Variable: SettingLogic Reader 2 - Input: Autolathe; Variable: ExportCount !This is why it works so accurately!Logic Compare Unit - Imput 1: Reader 1; Imput 2: Reader 2; Mode: GreaterLogic Writer 1 - Input: Button; Output: Autolathe; Variable: ClearMemoryLogic Writer 2 - Input: Logic Compare Unit; Output: Autolathe; Variable: ActivateHow it works:You set the Stacker to a stack of a certain size. The Reader 1 reads that value.Everytime the Autolathe creates an item, the value of its ExportCount rises by one. Reader 2 reads that value.The Compare Unit then compares the nuber of items to be made (Reader 1) and nuber of items already made (Reader 2). If the number of items to be made is bigger than the number of items already made the Logic Compare Unit outputs 1. If it made all the required items it outputs 0.The Writer 2 takes that 1 or 0 from the Compare Unit and controls the activation of the Autolathe. SIgnal 0 deactivates the Autolathe, signal 1 activates it.After the Autolathe created the desired amount of items it is deactivated by the Writer 2. However the number of created items in its memory stays. We need to reset that memory. Thats what the Button and Writer 1 are for. The button ouputs signal 0. When pushed it outputs signal 1 for a brief moment. The Writer 1 sends that signal 1 to Autolathe and erases it's memory.BEWARE! When the memory is erased this setup immedialety starts creating new items. The old memory keeps this setup from activating again if the number on stacker is same as before or smaller. So the button work as a Start button for new manufacturing task by erasing the old memory resetting the item count.