man8/HPBtask

Table of Contents

Name

HPBtask - Group 3 hall probe controller serial I/O service

Synopsis

HPBtask <argument list>

Description

Serial I/O service for a Group 3 hall probe controller.

Arguments

Argument processing is done using Unix long argument syntax

The values of all the parameters listed here are printed on stderr when the program starts, whether or not they were supplied on the command line.

--dbman_host <hn>

The host where dbman is running.

This is optional, and will default to localhost or the current value of the DBMAN_HOST environment variable.

--local <iopath>

Defines the local device path to connect to. Local or remote must be specified.
remote <host>,<port>

Configures remote mode using the provided host and port. Remote or local mode must be specified.
--label <label>

A label from the database.
--config <filename>

The pathname of a file in which to store configuration information.

The offsets and scale values for each range are stored here if the file is present.

See the Scale* and Offset* RefNames in the Hall probe controller Database RefNames section for more information.

If the file does not exist and a pathname is specified on the command line when the program is started it is created.

Argument Usage

Argument processing is fairly simple with long options. There is no required order for any of the long options with the exception that when declaring remote mode the host and port must be specified. If an invalid argument is passed, the usage message will be printed. In remote mode a host name or an IP address may be used. The port number is extracted from /etc/services or may be specified as a numeric value.

Hall probe controller Database RefNames

These RefNames are expected by the program. If they are marked optional they are not required and they will either be ignored or some default action will take place.

ResetSC - optional


This is a command to the program to reinitialize the hall probe controller and resync it with the database.

This is a 1 bit control, nop/reset.

0.0 = nop
1.0 = reset

The control key should be set to Mom.

This parameter should be owned by whatever task HPBtask registers as and the permissions set for direct update by users and direct update for the owner.

MfieldR


The field reading.

This parameter should have a range of +/- 20000 or more if the units are in gauss or a range of +/- 2 if the units are in tesla.

The control key doesn’t matter.

This parameter should be owned by whatever task HPBtask registers as and the permissions set for none by users and direct update for the owner.

TR - optional


The temperature reading.

This parameter should have a range of +/- 100. The reading is in degrees Celsius.

The control key doesn’t matter.

This parameter should be owned by whatever task HPBtask registers as and the permissions set for none by users and direct update for the owner.

RangeSel


Hall probe range selection.

This is a two bit paramater. Valid values are:

0.0 - 0.3 tesla range.
1.0 - 0.6 tesla range.
2.0 - 1.2 tesla range.
3.0 - 3.0 tesla range.

The control key can be set to IncN, DecN, or IDecE. Usually IDecE is used.

This parameter should be owned by whatever task HPBtask registers as and the permissions set for direct update by users and direct update for the owner.

This parameter is not used with a single range probe and may be omitted.

Offset* - optional

The program allows four database parameters to be used for specifying the offset correction for each hall probe range. The parameters are named:

Offset0 - 0.3 tesla range
Offset1 - 0.6 tesla range
Offset2 - 1.2 tesla range
Offset3 - 3.0 tesla range

The parameters should have a range of +/- 20000 or more if the units are in gauss or a range of +/- 2 if the units are in tesla.

The control key should be set to RSetK.

These parameter should be owned by whatever task HPBtask registers as and the permissions set for direct update by users and direct update for the owner.

When HPBtask starts the values for these parameters are taken from the configuration file if specified on the command line. If the file is not present the values are set to zero.

If the file is present and the datapoints do not exist in the database the values from the file are used to set the hall probe controller.

If the value is changed the configuration file is updated with the new value so that the values are remembered across restarts.

When using a single range probe only the Offset0 parameter is used regardless of the actual range of the probe. The rest of the Offset* parameters are not used and may be omitted from the database.

Scale* - optional

The program allows four database parameters to be used for specifying the scale correction for each hall probe range. The parameters are named:

Scale0 - 0.3 tesla range
Scale1 - 0.6 tesla range
Scale2 - 1.2 tesla range
Scale3 - 3.0 tesla range

The parameters should have a range of +/- 10 or more. The units dimensionless.

The control key should be set to RSetK.

These parameter should be owned by whatever task HPBtask registers as and the permissions set for direct update by users and direct update for the owner.

When HPBtask starts the values for these parameters are taken from the configuration file if specified on the command line. If the file is not present the values are set to zero.

If the file is present and the datapoints do not exist in the database the values from the file are used to set the hall probe controller.

If the value is changed the configuration file is updated with the new value so that the values are remembered across restarts.

When using a single range probe only the Scale0 parameter is used regardless of the actual range of the probe. The rest of the Scale* parameters are not used and may be omitted from the database.

HPB controller configuration

The switches inside of the hall probe controller are recommended to be set as follows:

SW1-1 - off - SW1-(1-5) position does not matter
SW1-2 - off
SW1-3 - off
SW1-4 - off
SW1-5 - off
SW1-6 - on - serial data format = 1 stop bit, no parity
SW1-7 - off -
SW1-8 - on -

SW2-1 - off - transmit mode = on demand only
SW2-2 - on - terminator = carriage return
SW2-3 - off - double terminator = disabled
SW2-4 - on - echo commands = yes
SW2-5 - on - field units = gauss
SW2-6 - on - units symbol = symbol after data
SW2-7 - on - digital filtering = on
SW2-8 - off - reset = off

Switches SW1-(6-8) are shown in the NEC default positions, one stop bit, no parity. They can be set to other positions if the user wishes to initialize the communications port differently.

The field units may be set for gauss or tesla depending on the database configuration. The program will process either type of message.

Digital filtering may be turned on or off depending on user requirements.

Reset on power up can be set for user preference.

Note that at this time the program reads the switch settings from the controller on startup. The program adjusts itself for the SW2 settings except for the transmit mode which must be "on demand" rather than "every measurement sent". The rest of the SW2 settings are meant as a guide.

HINT: 9600 baud is the E position on the baud rate switch.

Communication port settings

When using com ports on the computer the following settings should be used: no echo, and raw mode. See the examples section for more information.

Note also that the number of stop bits and the character bit length may need to be set.

Similiar settings should be programmed into the terminal server when using remote mode.

I/O polling rates

Polling is normally performed at 1Hz. Fast polling is not supported.

Examples


#
# local port communication example
#
stty -echo < /dev/ttyS0
stty raw < /dev/ttyS0
stty 9600 < /dev/ttyS0
HPBtask --dbman_host csdev1 --local /dev/ttyS0 --label "HPB 02-1"
#
# communication using a terminal server
#
HPBtask --dbman_host csdev1 --remote csdev11,ETSraw1 --label "HPB 02-1"

Note that the label will need to be quoted for the shell to treat it as a single argument.

Notes

When the program is started or a reset is issued a ^u (control U) is sent to the hall probe controller and all of the scale factors and offsets are initialized either to zero and one or according to values in the config file if specified on the command line.

It might be better if ResetSC where indirect update..

When the program is started it registers with dbman as HPBtask.

This program is presently debugged to work properly with v6.0b firmware. It is known that this program has firmware revision dependent code in it. This can’t be helped.

Manual page revision

$Id: HPBtask.8,v 1.10 2007/07/17 16:14:30 kitchen Exp $


Table of Contents