Flame Detection RPC Client Software

The transmission of data from Linux (or non-Foxboro sun) to the Foxboro system is achieved by omwr/omrd (Object Manager Write,Object Manager Read) on the client (Linux or sun) end and multisvc on the server (Foxboro AP/AW) end. The executables omrd/omwr are the same file. When invoked the software determines the name which it is invoked as to perform the correct function. The two filenames are linked together (ie there is only one actual file with two names ).

The data transfer is achieved using Remote Procedure Call (RPC) techniques. This method uses a server process which registers an available procedure for remote applications which does a particular function. This procedure is called by a client process on a remote or local computer. The software which sends the data across the network is transparent to both the client and the server. Refer to Power Programming with RPC by John Bloomer,Published by O'Reilly & Associates for additional description of operation.

The data format (protocol) sent between the client and server is defined by a control file called omrd.x which is compiled by rpcgen to produce the 'C' stubs and header files to transfer the data. For more information on rpcgen consult the manual pages (man rpcgen).

The client side user written code is omrd.c. A template can be produced by rpcgen which can be fleshed out to produce the desired result. A Makefile is provided to build all the relevent object files and link to produce the executables.
To build the client software-
# cd /stds/genl/source/flamedetection/linux ( To produce a linux client)
# cd /stds/genl/source/flamedetection/sun ( To produce a sun client)
# make omrd

The pseudo code for omrd/omwr is as follows

main ( args:  server address, [-f filename ] , [Compound:block.param] .... ) {
	if ( -f ) {
		open file for input 
		if ( filename = - ) use stdin
	} else read c:b.p from arguments
	allocate memory and load data to be transfered to the server (protocol)
	call server RPC function as required (read or write)
	format data returned and print
	free allocated memory
	exit
}	
omrd can take a maximum of 100 object requests and takes the following arguments
omrd server_name -f filename (filename can be stdin [-])
Filename contents must to a maximum of 100 entries and be of the form-
compound:block.parameter #comment
shared var name #comment
compound:block.parameter #comment
compound:block.parameter #comment
The file is therefore in the same structure as for the scan program.
The other form is with all the object names on the command line
omrd server_name compound:block.parameter compound:block.parameter compound:block.parameter compound:block.parameter compound:block.parameter ...
omrd returns a list of values in the order supplied
compound:block.parameter value
shared var name value
compound:block.parameter value
compound:block.parameter value
If the object does not exist the an error message and code will be returned.
omwr must supply a value with the object name and also a datatype for the value. The default datatype is INT. (for the flame detection)
omwr server_name -f filename (filename can be stdin [-])
Filename contents must to a maximum of 100 entries and be of the form-
compound:block.parameter value
shared var name value
DATATYPE
compound:block.parameter value
DATATYPE
compound:block.parameter value
eg
COMPOUND:BLOCK1.PARAM 123 (Datatype not set therefore INT)
+FLOAT
COMPOUND:BLOCK2.PARAM 123.45 (Datatype now FLOAT)
COMPOUND:BLOCK3.PARAM 223.12
COMPOUND:BLOCK4.PARAM 3323.67
+BOOL (Datatype BOOL)
COMPOUND:BLOCK5.PARAM 1
COMPOUND:BLOCK6.PARAM 0
Valid datatypes are +INT +FLOAT +STRING +BOOL +OM_BOOL +PKD_BOOL +PKD_LONG
Any subsequent object names after the DATATYPE entry will use the same datatype until the datatype changes.
The other form is with all the object names on the command line
omwr server_name compound:block.parameter value DATATYPE compound:block.parameter value ...
[Previous] [Contents] [Next]

Compiled by Darryl Bond
Mail to:Darryl Bond

Check Date for latest Update History