# -------------------------------------------------------------------------- # Initialization script for a virtual DMC instrument using a McStas # simulationas a data source # # Dr. Mark Koennecke, June 2005 #--------------------------------------------------------------------------- # O P T I O N S set home $env(HOME)/src/workspace/sics/mcstas/dmc #--------------------------------- first all the server options are set #ServerOption RedirectFile $home/stdcdmc ServerOption ReadTimeOut 10 ServerOption AcceptTimeOut 10 ServerOption ReadUserPasswdTimeout 500000 ServerOption LogFileBaseName "$home/vdmclog" ServerOption LogFileDir $home/ ServerOption ServerPort 2911 ServerOption statusfile $home/vdmcstatus.tcl ServerOption InterruptPort 3007 ServerOption TelnetPort 1301 ServerOption TelWord sicslogin #--------------------------------------------------------------------------- # U S E R S SicsUser lnsmanager lnsSICSlns 1 SicsUser Manager Manager 1 SicsUser user looser 2 SicsUser Spy 007 1 #-------------------------------------------------------------------------- # D E V I C E S : M O T O R S #--------------------------------------------------------------------------- ClientPut "Installing Motors" Motor OmegaM SIM 0 120 -.1 2. Motor TwoThetaM SIM 30 100 -.1 1. Motor MonoX SIM -30 30 -.1 3.0 Motor MonoY SIM -30 30 -.1 3.0 Motor CurveM SIM 0 20 -.1 3.0 Motor MonoPhi SIM -30 30 -.1 3.0 Motor MonoChi SIM -30 30 -.1 3.0 # sample Table Motor Table SIM -180 360 -.1 2. Motor TwoThetaD SIM -10 120 -.1 1. #------------------------------------------------------------- # Monochromator #------------------------------------------------------------- MakeMono Mono "PG-002" OmegaM TwoThetaM CurveM Mono DD 3.3537 Mono vk1 -0.025942 Mono vk2 5.351660 # Syntax MakeWaveLength name MonochromatorToUse MakeWaveLength lambda Mono #-------------------------------------------------------------------------- # Configure Detector # NOTE: the McStas objects have to be created first, otherwise # the initialisation will fail. #-------------------------------------------------------------------------- MakeMcStasReader MakeMcStasController allowexec $home/dmcafter allowexec $home/dmc_sics05 ClientPut "Installing counter" MakeCounter counter mcstas counter SetExponent 1 MakeHM banana mcstas banana configure HistMode Normal banana configure OverFlowMode Ceil banana configure Rank 1 banana configure dim0 400 banana configure BinWidth 4 banana preset 100. banana CountMode Timer banana configure Counter counter banana configure init 0 banana init banana exponent 3 #------------------------------------------------------------------------- # Aliases #------------------------------------------------------------------------- SicsAlias OmegaM A1 SicsAlias TwoThetaM A2 SicsAlias Table A3 SicsAlias TwoThetaD A4 SicsAlias MonoX A5 SicsAlias MonoY A6 SicsAlias MonoPhi A7 SicsAlias MonoChi A8 SicsAlias CurveM A9 DefineAlias TT temperature #-------------------------------------------------------------------------- # V A R I A B L E S # now a few general variables are created # Syntax: VarMake name type access # type can be one of: Text, Int, Float #access can be one of: Internal, Mugger, User, Spy #----------------------------------------------------------------------------- VarMake SicsDataPath Text Internal SicsDataPath "$home/" SicsDataPath lock VarMake DetStepWidth Float Internal DetStepWidth 0.2 DetStepWidth lock VarMake Instrument Text Internal Instrument "Virtual DMC driven by McStas" Instrument lock VarMake Title Text User VarMake User Text User VarMake Collimation Text User VarMake SampleIntern Text User SampleIntern Kellerit VarMake comment1 Text User VarMake comment2 Text User VarMake comment3 Text User VarMake starttime Text User starttime "" VarMake SicsDataPrefix Text Internal SicsDataPrefix vdmc #--------- make data number MakeDataNumber SicsDataNumber $home/DataNumber VarMake SicsDataPostFix Text Internal SicsDataPostFix ".hdf" VarMake Adress Text User VarMake phone Text User VarMake fax Text User VarMake email Text User VarMake sample_mur Float User #-------------------------------------------------------------------------- # P R O C E D U R E S #-------------------------------------------------------------------------- MakeDrive MakeBatchManager MakeNXScript #-------------------- initialize scripted commands source $home/vdmccom.tcl #-------------------- configure commandlog commandlog auto commandlog intervall 5 #----------- enable sycamore #InstallProtocolHandler #InstallSinfox #source sycFormat.tcl #source /usr/lib/tcllib1.6.1/stooop/stooop.tcl #namespace import stooop::* #source sinfo.tcl #source sycamore.tcl #Publish sinfo Spy