OPNDRS Demo


The OPNDRS project aims to create an access control framework.

This demo will exercise the latest version of this code running on the Linode. The workstation can be running Linux, Windows or Mac with Tcl/Tk installed. The SIMPL toolkit is not required on the workstation side.

In a real system the inputMgr would be wired to the data acquisition module handling digital inputs. In our demo those messages are originating from the GUI buttons described below.

The inputMgr acts as a smart message router. In this demo it can route messages to the doorStatemachine module using the SIMPL toolkit Relay function. The inputMgr can parse the configuration file to extract relevant data for its internal tables.

The doorStatemachine contains the internal tables for the doors as well as the finite state machine logic for the door business logic. These internal tables are configured by parsing the common configuration file for the system (see below). There are 3 ways events can present themselves at the state machine:

In a real system the outputMgr would be wired to the data acquisition system module handling digital outputs. In our demo those messages are simply relayed to the GUI for display purposes.

Any module can post an event message to the eventLogger. These events are all timestamped. In a real system those events would be logged to a file. In the demo this feature is not enabled. The GUI registers to be a relay client to the eventLogger. This means that once connected the GUI will see all the events as well. These events activate the door icons and/or the message box on the gui screen.


Getting started

You'll first want to grab these pieces of code:

Download these into a common folder.

NOTE: If you have a particularly secure firewall which blocks both incoming and outgoing packets, you'll want to have the system admin give you outgoing access for packets destined to icanprogram.ca:port 8000.

You can use these pieces of code to run the OPNDRS demo by typing:

wish gui2.tcl

A screen similar to this should pop up on your workstation.

This demo utilizes up to 8 digital inputs and 8 digital outputs. These are illustrated on the GUI screenshot above.

The inputs are buttons which toggle the value between 0 (Low-red) and 1 (High-green). The rhs of the door icon is also a button controlling the respective door lock output. Inputs are fed into the inputMgr module. The door icon button feeds directly to the doorStatemachine module. The Reload data button allows for on the fly configuration changes.


Configuration file

This code is controlled by a single text configuration file. A sample is supplied as the config file above. The Linode contains this file as the startup default. If the config file on the workstation is edited then the Reload data button will execute a configuration change on the fly.

Blank lines and lines beginning with the # symbol are ignored by the parser. The config file is divided into paragraphs each beginning with the word ADD and ending with the word Z. The first item inside a config paragraph should be the record block type. This can be:

All the rest of the items inside the paragraph are in the form of

tag: value


Door record description


Input record description


Output record description


Scheduler record description


Have fun. Hope you enjoy programming the SIMPL way.