# Strange behavior with input-output self or was I wrong?

**URL:** <https://forum.xod.io/t/strange-behavior-with-input-output-self-or-was-i-wrong/2035>\
**Category:** Uncategorized\
**Created:** [March 18, 2019, 3:58am UTC](https://forum.xod.io/t/strange-behavior-with-input-output-self-or-was-i-wrong/2035 "2019-03-18T03:58:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [March 18, 2019, 3:58am UTC](https://forum.xod.io/t/strange-behavior-with-input-output-self-or-was-i-wrong/2035/1 "2019-03-18T03:58:53Z")

</div>

In a node with input-output self, in the following lines it is logical that there is a time between reading “Set” and deciding.

```
if (!isInputDirty<input_Init>(ctx)){
emitValue<output_OUT>(ctx, getValue<input_IN>(ctx));
    return;}

```

Now if I use the following code and do a `jumper` to `output`, should a delay also occur when passing through the node?

```
if (!isInputDirty<input_Init>(ctx))
    return;

```

![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/e/e4d3337bfb3f9ae19d3490e588671cd7fbeed056.png)

In both cases there is a delay, which alters the code, all the `input-x-dev` of the library must go directly to `output DEV`  
I modified all the libraries, before I had not noticed this. Maybe I was always wrong.  
Thought that an internal bridge was the same as external, but the sequence takes another path.

---

<div class="post-metadata">

**Author:** ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)\
**Post date:** [March 26, 2019, 11:17am UTC](https://forum.xod.io/t/strange-behavior-with-input-output-self-or-was-i-wrong/2035/2 "2019-03-26T11:17:25Z")

</div>

When you have a `not-implemented-in-xod` node on a patch it is considered to be a C++ patch. Only its C++ code is taken into account. Any links and nodes (besides the terminals) are thrown away when transpiling.

What are you trying to achieve? A daisy-chain of nodes acting over the same resource/hardware/object?

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [April 1, 2019, 1:40pm UTC](https://forum.xod.io/t/strange-behavior-with-input-output-self-or-was-i-wrong/2035/3 "2019-04-01T13:40:26Z")

</div>

Hi, I see that in the library “hid” ah added an output-DEV ', try to do the same in the OLED library SSD1306, but if that node is not activated it works like a defer, the image of the display flashes.

In the previous image it works as a defer, not as a jumper, so stop using the pins and make a direct connection to DEV.

---

<div class="post-metadata">

**Author:** ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)\
**Post date:** [April 1, 2019, 3:07pm UTC](https://forum.xod.io/t/strange-behavior-with-input-output-self-or-was-i-wrong/2035/4 "2019-04-01T15:07:18Z")

</div>

The chaining pattern is useful enough to be supported at a more basic level. We are going to introduce `chainable` marker nodes that could be applied to a custom type so that the `DEV` input will get its `DEV` counterpart output linked internally out of the box.

The `DEV` / `DEV'` pattern is something I have successfully exploit in a few projects to achieve chaining to the extent it was necessary there and, to be honest, I can’t understand why doesn’t it work in your case. Passing a value to the `DEV` input alone is enough for the node to be evaluated, so it should not act as a defer… Would you elaborate?

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [April 1, 2019, 5:06pm UTC](https://forum.xod.io/t/strange-behavior-with-input-output-self-or-was-i-wrong/2035/6 "2019-04-01T17:06:10Z")

</div>

Doing some tests with I found the problem, I made a misuse of the chained.

Here at nkrkv / hid, I found the one that works correctly.

```auto
{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    emitValue<output_OUT>(ctx, getValue<input_DEV>(ctx));
    if (!isInputDirty<input_UPD>(ctx))
        return;

```

I used this, and the problem arose, when evaluating the node first

```auto
void evaluate(Context ctx) {
    if (!isInputDirty<input_INIT>(ctx)){
    emitValue<output_OUT>(ctx, getValue<input_DEV>(ctx));
        return;}

```

is equal to

[![](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/e/e4d3337bfb3f9ae19d3490e588671cd7fbeed056.png) ](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/e/e4d3337bfb3f9ae19d3490e588671cd7fbeed056.png)

and the “defer” occurs.

I think it’s the solution I was looking for, thanks to the library HID, helped me.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/eb7348baa04192c2ef932d1db54d44f09f8a7888.png) [@system](https://forum.xod.io/u/system)\
**Post date:** [April 3, 2019, 5:06pm UTC](https://forum.xod.io/t/strange-behavior-with-input-output-self-or-was-i-wrong/2035/7 "2019-04-03T17:06:15Z")

</div>

Closed on April 3, 2019, 5:06pm UTC

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
