WICE Signal Broker API

From WICE Wiki v2.89
Revision as of 07:55, 28 May 2018 by Mathias (talk | contribs) (Created page with "The WICE Signal Reader module can act as a signal broker for Rapid Prototyping software components or other components running on external hardware connected to the WCU using...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The WICE Signal Reader module can act as a signal broker for Rapid Prototyping software components or other components running on external hardware connected to the WCU using ethernet or WiFi. The signal broker API is based on a publish/subscribe model, whereby custom client software components can connect a TCP socket (with default port number 31415) to Signal Reader, and subscribe to signals by name using the subscribe command (see below). The client software components can also publish signal values to the broker, using the publish command, for three special-purpose WICE-internal signals (called Dynamic_1, Dynamic_2 and Dynamic_3). The published signals can be used in trigger conditions, monitored and recorded in MDF files, like any other signal. They can also be subscribed to by other custom client software components.

The following API commands are supported on the signal broker socket:

Command string Description
list Lists the names of signals available for subscription.
modulenames <on/off> Selects between subscribed signals being reported with or without module names.
onchange <on/off> Selects whether signals are to be reported on the API socket only when changed, or whenever they are read.
publish <dynamic internal signal name> <value> Assignes the supplied floating point value to the WICE-internal dynamic signal supplied. The signal name, including module name, is WICE_Generic_Internal.Dynamic_<n>, where <n> is from 1 to 3.
quit Disconnects from API socket.
starttime Returns the time signal reader was started
subscribe <signal name 1> <signal name 2> ...<signal name n> Subscribes to the list of signals supplied. Signal names must include module names.
textvalues Selects whether signals that have text table conversions should be reported with or without the text value.
timestamp <on/off> Enables / disables timestamps of subscribed signals. Timestamps are in seconds since Signal Reader was started (reported by the starttime command).
unsubscribe <signal name 1> <signal name 2> ...<signal name n> Unsubscribes the list of signals supplied. Signal names must include module names.
version Returns the Signal Reader version.
vin Returns the Vehicle Identification Number of the vehicle the WCU is installed in, if available.

All command strings in the table above are case sensitive and terminated by a newline character. Tokens are separated by a single space character.

Signal values are written to the API socket, one signal per line, with the following syntax:

[timestamp] <signal name> <signal value> [textual value]

Timestamps can be enabled and disabled using the timestamp command. Textual values are enabled and disabled using the textvalues command.