Jump to content

Can someone explain to me the memory toggle


Recommended Posts

Its basically a SR-Latch.  There are three ports that all look different.  The two you know are the Logic port and the Signal port.  The third is the Reset port.  If there's an Active signal on the Signal port, the toggle goes active.  It stays active, even if the signal port goes inactive, until the Reset port goes active.  

A very quick example of a use for SR-Latches is hysteresis on a thermostat.  Lets say that you have a 5 degree range you want to keep your cold pool.  So you would set one sensor to above, say, 10c and the other to below 5c.  The first sensor would connect to the logic port, turning your aquatuner on if your pool got warmer than 10c.  The second sensor would connect to the reset port.  This would keep your aquatuner active until the temperature dropped to below 5c.  The tuner would not come on again until the temperature rose above 10c.

 

Another example is lets say you have a storage room for hydrogen, and you want it to start pumping that to your hydrogen generators once it hits 2kg per tile but stop if it falls below 500g. You can now use it for this purpose Well that used to be my wanting for it but now I changed my power grid haha

2 hours ago, ShadowBound said:

@KittenIsAGeekI think I understand now, this is something I wanted for a long time. Thanks.

You just need to learn more about logic gate, we can do it since the beginning of the automation upgrade.

A latch can be made with only AND (or OR) gate and the NOT gate (two NAND or NOR gate)

 

In fact, in electronic system all you need is a AND (or OR) gate and the NOT gate and you can build a computer, all the other logic system is a combination of the previous logic gate

6 minutes ago, Arxeon said:

Here's a pic to show the idea for those who like pics.

New RS Latch.png

You're system is too big, for a latch all you need is two AND (or OR) and two NOT gate, why using filter?

 

image.png.c8f574f4e48d072f774945ec50427071.png

 

I've tried that method (example B) but it can cause the signal hold and the reset to flip functions.

Example A was another that I tried but on the odd occasion go on the blink like a siren. not reliable enough for me.

Example C is actually 2 components (Latch and Pulse) put together to give the desired result to hold the main signal but not be triggered by the reset.

As for the reason for the filters. The 1 second filter on the pulse gives it a 1 second pulse while the 0.1 second filter cleans up a brief after blip when the pulse stops receiving a signal. The 1 second filter on the latch side prevents the latch from going on the blink during the 1 second pulse reset.

3 latches.png

I try myself the B example, it's work well, it's probably just because you misunderstood the function of this latch. With Lach gate you have a forbiden state. The forbiden state cause trouble and unpredictable result, it's for that reason is called forbiden state

For example B you need to invert entry signal with a NOT gate for the both entry signal to made the latch correctly (SR NAND latch), so the forbidden state is S=inactive and R=inactive (so in your example is S=active and R= active), i don't know if you know logic system but the sign upside the letter is the meaning of a NOT

If you made example B with OR gate instead of AND gate, you will have a latch with normal entry signal (SR NOR latch), the forbiden state is S=active and R= active

If you affraid of forbidden state you can also made a SR AND-OR latch with a OR, a AND and a not gate (so only three gate needed)

image.png.d4471db0072488e11e3b94691bfb3d4f.png

 

I'm not sure witch model dev use to make the new logic gate cause i not test it completly to made the truth table but i suppose they use the SR AND-OR to avoid the forbiden state that could be really annoying for newbie in automation

 

Choose wisely how you use it and all will be fine, but you need to prefectly avoid forbiden state when you design your logic circuit

It's just a matter of how you use it

5 minutes ago, Saturnus said:

Note that for most common use cases you never needed an SR latch. An AND gate would do exactly the same.

image.thumb.png.24154316b82627918142771c85d19430.png

Not really, you can't do something like BlueLance talk about, it's could look the same but in some case you will have some serious trouble

 

2 hours ago, BlueLance said:

Another example is lets say you have a storage room for hydrogen, and you want it to start pumping that to your hydrogen generators once it hits 2kg per tile but stop if it falls below 500g. You can now use it for this purpose Well that used to be my wanting for it but now I changed my power grid

You could do something look like it with a sensor under 2 Kg and another above 500 g but your system will block if pressure go more than 2Kg, and it's impossible to make a system waiting for the pressure to hit 2Kg per tile

 

I use latch for my water treatment system to avoid overpressurized the room, sure it's possible without but at some point the system turn off and down like a impredictable clock, i prefer to use a big amount of gas for a time and stopping the anti-overpressurize for a while

5 minutes ago, Flydo said:

Not really.

Did you even look at it? Probably not.

What I posted is an AND-OR latch. But because of the way logic is handled in ONI you do not need the OR gate at all unless you need it to feed other logic circuits after it. And in that case you'd simply isolate it by using a buffer gate at 0.1s.

1 minute ago, Saturnus said:

Did you even look at it? Probably not.

What I posted is an AND-OR latch. But because of the way logic is handled in ONI you do not need the OR gate at all unless you need it to feed other logic circuits after it. And in that case you'd simply isolate it by using a buffer gate at 0.1s.

Probably yes :D, sorry it's work for what bluelance talk about, just a non-sense for me to can have a inactive and active signal on the same wire, too dangerous to made

But his is not an AND-OR latch, it's could look the same but it's not (it's work only if you use the same sensor type):

-first you need to invert reset signal to have a something look quite the same but it's not the same

-second your "reset" signal don't have the priority, and this for me is very annoying cause once this system is on, you can only turn off with the two signal turn inactive. Reset priority is one of the important thing in a latch to made security system work well (like an emergency shut down for example)

 

So another example:

i want a system that start pumping liquid when the pressure above 700 Kg/tile but absolutely stop pumping in all case if temperature rise above 50 °C, AND gate not working

14 minutes ago, Flydo said:

But his is not an AND-OR latch... (it's work only if you use the same sensor type)

It is in fact an AND-OR latch.

As I said

Quote

Note that for most common use cases you never needed an SR latch. An AND gate would do exactly the same.

And then I give an example of said use case which will be the one most people would need it for, ie. a hysteresis switch.

10 minutes ago, Saturnus said:

It is in fact an AND-OR latch.

Nope: image.png.b3e73f655e215fbf214dbb80a8e92f0d.png

I test your, reset have not the priority, once it's on, you need to have both to inactive

11 minutes ago, Saturnus said:

And then I give an example of said use case which will be the one most people would need it for, ie. a hysteresis switch.

Yes for the same sensor type on signal entry and reset entry, it's work, but it's the only case, you can't have a hysteresis switch with an emergency shut down

2 minutes ago, Flydo said:

Yes for the same sensor type on signal entry and reset entry, it's work...

Good.

3 minutes ago, Flydo said:

you can't have a hysteresis switch with an emergency shut down

Yes, you can. Sorry if you can't see how but you can.

3 hours ago, Saturnus said:

Yes, you can. Sorry if you can't see how but you can.

Sorry but i test it to made the truth table to be sure what i talk about, if one of the input is active the output stay active.

You probably need to add something to have a real reset

This is gonna make pipe routing easy I think

Pipe 1 + Sensor 1-> S                               not (output) -> liquid shutoff 1 -> Pipe 2

                                      -> SR Latch ->

Pipe 1 + Sensor 2-> R                              output -> liquid shutoff 2 -> Pipe 3

 

And that would be a logical filter :D this is just awesome

37 minutes ago, Arash70 said:

This is gonna make pipe routing easy I think

Pipe 1 + Sensor 1-> S                               not (output) -> liquid shutoff 1 -> Pipe 2

                                      -> SR Latch ->

Pipe 1 + Sensor 2-> R                              output -> liquid shutoff 2 -> Pipe 3

 

And that would be a logical filter :D this is just awesome

I hope someone posts some screenshots of this because I can kinda grasp it and hope that it does what I think you are saying it does!!

 

5 hours ago, Flydo said:

i want a system that start pumping liquid when the pressure above 700 Kg/tile but absolutely stop pumping in all case if temperature rise above 50 °C, AND gate not working

I don't see the problem. Pressure sensor goes ON when above 700kg. Feed to one input of AND. Temperature sensor goes OFF when above 50C. Feed to other input of AND. AND output controls pump.

Also, hysteresis with one AND in function. Both sensors ON when above 500kg.

Hysteresis.thumb.png.bcf745ac0b96d0a8d7d211060eb4d28a.png 

2 hours ago, Denisetwin said:

I hope someone posts some screenshots of this because I can kinda grasp it and hope that it does what I think you are saying it does!!

 

Ok here it goes:

Model #1:

Pushes liquid of your choosing to bottom vent, and others to right vent

20180420223932_1.thumb.jpg.e9f847fc064336f5c300b0e840e5541f.jpg

20180420224051_1.thumb.jpg.10162f27c3a1e99dcbfbc7c00c88d74c.jpg

 

Model #2:

Same thing for 3 mixed liquids

20180420225246_1.thumb.jpg.28758f5d551dbd8390cd3746210004f6.jpg

20180420225242_1.thumb.jpg.30401c1935d9480eb22f407cbe82ac72.jpg

 

So using SR would work similar to this

3 hours ago, Saturnus said:

I don't see the problem. Pressure sensor goes ON when above 700kg. Feed to one input of AND. Temperature sensor goes OFF when above 50C. Feed to other input of AND. AND output controls pump.

Also, hysteresis with one AND in function. Both sensors ON when above 500kg.

Hysteresis.thumb.png.bcf745ac0b96d0a8d7d211060eb4d28a.png 

Yes, i know it's work but in this particular case

 

You test in truth table 00 01 11 11 not 10, it's what i mean by "you can reset the system, so it's can't work with pressure sensor and a thermal sensor for emergency shut down

14 hours ago, Saturnus said:

That's the point. You set it up like that on purpose.

Yes but without the 10 you can't made a emergency shut down like i need it.

Sure for a double pressure sensor it's smart (but dangerous if dev reencode the automation ingame, it's for that i don't want to use it too), with double sensor you can't have code 10, pretty impossible that you have pressure under  500g/tile and above  2 Kg/ tile........but I know it by my own experience in game, it's possible (don't seem logic but it's possible, i will explain), if you have a mixed type of liquid, like water and a little polluted water, you can have one sensor above 2Kg/tile of water and the other under 500g/tile of polluted water, in this case i need the system reset to avoid pumping polluted water and making trouble in my system.

Priority of the reset function is important for me and your system look great but I really prefer to use a real latch gate

1 hour ago, Flydo said:

Priority of the reset function is important for me and your system look great but I really prefer to use a real latch gate

I'm not arguing that a real latch doesn't have a use. I'm saying that for the vast majority of use cases for the average player, they'd only need the single AND gate hysteresis control. Or with an AND and NOT gate for full AND-OR gate functionality.

This is a very old discussion though and has already been exhaustively covered within the first few days of the automation update preview release. Personally I'd much rather they'd made a single gate JK flip flop instead of a single gate SR latch as that would have been much more useful for more complex circuitry but I digress. As it is the added SR latch hardly makes any difference for anyone.

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...