Table of Contents

Name

McSNICSmngr - McSNICS ion source indexer manager

Synopsis

McSNICSmngr <argument list>

Description

This program manages several types of NEC McSNICS ion source pneumatic indexers. 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 McSNICSmngr 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 McSNICSmngr 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.

If there is a problem performing the move, for example if the indexer fails to complete an index cycle McSNICSmngr will enter home mode and attempt to rehome the indexer. If the attempted home operation fails the operator is notified and BusySR (resp2) is set to the error state.

Operation of an indexer by the program

This section describes how McSNICSmngr interacts with the McSNICS indexer controller. Schematic designators refer to NEC schematic 2HS032530.

PLUNGER means one or the other of the air cylinders which rotate the sample wheel.

PIN means the locking pin, which is parallel to the source axis. Remote control signals are connected to J1.

The source connects to this schematic by air lines.
LS1 is the roller air switch

LS2 is the PIN is fully extended switch.

SOL1 withdraws the forward PLUNGER when energized.

SOL2 withdraws the reverse PLUNGER when energized.

SOL3 withdraws the PIN when energized.

Other SOLs operate service functions and are too obvious to discuss.

McSNICSmngr activates IdxChgSC (ctl1) to change position which closes K201 which closes K1 which closes K2. Within a few milliseconds K1 causes the SOL1 PLUNGER to retract, and K2 causes the SOL3 PIN to retract.

When the PIN retracts, LS2 changes state to false. McSNICSmngr reads this as IdxPosSR (read1). McSNICSmngr then releases K201 which releases K1, starting the K1 delay time.

At end of the K1 delay, K1 opens its contacts, one of which lets SOL1 plunger extend, and the other of which releases K2, starting the K2 delay time.

As it extends the plunger moves the wheel and the "latch" circuitry involving K102, K103 and K104 captures the momentary change (a blink) in the roller switch LS1. The LED CR2 should actually blink as the wheel advances.

At end of the K2 delay, K2 opens its contacts, one of which lets SOL3 PIN extend. If it extends properly LS2 changes state.

McSNICSmngr waits for InPosSR to return to the true state. Next IdxAdvSR (read2) is checked to confirm INDEXER ADVANCED.

IdxAckSC (ctl2) is set true to clear INDEXER ADVANCED. This sets K202, which resets the latch "flip-flop".

After IdxAdvSR goes to the false state IdxAckSC is set false and the cathode number is incremented.

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).

--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).

--mngr_pn <name>

The program name to use when parsing the CONFLIST file.

Defaults to McSNICSmngr.

--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.
--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.

McSNICSmngr 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.

If the parameters marked required are missing from the configuration file the indexer will not work. Error messages will be 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 McSNICSmngr 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 McSNICSmngr 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 McSNICSmngr is sent an indirect update msg.

When McSNICSmngr 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 McSNICSmngr 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 McSNICSmngr is sent an indirect update msg.

When McSNICSmngr 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.

McSNICSmngr 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 McSNICSmngr 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

rest means that the indexer isn’t moving and is ready for the next move.

busy means there is a move in progress.

need_home means that the indexer needs to be rehomed. This may happen automatically when a new cathode position is entered or may be done explicitly be activating the HomeSC.

error means that a fatal error has occurred. For example the indexer may have encountered an error while homing the drive.

The control key should be set to RSet.

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

resp3 - optional

Indexer move interlock output.

This is a 1 bit control.

0.0 = bad
1.0 = ok

The control key should be set to RSet.

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

See the section "Notes on using resp3" for more information.

ctl1 - required

Indexer hardware parameter - initiates an indexer move.

Usually this is named IdxChgSC in the AccelNET database.

This is a 1 bit control, nop/chg.

0.0 = nop
1.0 = chg

The control key should be set to Mom.

This parameter should be writable by whatever task McSNICSmngr registers and owned as appropriate.

ctl2 - optional
Indexer hardware parameter - clears the indexer advanced signal.

Usually this is named IdxAckSC in the AccelNET database.

See read2 for more information.

This is a 1 bit control, nop/chg.

0.0 = nop
1.0 = chg

The control key should be set to Mom.

This parameter should be writable by whatever task McSNICSmngr registers and owned as appropriate.

See the section Note on using ctl2 and read2 for more information about this parameter.

ctl3 - optional
Indexer hardware parameter - set index direction.

Usually this is named IdxDirSC in the AccelNET database.

Some models of the McSNICS ion source are capable of bidirectional operation. This control determines which way the indexer will move.

This is a 1 bit control, fwd/rev.

0.0 = forward
1.0 = reverse

The control key should be set to IncN.

This parameter should be writable by whatever task McSNICSmngr registers and owned as appropriate.

When this parameter is present it enables bidirectional mode in McSNICSmngr.

read1 - required

Indexer hardware parameter - indexer in position

Usually this is named IdxPosSR in the AccelNET database.

This is a 1 bit readback.

0.0 = NOT in position
1.0 = in position

Ownership and control keys for this parameter do not matter to this program. They should be set as appropriate for the I/O subsytem providing this information.

read2 - optional

Indexer hardware parameter - indexer has advanced.

Usually this is named IdxAdvSR in the AccelNET database.

This is a 1 bit readback.

0.0 = nop
1.0 = indexer advanced

Ownership and control keys for this parameter do not matter to this program. They should be set as appropriate for the I/O subsytem providing this information.

See the section Note on using ctl2 and read2 for more information about this parameter.

read3 - required

Indexer hardware parameter - cathode wheel is at home position i.e. cathode

zero

Usually this is named IdxHmeSR in the AccelNET database.

This is a 1 bit readback.

0.0 = nop
1.0 = wheel is at home position

Ownership and control keys for this parameter do not matter to this program. They should be set as appropriate for the I/O subsytem providing this information.

read4 - required

Indexer hardware parameter - indexer controller local/remote switch status

Usually this is named LclRemSR in the AccelNET database.

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 for the I/O subsytem providing this information.

const0 - optional

The amount of time to wait (in seconds) between indexes when doing a homing operation before checking the state of the home switch.

If this parameter is not present the delay time defaults to 1 second.

Note: the value may be placed in the Label field as shown below in the S2 ion source example. However, this behavior is deprecated and the value should now be placed in the Preset field as shown in the S1 example for the const1 entry.

const1 - optional

The move TMO value.

The amount of time to wait before declaring an indexer move timed out.

If this parameter is not present the delay time defaults to 10 seconds.

const2 index 0 - optional

The time to wait after setting NlkSR (resp3) false and beginning the move.

If this parameter is not present the delay time defaults to 0 seconds.

See the section "Notes on using resp3" for more information.

const2 index 1 - optional

The time to wait after the move completes and NlkSR (resp3) is set true before setting BusySR (resp2) to rest.

If this parameter is not present the delay time defaults to 0 seconds.

See the section "Notes on using resp3" for more information.

const3 - optional

A list of cathode positions to NOT setting NlkSR (resp3) true when the move completes.

The cathode position number is stored in the Preset field.

One entry is used for each cathode position to be excluded.

See the section "Notes on using resp3" for more information.

Examples


#
#    MNGRconf
#
#    McSNICSmngr configuration
#
#    source 1
#    134 sample, bidirectional source
#
#    wait 15 seconds before declaring a move TMO
#    because for some reason the indexer controller
#    has been adjusted to perform the move slowly
#
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|ctl1 |0|MCS S1-1|IdxChgSC|
McSNICSmngr|g1|ctl2 |0|MCS S1-1|IdxAckSC|
McSNICSmngr|g1|ctl3 |0|MCS S1-1|IdxDirSC|
McSNICSmngr|g1|read1 |0|MCS S1-1|IdxPosSR|
McSNICSmngr|g1|read2 |0|MCS S1-1|IdxAdvSR|
McSNICSmngr|g1|read3 |0|MCS S1-1|IdxHmeSR|
McSNICSmngr|g1|read4 |0|MCS S1-1|LclRemSR|
McSNICSmngr|g1|const1 |0|NULL |NULL |15.0
#
#    source 2
#    40 sample, unidirectional source
#
#    home switch is slow because of I/O system
#    we need to wait 3 seconds between indexes
#    when homing the source
#
#    Cathode 0 will not set NlkSR true
#    There is 5 second delay interlock on
#    each side of the move.
#
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|
McSNICSmngr|g2|resp3 |0|MCS S2-1|NlkSR |
McSNICSmngr|g2|ctl1 |0|MCS S2-1|IdxChgSC|
McSNICSmngr|g2|ctl2 |0|MCS S2-1|IdxAckSC|
McSNICSmngr|g2|read1 |0|MCS S2-1|IdxPosSR|
McSNICSmngr|g2|read2 |0|MCS S2-1|IdxAdvSR|
McSNICSmngr|g2|read3 |0|MCS S2-1|IdxHmeSR|
McSNICSmngr|g2|read4 |0|MCS S2-1|LclRemSR|
McSNICSmngr|g2|const0 |0|NULL |NULL |3.0
McSNICSmngr|g2|const2 |0|NULL |NULL |5.0
McSNICSmngr|g2|const2 |1|NULL |NULL |5.0
McSNICSmngr|g2|const3 |0|NULL |NULL |0.0

Note on using ctl2 and read2

The ion source has a pneumatic switch which is actuated each time the indexer is advanced. The indexer controller contains a circuit which detects the switch changing state and holds this information.

The state of the latch is read by the software via read2 and is cleared by a momentary actuation of ctl2.

Each time the indexer is advanced the latch is read and cleared to confirm that the indexer wheel actually advanced.

This is generally a good thing in that it provides an integrity check of indexer operation.

Usually ctl2 and read2 are implemented in the system, however, some users may not like this check for some reason.

If either ctl2 or read2 is ommited or commented out in the CONFLIST the check is skipped. A warning message is printed to stderr (which is usually redirected into a logging file) when the program is started indicating that the parameter(s) wasn’t (weren’t) found.

The newer model index controllers also contain a hardware interlock which prevents a new index operation if the latch isn’t cleared so it is necessary for the user wishing to bypass the check to make a hardware modification to the controller to bypass the interlock relay contact.

Notes on using resp3

McSNICSmngr provides a parameter which may be used to interlock power supplies etc. when the indexer is moving.

If the related parameters are present in the configuration file McSNICSmngr will set resp3 false (0.0) when the move begins and true (1.0) when the move ends.

Using the cathode power supply as an example this is done by creating a virtual datapoint for the voltage control (VC) and naming the physical control VCactual. NUMmngr is used process this in this way: VCactual = VC * NlkSR.

When a new cathode position is entered NlkSR (resp3) is immediately set false and BusySR (resp2) is immediately set to busy. If const2 index 0 is present the actual move will start after the delay time specified by the directive. This is used to allow the power supplies time to decay.

When the move completes NlkSR is immediately set true and if const2 index 1 is present BusySR stays in the busy state until the time specified by the directive is reached then BusySR is set to the rest state.

BusySR is used by DMANserv_v2(8) to determine when to move onto the Warmup state so this allows time for the power supplies to reach their operating point and possibly time for the beam to ramp up before beginning the next phase of the AMS measurement.

Cathode positions may be "excluded" i.e. NlkSR is not set true when in particular cathode positions by using the const3 directives. Each cathode position to be excluded is listed as a const3 directive and the list is searched when a move completes to see if a cathode position is listed. The Preset field is used to specify the cathode number. The index values only need to be unique so the entry loads.

Notes

McSNICSmngrOLD is the old almost obsolete version of this program. The indexer and ion source need modification in order to use the newer program therefore McSNICSmngrOLD is still in use in a couple places in the world.

The mcs_config.dat file is used by McSNICSmngr to remember the cathode position. If this file is found the information in it is used to initialize the cathode position, however, the indexer may still want to do an autorehome the first time a move is initiated.

This occurs because McSNICSmngr is usually started before the I/O manager(s) are started. If the database was freshly loaded the value of the LclRemSR is 0.0 (nop).

McSNICSmngr interpretes this as needing to do an autorehome because whenever the local/remote switch is changed to the local position the autorehome flag is set.

If this is annoying enough it could be gotten around by starting the I/O manager(s) before McSNICSmngr is started.

Troubleshooting Notes

At this time factory testing of the McSNICS indexer system shows that reliability is very good. We are able to make more than 500 turns of the wheel without a failure. We do not see failures above 500 turns, our factory test procedure is only run for 500 turns.

In bidirectional mode the test is much more stringent and we still don’t see a failure.

If you (the user) experience problems it’s likely the cause is broken or misadjusted hardware. Things do wear out, and dirt in the air system tends to clog things up.

One thing that has been seen and diagnosed is ocassional timeouts of IdxAdvSR. The cause was determined to be a leaky pneumatic air switch (LS1) in the controller. If you (the user) see a problem like this you should check for air leaks at this switch or possibly at the pneumatic switch located on the ion source.

See Also

libmngr(3mngr)

Manual page revision

$Id: McSNICSmngr.8,v 1.18 2009/01/21 17:49:07 kitchen Exp $


Table of Contents