! ! newsys.scr - NewBug routines for setting up a new instrument ! Copyright (c) Zygo Corporation 1996-2011 ! Revised 9-FEB-2011 ! ! Use ONE of these commands: ! do newsystem (prompts for system type) ! do newmaxim (prompts for maxim type) ! do newmaximxr ! do newmaximgp ! do newmaximxrgp ! do newgpi ! do newmarkgpi ! do newdvdgpi ! do newmesa ! do newnif ! do newnifcan ! do newlupi ! do newmst ! do newmstcan ! do newpti250 ! do newmarkfp ! do newgpican ! do newmarkph ! do newdvdcan ! do newwsgpi ! do newnv600s ! do newnv600p ! do newnv700s ! do newnv700p ! do newnewview6000 ! do newnewview7000 ! !! newsystem Setup a new system newsystem: !{ ! Creates a system calibration file ! Generates default ramp files ! Initializes the instrument ! Note that this subroutine has multiple entry points input_systype: input_typenum: ? "Basic system type is one of the following:" ? " (1) Microscope" ? " (2) Non-Microscope" input "Enter the number of the basic system type (1 or 2) ", type% if type% = 1 then goto new_micro if type% = 2 then goto new_non_micro goto input_typenum ! new_non_micro: ? "Non-microscope system type is one of the following:" ? " DVD" ? " DvdCan" ? " Gpi" ? " GpiCan" ? " MarkGPI" ? " Mesa" ? " Nif" ? " NifCan" ? " PTI250" ? " Mst" ? " MstCan" ? " MarkFP" ? " MarkPH" ? " WsGpi" ? " WsGpiCan" input "Enter the non-microscope system type ", systype$ systype$ = trim$(upc$(systype$)) if systype$ = "DVD" then goto newdvdgpi if systype$ = "DVDCAN" then goto newdvdcan if systype$ = "GPI" then goto newgpi if systype$ = "GPICAN" then goto newgpican if systype$ = "MARKGPI" then goto newmarkgpi if systype$ = "MESA" then goto newmesa if systype$ = "NIF" then goto newnif if systype$ = "NIFCAN" then goto newnifcan if systype$ = "MST" then goto newmst if systype$ = "MSTCAN" then goto newmstcan if systype$ = "PTI250" then goto newpti250 if systype$ = "MARKFP" then goto newmarkfp if systype$ = "MARKPH" then goto newmarkph if systype$ = "WSGPI" then goto newwsgpi if systype$ = "WSGPICAN" then goto newwsgpican goto new_non_micro ! new_micro: ? "Microscope system type is one of the following:" ? " Maxim" ? " MicroLUPI" ? " NV6000" ? " NV600P" ? " NV600S" ? " NV700P" ? " NV700S" ? " NV7000" input "Enter the microscope system type ", systype$ systype$ = trim$(upc$(systype$)) if systype$ = "MAXIM" then goto newmaxim if systype$ = "MICROLUPI" then goto newlupi if systype$ = "NV6000" then goto newnewview6000 if systype$ = "NV600P" then goto newnv600p if systype$ = "NV600S" then goto newnv600s if systype$ = "NV700P" then goto newnv700p if systype$ = "NV700S" then goto newnv700s if systype$ = "NV7000" then goto newnewview7000 goto new_micro ! !! newnewview7000 Setup new NewView7000 newnewview7000: map def ! find board and setup special vars systype$ = "NV7000" subtype$ = "" goto got_microscope_types ! !! newnewview6000 Setup new NewView6000 newnewview6000: map def ! find board and setup special vars systype$ = "NV6000" subtype$ = "" goto got_microscope_types ! !! newnv600S Setup new NewView600S newnv600s: map def ! find board and setup special vars systype$ = "NV600S" subtype$ = "" goto got_microscope_types ! !! newnv600P Setup new NewView600P newnv600p: map def ! find board and setup special vars systype$ = "NV600P" subtype$ = "" goto got_microscope_types ! !! newnv700S Setup new NewView700S newnv700s: map def ! find board and setup special vars systype$ = "NV700S" subtype$ = "" goto got_microscope_types ! !! newnv700P Setup new NewView700P newnv700p: map def ! find board and setup special vars systype$ = "NV700P" subtype$ = "" goto got_microscope_types ! !! newmaxim Setup new Maxim or NewView newmaxim: map def ! find board and setup special vars systype$ = "Maxim" gosub get_maxim_subtype goto got_microscope_types ! !! newmaximxr Setup new NewView (Maxim XR) newmaximxr: map def ! find board and setup special vars systype$ = "Maxim" subtype$ = "XR" goto got_microscope_types ! !! newmaximgp Setup new Maxim GP newmaximgp: map def ! find board and setup special vars systype$ = "Maxim" subtype$ = "GP" goto got_microscope_types ! !! newmaximxrgp Setup new NewView and phase option (Maxim XRGP) newmaximxrgp: map def ! find board and setup special vars systype$ = "Maxim" subtype$ = "XRGP" goto got_microscope_types ! got_microscope_types: ! systype$ and subtype$ are known calfile "DEFAULTS" ! after 7.14, to initialize sysInfo with default values gosub get_sernum gosub get_fgtype calfile systype$ & subtype$ & " " & val$(yy%) & " " & val$(ww%) & " " & val$(sn%) gosub does_instr_use_can_hardware ! sets var can_hardware% to 0 or 1 if can_hardware% <> 0 then calfile "Version" & " " & fgtype$ & " 0 CAN" gosub get_macaddress else calfile "Version" & " " & fgtype$ & " 0 XRGP" calfile "InstrComm com1" endif gosub get_microscope_camera if (systype$ = "NV600P") or (systype$ = "NV700P") then calfile "Light LED 0.550 0.550 0.550 0.550" calfile "LLC Freq 23000" calfile "LLC Range 0 65535" calfile "LLC Options 1" calfile "PztPwr 200" else if (systype$ = "NV600S") or (systype$ = "NV700S") then calfile "Light LED 0.570" calfile "LLC Freq 23000" calfile "LLC Range 0 65535" calfile "LLC Options 1" calfile "PztPwr 200" gosub get_scanner calfile "PifocType 2" calfile "ScanCal 0.99653" else if systype$ = "NV6000" then calfile "Light LED 0.570" calfile "LLC Config 1" calfile "LLC Freq 132000" calfile "LLC Range 0 65535" calfile "LLC Options 1" calfile "PztPwr 200" calfile "ScanCal 1 1" gosub get_scanner else if systype$ = "NV7000" then calfile "Light LED 0.570" calfile "LLC Config 1" calfile "LLC Freq 23000" calfile "LLC Range 0 65535" calfile "LLC Options 1" calfile "PztPwr 200" calfile "ScanCal 1 1" gosub get_scanner calfile "PifocType 2" else calfile "Light White 0.6480 0.6000 0.6000 0.6000" calfile "LLC Range 0 4095 0 100" calfile "LLC Target 150 150" calfile "LLC Options 1" calfile "PztPwr 200" calfile "ScanCal 1 1" calfile "ZAxisCal 1.00" if (subtype$ <> "GP") AND (subtype$ <> "GPICO") then gosub get_pifoc endif endif endif endif endif for n = 0 to CAMERA_BAD_MAX-1 si.cameraBad(n,0) = -1 si.cameraBad(n,1) = -1 next n ask_again: input "Does this system have a turret (y/n) ", ok$ ok$ = lwc$(ok$) haveTurret = 0 if ok$[1] = "n" then goto no_turret if ok$[1] = "y" then ask_again2: input "Motorized(1) Encoded(2) None(0) ", trt% if trt% = 0 then goto no_turret if trt% > 2 then goto ask_again2 input "Enter number of turret positions ", num% if num% > 0 then haveTurret = 1 calfile "Turret " & val$(trt%) & " " & val$(num%) goto no_turret endif goto ask_again2 endif goto ask_again no_turret: ! ask_again3: input "Does this system have a zoom (y/n) ", ok$ ok$ = lwc$(ok$) haveZoom = 0 if ok$[1] = "n" then goto no_zoom if ok$[1] = "y" then ask_again4: input "Encoded(1) Motorized(2) None(0) ", trt% if trt% = 0 then goto no_zoom if trt% > 2 then goto ask_again4 haveZoom = 1 calfile "Zoom " & val$(trt%) goto no_zoom endif goto ask_again3 no_zoom: ! if (systype$ = "NV6000") or (systype$ = "NV600P") or (systype$ = "NV600S") then if ((haveTurret = 0) and (haveZoom = 0)) then calfile "IgnoreDualBrushMotor" endif endif if (systype$ = "NV7000") or (systype$ = "NV700P") or (systype$ = "NV700S") then if ((haveTurret = 0) and (haveZoom = 0)) then calfile "IgnoreDualBrushMotor" endif endif ! goto write_calfile ! !! newmarkgpi Setup new Mark GPI newmarkgpi: map def ! find board and setup special vars systype$ = "MarkGPI" subtype$ = "" goto got_macroscope_types ! !! newdvdgpi Setup new DVD GPI newdvdgpi: map def ! find board and setup special vars systype$ = "DVD" subtype$ = "" goto got_macroscope_types ! !! newdvdcan Setup new DVD CAN newdvdcan: map def ! find board and setup special vars systype$ = "DVDCAN" subtype$ = "" goto got_macroscope_types ! !! newmesa Setup new Mesa newmesa: map def ! find board and setup special vars systype$ = "Mesa" subtype$ = "" goto got_macroscope_types ! !! newpti Setup new PTI250 newpti250: map def ! find board and setup special vars systype$ = "PTI250" subtype$ = "" goto got_macroscope_types ! !! newnif Setup new NIF newnif: map def ! find board and setup special vars systype$ = "NIF" subtype$ = "" goto got_macroscope_types ! !! newnifcan Setup new NIFCAN newnifcan: map def ! find board and setup special vars systype$ = "NIF_CAN" subtype$ = "" goto got_macroscope_types ! !! newgpi Setup new GPI newgpi: map def ! find board and setup special vars systype$ = "GPI" subtype$ = "" goto got_macroscope_types ! !! newwsgpi Setup new WSGPI newwsgpi: map def ! find board and setup special vars systype$ = "WSGPI" subtype$ = "" goto got_macroscope_types ! !! newwsgpican Setup new WsGpiCan newwsgpican: map def ! find board and setup special vars systype$ = "WSGPICAN" subtype$ = "" goto got_macroscope_types ! !! newlupi newlupi: map def ! find board and setup special vars systype$ = "MicroLUPI" subtype$ = "" goto got_macroscope_types ! !! newmst Setup new MST newmst: map def ! find board and setup special vars systype$ = "MST" subtype$ = "" goto got_macroscope_types ! !! newmstcan Setup new MST_CAN newmstcan: map def ! find board and setup special vars systype$ = "MST_CAN" subtype$ = "" goto got_macroscope_types ! !! newmarkfp Setup new Mark FP newmarkfp: map def ! find board and setup special vars systype$ = "MarkFP" subtype$ = "" fgtype$ = "FLASHBUS" goto got_macroscope_types ! ! !! newmarkph Setup new Mark PH newmarkph: map def ! find board and setup special vars systype$ = "MarkPH" subtype$ = "" fgtype$ = "FLASHBUS" goto got_macroscope_types ! !! newgpican Setup new GPI CAN newgpican: map def ! find board and setup special vars systype$ = "GPICAN" subtype$ = "" goto got_macroscope_types ! got_macroscope_types: calfile "DEFAULTS" ! after 7.14, to initialize sysInfo with default values gosub get_sernum if (systype$ <> "MarkFP") AND (systype$ <> "MarkPH") then gosub get_fgtype endif calfile systype$ & " " & val$(yy%) & " " & val$(ww%) & " " & val$(sn%) if (systype$ = "PTI250") then instrbd: input "Does this system have a MESA board (y/n) ", ok$ ok$ = lwc$(ok$) if ok$[1] = "n" then calfile "Version" & " " & fgtype$ & " 0 NOTNEEDED" goto done_instrbd endif if ok$[1] = "y" then calfile "Version" & " " & fgtype$ & " 0 Mesa" goto done_instrbd endif goto instrbd done_instrbd: else if (systype$ = "Mesa") or (systype$ = "MicroLUPI") then calfile "Version" & " " & fgtype$ & " 0 Mesa" else if systype$ = "MarkFP" then calfile "Version" & " " & fgtype$ & " 0 NOTNEEDED" else gosub does_instr_use_can_hardware ! sets var can_hardware% to 0 or 1 if can_hardware% <> 0 then calfile "Version" & " " & fgtype$ & " 0 CAN" gosub get_macaddress else calfile "Version" & " " & fgtype$ & " 0 GPI" calfile "InstrComm com1" endif endif endif endif if (systype$ <> "MarkFP") AND (systype$ <> "MarkPH") then gosub get_macroscope_camera endif if systype$ = "Mesa" then calfile "Light Diode 12.75" calfile "LLC Range 0 4095" calfile "NomMag 1 2" calfile "SysMag 0 0" calfile "InvertData 1" else if systype$ = "PTI250" then calfile "Light Diode 0.655" calfile "LLC Options 1" calfile "NomMag 1 2" calfile "SysMag 0.182108 0" calfile "InvertData 1" calfile "NoIntensAvg" else if systype$ = "MicroLUPI" then calfile "Light Diode 0.6329" calfile "LLC Instr DD100MC_B com1" calfile "LLC Range 1000 2000" calfile "LLC Options 1" calfile "NomMag 50 100" calfile "SysMag 0 0" calfile "InvertData 1" calfile "RadCrvFocCal 1" calfile "RadCrvPwrCal 1" calfile "XAxisBacklash 30" calfile "YAxisBacklash 30" calfile "ZAxisBacklash 10" else if (systype$ = "DVD") then calfile "Light Diode 0.4050 0.4050 0.4050 0.4050" calfile "LLC Range 10 159" calfile "LLC Target 150" calfile "PztPwr 250" else if (systype$ = "DVDCAN") then calfile "Light Diode 0.4050 0.4050 0.4050 0.4050" calfile "LLC Range 10 159" calfile "LLC Target 150" calfile "PztPwr 250" calfile "IgnoreLAPS" calfile "IgnoreZoom" else if systype$ = "WSGPI" then calfile "Light HeNe 0.633 0.633 0.633 0.633" calfile "LLC Range 10 159" calfile "LLC Target 150" calfile "wmComm com2" calfile "wmSysGain 2.55" else if systype$ = "WSGPICAN" then calfile "Light HeNe 0.6328 0.6328 0.6328 0.6328" calfile "LLC Range 10 159" calfile "LLC Target 150 150" calfile "wmComm com2" calfile "wmSysGain 2.55" calfile "wmTuneRange 150.0 0.2" calfile "wmTuneRate 1100.0 0.1" calfile "SleepTimeout 2:00:00" calfile "InvertData 1" else if (systype$ = "MST") or (systype$ = "MST_CAN") then gosub get_mst_wavelen if mst_wavelen$ = "633" then calfile "Light HeNe 0.6328 0.6328 0.6328 0.6328" calfile "LLC Range 10 159" calfile "LLC Target 150 150" calfile "wmComm com2" calfile "wmTuneRange 150.0 0.2" calfile "wmTuneRate 1100.0 0.1" calfile "wmMonOPD 0.397" calfile "SleepTimeout 2:00:00" calfile "InvertData 1" calfile "FTPSIInvertData 1" endif if mst_wavelen$ = "1550" then calfile "Light HeNe 1.550 1.550 1.550 1.550" calfile "LLC Range 10 159" calfile "LLC Target 125" calfile "wmComm com2" calfile "wmTuneRange 500.0 0.5" calfile "wmTuneRate 50 1" calfile "wmMonOPD 7.33" calfile "InvertData 1" !calfile "FTPSIInvertData 1" endif if systype$ = "MST_CAN" then calfile "IgnoreLAPS" calfile "IgnorePZT" endif else if systype$ = "MarkFP" then calfile "Camera Type Custom" calfile "Camera File fbrs170.ini" calfile "Light HeNe 0.6328 0.6328 0.6328 0.6328" !calfile "LLC Options 1" !calfile "InvertData 1" calfile "NoIntensAvg" else if systype$ = "MarkPH" then calfile "Camera Type Custom" calfile "Camera File fbrs170.ini" calfile "Light HeNe 0.6328 0.6328 0.6328 0.6328" calfile "LLC Target 200" calfile "PztPwr 250" calfile "NoIntensAvg" calfile "IgnoreLAPS" calfile "IgnoreWand" calfile "IgnoreZoom" calfile "IgnoreFocusNDW" else calfile "Light HeNe 0.6328 0.6328" calfile "LLC Range 10 159" calfile "LLC Target 150 150" calfile "PztPwr 250" endif endif endif endif endif endif endif endif endif endif for n = 0 to CAMERA_BAD_MAX-1 si.cameraBad(n,0) = -1 si.cameraBad(n,1) = -1 next n if (systype$ = "GPI") or (systype$ = "WSGPI") or (systype$ = "WSGPICAN") or (systype$ = "MST_CAN") then gosub get_ring_spot endif if (systype$ = "GPICAN") or (systype$ = "WSGPICAN") then calfile "DiffDiskRate 40" endif if systype$ = "GPICAN" then gosub get_optional_nodes endif goto write_calfile ! write_calfile: if systype$ <> "MarkFP" then gosub motion_control gosub pos_instr endif ? "Writing calfile" write calfile ! stop reset def average = 0 agc = 1 cal = 1 window def if (si.instrBdType = IB_GPI) or (si.instrBdType = IB_XRGP) then ur_initUZ write inst status endif if sb_inst_uses_pmi_ramps <> 0 then gosub gen_dflt_pmi_ramps endif ! 8.3.2 removed this line: reset inst 1 return !} end newsystem ! ! this is only valid for revisions ! reset inst 1 must be done by caller rewrite_calfile: !{ write calfile write inst status reset def window def rr_get_ramp_info ! read ramps return !} ! !! cal_to_uzi Copy calfile info to instrument EEPROM !! newprom Copy calfile info to instrument EEPROM cal_to_uzi: !{ newprom: reset def ur_initUZ write inst status do init return !} ! !! modmaxim Modify to be Maxim or NewView XR/GP/XRGP ! These functions allow easy switching of microscope instrument type, ! note that hardware must also be the correct type. modmaxim: !{ ? "Current system type is "; gl.systemTypeName$(si.systemType) gosub get_maxim_subtype goto mod_microscrope_types !! modmaximxr Modify to be NewView (Maxim XR) modmaximxr: subtype$ = "XR" goto mod_microscrope_types !! modmaximgp Modify to be Maxim GP modmaximgp: subtype$ = "GP" goto mod_microscrope_types !! modmaximxrgp Modify to be NewView with phase (Maxim XRGP) modmaximxrgp: subtype$ = "XRGP" goto mod_microscrope_types mod_microscrope_types: ! subtype$ is known old = si.systemType if subtype$ = "XR" then si.systemType = SYSTEM_MAXIM_XR if subtype$ = "GP" then si.systemType = SYSTEM_MAXIM_GP if subtype$ = "XRGP" then si.systemType = SYSTEM_MAXIM_XRGP if subtype$ = "XRICO" then si.systemType = SYSTEM_MAXIM_XR_ICO if subtype$ = "GPICO" then si.systemType = SYSTEM_MAXIM_GP_ICO if subtype$ = "XRGPICO" then si.systemType = SYSTEM_MAXIM_XRGP_ICO ! from GP to (XR or XRGP) -- get Pifoc info if (old = SYSTEM_MAXIM_GP) AND (subtype$ <> "GP") then gosub get_pifoc endif if (old = SYSTEM_MAXIM_GP_ICO) AND (subtype$ <> "GPICO") then gosub get_pifoc endif ! from (XR or XRGP) to GP -- list old Pifoc info for user if (old <> SYSTEM_MAXIM_GP) AND (subtype$ = "GP") then gosub print_old_pifoc endif gosub rewrite_calfile if (si.nPmiRamps < 4) AND (subtype$ <> "XR") then gosub gen_dflt_pmi_ramps endif reset inst 1 return !} modmaxim ! !! newpifoc Revise PIFOC id, alpha, beta newpifoc: !{ gosub print_old_pifoc gosub get_pifoc gosub rewrite_calfile reset inst 1 return !} newpifoc ! get_maxim_subtype: !{ ! Gets maxim sub-type. ! Sets these variables: ! subtype$ ! Intended for local use only input_maxim_subtype: ? "Maxim subtype is one of the following:" ? " DELTA" ? " GP" ? " GPICO" ? " XR" ? " XRGP" ? " XRGPICO" ? " XRICO" input "Enter the Maxim subtype ", subtype$ subtype$ = trim$(upc$(subtype$)) if subtype$ = "DELTA" then return if subtype$ = "GP" then return if subtype$ = "GPICO" then return if subtype$ = "XR" then return if subtype$ = "XRGP" then return if subtype$ = "XRGPICO" then return if subtype$ = "XRICO" then return goto input_maxim_subtype !} ! ! Get the frame grabber type get_fgtype: !{ ? "The frame grabber type is one of the following:" ? " (B) Bandit" ? " (L) CameraLink" ? " (C) Corona" ? " (F) FireWire" ? " (G) Gige" ? " (P) Pulsar" ? " (X) X64LVDS" ? " (V) PC2Vision" input "Enter the single letter frame grabber type code ", c$ c$ = trim$(upc$(c$)) if c$ = "X" then fgtype$ = "X64LVDS" return endif if c$ = "V" then fgtype$ = "PC2Vision" return endif if c$ = "B" then fgtype$ = "BANDIT" return endif if c$ = "L" then fgtype$ = "CAMERALINK" return endif if c$ = "C" then fgtype$ = "CORONA" return endif if c$ = "F" then fgtype$ = "FIREWIRE" return endif if c$ = "G" then fgtype$ = "GIGE" return endif if c$ = "P" then fgtype$ = "PULSAR" return endif goto get_fgtype !} get_fgtype return !} ! get_sernum: !{ ! Gets serial number, year, and week ! Sets these variables: ! sn%, yy% and ww% ! Intended for local use only input_serial: if systype$ = "MarkFP" then sn% = 20000 yy% = 04 ww% = 26 return endif input "Enter serial number (100 to 999999) ", sn% if (sn% < 100) or (sn% > 999999) goto input_serial input_year: d$ = date$(timedate) yy% = val(d$[14,15]) ofmti("%02d") ? "The current year is " & val$(yy%) & "." input "Use this value (y/n) ", ok$ ok$ = lwc$(ok$) if ok$[1] = "y" then goto input_week input "Enter year (0 to 99) ", yy% if (yy% < 0) or (yy% > 99) goto input_year input_week: input "Enter week (1 to 52) ", ww% if (ww% < 1) or (ww% > 52) goto input_week return !} ! get_macroscope_camera: !{ ! Gets macroscope camera type and sets calfile values ! Intended for local use only input_macroscope_camera: ? "Camera type is one of the following:" ? " (B) Basler" ? " (C) Cidtec" ? " (X) Custom" ? " (D) DragonFly" ? " (E) E2V7899" ? " (F) FireFly2" ? " (P) Philips" ? " (L) Pulnix" ? " (U) Sensors Unlimited" ? " (S) Sony" ? " (V) Vidicon" input "Enter the single letter camera type code ", c$ c$ = trim$(upc$(c$)) if c$ = "P" then calfile "Camera Type P62505" calfile "Camera File vc62505n.dcf vc62505i.dcf cx105i.dcf" goto got_macroscope_camera endif if c$ = "E" then calfile "Camera Type E2V7899" goto got_macroscope_camera endif if c$ = "S" then input "Enter Sony Camera Type (XC77, XC7500, or XC7500S)", s$ s$ = trim$(upc$(s$)) if s$ = "XC77" then calfile "Camera Type xc77" if systype$ = "Mesa" then calfile "Camera File xc77cen2.dcf" else calfile "Camera File xc77cen2.dcf xc77cei2.dcf cx105i.dcf" endif goto got_macroscope_camera endif if s$ = "XC7500S" then calfile "Camera Type xc7500s" if systype$ = "Mesa" then calfile "Camera File xc7500n.dcf" else calfile "Camera File xc7500n.dcf xc7500f_x2.dcf xc7500f_x2s.dcf" endif else calfile "Camera Type xc7500" calfile "Camera File xc7500n.dcf" endif goto got_macroscope_camera endif if c$ = "C" then enter_cidtec_type: input "Enter Cidtec Camera Type (2220 or 2250)", s$ s$ = trim$(upc$(s$)) if s$ = "2220" then calfile "Camera Type cid2220" calfile "Camera File cid2220n.dcf cid2220i.dcf" goto got_macroscope_camera endif if s$ = "2250" then calfile "Camera Type cid2250" calfile "Camera File cid2250n.dcf" goto got_macroscope_camera endif goto enter_cidtec_type endif if c$ = "D" then enter_dragon_fly_type: input "Enter DragonFly Camera Type (640 or 1024)", s$ s$ = trim$(upc$(s$)) if s$ = "640" then calfile "Camera Type DGFLY640" calfile "Camera File pgrcam.ini" goto got_macroscope_camera endif if s$ = "1024" then calfile "Camera Type DGFLY1024" calfile "Camera File pgrcam.ini" goto got_macroscope_camera endif goto enter_dragon_fly_type endif if c$ = "F" then ! FireFly2 uses same calfile info as DragonFly 640 calfile "Camera Type DGFLY640" calfile "Camera File pgrcam.ini" goto got_macroscope_camera endif if c$ = "V" then calfile "Camera Type Vidicon" calfile "Camera File mv7290i.dcf" goto got_macroscope_camera endif if c$ = "L" then enter_pulnix_type: ? "Pulnix camera type is one of the following:" ? " 6705" ? " 6710" ? " 6740" input "Enter the Pulnix camera type ", s$ s$ = trim$(upc$(s$)) if s$ = "6705" then calfile "Camera Type tm6705" calfile "Camera File tm6705f.dcf tm6705n.dcf tm6705ptr.dcf" goto got_macroscope_camera endif if s$ = "6710" then ! pure guessing here calfile "Camera Type tm6710" calfile "Camera File tm6710f.dcf tm6710n.dcf tm6710ptr.dcf" goto got_macroscope_camera endif if s$ = "6740" then ! pure guessing here calfile "Camera Type tm6740" calfile "Camera File tm6740f.dcf tm6740n.dcf tm6740ptr.dcf" goto got_macroscope_camera endif goto enter_pulnix_type endif if c$ = "B" then if systype$ = "DVD" then print "DVD may not have a Basler camera" if systype$ = "MARKGPI" then print "MARKGPI may not have a Basler camera" if (systype$ = "DVD") or (systype$ = "MARKGPI") goto input_macroscope_camera input_basler_macroscope_type: ? "Basler camera type is one of the following:" ? " 311" ? " 312" ? " PIA640" ? " PIA1000" ? " Other" input "Enter the Basler camera type ", s$ s$ = trim$(upc$(s$)) if s$ = "311" then calfile "Camera Type A311F" calfile "Camera File fwa311fcx.ini" goto got_macroscope_camera endif if s$ = "312" then calfile "Camera Type A312F" calfile "Camera File fwa312fcx.ini" goto got_macroscope_camera endif if s$ = "PIA640" then calfile "Camera Type PIA640" calfile "Camera Options 1" goto got_macroscope_camera endif if s$ = "PIA1000" then calfile "Camera Type PIA1000" calfile "Camera Options 1" goto got_macroscope_camera endif if s$ = "OTHER" then calfile "Camera Type Basler" goto got_macroscope_camera endif goto input_basler_macroscope_type endif if c$ = "U" then if systype$ = "DVD" then print "DVD may not have a Sensors Unlimited camera" if (systype$ = "DVD") goto input_macroscope_camera calfile "Camera Type SU320" calfile "Camera File su320_12_c.dcf" goto got_macroscope_camera endif if c$ = "X" then subsample: input "Should this camera subsample (y/n) ", ok$ ok$ = lwc$(ok$) if ok$[1] = "n" then calfile "Camera Type Custom" goto got_macroscope_camera endif if ok$[1] = "y" then calfile "Camera Type Custom 1" goto got_macroscope_camera endif goto subsample endif goto input_macroscope_camera got_macroscope_camera: return !} get_macroscope_camera ! get_mst_wavelen: !{ input "Enter MST nominal wavelength (633 or 1550) ", mst_wavelen$ mst_wavelen$ = trim$(upc$(mst_wavelen$)) if mst_wavelen$ = "633" then return if mst_wavelen$ = "1550" then return goto get_mst_wavelen return !} get_mst_wavelen ! get_microscope_camera: !{ ! Gets microscope camera type and sets calfile values ! Intended for local use only input_microscope_camera: ? "Camera type is one of the following:" ? " (A) Adimec" ? " (B) Basler" ? " (X) Custom" ? " (D) DragonFly" ? " (I) Imperx" ? " (P) Pulnix" ? " (S) Sony" input "Enter the single letter camera type code ", c$ c$ = trim$(upc$(c$)) if c$ = "D" then ! assumes NV6000 or NV7000 calfile "Camera Type DGFLY6200" calfile "Camera File pgrcam.ini" calfile "SysMag 0.335 0.505 0.675 1.010 1.341" calfile "NomMag 0.5 0.75 1.0 1.5 2.0" goto got_microscope_camera endif if c$ = "S" then input_sony_microscope_camera: ? "Sony camera type is one of the following:" ? " XC77" ? " XC7500N" ? " XC7500F" ? " XC7500S" input "Enter the Sony camera type ", s$ s$ = trim$(upc$(s$)) if s$ = "XC77" then calfile "Camera Type xc77" calfile "Camera File xc77cen.dcf xc77cei.dcf" ! NOTE: this camera is obsolete goto got_microscope_camera endif if s$ = "XC7500N" then calfile "Camera Type xc7500" calfile "Camera File xc7500n.dcf" calfile "Camera Dark 0" calfile "SysMag 0.36 0.45 0.72 0.9 1.197 1.8" calfile "NomMag 0.4 0.5 0.8 1.0 1.3 2.0" goto got_microscope_camera endif if s$ = "XC7500F" then calfile "Camera Type xc7500" calfile "Camera File xc7500f.dcf" calfile "Camera Dark 0" calfile "SysMag 0.36 0.45 0.72 0.9 1.197 1.8" calfile "NomMag 0.4 0.5 0.8 1.0 1.3 2.0" goto got_microscope_camera endif if s$ = "XC7500S" then calfile "Camera Type xc7500s" calfile "Camera File xc7500n.dcf xc7500f_x2.dcf xc7500f_x2s.dcf" calfile "Camera Dark 0" calfile "SysMag 0.36 0.45 0.72 0.9 1.197 1.8" calfile "NomMag 0.4 0.5 0.8 1.0 1.3 2.0" goto got_microscope_camera endif goto input_sony_microscope_camera endif if c$ = "P" then input_pulnix_microscope_camera: ? "Pulnix camera type is one of the following:" ? " 6705" ? " 6710" ? " 6740" input "Enter the Pulnix camera type ", s$ s$ = trim$(upc$(s$)) if s$ = "6705" then calfile "Camera Type tm6705" calfile "Camera File tm6705f.dcf tm6705n.dcf tm6705ptr.dcf" calfile "Camera Dark 0" calfile "Camera Options 1" calfile "SysMag 0.32 0.4 0.64 0.8 1.064 1.6" calfile "NomMag 0.4 0.5 0.8 1.0 1.3 2.0" goto got_microscope_camera endif if s$ = "6710" then ! pure guesses here calfile "Camera Type tm6710" calfile "Camera Options 1" if (si.systemType = SYSTEM_NEWVIEW_6000) or (si.systemType = SYSTEM_NEWVIEW_7000) then calfile "Camera File tm6710f.dcf" calfile "SysMag 0.335 0.505 0.675 1.010 1.341" calfile "NomMag 0.5 0.75 1.0 1.5 2.0" else calfile "Camera File tm6710f.dcf tm6710n.dcf tm6710ptr.dcf" calfile "Camera Dark 0" calfile "SysMag 0.32 0.4 0.64 0.8 1.064 1.6" calfile "NomMag 0.4 0.5 0.8 1.0 1.3 2.0" endif goto got_microscope_camera endif if s$ = "6740" then ! assuming NV60000 or NV7000 calfile "Camera Type tm6740" calfile "Camera Options 1" if (systype$ = "NV600P") or (systype$ = "NV600S") or (systype$ = "NV700P") or (systype$ = "NV700S") then calfile "SysMag 0.675" calfile "NomMag 1.0" else calfile "SysMag 0.335 0.505 0.675 1.010 1.341" calfile "NomMag 0.5 0.75 1.0 1.5 2.0" endif goto got_microscope_camera endif goto input_pulnix_microscope_camera endif if c$ = "X" then subsample2: input "Should this camera subsample (y/n) ", ok$ ok$ = lwc$(ok$) if ok$[1] = "n" then calfile "Camera Type Custom" goto got_microscope_camera endif if ok$[1] = "y" then calfile "Camera Type Custom 1" goto got_microscope_camera endif goto subsample2 endif if c$ = "B" then input_basler_microscope_camera: ? "Basler camera type is one of the following:" ? " A202K" ? " A302" ? " PIA640" ? " PIA1000" ? " SCA640" ? " SCA640G" input "Enter the Basler camera type ", s$ s$ = trim$(upc$(s$)) if (s$ = "A202K") or (s$ = "A302") then calfile "Camera Type Basler" goto got_microscope_camera endif if (s$ = "SCA640") or (s$ = "SCA640G") then if s$ = "SCA640" then calfile "Camera Type SCA640" else calfile "Camera Type SCA640G" endif calfile "Camera Options 1" if (systype$ = "NV600P") or (systype$ = "NV600S") then calfile "SysMag 0.675" calfile "NomMag 1.0" else if (systype$ = "NV700P") or (systype$ = "NV700S") then calfile "SysMag 0.505" calfile "NomMag 0.75" else calfile "SysMag 0.335 0.505 0.675 1.010 1.341" calfile "NomMag 0.5 0.75 1.0 1.5 2.0" endif endif goto got_microscope_camera endif if s$ = "PIA640" then calfile "Camera Type PIA640" calfile "Camera Options 1" if (systype$ = "NV600P") or (systype$ = "NV600S") or (systype$ = "NV700P") or (systype$ = "NV700S") then calfile "SysMag 0.675" calfile "NomMag 1.0" else calfile "SysMag 0.335 0.505 0.675 1.010 1.341" calfile "NomMag 0.5 0.75 1.0 1.5 2.0" endif goto got_microscope_camera endif if s$ = "PIA1000" then calfile "Camera Type PIA1000" calfile "Camera Options 1" if (systype$ = "NV600P") or (systype$ = "NV600S") or (systype$ = "NV700P") or (systype$ = "NV700S") then calfile "SysMag 0.675" calfile "NomMag 1.0" else calfile "SysMag 0.335 0.505 0.675 1.010 1.341" calfile "NomMag 0.5 0.75 1.0 1.5 2.0" endif goto got_microscope_camera endif goto input_basler_microscope_camera endif if c$ = "I" then calfile "Camera Type Imperxvga" calfile "Camera Options 1" if (systype$ <> "NV6000") and (systype$ <> "NV7000") then calfile "LLC Config 21" endif calfile "SysMag 0.335 0.505 0.675 1.010 1.341" ! for NV6000 and NV7000 calfile "NomMag 0.5 0.75 1.0 1.5 2.0" goto got_microscope_camera endif if c$ = "A" then calfile "Camera Type Adimec1000" calfile "Camera Options 1" if (systype$ <> "NV6000") and (systype$ <> "NV7000") then calfile "LLC Config 5" endif calfile "SysMag 0.335 0.505 0.675 1.010 1.341" ! for NV6000 and NV7000 calfile "NomMag 0.5 0.75 1.0 1.5 2.0" goto got_microscope_camera endif goto get_microscope_camera got_microscope_camera: return !} get_microscope_camera ! get_pifoc: !{ ! Gets pifoc information and sets calfile values ! Intended for local use only input_id: input "Enter Pifoc ID ", id% if id% <= 0 goto input_id alpha = 0 input_alpha: input "Enter Alpha (0.5 to 2.0) ", alpha if (alpha < 0.5) or (alpha > 2.0) goto input_alpha beta = 0 input_beta: input "Enter Beta (0.0 to 0.1) ", beta if (beta < 0.0) or (beta > 0.1) goto input_beta calfile "Pifoc " & val$(id%) & " " & val$(alpha) & " " & val$(beta) return !} ! get_scanner: !{ ! Gets scanner serial number, sets calfile pifoc ID ! Intended for local use only input_scanner_id: input "Enter the scanner serial number ", sn$ id% = val(trim$(sn$)) if id% <= 0 goto input_scanner_id calfile "Pifoc " & val$(id%) return !} ! print_old_pifoc: !{ ! Prints pifoc information to allow operator to note old values print_pifoc: ? "Old "; ? "Pifoc ID = "; pi.id; ", Alpha = "; ofmtr("%.6f") ? pi.alpha; ", Beta = "; pi.beta ofmtr("") return !} print_old_pifoc ! motion_control: !{ input "Does this system have motion control (y/n) ", ok$ ok$ = lwc$(trim$(ok$)) if ok$[1] = "n" then return if ok$[1] <> "y" then goto motion_control gosub motion_control_get_type ! Sets var mc_type$ if mc_type$ = "NOVA" then gosub motion_control_nova endif if mc_type$ = "MPX" then gosub motion_control_mpx endif return !} motion_control ! motion_control_get_type ! Prompts operator to enter motion controller type. ! Used by sub motion_control. ! Sets var mc_type$ motion_control_get_type: !{ ? "Motion controller type is one of the following:" ? " Nova" ? " MPX" input "Enter motion controller type ", mc_type$ mc_type$ = trim$(upc$(mc_type$)) if mc_type$ = "NOVA" then return if mc_type$ = "MPX" then return goto motion_control_get_type return !} ! motion_control_nova ! Set up for NOVA motion controller. ! Used by sub motion_control. motion_control_nova: !{ dim mc_config$[99] input "Enter Nova motion configuration file name ", mc_config$ mc_config$ = trim$(mc_config$) motion_control_nova_get_port: input "Enter Nova motion communications port number (1-9) ", port$ port$ = trim$(port$) if (val(port$) < 1) or (val(port$) > 9) then goto motion_control_nova_get_port calfile "MotionCtrl " & upc$(mc_config$) & " com" & port$ print "Nova motion configuration done" return !} ! motion_control_mpx ! Set up for MPX motion controller. ! Used by sub motion_control. motion_control_mpx: !{ calfile "MotionCtrl SystemInfo.config MetroProX" print "Mpx motion configuration done" return !} ! pos_instr ! Handles adding position instrument information to cal file pos_instr: !{ input "Does this system have a position instrument (y/n) ", ok$ ok$ = upc$(trim$(ok$)) if ok$ = "N" then return if ok$ <> "Y" then goto pos_instr gosub pos_instr_get_type ! Sets var pi_type$ if pi_type$ = "AXIOM" then ! Example: PosInstr Axiom 0 pi_port_str$ = "0" pi_config$ = "" endif if pi_type$ = "HEID" then ! Example: PosInstr Heid COM2 pi_min_port_num% = 1 pi_max_port_num% = 9 gosub pos_instr_get_comm_port ! Sets var pi_port_num% ofmti("%d") pi_port_str$ = "COM" & val$(pi_port_num%) pi_config$ = "" endif if pi_type$ = "LCDMI" then ! Example: PosInstr LCDMI 0 LCDMI.cfg pi_min_port_num% = 0 pi_max_port_num% = 9 gosub pos_instr_get_comm_port ! Sets var pi_port_num% ofmti("%d") pi_port_str$ = val$(pi_port_num%) pi_config$ = "LCDMI.cfg" endif if pi_type$ = "METRONICS" then ! Example: PosInstr Metronics COM2 pi_min_port_num% = 1 pi_max_port_num% = 9 gosub pos_instr_get_comm_port ! Sets var pi_port_num% ofmti("%d") pi_port_str$ = "COM" & val$(pi_port_num%) pi_config$ = "" endif if pi_type$ = "MICROLYNX" then ! Example: PosInstr MicroLYNX COM2 pi_min_port_num% = 1 pi_max_port_num% = 9 gosub pos_instr_get_comm_port ! Sets var pi_port_num% ofmti("%d") pi_port_str$ = "COM" & val$(pi_port_num%) endif if pi_type$ = "MPXZMI501" then ! Example: PosInstr MPXZMI501 11 0 ! Example: PosInstr MPXZMI501 13 0 gosub pos_instr_get_num_channels ! Sets var pi_channels% if pi_channels% = 1 then pi_port_str$ = "11" else pi_port_str$ = "13" endif pi_config$ = "0" endif if pi_type$ = "RENISHAW" then ! Example: PosInstr Renishaw_StepNet 32 pi_type$ = "Renishaw_StepNet" pi_port_str$ = "32" ! CAN node ID of Copley StepNet device pi_config$ = "" endif if pi_type$ = "USDED2" then ! Example: PosInstr USDED2 COM2 pi_min_port_num% = 1 pi_max_port_num% = 9 gosub pos_instr_get_comm_port ! Sets var pi_port_num% ofmti("%d") pi_port_str$ = "COM" & val$(pi_port_num%) endif if pi_type$ = "ZMI" then ! Example: PosInstr ZMI COM2 pi_min_port_num% = 1 pi_max_port_num% = 9 gosub pos_instr_get_comm_port ! Sets var pi_port_num% ofmti("%d") pi_port_str$ = "COM" & val$(pi_port_num%) endif if pi_type$ = "ZENCODER" then ! Example: PosInstr ZEncoder None None pi_port_str$ = "None" pi_config$ = "None" endif if pi_type$ = "ZMI501" then ! Example: PosInstr ZMI501 11 0 ! Example: PosInstr ZMI501 13 0 gosub pos_instr_get_num_channels ! Sets var pi_channels% if pi_channels% = 1 then pi_port_str$ = "11" else pi_port_str$ = "13" endif pi_config$ = "0" endif calfile "PosInstr " & pi_type$ & " " & pi_port_str$ & " " & pi_config$ return !} pos_instr ! pos_instr_get_type ! Prompts operator to enter position instrument type. ! Used by sub pos_instr. ! Sets var pi_type$ pos_instr_get_type: !{ ? "Position instrument type is one of the following:" ? " Axiom" ? " Heid" ? " LCDMI" ? " Metronics" ? " MicroLYNX" ? " MPXZMI501" ? " Renishaw" ? " USDED2" ? " ZEncoder" ? " ZMI" ? " ZMI501" input "Enter position instrument type ", pi_type$ pi_type$ = trim$(upc$(pi_type$)) if pi_type$ = "AXIOM" then return if pi_type$ = "HEID" then return if pi_type$ = "LCDMI" then return if pi_type$ = "METRONICS" then return if pi_type$ = "MICROLYNX" then return if pi_type$ = "MPXZMI501" then return if pi_type$ = "RENISHAW" then return if pi_type$ = "USDED2" then return if pi_type$ = "ZENCODER" then return if pi_type$ = "ZMI" then return if pi_type$ = "ZMI501" then return goto pos_instr_get_type return !} ! pos_instr_get_comm_port ! Prompts operator to enter position instrument communication port. ! This is relevant for only some of the position instrument types. ! Used by sub pos_instr. ! Uses vars pi_min_port_num% and pi_max_port_num% ! Sets var pi_port_num% pos_instr_get_comm_port: !{ dim msg$[999] msg$ = "Position instrument communications port number may be " ofmti("%d") msg$ = msg$ & val$(pi_min_port_num%) & " to " & val$(pi_max_port_num%) pos_instr_get_comm_port_input: ? msg$ input "Enter position instrument communications port number ", str$ pi_port_num% = val(trim$(str$)) if (pi_port_num% < pi_min_port_num%) or (pi_port_num% > pi_max_port_num%) then goto pos_instr_get_comm_port_input endif return !} pos_instr_get_comm_port ! pos_instr_get_num_channels ! Prompts operator to enter number of position instrument channels. ! (This is relevant for the ZMI501 and MPXZMI501 types.) ! Used by sub pos_instr. ! Sets var pi_channels% to 1 or 2 pos_instr_get_num_channels: !{ pi_config$ = "" input "Enter position instrument number of channels (1 or 2) ", pi_channels% if (pi_channels% <> 1) and (pi_channels% <> 2) then goto pos_instr_get_num_channels endif return !} pos_instr_get_num_channels ! pos_instr_get_config_file ! Prompts operator to enter position instrument configuration file name. ! Used by sub pos_instr. ! Sets var pi_config$ pos_instr_get_config_file: !{ pi_config$ = "" input "Enter position instrument configuration file name ", pi_config$ if pi_config$ = "" then goto pos_instr_get_config_file endif return !} pos_instr_get_config_file ! get_ring_spot: !{ input "Does this system have ring-of-fire hardware (y/n) ", ok$ ok$ = lwc$(ok$) if ok$[1] = "n" then return if ok$[1] = "y" then calfile "RingSpot" return endif goto get_ring_spot return !} get_ring_spot !! get_macaddress: !{ input "Enter last 6 hex digits of the CAN bridge MAC address (XX YY ZZ) ", mac1$ mac1$ = trim$(upc$(mac1$)) mac2$ = "00 03 F4 " & mac1$ ? "MAC address: " & mac2$ input "Is this correct (y/n) ", ok$ ok$ = lwc$(ok$) if ok$[1] = "y" then calfile "MacAddress " & mac2$ return endif mac1$ = "" mac2$ = "" goto get_macaddress return !} get_macaddress !! get_optional_nodes: !{ ! Get the missing node codes ? "Enter the codes for any hardware nodes that are NOT in the system." ? " (P) Triple PZT" ? " (L) Large Aperture" ? " (W) Wand" ? " (Z) Zoom & Diffuser Disk" ? " (R) Ring of Fire & Diffuser Disk" ? " (F) Focus & ND Wheel" input "Codes: PLWZRF (- for all hardware in system) ", code$ code$ = lwc$(code$) ! Check the codes for idx = 1 to len(code$) if code$[idx;1] <> "-" and code$[idx;1] <> "p" and code$[idx;1] <> "l" and code$[idx;1] <> "w" and code$[idx;1] <> "l" and code$[idx;1] <> "z" and code$[idx;1] <> "l" and code$[idx;1] <> "r" and code$[idx;1] <> "l" and code$[idx;1] <> "f" then ? "\"" & code$[idx;1] & "\" is not a valid code" goto get_optional_nodes endif next idx ! Add the cal file entries rof = 1 for idx = 1 to len(code$) if code$[idx;1] = "p" then calfile "IgnorePZT" endif if code$[idx;1] = "l" then calfile "IgnoreLAPS" endif if code$[idx;1] = "w" then calfile "IgnoreWand" endif if code$[idx;1] = "z" then calfile "IgnoreZoom" endif if code$[idx;1] = "f" then calfile "IgnoreFocusNDW" endif if code$[idx;1] = "r" then rof = 0 endif next idx if rof = 1 then calfile "RingSpot" get_optional_nodes_done: return !} ! !! does_instr_use_can_hardware ! Tests var systype$ and sets var can_hardware% to 0 or 1 does_instr_use_can_hardware: !{ can_hardware% = 1 if systype$ = "DVDCAN" then return if systype$ = "GPICAN" then return if systype$ = "MarkPH" then return if systype$ = "MST_CAN" then return if systype$ = "NIF_CAN" then return if systype$ = "NV6000" then return if systype$ = "NV600S" then return if systype$ = "NV600P" then return if systype$ = "NV700S" then return if systype$ = "NV700P" then return if systype$ = "NV7000" then return if systype$ = "WSGPICAN" then return can_hardware% = 0 return !} does_instr_use_can_hardware