SR-latch

This is the place to request new mods or give ideas about what could be done.
Post Reply
Dragonling
Manual Inserter
Manual Inserter
Posts: 4
Joined: Thu Sep 12, 2019 2:00 pm
Contact:

SR-latch

Post by Dragonling » Fri Sep 13, 2019 6:03 am

I have searched over the requests, and haven't found this one.

A Set-Reset Latch is a circuit network item, that starts emitting a signal when a "set" event (logical condition) occurs, and stops emitting the signal only when a "reset" event occurs. One of the obvious applications is using this contraption to turn on steam generator reserve when accumulators' energy level is 1% or less, and turn them off, when accumulators charge up to, say, 20% (this allows to avoid flickering). But it has much more uses than just that example.

It is common knowledge, that a Set-Reset Latch can be implemented with 3 combinators, as per the Cookbook. However, not every player is skilled enough to understand, how it works and is built (my personal case: coop with family). Also, not every player can understand English enough to read the Cookbook.

Would someone, please, implement SR-latch as a simple to use single item?

User avatar
brunzenstein
Filter Inserter
Filter Inserter
Posts: 896
Joined: Tue Mar 01, 2016 2:27 pm
Contact:

Re: SR-latch

Post by brunzenstein » Fri Sep 13, 2019 7:05 am

https://youtu.be/vEOXGBYR6oM
Its in plain English and easy to understand, follow and use therefore easily


User avatar
planetmaker
Long Handed Inserter
Long Handed Inserter
Posts: 80
Joined: Mon Jan 21, 2019 9:30 am
Contact:

Re: SR-latch

Post by planetmaker » Fri Sep 13, 2019 8:10 am

My suggestion: create a blueprint for the SR latch and share it with those people (e.g. your family).

Of course, switching on backup power, is the most obvious use, it is not common enough to warrant a special item for that in the vanilla game IMHO (maybe one can make a mod to create such item - then you could use that mod).

Dragonling
Manual Inserter
Manual Inserter
Posts: 4
Joined: Thu Sep 12, 2019 2:00 pm
Contact:

Re: SR-latch

Post by Dragonling » Fri Sep 13, 2019 8:37 am

planetmaker wrote:
Fri Sep 13, 2019 8:10 am
(maybe one can make a mod to create such item - then you could use that mod).
Well, yes, let's hope for that. After all, I am posting this request in the forum branch called "Ideas and requests for mods".
I am thankful for everyone trying to help me by suggesting workarounds, but I am looking for anyone with goodwill to make the quality of life mod, which will not require additional actions or special knowledge.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2258
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: SR-latch

Post by Optera » Fri Sep 13, 2019 8:59 am

planetmaker wrote:
Fri Sep 13, 2019 8:10 am
My suggestion: create a blueprint for the SR latch and share it with those people (e.g. your family).

Of course, switching on backup power, is the most obvious use, it is not common enough to warrant a special item for that in the vanilla game IMHO (maybe one can make a mod to create such item - then you could use that mod).
Not common had me chuckle.
Every single of my production lines is behind an sr-latch, with delayed off timer to clean belts before turning off power.
Then again I'm probably the minority enjoy fine tuning automation with combinators.

Having a dedicated latch combinator instead of two could reduce my combinator count a fair bit.

User avatar
planetmaker
Long Handed Inserter
Long Handed Inserter
Posts: 80
Joined: Mon Jan 21, 2019 9:30 am
Contact:

Re: SR-latch

Post by planetmaker » Fri Sep 13, 2019 10:19 am

Optera wrote:
Fri Sep 13, 2019 8:59 am
planetmaker wrote:
Fri Sep 13, 2019 8:10 am
My suggestion: create a blueprint for the SR latch and share it with those people (e.g. your family).

Of course, switching on backup power, is the most obvious use, it is not common enough to warrant a special item for that in the vanilla game IMHO (maybe one can make a mod to create such item - then you could use that mod).
Not common had me chuckle.
Every single of my production lines is behind an sr-latch, with delayed off timer to clean belts before turning off power.
Then again I'm probably the minority enjoy fine tuning automation with combinators.

Having a dedicated latch combinator instead of two could reduce my combinator count a fair bit.
On the chance to have this going a bit off-topic: Agreed, yes. Arguably there are playstyles and setups where they are common (and I find them quite a commodity use them for power and situations like you describe myself). Yet... I doubt that qualifies as 'majority of players use it and need it'.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2216
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: SR-latch

Post by darkfrei » Fri Sep 13, 2019 10:34 am

Dragonling wrote:
Fri Sep 13, 2019 8:37 am
Well, yes, let's hope for that. After all, I am posting this request in the forum branch called "Ideas and requests for mods".
I am thankful for everyone trying to help me by suggesting workarounds, but I am looking for anyone with goodwill to make the quality of life mod, which will not require additional actions or special knowledge.
This entity must be at least 2x2, maybe 3x3 tiles, one edge as R, the second as S, another two edges are output values with Q and not(Q).
If any on S, then Q is same as S, nothing on not(Q) and holding this value;
when any on R then nothing on Q, but not(Q) has the value of R;
if nothing on S and R then hold the value;
if both S AND R then Q and not(Q) are nothing.

It can be done with two lamps as input, two constant combinators as output and control.lua calculations on each tick;
or as hidden arithmetic and decider combinators without control.lua on tick, just on entity placing.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2258
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: SR-latch

Post by Optera » Fri Sep 13, 2019 2:09 pm

Performance of any lua scripted combinator will be magnitudes worse than dedicated circuit logic.
Especially if all an sr latch requires is 2-3 combinators. Personally I prefer the 3 combinator variant with one decider set to if R == 0 then everything = 1 and dedicated combinators to trigger set and reset signals as those are easier to set up for multiple set and reset conditions and also easier to check remotely.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 10555
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: SR-latch

Post by ssilk » Tue Sep 24, 2019 9:54 am

Reading this through I thought of this:
A mod that packs a number of (hidden) combinators into one entity with a nice user interface.

For example the SR-Latch:
The entity you can place has three inputs: low, high and value and an output. Or instead a second variant: One value-input, and an output and a user-interface to filter the input (optional) and set low/high and the output item.
Internally - when you place that item - it places some combinators and cables them together - totally invisible. It places three combinators: one with the input and the low value to fire the R-signal, one with the input and the high value to fire S signal and one with the memory cell and input form first and second combinator. What you see is just somthing like a combinator with three inputs and one output. If you hover over the item it can explain you how it is intended to work.

Or a timer: One input with optional filter for pulse or hold, an output for current counts of items or on/off.
And again, internally the mod places 5 or 6 combinators, cables all together and sets the right values into the combinators.

Think about the possibilities: instead of creating "universal" combinator-layouts (e.g. you need to set the filtered item only once with a combinator), you can specialize the design of the circuit, because when you place it, it fills out the needed placeholders (items, numbers, sub-circuits) for you.

The advantage would be, that this uses the (fast) internal circuit logic, but enables to create really complex things. Think for example to a state machine for the recursive blueprint mod, that is able to scan revealed underground for resources and build complete outpost out of nothing.

Ahmmm... what's missing then? An editor to create circuits.
Like this: https://resources.jointjs.com/demos/logic

BTW: I looked a bit deeper into that link: fascinating how simple it should be to create a factorio circuit editor. Or if I had a wish: That would be one of those things, that could add veeeerry much game to factorio: An editor, where you can create logic circuits (as described above), and where you can test it (random input, power loss etc.) and then put them together into one circuit as a new circuit-element. It would be a bit like blueprints for circuits.

Hmmmmm. :)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2216
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: SR-latch

Post by darkfrei » Tue Sep 24, 2019 10:32 am

It's something like hysteresis combinator, that works like
If input_signal is more than maximum_value than switch the output and it will be switched back only when the input_signal will be lower than minimum_value.

Internal:
One constant combinator with two virtual signals: minimum_value, maximum_value;
one lamp(?) entity as input signal placeholder. Another lamp as output signal placeholder.

Post Reply

Return to “Ideas and Requests For Mods”

Who is online

Users browsing this forum: No registered users