NAME

k22orb - transfer data from a Kinemetrics Altus digitizer to an orb

SYNOPSIS

k22orb [-pf pfname] [-db calibdb] [-dlclock dlname] [-v]
       [-state statefile] [-start starttime]
       targetname dataorbname [cmdorbname]

DESCRIPTION

k22orb is a program for interacting with one or more Kinemetrics Altus digitizers, through a bank of direct serial connections, telephone modems or ip devices, such as terminal servers, routers or device servers. Data packets along with log messages, status messages and event summary messages are written to an output orb. Optionally, the raw Kinemetrics .EVT files may also be written to disk. k22orb is capable of supporting all block mode data transfers including continuous streaming mode and both the dialout and dialin event triggered modes of the Kinemetrics Altus digitizers. Remote command and control of the dataloggers is accomplished through orb-based command/response packet communications using k2cmd(1). k22orb supports the entire Kinemetrics Altus product line, including the 18-channel Mount Whitneys.

OPTIONS

ORB OUTPUT PACKETS

k22orb writes out waveform data in a "generic" compressed packet format. The time lengths of the output data packets are controlled through the k22orb input parameter file, as defined below, for event data, and packet time lengths are preserved for streaming data (hardwired in the Altus dataloggers to 1 second).

k22orb also writes out a set of log messages (as <digitizer_name>/log and <targetname>/log packets). These messages are simple ASCII strings.

k22orb keeps a set of status information for each attached digitizer. All of this status information is written as a parameter file packet (with name <target_name>/pf/st) to the output orb whenever a state change occurs, for each digitizer, or based upon the request_status_interval parameter during streaming mode. >LP Whenever a new connection is established to a digitizer and new events are being requested, k22orb puts out event summary information as parameter file packets (with name /pf/<targetname>_k22orb_evtinfo). These event summary packets are transferred to the output orb immediately upon connection to the digitizer and are independent of the actual waveform transfers.

PROGRAM PARAMETER FILE

The k22orb parameter file contains all of the information necessary for connecting to various modems (or terminal servers) and from there to the digitizers. Following is an example k22orb parameter file.

#
#	k22orb.pf describes the modem comm links and the dataloggers
#

status_interval	20.0		# status reporting interval in seconds
datarate_interval 20.0		# datarate calculation interval in seconds
evt_file_dir	/b2/test/altus/evt	# root directory for .evt files
connect_listen_string	ATDT
connect_response_string	CONNECT<r><n><sl=1>CONNECT<r><n><sl=1>CONNECT<r><n>

modem_defaults &Arr{	# default parameters for modems
	baud			38400			# baud rate for serial
	dialin			yes			# listen for dailin connections?
	dialin_cmd		getevents		# command to execute whenever a dialin connection is made
	dialout			yes			# allow dialout connections?
	listen_string		ATE1N1W1&C1S0=1<r>	# listen modem control string
	nolisten_string		ATE1N1W1&C1S0=0<r>	# no listen modem control string
	dialout_string		AT&C1S0=0&D2DT<pn><r>	# call (dialout) modem control string
	hangup_string		ATH0<r>			# hangup telephone modem control string
	attention_string 	+++<sl=3>AT<r>		# string that will get the attention of the modem
	ring_rec_string		<r><n>RING<r><n>	# recognition string for telephone ringing
	busy_rec_string		<r><n>BUSY<r><n>	# recognition string for telephone busy
	connect_rec_string	<r><n>CONNECT~<r><n>	# recognition string for carrier detect
	offhook_rec_string	<r><n>NO CARRIER<r><n> 	# recognition string for carrier dropped
	attention_rec_string 	<r><n>OK<r><n>		# string that indicates modem is in command mode
	timeout			10.0			# read timeout value in seconds
	timeout_connect		30.0			# connect timeout value in seconds
	maxtries		3			# maximum number of tries to read data
}

modems &Arr{			# modem bank array
	modem1 &Arr{					# telephone modem
		com_mode		serial			# 'serial' or 'tcpclient'
		modem_control		local			# 'local', 'remote', or 'none'
		dev			/dev/ttyb		# UNIX device name for serial port to modem
	}
	serial1 &Arr{					# direct serial connection (no modem)
		com_mode		serial			# 'serial' or 'tcpclient'
		modem_control		none			# indicates direct serial connection (no modem)
		dev			/dev/ttya		# UNIX device name for serial
		dialin			no			# do not listen for dialin connections
		timeout_connect		10.0			# connect timeout value in seconds
	}
	cobox1 &Arr{					# cobox device server
		com_mode		tcpclient		# 'serial' or 'tcpclient'
		modem_control		none			# indicates direct serial connection (no modem)
		ipaddr			cobox			# ip-address for destination server
		port			9000			# port no. for destination server
		dialin			no			# do not listen for dailin connections
		timeout_connect		10.0			# connect timeout value in seconds
	}
	cobox2 &Arr{					# cobox device server
		com_mode		tcpclient		# 'serial' or 'tcpclient'
		modem_control		none			# indicates direct serial connection (no modem)
		ipaddr			cobox			# ip-address for destination server
		port			9001			# port no. for destination server
		dialin			no			# do not listen for dailin connections
		timeout_connect		10.0			# connect timeout value in seconds
	}
}

datalogger_defaults &Arr{	# default parameters for dataloggers
	model		K2		# datalogger model
	dialin		yes		# listen for dailin connections?
	dialout		yes		# allow dialout connections?
	dialout_if_getevents_incomplete yes	# dialout if getevents incomplete
	auto_delete	yes		# causes deletion of event files
					#   at K2 after reception
	auto_stream	yes		# causes datalogger to dialout for a
					#   streaming connection whenever idle
	auto_getevents	yes		# causes automatic acquisitions of events
					#   whenever an alarm is detected
	save_evt_files	no		# save K2 .evt files?
	callmode_on_close yes		# set K2 to CALLMODE on close?
	max_strbuf	1800		# maximum size of streaming packets buffer
	max_retran	30		# maximum pending retransmissions
	max_status_size	100		# maximum size of status list
	order_output_data	yes	# time order stream output data
	output_packet_twin 1.0		# time window in seconds of output ORB
					#   packets (for event data)
	tmpfile_maxwaittime 600.0	# maximum wait time in seconds for a
					#   K2 tmp events file to be completed
	request_params_interval 60.0    # time interval for automatically requequesting
                                        #   datalogger parameters block in streming
                                        #   mode only
	samprate	100		# requested streaming sample rate
	stream_timeout	200		# this is the ALtus streaming-modem communication
					#   timeout in packets - setting this to 0 will
					#   enable "mode 1" streaming communication
}

dataloggers &Arr{		# dataloggers array
	E1176 &Arr{			# target name for first datalogger
		serial		1176		# serial number for this datalogger
		model		Etna		# datalogger model
		dialin		no		# do not listen for dailin connections
		dialout_modem	serial1		# use 'serial1' serial line for dialout
		callmode_on_close no		# do not set Etna to CALLMODE on close
		auto_getevents	no		# causes automatic acquisitions of events
						#   whenever an alarm is detected
		output_channels &Tbl{		# net_sta_chan codes (or net_sta_chan_loc
						#   codes) for each Etna channel output
#                       pchan	net_sta_chan(_loc)	when	calib	calper	segtype	[str_netstachanloc]
			0 	BR_E1176_HGE 		both	data	-1.0	A
			1 	BR_E1176_HGN 		both	data	-1.0	A
			2 	BR_E1176_HGZ 		both	data	-1.0	A
		}
		max_strbuf	360		# maximum size of streaming packets buffer
	}
	K157 &Arr{			# target name for second datalogger
		serial		157		# serial number for this datalogger
		model		K2		# datalogger model
		dialout_modem	modem.		# use 'modem*' modems for dialout
		phone_number	3039380934	# telephone number for dialout
		auto_stream	no		# causes datalogger to dialout for a
						#   streaming connection whenever idle
		auto_getevents	no		# causes automatic acquisitions of events
						#   whenever an alarm is detected
		output_channels &Tbl{		# net_sta_chan codes (or net_sta_chan_loc
						#   codes) for each K2 channel output
#                       pchan	net_sta_chan(_loc)	when	calib	calper	segtype	[str_netstachanloc]
			0 	BR_K157_HGE 		both	db
			1 	BR_K157_HGN 		both	db
			2 	BR_K157_HGZ 		both	db
		}
		max_strbuf	540		# maximum size of streaming packets buffer
	}
	K110 &Arr{			# target name for first datalogger
		serial		110		# serial number for this datalogger
		model		K2		# datalogger model
		dialin		no		# do not listen for dailin connections
		dialout_modem	cobox2		# use 'cobox2' device server for dialout
		callmode_on_close no		# do not set K2 to CALLMODE on close
		output_channels &Tbl{		# net_sta_chan codes (or net_sta_chan_loc
						#   codes) for each K2 channel output
#                       pchan	net_sta_chan(_loc)	when	calib	calper	segtype	[str_netstachanloc]
			0 	BR_K110_HGE_EV 		both	data	-1.0	A	BR_K110_HGE
			1 	BR_K110_HGN_EV 		both	data	-1.0	A	BR_K110_HGN
			2 	BR_K110_HGZ_EV 		both	data	-1.0	A	BR_K110_HGZ
		}
		max_retran	12		# maximum pending retransmissions
	}
	M206 &Arr{			# target name for first datalogger
		serial		206		# serial number for this datalogger
		model		MtWhitney	# datalogger model
		dialin		no		# do not listen for dailin connections
		dialout_modem	cobox1		# use 'cobox1' device server for dialout
		auto_getevents	no		# causes automatic acquisitions of events
						#   whenever an alarm is detected
		callmode_on_close no		# do not set Mt Whitney to CALLMODE on close
		output_channels &Tbl{		# net_sta_chan codes (or net_sta_chan_loc
						#   codes) for each Mt Whitney channel output
#                       pchan	net_sta_chan(_loc)	when	calib	calper	segtype	[str_netstachanloc]
			0 	BR_M206_HGZ_00 		both	data	-1.0	A	BR_M206_HGZ_S0
			1 	BR_M206_HGZ_01 		both	data	-1.0	A	BR_M206_HGZ_S1
			2 	BR_M206_HGZ_02 		both	data	-1.0	A	BR_M206_HGZ_S2
			3 	BR_M206_HGZ_03 		event	data	-1.0	A
			4 	BR_M206_HGZ_04 		event	data	-1.0	A
			5 	BR_M206_HGZ_05 		event	data	-1.0	A
			6 	BR_M206_HGZ_06 		stream	data	-1.0	A
			7 	BR_M206_HGZ_07 		stream	data	-1.0	A
			8 	BR_M206_HGZ_08 		stream	data	-1.0	A
			9 	BR_M206_HGZ_09 		event	data	-1.0	A
			10 	BR_M206_HGZ_10 		event	data	-1.0	A
			11 	BR_M206_HGZ_11 		event	data	-1.0	A
			12 	BR_M206_HGZ_12 		event	data	-1.0	A
			13 	BR_M206_HGZ_13 		event	data	-1.0	A
			14 	BR_M206_HGZ_14 		event	data	-1.0	A
			15 	BR_M206_HGZ_15 		event	data	-1.0	A
			16 	BR_M206_HGZ_16 		event	data	-1.0	A
			17 	BR_M206_HGZ_17 		event	data	-1.0	A
		}
		max_strbuf	2700		# maximum size of streaming packets buffer
		max_retran	12		# maximum pending retransmissions
		password	secret		# for password protected dataloggers
	}
}

There are many parameters that are used either as command strings for telephone modems, or as recognition strings that the host computer uses to identify a modem response. Strings of this type from the k22orb parameter file are processed through a special parser that will recognize tokens for non-printing characters, such as RETURN and NEWLINE characters, as well as tokens to indicate time sleeps and substitute tokens for substituting telephone numbers. These special tokens are defined as follows:

At the beginning of the parameter file there are a set of global parameters as follows:

After the global parameters there must be four array parameters; modem_defaults, modems, datalogger_defaults and dataloggers. k22orb manages communications links through the "modems" array entries and dataloggers through the "dataloggers" array entries. Generally, the relationship between "modems" and "dataloggers" is dynamic, i.e. in typical event-oriented mode a datalogger may dial into any available modem and a datalogger command, either internally generated or from k2cmd(1), can initiate a dialout from any available modem to any particular datalogger. However, for hardwired serial connections, either wire-based or ip-based, that do not directly involve telephone modems, a fixed point-to-point connection between a particular communication link and a particular datalogger can be defined in the parameter file.

Communications links are defined in the "modems" array. Each entry in the array defines a single communications link and is itself another array with name set to the "modem" target name and values set to the parameters for that link. The parameters for a single communications link are as follows:

All of the communication link parameters, except for com_mode, modem_control, dev, ipaddr and port parameters, must be specified in the modem_defaults array which defines a set of default values for all of the individual modems array entries. Any of the default values can be overidden within each modems array entry as shown in the example parameter file.

Remote dataloggers are defined in the "dataloggers" array. Each entry in the array defines a single remote datalogger and is itself another array with name set to the "datalogger" target name and values set to the parameters for that datalogger. The parameters for a single remote datalogger are as follows:

All of the remote datalogger parameters, except for serial, dialout_modem, phone_number and output_channels, must be specified in the datalogger_defaults array which defines a set of default values for all of the individual dataloggers array entries. Any of the default values can be overidden within each dataloggers array entry as shown in the example parameter file.

BUGS AND CAVEATS

This version of k22orb is not compatible with the k2mon(1) and k2mon2(1) status display programs. Instead, the new dlmon(1) program should be used.

SEE ALSO

dlmon(1)

AUTHOR

Danny Harvey
Boulder Real Time Technologies, Inc.

Table of Contents
Antelope Release 4.6 Linux 2.4.19-4GB 2004-10-19
Boulder Real Time Technologies, Inc For more information, contact support@brtt.com