next up previous
Next: Pre-observing Review Up: gbtGOglishScripts Previous: Device Glish Script Template

Device Setup Glish Script Template

It is important that the template defined below be followed to ensure that variables in GO are not overwritten or corrupted when a device setup glish script is used.

First, all the parameters should be set in a function. The name of the functions should be the same as the name of the glish file (minus the .g of course). In the template below the file name is rcvr1_2setup.g and the function name is rcvr1_2setup.

The first if statement in the function makes sure that the glish session can talk with the device manager.

Next, the parameters that are to be changed are listed. Comment statements either before the lines of code setting the parameter or on the line setting the parameter should indicate the valid values for the parameter.

Parameters which provide monitor information or or automatically are set by another device (such as the scan coordinator) are put in the next section. The code in this area should also be commented out.

Secondary parameters which will rarely be changed from their default values will be listed in the next section of code. Once again this section of code should have all its lines of code commented out.

The final line of code in the function should be device.prepare() function call which will actually perform the changes requested for the device.

A version of the checklist will be contained in the header of the glish file to help keep track of its history. This will help ensure that the correct version of the file is included into the Monitor and Control system.

# 1.15-1.75 GHz Receiver setup from glish for XXXXXXX

# checklist information
# requestor's name:  Rick Fisher
# Device: Rcvr1_2
# Description: setup the 1.15-1.75 GHz Receiver for default standard observing
# Date Started: Dec 26, 2000
# Date parameter list obtained: Dec 26, 2000
# Date of completion of initial version: Dec 26, 2000
#
# Date of review: Jan, 2 2001
# Reviewer: Dana Balser
# Comments:  Forgot segmentEnable, linCircPhaseShift doesn't need to be set
#            for this particular setup
# Accepted by Dana Balser on January 5, 2001
# 
# Date of non-observing test: Jan 7, 2001
# Name of tester: Ron Maddalena
# Comments: worked ok except for loOrHiCalSel - should use lowCal
# Accepted by Ron Maddalena on Jan 9, 2001
#
# Date of observing test: Jan 11, 2001
# Name of commissioner: Glen Langston
# Comments: OK
# Accepted by Glen Langston on Jan 11, 2001
#
# Date of final review: Jan 15, 2001
# Name of reviewer: Mark Clark
# Comments: function name did not match file name
# Accepted by Mark Clark on Jan 17, 2001
#
# Included into Monitor and Control on Jan 20, 2001
#

rcvr1_2_setup := function ( )
{
    if (!is_defined('thisdev')) {
        thisdev := ygor('Rcvr1_2');
    }

    # set parameter for error checking
    ok := T;

    ok := ok & thisdev.setParameter('cpuLoCalPwrSw', 'swOn');	# swOff, swOn
    ok := ok & thisdev.setParameter('loOrHiCalSel', 'lowCal');	# lowCal, highCal
    ok := ok & thisdev.setParameter('xlExtToMCBCtrlSel', 'ctlExt');  # ctlExt, ctlMcb
    ok := ok & thisdev.setParameter('yrExtToMCBCtrlSel', 'ctlExt');  # ctlExt, ctlMcb
        # following are option for rightIfFilterSwitch and leftIfFilterSwitch
	# 1 = 1.10-1.80 GHz
	# 2 = 1.60-1.75 GHz
	# 3 = 1.30-1.45 GHz
	# 4 = 1.10-1.45 GHz
	# 5 = Spare
    ok := ok & thisdev.setParameter('rightIfFilterSwitch', 3);
    ok := ok & thisdev.setParameter('leftIfFilterSwitch', 3);
        # following are options for polarizationSelect
	# polLinear, polCircular
    ok := ok & thisdev.setParameter('polarizationSelect', 'polLinear');
    ok := ok & thisdev.setParameter('xferSwitch', 'tsThru');	# tsThru, tsCrossed
    ok := ok & thisdev.setParameter('xferSwCtlMode', 'ctlMcb');	# ctlExt, ctlMcb
    ok := ok & thisdev.setParameter('linCircPhaseShift', 45.35);
    ok := ok & thisdev.setParameter('raCryoAmp', -3);
    ok := ok & thisdev.setParameter('lbCryoAmp', 2);
    ok := ok & thisdev.setParameter('yrCPUNoiseSwCtrl', 'swOff');	# swOff, swOn
    ok := ok & thisdev.setParameter('xlCPUNoiseSwCtrl', 'swOff');	# swOff, swOn
	# refrigOff, refrigHeat, refrigCool, refrigPump
    ok := ok & thisdev.setParameter('cryoState', 'refrigCool');
    ok := ok & thisdev.setParameter('raBiasSwitch', 'swOn');	# swOff, swOn
    ok := ok & thisdev.setParameter('lbBiasSwitch', 'swOn');	# swOff, swOn
    ok := ok & thisdev.setParameter('segmentEnable', F);

## Monitor/Auto Parameters:
#    ok := ok & thisdev.setParameter('cryoMonitorRate', 'mr2Sec');
#    ok := ok & thisdev.setParameter('cryoStatusMonitorRate', 'mr2Sec');
#    ok := ok & thisdev.setParameter('cryoCtlMonitorRate', 'mr30Sec');
#    ok := ok & thisdev.setParameter('switchStatusMonitorRate', 'mr200MS');
#    ok := ok & thisdev.setParameter('noiseSourceMonitorRate', 'mr2Sec');
#    ok := ok & thisdev.setParameter('loPowerMonitorRate', 'mr2Sec');
#    ok := ok & thisdev.setParameter('gregorianMonitorRate', 'mr1Min');
#    ok := ok & thisdev.setParameter('supplyMonitorRate', 'mr2Sec');
#    ok := ok & thisdev.setParameter('cryoAmpMonitorRate', 'mr2Sec');
#    ok := ok & thisdev.setParameter('biasSwitchMonitorRate', 'mr30Sec');
#    ok := ok & thisdev.setParameter('vacIonPumpMonitorRate', 'mr30Sec');

## Secondary parameters:
#    ok := ok & thisdev.setParameter('calStateCntl', 0);
#    ok := ok & thisdev.setParameter('biasPwr', 0);
#    ok := ok & thisdev.setParameter('receiverSegment',
#	[segmentLength=[seconds=0.02, MJD=0, flags=0, refFrame=1, units=1],
#	 highCalPower=F, lowCalPower=T, rcpNoiseExt=T, lcpNoiseExt=T,
#	 noiseStateL=T, noiseStateR=T, beamXferSwABL=F, beamXferExt=T,
#	 beamXferSwABR=F, beamXferSwCDL=F, beamXferSwCDR=F]);
#    ok := ok & thisdev.setParameter('stopTime',
#			[seconds=0, MJD=0, flags=0, refFrame=1, units=1]);
#    ok := ok & thisdev.setParameter('polXferExtSigRefCtl', 6);	# 0:255

    thisdev.prepare();
    thisdev := [=];

    if (ok) {
       print ``rcvr1_2_setup.g was successful''
    } else {
       print ``rcvr1_2_setup.g FAILED''
    }

    return ok;
}


next up previous
Next: Pre-observing Review Up: gbtGOglishScripts Previous: Device Glish Script Template
Bob Garwood 2011-07-25