raw_mon

Section: WIN SYSTEM (1W)
Updated: 2000.12.21
Index Return to Main Contents
 

NAME

raw_mon, raw_mond - Conversion from RAW to MON format data  

SYNOPSIS

raw_mon rawkey monkey shmsize [ chfile [ logfile ]]

raw_mond rawkey monkey shmsize [ chfile [ logfile ]]

 

DESCRIPTION

Raw_mon generates MON format data from win-formatted RAW format data sorted in order of time cyclically written in a share memory segment identified by a key  rawkey and writes the generated data in another share memory segment identified by another key  monkey. When a channel file  chfile is given, only the data of the channels listed in it will be written. If the channel file name is prefixed with '-,' however, the data of all the channels other than the ones listed in that file will be written. If chfile is not given or if '-' is specified as the channel file, all the channel will be written. If the share memory segment with the key  monkey does not exist, a share memory segment with a size of  shmsize  (KB) will be created. If it already exists but has a size smaller than  shmsize  (KB), an error will occur. The shared memory key is a 32-bit integer.

Raw_mond is initiated in daemon mode.

When log file name  logfile is specified, operation log is set here. When it is not specified, log information is sent to the standard output (however, it is sent to syslogd(8) when operation is made in the daemon mode). The log file is opened/closed in each write.

When raw_mon is initiated without argument, brief usage is displayed.

The channel file is a text file that hexadecimally lists channel numbers, one for each line. In each line, only the first item is read, while the subsequent items delimited by blanks or tabs are all bypassed. Any lines starting with '#' are also bypassed. When receiving a hang-up signal, the raw_mon process rereads the channel file.

For the format of the shared memories, refer to order(1W) and winformat(1W).

The MON format is an irreversible data compression format for saving only the maximum and minimum values in 0.2 second-long intervals. Similarly to ones in the normal win format (RAW format), a second-scale channel block consists of a time header (second header) and channel blocks for the number of channels but has a different internal structure. A channel block consisting of data for one channel/one second has the following format:


Channel numberInterval 1Interval 2Interval 5
Max/min valueMax/min value...Max/min value
2BVariable lengthVariable lengthVariable length

Channel block (variable length)

The two bytes at the top is for the channel number, followed by variable-length (1-to-7-byte-long) blocks for five intervals (one second), each containing the encoded minimum and maximum values in a 0.2 second interval. The minimum and maximum values in a 0.2 second interval are encoded in the format below. The double vertical lines in the figure stand for byte boundaries. In the sequence of bits of each byte, the high-order bit comes to the left end. Multiple byte values are expressed in big-endian order (high-order byte first), and negative values are complements of 2.

(1) When both the minimum and maximum values can be expressed with 7 bits:

High-order 3 bitsHigh-order 3 bits ValueLow-order 4 bitsLow-order 4 bits
for min valuefor max value00for min value for max value
3 b3 b2 b4 b4 b

Maximum and minimum values in a 0.2 second interval (2 B)

(2) When both the minimum and maximum values can be expressed with 11 bits:

High-order 3 bitsHigh-order 3 bitsValueLow-order 1BLow-order1B
for min valuefor max value01for min valuefor max value
3 b3 b2 b1 B1 B

Maximum and minimum values in a 0.2 second interval (3 B)

(3) When both the minimum and maximum values can be expressed with 19 bits:

High-order 3 bitsHigh-order 3 bitsValueLow-order 2BLow-order 2B
for min valuefor max value10for min valuefor max value
3 b3 b2 b2 B2 B

Maximum and minimum values in a 0.2 second interval (5 B)

(4) When both the minimum and maximum values can be expressed with 27 bits:

High-order 3 bitsHigh-order 3 bitsValueLow-order 3BLow-order 3B
for min valuefor max value11for min valuefor max value
3 b3 b2 b3 B3 B

Maximum and minimum values in a 0.2 second interval (7 B)

 

OPTIONS

None
 

SOURCE

`raw_mon.c'
 

SEE ALSO

winformat(1W), order(1W), raw2mon(1W)


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
SOURCE
SEE ALSO