Signal Propagation
This tutorial demonstrates how data propagates through the network of connections, what is the difference between control and data nodes, and how to synchronise diverged paths.
Data
Data connections propagate values at the first opportunity. Simple nodes without control slots
will output or accept values as they come. TextValue for example updates output slot as soon
as text edit control notifies about accepted input.
Workspace is evaluated constantly at predefined time intervals by running a cycle:
- Evaluate all connections - pass values from source to target slot
- Evaluate all nodes - accept input and calculate the result
- Wait for time interval and start again
So in the example above, the propagation looks like this:
- Step 1:
- Change value of
Ain the edit box, the node detects input and puts it intooutslot.
- Change value of
- Step 2:
- Connection
ABdetects value in source slot, passes it to target slot. - Node
Bdetects value ininslot, puts it into edit box and copies tooutslot.
- Connection
- Step 3:
- Connection
BCdetects value in source slot, passes it to target slot. - Node
Cdetects value ininslot, puts it into edit box and copies tooutslot.
- Connection
Control
Control is a special data packet type and treated in a different way from the others. Slots that produce or accept control data packets are coloured blue. Control is required in situations where user input is explicitly required. Normal data will propagate at any opportunity, but control has to be generated explicitly, by, for example, pressing a button.
In this example, HtmlView node expects control to update HTML renderer, so passing HTML text from
TextValue does nothing at first. And only when you press the Push button, a control packet
gets generated and passed to HtmlView which refreshes the page.
Control packets can bear authentication information as well, for example in most cases you will be
required to provide credentials when using HTTP nodes. Those credentials can be generated by
com.dmc.std.auth nodes. The value of control packets cannot be inspected in slots.
Synchronisation
In some cases when propagation paths diverge, but then you want to use the results together, it can
get a little tricky. This example is quite artificial, but it demostrates the actual problem:
the path from Push node to HtmlView is just a single connection, and pressing the button will
refresh HtmlView before the text passes through TextFormatControl node, so the previous
HTML text will be used.
We can synchronise diverged paths by using a Barrier node. This node will stop incoming packets
until both of the inputs arrive, and it will then release both inputs simultaneously. So both
control and transformed HTML will reach HtmlView simultaneously.