HouseMon Circuits Tutorial-1.09

This circuit tutorial (09) continues where circuit tutorial 08 left off.

We have a circuit that is using 2 distinct .Out pins from a FanOut gadget to provide duplicate messages. These are wired to a ‘Printer’ and a ‘Pipe’ gadget respectively. The ‘Printer’ prints its message nicely to the screen, and as the Pipe did not have its .Out pin wired to anything, its message was lost (which also displays its message to screen by default), causing a muddled output.

This circuit introduced a new gadget called ‘Sink’.

The ‘Sink’ gadget takes input on its .In pin and does……nothing. It produces no output and therefore just eats input messages like there is no tomorrow. A ‘Sink’ gadget should be considered the “end of the line” for any message path it sits in.

We have added the ‘Sink’ gadget so it takes input from this ‘Pipe’ gadget, so no longer will the ‘Pipe’ produce messages that are ‘Lost’.
I think its true to say, we have specifically chosen the loose these messages. If were were using the river/lake analogy from the previous tutorial, then adding the Sink, is equivalent to pulling the plug on our lake and letting all the water flow into the earth, never to be seen again.

Lets take a quick look at the circuit:

#Read a Text file, output first delayed by 200ms, then sent to FanOut,
#fo.Pin1 sent to console line printer.
#fo.Pin2 sent to Pipe where its output is sent to the sink 'snk' and is eaten up
        name: "dummy"
        type: "Pipe"
        name: "rft"
        type: "ReadFileText"
        name: "p"
        type: "Printer"
        name: "d"
        type: "Delay"
        name: "fo"
        type: "FanOut"
        name: "pipe"
        type: "Pipe"
        name: "snk"
        type: "Sink"
        from: "rft.Out"
        to: "d.In"
        from: "d.Out"
        to: "fo.In"
        from: "fo.Out:pin1"
        to: "p.In"
        from: "fo.Out:pin2"
        to: "pipe.In"
        from: "pipe.Out"
        to: "snk.In"
        data: "setup.json"
        to: "rft.In"
        data: "200ms"
        to: "d.Delay"
        external: "In"
        internal: "dummy.In"
        external: "Out"
        internal: "dummy.Out"

See our new ‘Sink’ gadget (Lines 27-28) and our new ‘wire’ from ‘Pipe’ to ‘Sink’ (Lines 43-44).

It may be no surprise to see that when we run this circuit, it runs rather like the circuit 07, in fact the timings are exactly the same, but under the covers we are dealing with duplicate messages, where one set of duplicates are unceremoniously dumped.

In the next tutorial we will augment the main message stream (the one that is not dumped) with some additional data.

Posted in cirget, housemon, housemon tutorials, soft-circuits

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: