Setting Up Default Behaviours in Reflex

Although Cortex provides a very extensive automation capability, it is still a good idea to set up default Reflex behaviour. I have found Cortex to be very stable, but there are still various circumstances that might lead to Cortex failure, such as a partial power failure, PC problems or Windows updates leading to reboots. Or possibly you might want to maintain basic functions on one network segment whilst you are messing around with other segments of the network, you could maintain power to a network segment to keep functions alive without needing Cortex to be connected.

First, let me briefly explain what Reflex behaviour is. Each module has Reflex capabilities, and each module can store a small Reflex program. In response to local events, such as button pushes, the module can generate a sequence of network packets that can be addressed to other nodes, or itself. In response to network packets received, a module can alter it's state, including modifying things like relays and LEDs. So a network-wide Reflex program can be conceived if desired. But the simplest form of Reflex program is to make a module button affect it's own relays.

The current tools for programming Reflex are quite limited, basically there is some assistance in building up the packets, but not much beyond that. However, since only very basic "fallback" behaviour is required, this is not too serious, and it's quite easy to set up a minimal functionality, for example: DRB buttons falling back to on/off switching for lighting control.

Whilst it is operating Cortex replaces the default Reflex behaviour with it's own Reflex program to achieve various efficiency improvements, so the fallback behaviour has to be stored into non-volatile memory on each module and "invoked" by resetting the network on a Cortex failure. This can be done by programming a timer in any MFP to act as a "watchdog" timer. This timer will reset the network if it expires. In normal circumstances Cortex will "punch" the watchdog periodically, resetting it's count so that it doesn't expire. If Cortex fails to punch the timer, it expires, the network is reset and the default reflex behaviour will take over. The Cortex help file explains how to set this up.

The first step is to defined packets for the light relays. By selecting the power switching module and then the Reflex context menu item we can then get the "Define Packets" dialog:

Define Packets

From here we "Add" a new packet and build it using the Insight editor:

Add a new packet

And then give it a meaningful name. For obvious settings, the "Create Defaults" button can be used to generate common packets, such as toggling the relays and LEDs pairs, so this can be used instead of the above process:

Set of defined packets

The next step is to make the button actions couple to the relay actions. This time the module switches object is selected and the Reflex context menu selected. The following dialog controls how the reflex output packet will be initiated:

Define Response Vectors

Here you can see I have selected the action is initiated on button release (-ve edge in this case meaning button release) and also that a User Defined Packet will be generated.

Note that there is an inherent restriction here that a given set of trigger conditions is applied across all possible inputs, so you can have reflex packets trigger on button 1 and button 2 release, or reflex packets triggered on buttons 1 and 2, both press and release, but not a configuration of button 1 release and button 2 press.

The choice of packet is made by selecting the "Vector Setup..." button (vector is just a technical name for a trigger):

Vector Setup


The desired trigger (in this case button 1) is selected and then the required response selected. All defined packets are listed, but more can also be added if they weren't previously defined:

Packet Selection

Since I want button 1 to toggle the relay 1 and LED 1, that's the packet I chose. Multiple packets could be chosen to initiate sequences if that was required:

Vector configured

The final step is to select the top level object for the DRB module and enter the Reflex dialog, this allows the node to be Reflex programmed:

Reflex Program the Node

Cortex includes a tool to list all Reflex programming in the whole network to make it easier to check what has been setup.

About this Entry

This page contains a single entry by David published on June 30, 2006 12:23 AM.

Yet Another Small Victory was the previous entry in this blog.

More Default Behaviours with Reflex is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.