set_composition
Purpose:
-
Continuously update a composition variable based on the concentrations defined in a set of real variables.
At a specified process interval, the “set_composition” task reads compostion information from a set of real variables, then packages and transmits that information in the “onga_onga” event message. The “onga_onga” message includes a stream identifier. The “update_composition” task, running on any node that receives that event, will automatically update the composition of the stream with that identifier.
The process interval is specified as a command line argument along with the name of a specification file. The specification file contains the stream identifier and a list of CyFlex real variables and associated composition component extenders such as O2, N2, ME, etc. These must be valid extenders as defined in asset.h with the COMP_MEMBER_TYPE_INIT_STRINGS define.
If “update_composition” is running on the same node as “set_composition”, and the composition variable for the stream identified in the spec file exists on the local node, then the local composition variable will be updated.
If the composition variable to be updated is on a remote node, then the “ev_tcp_send” application must be running on the local node and the “ev_tcp_receive” application must be running on the remote node. In addition, the ev_tcp_specs file which “ev_tcp_send” uses to determine where to send the onga_onga message must be configured for the remote node. See the sample ev_tcp_specs file below.
Note that the stream identifier is specified in the /specs/properties/comp_specs.NNN file used by “init_composition” when the composition variables are first created. Type ‘use init_composition’ for help. Also refer to Composition and Property Variables for further information.
There may be multiple instances of “set_composition” running on the same system, each updating a unique composition variable. The “update_composition” application will be able to handle messages from multiple instances of “set_composition” as well as messages from a remote “ongadata” application.
Enter:
-
set_composition <priority> <process_interval> <filename> [+c]
Where:
-
priority
Specify the real-time task priority. The recommended value range is 11-12.
process_interval
Specify the process interval. The recommended rate is SLO. One of the slower USER rates can be used if set to 2000, which is the expected update rate slower than 1hz.
filename
Specify the fully qualified specification file path and name that contains the specifications of the gases being used at the test cell. See example spec file content below.
+c
Optional. Specify this flag to indicate a critical task to the watchdog.
Example:
-
set_composition 11 SLO /specs/set_stack_comp &
The above command spawns set_composition which will use the file /specs/set_stack_comp for the initialization. specification file for the “STACK” stream/composition variable.
Example Spec File:#This is the stream identifier
STACK
# time_t when data was updated (this is not used at this time)
1450213661
#variable label component_extender
TFS_Others_Frac N2
TFS_Methane_Frac ME
TFS_CO2_Frac C2
TFS_Propane_Frac PR
TFS_I_Butane_Frac IB
TFS_N_Butane_Frac NB
TFS_I_Pentane_Frac IP
TFS_Ethane_Frac EE
#####################################################
ev_tcp_specs file:
client
#####################################################
#remote_IP source_event_name destination_event_name
143.222.77.80 onga_onga onga_onga
#####################################################
Notes:
-
The “set_composition” app is normally spawned in the go.scp script.