# Third arg (optional) is a scan name, leave blank to get from pvScan IOC. exp1 = pvscan.Experiment() exp1.targetname = PV(pvPrefix + ':SCAN:TARGETNAME').get() if ' ' in exp1.targetname: exp1.targetname = exp1.targetname.replace(' ', '_') #--- Log file ------------------------------ # Create log file object. Writes to stdout and to a log file. # First arg (optional) is a filename, leave blank to get from pvScan IOC. logFile1 = pvscan.Tee() #--- Scan PVs ------------------------------------------ # Create ScanPv objects, one for each PV you are scanning. # First argument (required) is the scan PV, leave as empty string to get from pvScan IOC. # Second arg (required) is an index which should be unique. # Third arg (optional) is an RBV pv name. scanPv1 = pvscan.ScanPv('', 1) scanPv2 = pvscan.ScanPv('', 2) scanPv3 = pvscan.ScanPv('ESB:XPS1:m6:MOTR', 3, pvtype=1) # Motor scanPv4 = pvscan.ScanPv('ESB:XPS1:m3:MOTR', 4, pvtype=1) # Motor #--- Shutters ----------------------------------------- # Create Shutter objects. # Create Shutter objects. # First argument (required) is the shutter control 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.DummyShutter('ESB:GP01:VAL01', 'ESB:GP01:VAL01', 1) shutter2 = pvscan.DummyShutter('ESB:GP01:VAL02', 'ESB:GP01:VAL02', 2) shutter3 = pvscan.DummyShutter('ESB:GP01:VAL03', 'ESB:GP01:VAL03', 3) # # Create ShutterGroup object to use common functions on all shutters.
# Import pvScan module sys.path.append('/afs/slac/g/testfac/extras/scripts/pvScan/prod/modules/') import pvscan #--- Experiment --------------------------------------- # Create Experiment object. Sets default filepath and gets experiment name from PV. # First argument (optional) is an experiment name. # 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.
msgPv=PV(pvPrefix + ':MSG') msgPv.put('Aborting...') print 'Aborting...' # Import pvScan module sys.path.append('/afs/slac/g/testfac/extras/scripts/pvScan/prod/modules/') import pvscan # 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]) ##################################################################################################################
# Third arg (optional) is a scan name, leave blank to get from pvScan IOC. exp1 = pvscan.Experiment() exp1.targetname = PV(pvPrefix + ':SCAN:TARGETNAME').get() if ' ' in exp1.targetname: exp1.targetname = exp1.targetname.replace(' ', '_') #--- Log file ------------------------------ # Create log file object. Writes to stdout and to a log file. # First arg (optional) is a filename, leave blank to get from pvScan IOC. logFile1 = pvscan.Tee() #--- Scan PVs ------------------------------------------ # Create ScanPv objects, one for each PV you are scanning. # First argument (required) is the scan PV, leave as empty string to get from pvScan IOC. # Second arg (required) is an index which should be unique. # Third arg (optional) is an RBV pv name. scanPv1 = pvscan.ScanPv('', 1) scanPv2 = pvscan.ScanPv('', 2) scanPv3 = pvscan.ScanPv('MOTR:AS01:MC02:CH2:MOTOR', 3, pvtype=1) # UED Z Motor scanPv4 = pvscan.ScanPv('MOTR:AS01:MC02:CH8:MOTOR', 4, pvtype=1) # UED Y Motor #--- Shutters ----------------------------------------- # Create Shutter objects. # Create Shutter objects. # First argument (required) is the shutter control 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) 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.