# Second arg (optional) is a filepath. exp1 = pvscan.Experiment() sleep(2) #--- Scan PVs ------------------------------------------ # Create ScanPv objects, one for each PV you are scanning. # First argument is the scan PV, leave blank to get from pvScan IOC. # Second arg is an index which should be unique. scanPv1 = pvscan.ScanPv('', 1) #--- Shutters ----------------------------------------- # Create Shutter objects. # First argument is shutter PV. # Second arg (optional) is an RBV PV, for example an ADC channel. # Third arg (optional) is a unique shutter number index, which allows enabling/disabling from PVs. shutter1 = pvscan.LSCShutter('ASTA:LSC01', 'ADC:AS01:13:V', 1) # (UED Drive laser) shutter2 = pvscan.LSCShutter('ASTA:LSC02', 'ADC:AS01:14:V', 2) # (UED pump laser) shutter3 = pvscan.LSCShutter('ASTA:LSC03', 'ADC:AS01:15:V', 3) # (UED HeNe laser) # # Create ShutterGroup object to use common functions on all shutters. # Argument is a list of shutter objects. shutterGroup1 = pvscan.ShutterGroup([shutter1, shutter2, shutter3]) # #--- Other PVs ----------------- # Define as PV objects. Example PV('MY:RANDOM:PV') #lsrpwrPv=PV('ESB:A01:ADC1:AI:CH3') #toroid0355Pv=PV('ESB:A01:ADC1:AI:CH4') #toroid2150Pv=PV('ESB:A01:ADC1:AI:CH5') #structureChargePv=PV('ESB:A01:ADC1:CALC:CH1:CONV')
# Get PID PV pid=pvscan.pidPV.get() #--- Scan PVs ------------------------------------------ # Create ScanPv objects, one for each PV you are scanning. # First argument is the scan PV, leave as empty string to get from pvScan IOC. # Second arg is an index which should be unique. scanPv1=pvscan.ScanPv('',1) scanPv2=pvscan.ScanPv('',2) #--- Shutters ----------------------------------------- # Create Shutter objects. # First argument is shutter PV. # Second arg (optional) is an RBV PV, for example an ADC channel. shutter1=pvscan.LSCShutter('ASTA:LSC01','ADC:AS01:13:V',1) shutter2=pvscan.LSCShutter('ASTA:LSC02','ADC:AS01:14:V',2) shutter3=pvscan.LSCShutter('ASTA:LSC03','ADC:AS01:15:V',3) # # Create ShutterGroup object to use common functions on all shutters. # Argument is a list of shutter objects. shutterGroup1=pvscan.ShutterGroup([shutter1,shutter2,shutter3]) ################################################################################################################## def abortRoutine(): "This is the abort routine" # Kill scan routine process pvscan.printMsg('Killing process %d...' % (pid)) os.kill(pid, signal.SIGKILL) # Stop move(s) pvscan.printMsg('Stopping move(s)')
pvPrefix = sys.argv[1] # Set an environment variable for so pvScan module can use it os.environ['PVSCAN_PVPREFIX'] = pvPrefix # Import pvScan module sys.path.append('/afs/slac/g/testfac/extras/scripts/pvScan/prod/modules/') import pvscan # Get PID PV pid = pvscan.pidPV.get() #--- Shutters ----------------------------------------- # Create Shutter objects. # First argument is shutter PV. # Second arg (optional) is an RBV PV, for example an ADC channel. shutter1 = pvscan.LSCShutter('ASTA:LSC01') # (UED Drive laser) shutter2 = pvscan.LSCShutter('ASTA:LSC02') # (UED pump laser) shutter3 = pvscan.LSCShutter('ASTA:LSC03') # (UED HeNe laser) # # Create ShutterGroup object to use common functions on all shutters. # Argument is a list of shutter objects. shutterGroup1 = pvscan.ShutterGroup([shutter1, shutter2, shutter3]) ################################################################################################################## def abortRoutine(): "This is the abort routine" pvscan.printMsg('Aborting') # Kill scan routine process pvscan.printMsg('Killing process %d...' % (pid)) os.kill(pid, signal.SIGKILL)