man8/BMtaskS

Table of Contents

Name

BMtaskS - Danfysik Bending Magnet Pwr Supply I/O service

Synopsis

BMtaskS <argument list>

Description

Serial I/O service for a Danfysik Bending Magnet Pwr Supply.

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

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 BMtaskS, all processing of them takes place inside of dbman(8) .

BMtaskS uses it’s own name 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".
--label <dblabel>

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

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

The remote host and port to connect to. Remote or local mode must be specified.
--cr_percent

If present, the power supply is providing the answer to the CR query in percent. SpanMin/Max are used to calculate scaling coeffients to convert the value to amperes.
--vr_percent

If present, the power supply is providing the answer to the VR query in percent. SpanMin/Max are used to calculate scaling coeffients to convert the value to volts.
--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 the PARLIST table to stderr.
--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. The commands sent to the power supply are in percent, so at initialization time these values are checked and the software uses them to calculate the correct value to send to the power supply.

This parameter needs to be writable by BMtaskS 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 BMtaskS 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.

The power supply should be set to return this value in physical units.

VR - optional

Voltage readback.

This should be owned and writable by whatever task BMtaskS 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.

The power supply is usually set internally so that issuing an off command performs a reset.

PolSC - optional

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 is queried for the current polarity and then the appropriate command is issued to change it to the opposite polarity.

ResetSC - optional

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.

Many times this control is not implemented because the power supply can be configured internally to provide a reset when an off command is issured. See DCpwrSC for more information.

Mstat - required

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

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

This should be owned and writable by whatever task BMtaskS 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 BMtaskS. 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 Danphysik manual.

DCpwrSR

DC power status readback.

FailSR

general failure

FuseSR

open fuse in power supply passbank.

OcrSR

overcurrent

OvlSR

overload

PolSR

Polarity status read (if the power supply has a polarity switch).

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.

WfloSR

Water flow status read #1

WfloSR2

Water flow status read #2

PolSR

Magnet output polarity.

I/O polling rates

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

Examples

BMtaskS --dbman_host csdev1 --local /dev/com2 --label BM 02-1
BMtaskS --dbman_host csdev1 --remote csdev11,ETSraw1 --label BM 02-1
Note that the label will need to be quoted for the shell to treat it as a single argument.

Notes

The source code talks about Danphysik possibly having made changes to the power supply firmware after 10/99. The issue is about whether or not the power supply gives a response when issued a current command. If anyone notices any problems when using this software with older Danphysik power supplies please contact RLK.

Manual page revision

$Id: BMtaskS.8,v 1.14 2009/03/24 20:12:47 kitchen Exp $


Table of Contents