man1/poll_par2

Table of Contents

Name

poll_par2 - poll a list of parameters at a regular interval

Synopsis

poll_par2 <argument list>

Description

This program connects to dbman running on the host specified by the dbman_host argument.

It subscribes to the list of parameters contained in the file named by the conf argument.

The value of each parameter is written to files in the directory pointed to by the data_path argument.

All parameters in the list are written as a comma separated set of fields terminated by a new line, i.e. each line in the file is one round of polling information. The list is written to the file at intervals of one second unless overridden by the time argument.

Several files may be generated by the program. Each file will contain the number of polling events specified by the data_pnt argument. The maximum number of files to generate is determined by the file_cnt argument. The file names are of the form "f.<file_num>" where file_num is replaced by the current file number, i.e. if file_cnt=3 the generated files will be named f.001, f.002, and f.003.

This scheme allows data to be logged for prescribed intervals while providing for some kind of control of disk usage. An errant copy of poll_par2 won’t run for weeks on end and eventually create a problem by filling up the disk.

Arguments

--dbman_host <hn>

The host where dbman is running. If this argument is not specified the default is localhost or the DBMAN_HOST environment variable.
--mngr <fn>

A CONFLIST format file containing a list of AccelNET parameters to be subscribed to.
--mngr_pn <pn>

The program name to use when parsing the MNGRconf file.
--data_path <path>

The pathname to the logging dir.
--data_pnt <num>

The number of data points per file.
--file_cnt <num>

The number of logging files to generate. If not present one file will be generated.
--time <period>

This argument is optional. The default polling time is 1 sec. This may be overridden by specifying a value for this argument. A value of the form 1.5 means to poll every 1.5 secs. The minimum value for time is 0.1 seconds.

The time value is quantized to 100mS.

--show_tbl

Optional. Enables printing of conf tables etc, when enabled.
--verbose

Sets the program loquacity. Can optionally be passed a number to change the amount of statements printed. Defaults to 1, passing 2 or higher would be considered to enable debugging information.
--help

Prints a brief help message.

Examples

This example outputs the values of the list of paramenters specified by the MNGRconf file every 0.1 seconds. It generates 10 files in a directory named data_dir. Each generated file contains 30 data points.

poll_par2 --dbman_host csdev11 --mngr MNGRconf --data_path data_dir --data_pnt 30 --file_cnt 10 --time 0.1

The MNGRconf file looks like this.

poll_par|g1|read1 |0|TPS TK-1|GvmVR |
poll_par|g1|read2 |0|SETUP |Ispecies|
poll_par|g1|read3 |0|SETUP |Ospecies|

The data_dir contains these file names when finished.

f.001, f.002, f.003, f.004, f.005, f.006, f.007, f.008, f.009, and f.010.

The contents of the data file look like this (not all lines shown). <date> is replaced with the current time and date:

<date>,0.000000e+00,1.000000e+00,2.000000e+00,
<date>,0.000000e+00,1.000000e+00,2.000000e+00,
<date>,0.000000e+00,1.000000e+00,2.000000e+00,
<date>,0.000000e+00,1.000000e+00,2.000000e+00,

Notes

Please note that poll_par2 actually subscribes to the parameters and outputs the locally known copy of the value at the prescribed interval rather than actually polling dbman each time to obtain the value. This results in better efficency for AccelNET overall.

Manual page revision

$Id: poll_par2.1,v 1.6 2007/10/04 16:49:43 kitchen Exp $


Table of Contents