Linac Sequences Definition

Reynald Bourtembourg - 4 August, 2006

This page describes the macros used to change the state of the Linac.
The text written in dark blue is the text displayed during the execution of the sequence in the Attribute SequenceHistory of the sequencer device (elin/master/seq).

Macro ON
Macro OFF
Macro STANDBY
Macro LOW HEATING
Macro LOAD SETTINGS
Macro SAVE SETTINGS 
Macro FORCE SAVE

Macro ON

Begin macro On
Open The economy relay
Set the klystron focussing currents
            SetCurrent  on Tango:://elin/focus/klystron
                        SetCurrent on each Tango Bruker channel device
                        each tango Bruker Channels devices will apply its set point.
                                   Devsetvalue on each taco Bruker channel device
Set the beam1 focussing currents
            idem klystron focussing currents
Set the beam2 focussing currents
            Idem klystron focussing currents
Set the steering currents
            Idem klystron focussing currents
Switch ON/OFF 352Mhz
            if pulseType == LONG
                        On on elin/r-gun/352m
            else
                        Off on elin/r-gun/352m
Switch On Modulator 1 HV
            Reset on elin/mod1/hv (reset the Daresbury)
Switch On Modulator 2 HV
            SoftReset on elin/mod2/hv (SoftReset don't reset the Daresbury)
            Sleep(1);
            On on elin/mod1/hv
            SoftOn on elin/mod2/hv (doesn't pulse the relay which is the same as for elin/mod1/hv, but says to the server that we want elin/mod2/hv to be switched on, will change the state of the device)
Switch On Gun HV
            On on elin/gun/hv
            Sleep(1);
Switch On Modulator running
            On on elin/mod1/run
            SoftOn on elin/mod2/run (doesn't pulse the relay which is the same as for elin/mod1/run, but says to the server that we want elin/mod2/run to be switched on, will change the state of the device)
            Sleep(1)
Switch On Beam
            On on elin/beam/run
Set the Modulator 1 High Voltage
            SetHV on elin/mod1/hv
Set the Modulator 2 High Voltage
            SetHV on elin/mod2/hv
Switch On the triggers
            TimingOn on elin/rf/run
                        DevOn on taco://elin/t-rf/1
            TimingOn on elin/mod1/run
                        DevOn on taco://elin/t-mod/1
                        DevOn on taco://elin/t-mod/s1
            TimingOn on elin/mod2/run
                        DevOn on taco://elin/t-mod/2
                        DevOn on taco://elin/t-mod/s2
Switch On RF
            On on elin/rf/run
End  macro ON

Macro OFF

Begin macro Off
Set the Modulator 1 High Voltage
            HVZero on elin/mod1/hv (set the high voltage to 0.0 and memorized the set point)
Set the Modulator 2 High Voltage
            HVZero on elin/mod2/hv (set the high voltage to 0.0 and memorized the set point)
            sleep(1) (let the time to the capacity to discharge)
Switch Off the Modulators  HV
            Off on elin/mod1/hv (the 2 Modulators HVPS are controlled with the same relay)
            SoftOff on elin/mod2/hv (SoftOff doesn't send any command to the OffRelay, but is usefull to signal we want elin/mod2/hv to be OFF)
Switch Off the Gun HV
            Off on elin/gun/hv
set the current in Bruker to 0
            ZeroCurrent on elin/focus/beam1
            ZeroCurrent on elin/focus/beam1
            ZeroCurrent on elin/steer/1
            Sleep(1)
Switch Off the Beam1 focussing
            Off on elin/focus/beam1
                        DevOff on taco://elin/focus/beam1
Switch Off the Beam2 focussing
            Off on elin/focus/beam2
                        DevOff on taco://elin/focus/beam2
Switch Off the steerers
            Off on elin/steer/1
                        DevOff on taco://elin/steer/1
Switch Off the Modulator auxiliaries
            Off on elin/mod1/aux (the 2 modulator auxiliaries are controlled with the same relay)
            SoftOff on elin/mod2/aux (to signal we want elin/mod2/aux to be OFF)
Switch Off the Gun auxiliaries
            Off  on elin/gun/aux
            Sleep(1) (we don't stop everything in the same moment - the electric network prefers)
Switch Off the Klystron focussing
            ZeroCurrent  on elin/focus/klystron
            Sleep(1)
            Off on elin/focus/klystron
                        DevOff on taco://elin/focus/klystron
Switch off 352Mhz
            Set attribute In352Mhz of elin/beam/run with value false
End macro Off     

Macro STANDBY 

Begin macro Standby
Switch Off the beam
            Off on elin/beam/run
Switch(elin/gun/aux state)
            Case OFF:
                        Switch On the gun auxiliaries
                                   On on elin/gun/aux
            Case ON:
                        Switch Off the gun HV
                                   Off on elin/gun/hv
Open the economy relay
            Set attribute Economy of elin/beam/run with value false
if (elin/mod2/aux state = FAULT)
            The modulator auxiliaries are Fault
Switch(elin/mod1/aux state)
            Case OFF:
                        Switch On the modulator auxiliaries
                        On on elin/mod1/aux (the 2 modulator auxiliaries are controlled with the same relay)
                        SoftOn on elin/mod2/aux (to signal elin/mod2/aux sould be OFF)
            Case ON:
                        Set the Modulator 1 High Voltage
                                    HVZero on elin/mod1/hv (set the high voltage to 0 and memorize the last set value)
                        Set the Modulator 2 High Voltage
                                    HVZero on elin/mod2/hv (set the high voltage to 0 and memorize the last set value)
                                    Sleep(1)  (let the time to the capacity to discharge)
                        Switch Off the Modulators HV
                                    Off on elin/mod1/hv  (the 2 modulator HVPS are controlled with the same relay)
                                    SoftOff on elin/mod2/hv (to signal elin/mod2/hv sould be OFF)
            Case INIT (Low heating) or MOVING:
                        The modulator auxiliaries are Warming up
            Case FAULT :
                        The modulator auxiliaries are Fault
Set the klystron focussing currents
            SetCurrent on elin/focus/klystron
Set the beam1 focussing currents
            SetCurrent on elin/focus/beam1
Set the beam2 focussing currents
            SetCurrent on elin/focus/beam2
Set the steering currents
            SetCurrent on elin/steer/1
Switch off 352Mhz
            Set attribute In352Mhz of elin/beam/run with value false
End of macro Standby

Macro Low Heating

Begin macro Economy
if(elin/mod2/aux state = FAULT)
            The modulator auxiliaries are Fault
            Close the economy relay
                        Set attribute Economy of elin/beam/run with value true
Switch(elin/mod1/aux state)
            Case OFF:
                        Close the economy relay
                                    Set attribute Economy of elin/beam/run with value true
                        Switch On the modulator auxiliaries
                                    On on elin/mod1/aux (the 2 modulator auxiliaries are controlled with the same relay)
                                    SoftOn on elin/mod2/aux (to signal elin/mod2/aux sould be OFF)
            Case ON:
                        Set the Modulator 1 High Voltage
                                    HVZero on elin/mod1/hv (set high voltage to 0.0)
                        Set the Modulator 2 High Voltage
                                    HVZero on elin/mod2/hv (set high voltage to 0.0)
                                   Sleep(1)  (let the time to capacity to decharge)
                        Switch Off the Modulators HV
                                    Off on elin/mod1/hv  (the 2 modulator HVPS are controlled with the same relay)
                                    SoftOff on elin/mod2/hv (to signal elin/mod2/hv sould be OFF)
                        Close the economy relay
                                    Set attribute Economy of elin/beam/run with value true
            Case INIT (Low heating) or MOVING:
                        The modulator auxiliaries are Warming up
                        Close the economy relay
                                    Set attribute Economy of elin/beam/run with value true
            Case FAULT :
                        The modulator auxiliaries are Fault
                        Close the economy relay
                                    Set attribute Economy of elin/beam/run with value true
Switch(elin/gun/aux state)
            Case OFF:
                        Switch On the gun auxiliaries
                                   On on elin/gun/aux
            Case ON:
                        Switch Off the gun HV
                                   Off on elin/gun/hv
set the current in Bruker to 0
            ZeroCurrent on elin/focus/beam1
            ZeroCurrent on elin/focus/beam1
            ZeroCurrent on elin/steer/1
            Sleep(1)
Switch Off the Beam1 focussing
            Off on elin/focus/beam1
                        DevOff on taco://elin/focus/beam1
Switch Off the Beam2 focussing
            Off on elin/focus/beam2
                        DevOff on taco://elin/focus/beam2
Switch Off the steerers
            Off on elin/steer/1
                        DevOff on taco://elin/steer/1
Sleep(1)  (we don't stop everything in the same moment - the electric network prefers)
Switch Off the Klystron focussing
            Off  on elin/focus/klystron
                        DevOff on taco://elin/focus/klystron
Switch off 352Mhz
            Set attribute In352Mhz of elin/beam/run with value false
Reset the Beam1 focussing
            Reset  on elin/focus/beam1
Reset the Beam2 focussing
            Reset  on elin/focus/beam2
Reset the steerers
            Reset  on elin/steer/1
Reset the Klystron focussing
            Reset  on elin/focus/klystron
End macro Economy

Macro Load settings 

Begin of config file selection
Loading all the settings...
Set the Modulator 1 High Voltage
Set the Modulator 2 High Voltage
Set the Modulator 1 VPFN
Set the Modulator 2 VPFN
Set the Buncher Phase
Sleep(1)
Set the Pre-buncher phase
Set the Pre-buncher attenuation
Set the Section2 Phase
Set the Gun heating voltage
Set the Gun grid voltage
Sleep(1)
Set the Gun pulse voltage
Set the Gun pulse length
Set the Gun High Voltage
Set the RF Frequency
Switch in long|short pulse mode
Set the RF delay
Set the Modulator 1 delay
Set the Modulator 2 delay
Set the Modulator 1 delay s
Set the Modulator 2 delay s
Set the Klystron focussing currents
            Position the set point (will be effectively set only if the powersupply is already on)
Sleep(1)
Set the Beam1 focussing currents
            Position the set point (will be effectively set only if the powersupply is already on)
Set the Beam2 focussing currents
            Position the set point (will be effectively set only if the powersupply is already on)
Set the Steering currents
            Position the set point (will be effectively set only if the powersupply is already on)
End of config file selection

Macro Save Settings

Begin to save configuration
Reading Klystron focussing currents set point
Reading Beam1 focussing currents set point
Reading Beam2 focussing currents set point
Reading Steerers currents set point
Reading Modulator 1 high voltage set point
Reading Modulator 2 high voltage set point
Reading Modulator 1 VPFN set point
Reading Modulator 2 VPFN set point
Reading Buncher phase set point
Reading Pre-buncher phase set point
Reading Pre-buncher attenuation set point
Reading Section 2 phase set point
Reading Gun heating voltage set point
Reading Gun grid voltage set point
Reading Gun pulse voltage set point
Reading Gun pulse length set point
Reading Gun high voltage set point
Reading RF frequency set point
Reading Short/Long pulse mode set point
Reading RF timer set point
Reading Modulator 1 timer set point
Reading Modulator 2 timer set point
Reading Modulator 1 timer s set point
Reading Modulator 2 timer s set point
Saving settings in file …
End  to save configuration

Macro Force Save

The Macro FORCE SAVE is almost the same as the macro SAVE SETTING.
The difference is that if the Macro SAVE SETTING doesn't succeed in reading a set point, the macro is stopped, the error is reported to the user and nothing is written to the configuration file.
The Macro Force Save will save all the settings it could retrieve in the configuration file wanted and save a default value for the settings it could not get.


ESRF - Software Engineering Group