man8/McSNICSmngrSIM

Table of Contents

Name

McSNICSmngrSIM - McSNICS ion source indexer simulation manager

Synopsis

McSNICSmngrSIM <argument list>

Description

This program simulates managing an ion source indexer. From the user point of view it responds in the same way as McSNICSmngr(8) . However, no commands to manipulate the indexer hardware are sent to the database.

It can presently handle four indexers simultaneously.

Each ion source can be of a different type, i.e. 40 sample unidirectional, 40 sample bidirectional, and 134 sample bidirectional. All sources may be operated at the same time.

The number of samples (source wheel size) is determined by the PhyMin and PhyMax parameter in the wheel position control datapoint (comm1) usually named CatNumC in the AccelNET database.

Usage of this program from the operator’s point of view

The operator enters a new cathode position by changing the value of CatNumC (comm1). The indexer automatically begins moving towards the selected cathode. If the indexer is capable of bidirectional operation the shortest path to the destination is computed and indexer reverse or forward is selected as appropriate.

The operator may enter a new cathode number while the indexer is in motion and McSNICSmngrSIM will use the newly entered cathode number as the destination, switching directions if necessary.

The IdxHmeSC control (comm2) is used to initiate a homing operation. This command may be issued at any time. If the indexer is in motion McSNICSmngrSIM enters homing mode at the beginning of the next indexer cycle.

The IdxClrSC control (comm3) may be used to cancel the move at any time.

Since no actual moves are performed normal index and homing operations can’t fail therefore the read5 MNGRconf parameter may be used to simulate the local/remote switch. This allows testing of the need_home and error states of the BusySR (resp2).

Arguments

Arguments are processed using Unix long argument syntax.
--mngr <fn>

The pathname of the CONFLIST file from which to obtain the configuration information.

If this is not specified it defaults to "MNGRconf" in the current working directory (i.e. the directory where the program was started).

McSNICSmngr is used as the program name when searching this file.

--mngr_pn <fn>

The program name to use when parsing the CONFLIST file.

If this argument is not specified it generally defaults to the program name.

--data_path <pn>
The pathname of the CONFIG_TBL used to store the current cathode number.

If this file does not exist it will be created when the program is started. If the file is created at startup time the commanded and current cathode numbers (CatNumC, CatNumR) will be set to zero and the indexer will perform a homing operation automatically the first time a move is attempted.

If this is not specified it defaults to "mcs_config.dat" in the current working directory (i.e. the directory where the program was started).

--show_tbl

If this argument is present the contents of the CONFLIST table is printed to stderr
--diag

If this argument is present stdout and stdin are left open and the program may be killed by SIGINT.

This argument is useful when setting up the parameters for the PID loop(s) because it makes it very easy to kill and restart the program after changing the config file.

--verbose=<n>

Normally the program does it’s work silently. This sets the level of logging information. The number is optional but if provided it must include the "=". If no argument is provided the default level is 1.
0 - work silently
1 - print signon msg, option settings

Configuration name usage

The configuration file uses the libmngr(3mngr) facility to connect internal parameters to the AccelNET database. The mappings for this program are given below.

Parameters needed by this program can be combined with parameters belonging to other programs. The "program name" field in the configuration file differentiates the entries.

McSNICSmngrSIM uses "McSNICSmngr" as the program name when searching the file.

Groups 1 through 4 are used. Each group represents the controls for one indexer system.

The parameter assignments and the program named used when seaching the config file match McSNICSmngr(8) so that this program may be run in place of McSNICSmngr(8) without needing to change the database or the config file.

If the parameters marked required are missing from the configuration file the indexer will not work. Error messages are printed to stderr indicating this.

comm1 - required

The commanded cathode number.

Usually this is named CatNumC in the AccelNET database.

The control key should be set to RSetK.

This parameter should be owned by whatever task McSNICSmngrSIM registers as and the permissions set for indirect update by users and unconditional update for the owner.

The number of samples (source wheel size) is determined by PhyMin and PhyMax. Usually PhyMin is set to zero and PhyMax is set to the maximum wheel position.

Using a 40 sample source as an example:

PhyMin = 0
PhyMax = 39

comm2 - required

Initate an indexer homing operation.

Usually this is named IdxHmeSC in the AccelNET database.

This is a 1 bit control, nop/home.

0.0 = nop
1.0 = home

The control key should be set to Mom.

This parameter should be owned by whatever task McSNICSmngrSIM registers as and the permissions set for indirect update by users and unconditional update for the owner.

When a user task attempts to set this parameter to the value of home McSNICSmngrSIM is sent an indirect update msg.

When McSNICSmngrSIM receives the indirect update message it initiates the homing operation and sets the value of the datapoint to home pending completion of the homing operation.

When the homing operation completes the datapoint is reset to the nop state.

comm3 - optional

Cancel an indexer operation.

Usually this is named IdxClrSC in the AccelNET database.

This is a 1 bit control, nop/clear.

0.0 = nop
1.0 = clear

The control key should be set to Mom.

This parameter should be owned by whatever task McSNICSmngrSIM registers as and the permissions set for indirect update by users and unconditional update for the owner.

When a user task attempts to set this parameter to the value of clear McSNICSmngrSIM is sent an indirect update msg.

When McSNICSmngrSIM receives the indirect update message it initiates the index cancel operation or schedules it to occur at the completion of the current move if there is one in progress.

McSNICSmngrSIM sets the value of the datapoint to clear pending the actual termination of the index cancel operation.

When the index cancel has completed the datapoint is reset to the nop state.

The index operation is terminated at the completion of the current index cycle if one is in progress.

If an index operation is in progress a message is returned to the initiator of the operation telling that the index cycle cancellation is pending, otherwise a message is returned stating that no index operation is in progress.

When the index cancel completes a message is returned telling about it.

resp1 - required

The current cathode position.

Usually this is named CatNumR in the AccelNET database.

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

PhyMin and PhyMax are usually set to the same values as the cathode position control parameter comm1.

resp2 - required

The indexer program/hardware status.

Usually this is named BusySR in the AccelNET database.

This is a 2 bit control.

0.0 = rest
1.0 = busy
2.0 = need_home
3.0 = error

The control key should be set to RSet.

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

read5 - optional

This parameter may be used to simulate the action of the local/remote switch on the indexer.

It is given a separate assignment in the MNGRconf file to make it easier to use a common file for both McSNICSmngr and this program.

The purpose of this program in simulation of the indexer for purposes of testing other software such as DMAN. Therefore, this parameter usually is a "borrowed" parameter so there no recommended RefName for this item.

This is a 1 bit readback.

0.0 = local mode
1.0 = remote mode

Ownership and control keys for this parameter do not matter to this program. They should be set as appropriate to enable a user to change the value.

Examples


#
#    MNGRconf
#
#    McSNICSmngr configuration
#
#    source 1
#    134 sample, bidirectional source
#
#    in this case we will "borrow" one of
#    the mbs system gates to use as the
#    local/remote switch
#
McSNICSmngr|g1|comm1 |0|MCS S1-1|CatNumC |
McSNICSmngr|g1|comm2 |0|MCS S1-1|IdxHmeSC|
McSNICSmngr|g1|comm3 |0|MCS S1-1|IdxClrSC|
McSNICSmngr|g1|resp1 |0|MCS S1-1|CatNumR |
McSNICSmngr|g1|resp2 |0|MCS S1-1|IdxBsySR|
McSNICSmngr|g1|read5 |0|GATE 11 |State0 |
#
#    source 2
#    40 sample, unidirectional source
#
McSNICSmngr|g2|comm1 |0|MCS S2-1|CatNumC |
McSNICSmngr|g2|comm2 |0|MCS S2-1|IdxHmeSC|
McSNICSmngr|g2|comm3 |0|MCS S2-1|IdxClrSC|
McSNICSmngr|g2|resp1 |0|MCS S2-1|CatNumR |
McSNICSmngr|g2|resp2 |0|MCS S2-1|IdxBsySR|

See Also

libmngr(3mngr)

Manual page revision

$Id: McSNICSmngrSIM.8,v 1.5 2008/03/05 20:50:41 kitchen Exp $


Table of Contents