[0.16] Rail Signal Counter

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
b_d
Burner Inserter
Posts: 17
Joined: Sat Jul 13, 2019 2:49 pm
Contact:

[0.16] Rail Signal Counter

I don't like using Dual trains back and forth.
I know i have to create Parking Lanes.

Is there a way to use the Combinators to Count the trains that pass by and when it counts two trains passes by and stores it and subtracts it from the other end or make it reset when or after the two trains exit.

I'm guessing it uses an RS/SR Latch and can't get a counter to work cause if the Train Passes the signal it counts continually in the Input Count. i guess Binary Counter is the solution. but how to do it? i have no electrical engineering experience and Logic programming is Poor. i can only try to read a completed Circuit to see how it works.

Serenity
Filter Inserter
Posts: 562
Joined: Fri Apr 15, 2016 6:16 am
Contact:

Re: [0.16] Rail Signal Counter

You probably need some kind of edge detector to only count when the signal switches from green to red

slippycheeze
Filter Inserter
Posts: 557
Joined: Sun Jun 09, 2019 10:40 pm
Contact:

Re: [0.16] Rail Signal Counter

b_d wrote:
Wed Aug 28, 2019 9:04 am
I don't like using Dual trains back and forth.
I know i have to create Parking Lanes.

Is there a way to use the Combinators to Count the trains that pass by and when it counts two trains passes by and stores it and subtracts it from the other end or make it reset when or after the two trains exit.

I'm guessing it uses an RS/SR Latch and can't get a counter to work cause if the Train Passes the signal it counts continually in the Input Count. i guess Binary Counter is the solution. but how to do it? i have no electrical engineering experience and Logic programming is Poor. i can only try to read a completed Circuit to see how it works.
A standard memory works here: an arithmetic combinator with <signal> + 0 => <signal>, or <each> + 0 => <each>, wired from input to output.

Then wire the "in" signal directly to the input of that combinator, and the "out" signal to an arithmetic <red> * -1 and then to the input.

Your output will have the current count of trains between the two signals, to a first approximation. You can also have one signal emit <red> and <green>, then use an arithmetic combinator with <green> * -1 => <red> to get a single signal to do both parts of the counting, if you want.

Beyond that, though, if you are not comfortable with combinators I suspect you will shortly find yourself very annoyed at them. I'd personally try and work out how to design the network so that trains simply work out passing like that on their own. Usually, as long as you ensure they own all the signals the whole length of a two-way track it'll sort that out.

Also of potential use, viewtopic.php?t=53937 – "how to: two way rails" – which covers that in more detail.

b_d
Burner Inserter
Posts: 17
Joined: Sat Jul 13, 2019 2:49 pm
Contact:

Re: [0.16] Rail Signal Counter

I understand the 2 In&Out RAIL Standard Solution. like using a Basic Train & 4 Wagon instead of a Train & 5+plus Wagon setup.

I want the single rail set up for the small patches i find. i use a 2x(Train-4/+ xWagon) combo per single rail setup and do a parking lanes that can be alot easier to be extended.

1. Rail signal to Arithmetic Combinator Setup 1 looped into itself.
2. Setup1:[<each> + 0 ~> <Each>]looped & Connected to Arithmetic Setup2.
(I still see the CONTINUOUS signals Stacking to each other as just one train passes; Like if the Train is just parked on that rail BLOCK it continually sends the signal and stacks the Red signal to #K as it keeps counting as long as the train is occupying the Block. {the time it takes for that train to exit the block it already has 400+red signals }
3. Setup2 :[Red * -1 ~> -RED] Connected to Setup 1
(My guess is to Delete all the excess signal from the 1st setup; since Setup1-RED ={should equal to}= ZERO/1?) Cause i don't see it; ALL i get is the Setups 1&2 having epileptic seizures. Do i need a Decider Combinator to stabilizing the output to a <signal>~>1
4. I'm using this, to learn how combinators work. I was thinking since the signal is continuous do i use it as an on signal for an "inserter Counter"
[Fill one chest with 2 Logs and hope the time it transfers the log to the other container and it transfers the all the two logs back] using the Storage as the counter.

b_d
Burner Inserter
Posts: 17
Joined: Sat Jul 13, 2019 2:49 pm
Contact:

HELP!

Can anyone solve this?

disentius
Filter Inserter
Posts: 286
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: [0.16] Rail Signal Counter

Here. A concept train counter.
1. make sure the train signal only outputs red signal (middle click on the others to remove them)
2. Counters/memory cells only work reliable with 1-tick pulses. The pulse generator blocks all incoming signals after one tick, and keeps blocking as long as it receives a signal (which is why step 1 is important) .

Display cell -> DaveMcW

simple train counter.png (2.1 MiB) Viewed 56 times

Who is online

Users browsing this forum: Google [Bot]