man8/HZtask_v2

Table of Contents

Name

HZtask_v2 - Heinzinger Bending Magnet Pwr Supply I/O service

Synopsis

HZtask_v2 <argument list>

Description

This is the job control version of serial I/O service for a Heinzinger Bending Magnet Pwr Supply.

The program expects to find several RefNames under the Label. Some of the RefNames are used directly by HZtask_v2,

Other RefNames are used to decode the magnet status word (Mstat). These RefNames are mapped onto the same DataRec that Mstat is using and decode individual bit fields within the Mstat data word. These RefNames are ignored by HZtask, all processing of them takes place inside of dbman(8) .

HZtask_v2 uses BMtaskS when it registers with dbman.

When the program is started it queries the power supply for the current control setting. It sets the CC control to this value. The power supply state is otherwise left as found, i.e. the power supply is not turned off.

Arguments

Argument processing is done using Unix long argument syntax.

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

--dbman_host <hn>

The host where dbman is running. If this argument is not supplied the default is "localhost".

--dbman_name <rn>

Set the name used by the program to register with dbman.

--label <dblabel>

The database label, or label of device under control. ie, "BM 02-1"

--dev <device>

Determines what device to connect to.

The <device> argument has two forms:
local: "dev:<pathname>"
network: "tcp:<host>:<port>"

--log_clean

If this argument is present diagnostic messages from the CleanConnection() function are written to stderr.
--log_retry

Print a message to stderr each time the program needs to retry I/O to the power supply.

Sending SIGHUP to the program causes it to dump the I/O retry counters to stderr.

--log_cc

If this argument is present the CC conversation cmds and responses are printed to stderr (this is a diagnostic function).
--log_cr

If this argument is present the CR conversation cmds and responses are printed to stderr (this is a diagnostic function).
--log_init

If this argument is present the initialization conversation cmds and responses are printed to stderr (this is a diagnostic function).
--log_pol

If this argument is present the polarity change conversation cmds and responses are printed to stderr (this is a diagnostic function).
--log_sr

If this argument is present the SR conversation cmds and responses are printed to stderr (this is a diagnostic function).
--log_vr

If this argument is present the VR conversation cmds and responses are printed to stderr (this is a diagnostic function).
--log_resync

If this argument is present the CC resync conversation cmds and responses are printed to stderr (this is a diagnostic function).
--log_selmsg
If this argument is present response messages which arrive from the power out of sequence, i.e. not as a response to a command are logged.

Usually if this is happening it means the network has a lot of latency and the responses are arriving after the transaction code has decided to time out.

--diag

Don’t close stdin and stdout and allow SIGINT to kill the program.
--show_tbl

Print the contents of various tables to stderr.
--verbose=<level>

Print more information. If <level> is missing it defaults to 1.

--persist

Run the program in persist mode.

--tagname_ctl

parameter name to use for task control.

--tagname_status

parameter name to use for reporting task status.

--help

Print the help information to stderr.

Bending Magnet Control Database RefNames

The RefNames in this group directly relate to parameters in the bending magnet power supply. These are the parameters which are directly managed by BMtaskS.

CC - required


Current control.

SpanMin and SpanMax should be set for the current range of the power supply, in amps. The commands sent to the power supply are in mA.

This parameter needs to be writable by HZtask_v2 because the power supply is queried for it’s setting and the value is copied to the database.

CR - optional

Current readback.

This should be owned and writable by whatever task HZtask_v2 registers as. Make sure PhyMin and PhyMax are set to a high enough value so that BMtaskS can successfully write to the datapoint OR set the owner write permissions for unconditional update.

VR - optional

Voltage readback.

This should be owned and writable by whatever task HZtask_v2 registers as.

Make sure PhyMin and PhyMax are set to a high enough value so that BMtaskS can successfully write to the datapoint OR set the owner write permissions for unconditional update.

DCpwrSC

DC power status control. This is a 2 bit control, nop/off and nop/on.

0.0 = nop
1.0 = off
2.0 = on
3.0 = not used

The datapoint’s switch type should be set for Momentary.

Heinzinger supplies do not seem to perform a reset upon being issued an off command.

ResetSC

Power supply reset status control. This is a 1 bit control, nop/chg.

0.0 = nop
1.0 = chg

The datapoint’s switch type should be set for Momentary.

The power supply needs to be sent an RS command for it to reset. So, unlike the Danphysik supplies, this is needed.

Mstat - required

Magnet Status word. Individual bit fields in the word represent the state of the power supply. See the Heinzinger manual for more information.

This parameter is used by HZtask_v2 to write the entire word into the AccelNET database.

This should be owned and writable by whatever task HZtask_v2 registers as.

Other DESC records in the database mapped to the same DESC as Mstat are used to display the individual statuses contained in the word. See "RefNames mapped into Mstat data" for more information.

RefNames mapped into Mstat data

These parameters are not directly managed by HZtask_v2. The parameters listed here are mapped into bits in the same DataRec that Mstat is writing into. The exact bit mapping depends somewhat on the configuration of the power supply. More information can be found by consulting the Heinzinger manual.

DCpwrSR

DC power status readback.

FailSR

general failure

FuseSR

open fuse in power supply passbank.

OcrSR

overcurrent

OvlSR

overload

PwrSR

AC power status read

ReadySR

Ready status read. This means power supply is at value requested by CC.

TempSR

internal temperature status read.

TempSR2

external temperature status read. For example, a temperature sensor installed on the bending magnet and connected to the power supply.

TransSR

Transistor failure status read.

I/O polling rates

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

Examples


HZtaskS_v2 --dbman_host csdev1 --dev dev:/dev/com2 --label "BM 02-1"
HZtaskS_v2 --dbman_host csdev1 --dev tcp:csdev11:ETSraw1 --label "BM 02-1"

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

Notes

The source code was built off of BMtaskS_v2. It has similiar conditionalized code in it still in case at some point the supply starts giving extra responses when it didn’t before.

Manual page revision

$Id: HZtask_v2.8,v 1.0 2009/04/28 19:31:10 mcnamer Exp $


Table of Contents