A* stream multiplexor
Overview a-mx
Section titled “Overview a-mx”a-mx is a multiplexer or joiner between different data sources and
controllers using the A* protocol and is intended to be used for building up A* systems.
A typical use
This document is intended to be used by developers and assumes some familiarity with the UNIX command line and networking.
The requirements are:
- Create a number of processes which communicate via
a-mx. - Changes in values such as Generator 1 Power Actual are passed
to the other processes, e.g. a MODBUS reader would send
Gen1P = 102toa-mxwhich in turn would pass it to the HMI. - There are configurable limits
Summary a-mx
Section titled “Summary a-mx”The a-mx command is used to set up a collection of interconnected
components which communicate with the A*
protocol via a-mx.
The components are processes, files or fifos such as data recorders, time series data, HMI, models and controls.
For example the HMI a-hmi system can read and write values where as the a-console only
receives data from a-mx. For example:
The values are passed to stdin and stdout for the various components using
the A* protocol described below but one example would be:
sim-model- updatesPvAvailPbecause of the time of day and then sends the new value upstream toa-mxviastdout.a-mxrecords the new value and then passes it toa-hmi,a-npvt,a-consolevia each componentsstdin.- Each connection can have limits, e.g.
a-npvtcannot set values ora-hmican only set values matchin*Cmd.
This particular setup would be started with:
% ./a-mx -rw a-hmi sim-model -w sim-control -r a-console a-npvt TODO: rewrite example argumentsAny changes from the HMI would be recorded in a-mx
and passed onto the appropriate components via stdin.
The -rw option applies to the following components.
There are access control limits which can be set per component on the command line which are described later.
A* protocol summary
Section titled “A* protocol summary”The A* protocol is a minimalist plain text npvt format using a flat
namespace as described in a-protocol which also describes the’
broadcast variants.
Each command started by a-mx has its stdin and stdout
connected back to a-mx. The commands on both steams
are terminated by any of ‘\n’, ‘\r’, ‘\r\n’, i.e. a command
is executed when line termination is seen.
The four commands are:
- Set a name x property to value, e.g.
Gen1StartCmd = 1orGen1SetP -typical 0..100. - Time stamped npvt variant, e.g.
Gen1P = 100 1233332232.2 - Send variables
? ...- send all the state matching the description in...back to sender, e.g.? *Pwould send all npvt values matching*P - Watch variables
! ...- send the variables when they change. Note that there can be only a single watch for each stream. - Do we need an echo or comments??? TBA
The values for Send and Watch are used to identify the
values to using names (npat), properties (ppat), values (‘vpat’) and ’:’
property (isapat). They are whitespace separated and default to
*, e.g.
? - send all the state back.
? *P|*Q - send back all the state for names ending in P or Q.
? * = - send back the current values for all names.
? *Al = 1 - send any alarms that are 1.
? * -en * point - send -en for any name with its : property being point.
? *P = * point *Q = * point -
The inputs to watch are the same, e.g.
! *P - sends any changes to names ending in P to you.
There is a single watch list per channel and any changes to matching npv data are send via the usual means.
Details
Section titled “Details”% ./DevSim -prefix Pm -unit 10 | head -n 10Pm10P -units kW 1773802162.168Pm10P = 201.66678153521698 1773802162.168Pm10Q = 21.798631195816505 1773802162.168Pm10S = 238.37803235202006 1773802162.168Pm10F = 50.95897404009428 1773802162.168Pm10P = 202.38345932326442 1773802162.404Pm10Q = 24.400423052441525 1773802162.404The a-mx combines multiple streams into one or more output streams, e.g.
to simulate two Generators you could use:
% ./a-mx "./DevSim -unit 2" "./DevSim -unit 3" | head -20Gen2P -units kW 1773802432.017Gen2P = 209.87005127122163 1773802432.017Gen2Q = 22.97585771092021 1773802432.017Gen2S = 220.96218974374338 1773802432.017Gen2F = 50.15230230947598 1773802432.017Gen3P -units kW 1773802432.02Gen3P = 205.03645661987198 1773802432.021Gen3Q = 23.86320509429239 1773802432.021Gen3S = 235.55207908877733 1773802432.021Gen3F = 49.379324508076216 1773802432.021The a-mx commands takes options including -show_stdout
which limit the values that limits the values that are sent by a-mx
to stdout, e.g.
% ./a-mx -show_stdout "*P" "./DevSim -unit 1" "./DevSim -unit 3"Print -unit properties
% ./a-mx -show_stdout "* -units" "./DevSim -unit 1" "./DevSim -unit 3"Finally you can filter on values, e.g. Gen2StartCmd = 1
The option -show_stderrhas the same syntax but sends it output
to stderr for debugging/
Status a-mx
Section titled “Status a-mx”Draft
Related works and references
Section titled “Related works and references”TBA
Using a-mx
Section titled “Using a-mx”% ./a-mx "./DevSim -unit 10" "./DevSim -unit 11"Implementation of a-mx
Section titled “Implementation of a-mx”Details on the implementation
Security implications of a-mx
Section titled “Security implications of a-mx”Details on the security implications
Further sources for a-mx
Section titled “Further sources for a-mx”Other sources…
\appendix
Use case 1
Section titled “Use case 1”1
The protocol is just:
NameP = valueNameP = value timeThe special names are used for modelling and limiting communication.
Watch = Gen*PNoting Watch is a per link value! kept by a-mx.
You can of course have multiple instances