MEDOR_set

Purpose:

Use this process to update a composition variable based on the concentrations defined in a set of real variables and to write an output file for loading into a database. The composition variable to be updated and the real variables are identified in a spec file whose pathname is a command line argument.

Enter:

MEDOR_set <priority>  <update_event> <filename> [+c]

Where:

priority

Specify the real-time priority.  The recommended value range is 11-12.

update_event

Specify the event used to synchronize variable and database updates with the rate at which the MEDOR data is received.

filename

Specify the name of the file that contains the specifications of the gases being used at the test cell. See example spec file content below.

+c

Optional. Specify +c to register this app as critical to the ‘scheduler’ task.         

Example:

MEDOR_set 11 MEDOR_update /specs/set_comp.MEDOR &

The above command spawns MEDOR_set which will use the file /specs/set_stack_comp for the initialization.

Notes:

The “MEDOR_set” app is normally spawned in the go.scp script.

Each real variable is associated with a component extenders such as MTM, ETM, THT, etc.

Upon receiving an update event, the “MEDOR_set” task reads  composition information from a set of real variables, then packages and transmits that information in the “onga_onga” event message. The “onga_onga” event 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 event_name, usually “MEDOR_update”, is specified as a command line argument along with the name of a specification file.  
      
If “update_composition” is running on the same node as “MEDOR_set”, 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.

There may be multiple instances of “MEDOR_set” running on the same system, each updating a unique composition variable.  The “update_composition” application will handle messages from multiple instances of “MEDOR_set” as well as messages from the “set_composition” app and from a remote “ongadata” application.

Example Specification Files

Example specification file for the “ODOR1” stream/composition variable:

######################################################################
#This is the stream identifier
ODOR1
# time_t when data was updated (this is not used at this time)
1450213661

#variable label      component_extender
MC_h2s                    H2S
MC_methyl             MTM
MC_ethyl                 ETM
MC_dimethyl          DMS
MC_2proply            IPM
MC_butyl                 TBM
MC_methyl_ethyl  MES
MC_1proply             NPM
MC_2butyl               SBM
MC_diethly              DES
MC_tetra                  THT
######################################################################

   Example ev_tcp_specs file:

######################################################################  
#remote_IP         source_event_name    destination_event_name
  143.222.77.80     onga_onga            onga_onga
#####################################################################     

 

See Also:

medordata, update_composition, ev_tcp_send, ev_tcp_receive, init_composition,  Composition and Property Variables