#include <I2C_control_FSBB.au3>
-Global $Mi34_buttons[3] = ["Edit2", "TCSpinEdit5", "TEdit11"]
+Global $FSBB_buttons[3] = ["Edit2", "TCSpinEdit5", "TEdit11"]
-Func Mi34_GotoMiTab()
- GotoTab(7) ; Go to "Mi34" tab
+Func FSBB_GotoMiTab()
+ _GotoTab(7) ; Go to "Mi34" tab
EndFunc ;==>Mi34_GotoMiTab
-Func Mi34_SelectBoard()
- GotoTab(0) ; Go to first tab
+Func FSBB_SelectBoard()
+ _GotoTab(0) ; Go to first tab
ControlCommand($chipsoftware[0], "", "[TEXT:Mimosa34]", "Check")
EndFunc ;==>Mi34_SelectBoard
-Func Mi34_GetVref()
- return ControlGetText($chipsoftware[0], "", $Mi34_buttons[2])
+Func FSBB_GetVref()
+ return ControlGetText($chipsoftware[0], "", $FSBB_buttons[2])
EndFunc ;==>Mi34_GetVref
-Func Mi34_SetVref($vref)
- ControlSetText($chipsoftware[0], "", $Mi34_buttons[2], $vref)
+Func FSBB_SetVref($vref)
+ ControlSetText($chipsoftware[0], "", $FSBB_buttons[2], $vref)
EndFunc ;==>Mi34_SetVref
-Func Mi34_SetMiParameter($matrix, $vref)
- ControlFocus($chipsoftware[0], "", $Mi34_buttons[0])
- ControlSetText($chipsoftware[0], "", $Mi34_buttons[0], "")
+Func FSBB_SetMiParameter($matrix, $vref)
+ ControlFocus($chipsoftware[0], "", $FSBB_buttons[0])
+ ControlSetText($chipsoftware[0], "", $FSBB_buttons[0], "")
Sleep(100)
- ControlSend($chipsoftware[0], "", $Mi34_buttons[0], $matrix)
+ ControlSend($chipsoftware[0], "", $FSBB_buttons[0], $matrix)
Sleep(100)
;Send($matrix)
;ControlCommand($chipsoftware[0], "", "[TEXT:Clamp Enabled]", "Uncheck")
;ControlCommand($chipsoftware[0], "", "[TEXT:High (Default)]", "Check")
- ControlFocus($chipsoftware[0], "", $Mi34_buttons[1])
- ControlSetText($chipsoftware[0], "", $Mi34_buttons[1], "")
+ ControlFocus($chipsoftware[0], "", $FSBB_buttons[1])
+ ControlSetText($chipsoftware[0], "", $FSBB_buttons[1], "")
Sleep(100)
- ControlSetText($chipsoftware[0], "", $Mi34_buttons[1], "1")
+ ControlSetText($chipsoftware[0], "", $FSBB_buttons[1], "1")
Sleep(100)
- ControlFocus($chipsoftware[0], "", $Mi34_buttons[2])
- ControlSetText($chipsoftware[0], "", $Mi34_buttons[2], "")
+ ControlFocus($chipsoftware[0], "", $FSBB_buttons[2])
+ ControlSetText($chipsoftware[0], "", $FSBB_buttons[2], "")
Sleep(100)
- ControlSetText($chipsoftware[0], "", $Mi34_buttons[2], $vref)
+ ControlSetText($chipsoftware[0], "", $FSBB_buttons[2], $vref)
Sleep(100)
EndFunc ;==>Mi34_SetMiParameter
+
+Func FSBB_CheckWindowExist() ; Check if Mimosa window exists
+ CheckWindowExist_I2CFSBB()
+EndFunc ;==>CheckWindowExist
+
+Func FSBB_CheckIfBoardOK()
+ CheckIfBoardOK_I2CFSBB()
+EndFunc ;==>CheckIfBoardOK
+
+Func FSBB_GotoTab($tabnum)
+ GotoTab_I2CFSBB($tabnum)
+EndFunc ;==>GotoTab
+
+Func FSBB_GotoDebugTab()
+ GotoDebugTab_I2CFSBB()
+EndFunc ;==>GotoDebugTab
+
+Func FSBB_ProgramMi()
+ ProgramMi_I2CFSBB()
+EndFunc ;==>ProgramMi
+
+Func FSBB_GetCounter()
+ GetCounter_I2CFSBB()
+EndFunc ;==>GetCounter
+
+Func FSBB_StopRun()
+ StopRun_I2CFSBB()
+EndFunc
+
+Func FSBB_StartRun()
+ StartRun_I2CFSBB()
+EndFunc
+
+Func FSBB_TestSystem()
+ TestSystem_I2CFSBB()
+EndFunc
+
+Func FSBB_GetAverage($hWnd)
+ GetAverage_I2CFSBB($hWnd)
+EndFunc
+
+Func Pegasus_SetClockType($clock)
+ SetClockType_I2CFSBB($clock)
+EndFunc
\ No newline at end of file
#include-once
-Global $chipsoftware[2] = ["I2C control Software for Mimosa32", "TPageControl1"]
-Global $system = "USB"
-Global $hWnd
-Global $hCounter
-$savedir = "O:\FSBB"
-Global $vref = 650 ; Initial vref, will be adjusted during runtime
-$temperaturebefore = -10000
+Global $chipsoftware_I2CFSBB[2] = ["I2C control Software for Mimosa32", "TPageControl1"]
-Func CheckWindowExist() ; Check if Mimosa window exists
- If WinExists($chipsoftware[0]) = False Then
+Func CheckWindowExist_I2CFSBB() ; Check if Mimosa window exists
+ If WinExists($chipsoftware_I2CFSBB[0]) = False Then
Run("C:\CCMOS_SCTRL\MIMOSA34\I2C_ms_gui_labo_Debug.bat", "C:\CCMOS_SCTRL\MIMOSA34\")
- WinWait($chipsoftware[0])
+ WinWait($chipsoftware_I2CFSBB[0])
EndIf
WinWait("I2C control Software for Mimosa32")
EndFunc ;==>CheckWindowExist
-Func CheckIfBoardOK()
- ControlClick($chipsoftware[0], "", "[TEXT:Inactive;CLASS:TButton]") ; Activate Polling
+Func CheckIfBoardOK_I2CFSBB()
+ ControlClick($chipsoftware_I2CFSBB[0], "", "[TEXT:Inactive;CLASS:TButton]") ; Activate Polling
Local $i = 0
- While(ControlGetText($chipsoftware[0], "", "TEdit6") <> "Target Board OK")
+ While(ControlGetText($chipsoftware_I2CFSBB[0], "", "TEdit6") <> "Target Board OK")
If($i > 20) Then
MsgBox(16, "Message", "Mimosa board could not be polled, please check if board is connected properly.")
Exit
$i = $i + 1
Sleep(500)
WEnd
- ControlClick($chipsoftware[0], "", "[TEXT:Active;CLASS:TButton]")
+ ControlClick($chipsoftware_I2CFSBB[0], "", "[TEXT:Active;CLASS:TButton]")
EndFunc ;==>CheckIfBoardOK
-Func GotoTab($tabnum)
- WinWait($chipsoftware[0])
- Local $hWnd = WinGetHandle($chipsoftware[0])
- Local $hTab = ControlGetHandle($hWnd, "", $chipsoftware[1])
+Func GotoTab_I2CFSBB($tabnum)
+ WinWait($chipsoftware_I2CFSBB[0])
+ Local $hWnd = WinGetHandle($chipsoftware_I2CFSBB[0])
+ Local $hTab = ControlGetHandle($hWnd, "", $chipsoftware_I2CFSBB[1])
_GUICtrlTab_SetCurFocus($hTab, $tabnum) ; Go to "$tabnum" tab
Sleep(100)
EndFunc ;==>GotoTab
-Func GotoDebugTab()
- GotoTab(9)
+Func GotoDebugTab_I2CFSBB()
+ _GotoTab(9)
EndFunc ;==>GotoDebugTab
-Func ProgramMi()
- ControlClick($chipsoftware[0], "", "[TEXT:Prog All Analog;CLASS:TButton]") ; Program!
+Func ProgramMi_I2CFSBB()
+ ControlClick($chipsoftware_I2CFSBB[0], "", "[TEXT:Prog All Analog;CLASS:TButton]") ; Program!
Sleep(1000)
EndFunc ;==>ProgramMi
-Func GetCounter()
+Func GetCounter_I2CFSBB()
Return ControlGetText($hWnd, "", $hCounter)
EndFunc ;==>GetCounter
-Func StopRun()
+Func StopRun_I2CFSBB()
ControlClick($hWnd, "", "[TEXT:Stop Run;CLASS:TButton]")
EndFunc
-Func StartRun()
+Func StartRun_I2CFSBB()
ControlClick($hWnd, "", "[TEXT:Start Run;CLASS:TButton]")
EndFunc
-Func TestSystem()
+Func TestSystem_I2CFSBB()
WinWait("Debug")
ControlClick("Debug", "", "[TEXT:Messages Clear]")
Sleep(100)
Return 0
EndFunc
-Func GetAverage()
+Func GetAverage_I2CFSBB()
Return ControlGetText($hWnd, "", "[TEXT:DispAvg;CLASS:TEdit]")
EndFunc
#include-once
-Global $chipsoftware[2] = ["I2C control Software for Mimosa32", "TPageControl1"]
-Global $system = "USB"
-Global $hWnd
-Global $hCounter
-$savedir = "F:\currentrun"
-$storedir = "O:\Mi34"
-Global $vref = 650 ; Initial vref, will be adjusted during runtime
-$temperaturebefore = -10000
+Global $chipsoftware_I2CMi32[2] = ["I2C control Software for Mimosa32", "TPageControl1"]
-Func CheckWindowExist() ; Check if Mimosa window exists
- If WinExists($chipsoftware[0]) = False Then
+Func CheckWindowExist_I2CMi32() ; Check if Mimosa window exists
+ If WinExists($chipsoftware_I2CMi32[0]) = False Then
Run("C:\CCMOS_SCTRL\MIMOSA34\I2C_ms_gui_labo_Debug.bat", "C:\CCMOS_SCTRL\MIMOSA34\")
- WinWait($chipsoftware[0])
+ WinWait($chipsoftware_I2CMi32[0])
EndIf
- WinWait("I2C control Software for Mimosa32")
EndFunc ;==>CheckWindowExist
-Func CheckIfBoardOK()
- ControlClick($chipsoftware[0], "", "[TEXT:Inactive;CLASS:TButton]") ; Activate Polling
+Func CheckIfBoardOK_I2CMi32()
+ ControlClick($chipsoftware_I2CMi32[0], "", "[TEXT:Inactive;CLASS:TButton]") ; Activate Polling
Local $i = 0
- While(ControlGetText($chipsoftware[0], "", "TEdit6") <> "Target Board OK")
+ While(ControlGetText($chipsoftware_I2CMi32[0], "", "TEdit6") <> "Target Board OK")
If($i > 20) Then
MsgBox(16, "Message", "Mimosa board could not be polled, please check if board is connected properly.")
Exit
$i = $i + 1
Sleep(500)
WEnd
- ControlClick($chipsoftware[0], "", "[TEXT:Active;CLASS:TButton]")
+ ControlClick($chipsoftware_I2CMi32[0], "", "[TEXT:Active;CLASS:TButton]")
EndFunc ;==>CheckIfBoardOK
-Func GotoTab($tabnum)
- WinWait($chipsoftware[0])
- Local $hWnd = WinGetHandle($chipsoftware[0])
- Local $hTab = ControlGetHandle($hWnd, "", $chipsoftware[1])
+Func GotoTab_I2CMi32($tabnum)
+ WinWait($chipsoftware_I2CMi32[0])
+ Local $hWnd = WinGetHandle($chipsoftware_I2CMi32[0])
+ Local $hTab = ControlGetHandle($hWnd, "", $chipsoftware_I2CMi32[1])
_GUICtrlTab_SetCurFocus($hTab, $tabnum) ; Go to "$tabnum" tab
Sleep(100)
EndFunc ;==>GotoTab
-Func GotoDebugTab()
- GotoTab(9)
+Func GotoDebugTab_I2CMi32()
+ _GotoTab(9)
EndFunc ;==>GotoDebugTab
-Func ProgramMi()
- ControlClick($chipsoftware[0], "", "[TEXT:Prog All Analog;CLASS:TButton]") ; Program!
+Func ProgramMi_I2CMi32()
+ ControlClick($chipsoftware_I2CMi32[0], "", "[TEXT:Prog All Analog;CLASS:TButton]") ; Program!
Sleep(1000)
EndFunc ;==>ProgramMi
-Func GetCounter()
+Func GetCounter_I2CMi32()
Return ControlGetText($hWnd, "", $hCounter)
EndFunc ;==>GetCounter
-Func StopRun()
+Func StopRun_I2CMi32()
ControlClick($hWnd, "", "[TEXT:Stop Run;CLASS:TButton]")
EndFunc
-Func StartRun()
+Func StartRun_I2CMi32()
ControlClick($hWnd, "", "[TEXT:Start Run;CLASS:TButton]")
EndFunc
-Func TestSystem()
+Func TestSystem_I2CMi32()
WinWait("Debug")
ControlClick("Debug", "", "[TEXT:Messages Clear]")
Sleep(100)
Return 0
EndFunc
-Func GetAverage()
+Func GetAverage_I2CMi32($hWnd)
Return ControlGetText($hWnd, "", "[TEXT:DispAvg;CLASS:TEdit]")
EndFunc
+
+Func SetClockType_I2CMi32($clock)
+ ControlCommand($chipsoftware_I2CMi32[0], "", "[TEXT:Intern]", "Check")
+ If ($clock <> "100") Then
+ SetChipClock($clock)
+ ControlCommand($chipsoftware_I2CMi32[0], "", "[TEXT:Extern]", "Check")
+ EndIf
+EndFunc
#include-once
-Global $system = "USB"
-Global $hWnd
-Global $hCounter
-Global $vref = -1 ; Initial vref, will be adjusted during runtime
-$temperaturebefore = -10000
Func Mi19_SelectBoard()
EndFunc ;==>Mi34_SelectBoard
+Func Mi19_GotoMiTab()
+
+EndFunc ;==>Mi34_GotoMiTab
+
Func Mi19_SetMiParameter($matrix, $vref)
Sleep(1000)
;~ $savedir = "F:\currentrun" ; overwrite store path set in other Mimosa files read in by include
Func Mi19_SetVref($vref)
EndFunc ;==>Mi19_SetVref
+
+Func Mi19_GetAverage($hWnd)
+ Return 2000 ; fake a good vref
+EndFunc
+
+Func Mi19_CheckWindowExist() ; Check if Mimosa window exists
+
+EndFunc ;==>CheckWindowExist
+
+Func Mi19_CheckIfBoardOK()
+
+EndFunc ;==>CheckIfBoardOK
+
+Func Mi19_GotoTab($tabnum)
+
+EndFunc ;==>GotoTab
+
+Func Mi19_GotoDebugTab()
+
+EndFunc ;==>GotoDebugTab
+
+Func Mi19_ProgramMi()
+
+EndFunc ;==>ProgramMi
+
+Func Mi19_GetCounter()
+ Return GetCounter_I2CMi32()
+EndFunc ;==>GetCounter
+
+Func Mi19_StopRun()
+
+EndFunc
+
+Func Mi19_StartRun()
+
+EndFunc
+
+Func Mi19_SetClockType($clock)
+
+EndFunc
+
+Func Mi19_GetVrefDelta()
+ Return 50 ; not used, Mi19 has no DAQ control of Vref, use screwdiver
+EndFunc
\ No newline at end of file
-Global $system = "USB"
-Global $hWnd
-Global $hCounter
-$savedir = "F:\Mi29"
-Global $vref = -1 ; Initial vref, will be adjusted during runtime
-$temperaturebefore = -10000
Func Mi29_GotoMiTab()
Func Mi29_GetAverage($hWnd)
Return 2000 ; fake a good vref
EndFunc
+
+Func Mi29_CheckWindowExist() ; Check if Mimosa window exists
+
+EndFunc ;==>CheckWindowExist
+
+Func Mi29_CheckIfBoardOK()
+
+EndFunc ;==>CheckIfBoardOK
+
+Func Mi29_GotoTab($tabnum)
+
+EndFunc ;==>GotoTab
+
+Func Mi29_GotoDebugTab()
+
+EndFunc ;==>GotoDebugTab
+
+Func Mi29_ProgramMi()
+
+EndFunc ;==>ProgramMi
+
+Func Mi29_GetCounter()
+ Return GetCounter_I2CMi32()
+EndFunc ;==>GetCounter
+
+Func Mi29_StopRun()
+
+EndFunc
+
+Func Mi29_StartRun()
+
+EndFunc
+
+Func Mi29_SetClockType($clock)
+
+EndFunc
+
+Func Mi29_GetVrefDelta()
+ Return 50
+EndFunc
+
Global $Mi32_buttons[3] = ["Edit2", "TCSpinEdit4", "TEdit15"]
Func Mi32_GotoMiTab()
- GotoTab(1) ; Go to "Mi32 A" tab
+ _GotoTab(1) ; Go to "Mi32 A" tab
EndFunc ;==>Mi32_GotoMiTab
Func Mi32_SelectBoard()
- GotoTab(0) ; Go to first tab
+ _GotoTab(0) ; Go to first tab
ControlCommand($chipsoftware[0], "", "[TEXT:Mimosa32]", "Check")
EndFunc ;==>Mi32_SelectBoard
ControlSetText($chipsoftware[0], "", $Mi32_buttons[2], $vref)
Sleep(100)
EndFunc ;==>Mi32_SetMiParameter
+
+Func Mi32_CheckWindowExist() ; Check if Mimosa window exists
+ CheckWindowExist_I2CMi32()
+EndFunc ;==>CheckWindowExist
+
+Func Mi32_CheckIfBoardOK()
+ CheckIfBoardOK_I2CMi32()
+EndFunc ;==>CheckIfBoardOK
+
+Func Mi32_GotoTab($tabnum)
+ GotoTab_I2CMi32($tabnum)
+EndFunc ;==>GotoTab
+
+Func Mi32_GotoDebugTab()
+ GotoDebugTab_I2CMi32()
+EndFunc ;==>GotoDebugTab
+
+Func Mi32_ProgramMi()
+ ProgramMi_I2CMi32()
+EndFunc ;==>ProgramMi
+
+Func Mi32_GetCounter()
+ Return GetCounter_I2CMi32()
+EndFunc ;==>GetCounter
+
+Func Mi32_StopRun()
+ StopRun_I2CMi32()
+EndFunc
+
+Func Mi32_StartRun()
+ StartRun_I2CMi32()
+EndFunc
+
+Func Mi32_TestSystem()
+ TestSystem_I2CMi32()
+EndFunc
+
+Func Mi32_GetAverage($hWnd)
+ Return GetAverage_I2CMi32($hWnd)
+EndFunc
+
+Func Mi32_SetClockType($clock)
+ SetClockType_I2CMi32($hWnd)
+EndFunc
+
+Func Mi32_GetVrefDelta()
+ Return 50
+EndFunc
\ No newline at end of file
Global $Mi32Ter_buttons[3] = ["Edit2", "TCSpinEdit4", "TEdit27"]
Func Mi32Ter_GotoMiTab()
- GotoTab(3) ; Go to "Mi32 Ter A" tab
+ _GotoTab(3) ; Go to "Mi32 Ter A" tab
EndFunc ;==>Mi32Ter_GotoMiTab
Func Mi32Ter_SelectBoard()
- GotoTab(0) ; Go to first tab
+ _GotoTab(0) ; Go to first tab
ControlCommand($chipsoftware[0], "", "[TEXT:Mimosa32Ter]", "Check")
EndFunc ;==>Mi32Ter_SelectBoard
ControlSetText($chipsoftware[0], "", $Mi32Ter_buttons[2], $vref)
Sleep(100)
EndFunc ;==>Mi32Ter_SetMiParameter
+
+Func Mi32Ter_CheckWindowExist_I2CMi32() ; Check if Mimosa window exists
+ CheckWindowExist_I2CMi32()
+EndFunc ;==>CheckWindowExist
+
+Func Mi32Ter_CheckIfBoardOK_I2CMi32()
+ CheckIfBoardOK_I2CMi32()
+EndFunc ;==>CheckIfBoardOK
+
+Func Mi32Ter_GotoTab_I2CMi32($tabnum)
+ GotoTab_I2CMi32($tabnum)
+EndFunc ;==>GotoTab
+
+Func Mi32Ter_GotoDebugTab_I2CMi32()
+ GotoDebugTab_I2CMi32()
+EndFunc ;==>GotoDebugTab
+
+Func Mi32Ter_ProgramMi_I2CMi32()
+ ProgramMi_I2CMi32()
+EndFunc ;==>ProgramMi
+
+Func Mi32Ter_GetCounter_I2CMi32()
+ GetCounter_I2CMi32()
+EndFunc ;==>GetCounter
+
+Func Mi32Ter_StopRun_I2CMi32()
+ StopRun_I2CMi32()
+EndFunc
+
+Func Mi32Ter_StartRun_I2CMi32()
+ StartRun_I2CMi32()
+EndFunc
+
+Func Mi32Ter_TestSystem_I2CMi32()
+ TestSystem_I2CMi32()
+EndFunc
+
+Func Mi32Ter_GetAverage_I2CMi32($hWnd)
+ Return GetAverage_I2CMi32($hWnd)
+EndFunc
+
+Func Mi32Ter_SetClockType($clock)
+ SetClockType_I2CMi32($clock)
+EndFunc
+
+
+Func Mi32Ter_GetVrefDelta()
+ Return 50
+EndFunc
\ No newline at end of file
Global $Mi34_buttons[3] = ["Edit2", "TCSpinEdit5", "TEdit11"]
Func Mi34_GotoMiTab()
- GotoTab(7) ; Go to "Mi34" tab
+ _GotoTab(7) ; Go to "Mi34" tab
EndFunc ;==>Mi34_GotoMiTab
Func Mi34_SelectBoard()
- GotoTab(0) ; Go to first tab
+ _GotoTab(0) ; Go to first tab
ControlCommand($chipsoftware[0], "", "[TEXT:Mimosa34]", "Check")
EndFunc ;==>Mi34_SelectBoard
ControlSetText($chipsoftware[0], "", $Mi34_buttons[2], $vref)
Sleep(100)
EndFunc ;==>Mi34_SetMiParameter
+
+Func Mi34_CheckWindowExist() ; Check if Mimosa window exists
+ CheckWindowExist_I2CMi32()
+EndFunc ;==>CheckWindowExist
+
+Func Mi34_CheckIfBoardOK()
+ CheckIfBoardOK_I2CMi32()
+EndFunc ;==>CheckIfBoardOK
+
+Func Mi34_GotoTab($tabnum)
+ GotoTab_I2CMi32($tabnum)
+EndFunc ;==>GotoTab
+
+Func Mi34_GotoDebugTab()
+ GotoDebugTab_I2CMi32()
+EndFunc ;==>GotoDebugTab
+
+Func Mi34_ProgramMi()
+ ProgramMi_I2CMi32()
+EndFunc ;==>ProgramMi
+
+Func Mi34_GetCounter()
+ GetCounter_I2CMi32()
+EndFunc ;==>GetCounter
+
+Func Mi34_StopRun()
+ StopRun_I2CMi32()
+EndFunc
+
+Func Mi34_StartRun()
+ StartRun_I2CMi32()
+EndFunc
+
+Func Mi34_TestSystem()
+ TestSystem_I2CMi32()
+EndFunc
+
+Func Mi34_GetAverage($hWnd)
+ Return GetAverage_I2CMi32($hWnd)
+EndFunc
+
+Func Mi34_SetClockType($clock)
+ SetClockType_I2CMi32($hWnd)
+EndFunc
+
+Func Mi34_GetVrefDelta()
+ Return 50
+EndFunc
#include-once
-Global $system = "Pegasus"
-Global $hWnd
-Global $hCounter
-$savedir = "O:\pegasus"
-$temperaturebefore = -10000
-
Func GetCounter()
Return ControlGetText($hWnd, "", $hCounter)
EndFunc ;==>GetCounter
ControlClick($hWnd, "", "[TEXT:Start Run;CLASS:TButton]")
EndFunc
-Func TestSystem()
+Func Pegasus_TestSystem()
WinWait("Debug")
ControlClick("Debug", "", "[TEXT:Messages Clear]")
Sleep(100)
EndFunc ;==>Mi34_SetVref
+
+Func Pegasus_CheckWindowExist() ; Check if Mimosa window exists
+ CheckWindowExist_I2CMi32()
+EndFunc ;==>CheckWindowExist
+
+Func Pegasus_CheckIfBoardOK()
+ CheckIfBoardOK_I2CMi32()
+EndFunc ;==>CheckIfBoardOK
+
+Func Pegasus_GotoTab($tabnum)
+ GotoTab_I2CMi32($tabnum)
+EndFunc ;==>GotoTab
+
+Func Pegasus_GotoDebugTab()
+ GotoDebugTab_I2CMi32()
+EndFunc ;==>GotoDebugTab
+
+Func Pegasus_ProgramMi()
+ ProgramMi_I2CMi32()
+EndFunc ;==>ProgramMi
+
+Func Pegasus_GetCounter()
+ GetCounter_I2CMi32()
+EndFunc ;==>GetCounter
+
+Func Pegasus_StopRun()
+ StopRun_I2CMi32()
+EndFunc
+
+Func Pegasus_StartRun()
+ StartRun_I2CMi32()
+EndFunc
+
+Func Pegasus_TestSystem()
+ TestSystem_I2CMi32()
+EndFunc
+
+Func Pegasus_GetAverage($hWnd)
+ GetAverage_I2CMi32($hWnd)
+EndFunc
+
+Func Pegasus_SetClockType($clock)
+ SetClockType_I2CMi32($clock)
+EndFunc
+
+Func Pegasus_GetVrefDelta()
+ Return 50 ; not used, use skrediver
+EndFunc
#include "mysql_functions.au3"
$objErr = ObjEvent("AutoIt.Error","MyErrFunc")
-$programversion = "1.2"
-$excelLineBegin = "1100" ; Change this to the range of cells you want to be processed
-$excelLineEnd = "4000"
+$programversion = "1.3"
Global $completelog = ""
Global $comment = ""
-$lastexcelcell = "Q"
-$CellRange = "A" & $excelLineBegin & ":" & $lastexcelcell & $excelLineEnd
-$cellSystem = 0
-$cellDate = 1
-$cellChipV = 3
-$cellRunNum = 4
-$cellTemp = 5
-$cellTempWait = 6
-$cellEventsN = 7
-$cellChipN = 8
-$cellVRef = 10
-$cellMatrix = 11
-$cellRadSrc = 12
-$cellClock = 13
-$cellRad = 14
-$cellTChip = 15
-$cellNote = 16
-
$estimate = 0
$totalrealruns = 0
$temperaturebefore = -10000
-Global $skippedruns[1] ; TODO fix skipping runs
+Global $skippedruns[1]
; set external parameters
$FileName = IniRead($configfile, "experimental setup", "ExcelPath", "H:\dennis doering\Arbeitsprogramme\Mimosa34\LaborbuchMi34_PXI.xls") ; read path to Excel file
+
$runid = $suitrun[0]
$TempCooling = $suitrun[1]
$TempWaitFor = $suitrun[2]
EndIf
Global $runnumber = $suitrun[4]
$matrix = $suitrun[5]
-$events = $suitrun[6]
\ No newline at end of file
+$events = $suitrun[6]
$i = 0
Do
- $oldcounter = GetCounter()
+ $oldcounter = _GetCounter()
$percentCurrent = Round($oldcounter / $events * 100, 3)
$percentoverall = Round(($oldcounter / $events / $totalruns + $totalrealruns / $totalruns) * 100, 3)
If Not $estimate And $percentCurrent > 5 Then
Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "' & $system & '" "Percent done: ' & $percentoverall & ' (' & $totalrealruns & '/' & $totalruns & ') TempChip: ' & $currenttempchip & '"', @ScriptDir)
EndIf
Sleep(10000)
- If ($oldcounter + 100 > GetCounter()) Then
+ If ($oldcounter + 100 > _GetCounter() And _GetCounter() < $events) Then
Sleep(50000)
- If ($oldcounter + 100 > GetCounter()) Then
+ If ($oldcounter + 100 > _GetCounter() And _GetCounter() < $events) Then
; StopRun()
Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\SendNtfctn.au3" "' & $system & '" "Skipped run ' & $runnumber & ', event counter froze."', @ScriptDir)
Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(48, ''Warning'', ''Skipped run ' & $runnumber & ', event counter froze.'')"')
EndIf
EndIf
$i = $i + 1
-Until (GetCounter() > $events)
+Until (_GetCounter() >= $events)
$temperaturechipend = GetTemperatureForSure("Chip" & $system)
\ No newline at end of file
+++ /dev/null
-;
-; AutoIt Version: 3.0
-; Language: English
-; Platform: Win9x/NT
-; Author: Benny Linnik (b.linnik@gsi.de)
-;
-; Script Function:
-; Automatically runs the USB or PXI system with data gathered from an Excel sheet
-$configfile = @ScriptDir & "\config_Pegasus.ini"
-#include "Functions\Header.au3"
-#include "Chips\Pegasus.au3"
-#include "Functions\SetChipClock.au3"
-#include "Functions\CommonFunctions.au3"
-#include "Functions\Checkdata.au3"
-Global $vref = 650 ; Initial vref, will be adjusted during runtime
-
-;create virtual functions
-Func GetVref()
- Return Call($chipversion & "_GetVref")
-EndFunc ;==>GetVref
-Func SetVref($vref)
- Call($chipversion & "_SetVref", $vref)
-EndFunc ;==>SetVref
-Func _GetAverage($hWnd)
- If $chipversion <> "Mi29" Then
- Return GetAverage()
- Else ; mimosa 29 ausnahme
- Return Call($chipversion & "_GetAverage", $hWnd)
- EndIf
-EndFunc ;==>_GetAverage
-Func _TestSystem()
- TestSystem()
-EndFunc ;==>_TestSystem
-
-If (Not @error) Then ; Check again if everything went well
- $totalruns = ReturnNumSuitRuns($chipversion, $chipinstalled, $radSource, "Pegasus")
-; ReturnSuitRuns($chipversion, $chipinstalled, $radSource, "Pegasus",$totalruns)
-
-
- If $totalruns > 0 Then ; Check if we retrieved any data
- Local $answer = MsgBox(4, "Total runs", "Number of suitable runs found at the moment: " & $totalruns)
- If $answer = 7 Then
- Exit
- EndIf
- RefreshGUISendNtfct("Starting with " & $totalruns & " runs.")
- Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
- If ProcessExists("daq.exe") = True Then
- ProcessClose("daq.exe")
- ProcessWaitClose("daq.exe")
- EndIf
- Local $sTitle = "CMOS USB DAQ V3.5.8"
- Run("C:\ccmos_daq\v3.5.7__5_boards\daq_v3.5.7__5_boards.bat", "C:\ccmos_daq\v3.5.7__5_boards\")
- If _TestSystem() Then Exit
- WinWait($sTitle)
- $hWnd = WinGetHandle($sTitle)
- $hTab = ControlGetHandle($hWnd, "", "TPageControl1")
- $hCounter = ControlGetHandle($hWnd, "", "TEdit42")
- $starttimetotal = _NowCalc()
- $suitrun = ReturnSuitRuns($chipversion, $chipinstalled, $radSource, "Pegasus")
- While Not $suitrun[0] = "" ; Do runs, until no new run found
- #include "Functions\ReadAndSaveSQLParameters.au3"
- #include "Functions\WaitForTemperature.au3"
- _GUICtrlTab_SetCurFocus($hTab, 2) ; Go to "Run parameter" tab
- Sleep(200)
- ControlSetText($hWnd, "", "TEdit16", "")
- Sleep(100)
- ControlFocus($hWnd, "", "TEdit16")
- ControlSend($hWnd, "", "TEdit16", $savedir)
- Sleep(100)
- ControlSetText($hWnd, "", "TEdit15", "")
- Sleep(100)
- ControlFocus($hWnd, "", "TEdit15")
- ControlSend($hWnd, "", "TEdit15", $runnumber)
- Sleep(100)
- ControlSetText($hWnd, "", "TEdit14", "")
- Sleep(100)
- ControlFocus($hWnd, "", "TEdit14")
- ControlSend($hWnd, "", "TEdit14", $events)
- Sleep(100)
- ControlFocus($hWnd, "", "TEdit15")
- Sleep(1000)
- $starttime = _NowCalc()
- StartRun()
- Sleep(1000)
- If (WinExists("Avertissement")) Then
- RefreshGUISendNtfct("Skipped run " & $runnumber & " could overwrite data.")
- _ArrayAdd($skippedruns, $runnumber)
- $comment = "Skipped: Could overwrite data."
- #include "Functions/SaveToSQL.au3"
- Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(48, ''Warning'', ''Skipped run ' & $runnumber & ', could overwrite data!'')"')
- ControlClick("Avertissement", "", "TButton1")
- ContinueLoop
- EndIf
- $avg = _GetAverage($hWnd)
-
-;~ Sleep(200)
-;~ $j = 0
-;~ If ($avg > 2300 Or $avg < 1700) Then
-;~ Do
-;~ ControlClick($hWnd, "", "[TEXT:Stop Run;CLASS:TButton]")
-;~ $vref = GetVref()
-;~ $diff = $avg - 2000
-;~ Select
-;~ Case Abs($diff) > 600
-;~ $vref = $vref + SGN($diff) * 100
-;~ Case Else
-;~ $vref = $vref + SGN($diff) * 50
-;~ EndSelect
-;~ If ($vref > 1000 Or $vref < 300) Then
-;~ StopRun()
-;~ RefreshGUISendNtfct("Skipped run " & $runnumber & ", vref value could not be set properly. Frequency: " & $clock)
-;~ _ArrayAdd($skippedruns, $runnumber)
-;~ Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(48, ''Warning'', ''Skipped run ' & $runnumber & ', vref value needs to be too low (<300) or too high (>1000), please check manually!'')"')
-;~ FileDelete($savedir & "/" & $runnumber & "/*")
-;~ $vref = 650
-;~ ContinueLoop 2
-;~ EndIf
-;~ SetVref($vref)
-;~ _ProgramMi()
-;~ WinWait($hWnd)
-;~ ;_GUICtrlTab_SetCurFocus($hTab, 2) ; Go to "Run parameter" tab
-;~ StartRun()
-;~ WinWait("Avertissement")
-;~ ControlClick("Avertissement", "", "TButton2")
-;~ Sleep(1000)
-;~ $avg = ControlGetText($hWnd, "", "[TEXT:DispAvg;CLASS:TEdit]")
-;~ Sleep(100)
-;~ $j = $j + 1
-;~ If ($j > 10) Then
-;~ StopRun()
-;~ RefreshGUISendNtfct("Skipped run " & $runnumber & ", vref value could not be set properly. Clock: " & $clock & " Mhz")
-;~ _ArrayAdd($skippedruns, $runnumber)
-;~ Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(48, ''Warning'', ''Skipped run ' & $runnumber & ', vref value needs to be too low (<300) or too high (>1000), please check manually!'')"')
-;~ FileDelete($savedir & "/" & $runnumber & "/*")
-;~ $vref = 650
-;~ ContinueLoop 2
-;~ EndIf
-;~ Until ($avg < 2300 And $avg > 1700)
-;~ EndIf
- #include "Functions\Watchrun.au3"
- _GUICtrlTab_SetCurFocus($hTab, 2) ; Go to "Run parameter" tab
- Sleep(100)
- StopRun()
- #include "Functions\SaveToSQL.au3"
- $totalrealruns = $totalrealruns + 1
- $completelog &= _NowCalc() & " Completed run " & $runnumber & ", " & $percentoverall & "% (" & $totalrealruns & "/" & $totalruns & ")" & @CRLF
- Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
- $suitrun = ReturnSuitRuns($chipversion, $chipinstalled, $radSource, "Pegasus")
- ConsoleWrite($suitrun[0])
- WEnd
- #include "Functions\PrintSucessMessage.au3"
- Else
- MsgBox(16, "SQL Data Test", "No suitable runs found")
- EndIf
-Else
- MsgBox(16, "Server fail", "Error: Could not open connection to mySQL server.")
-EndIf
-Func SGN($i)
- Return ($i > 0) - ($i < 0)
-EndFunc ;==>SGN
-Func CheckValues($vref, $matrix, $runnumber, $events, $clock)
- Return 0
-EndFunc ;==>CheckValues
; Author: Benny Linnik (b.linnik@gsi.de)
;
; Script Function:
-; Automatically runs the USB or PXI system with data gathered from an Excel sheet
+; Automatically runs the USB or PXI system with data gathered from an SQL database
+; System specific configuration, last run configuration
$configfile = @ScriptDir & "\config_USB.ini"
-#include "Functions\Header.au3"
-#include "Chips\Mimosa19.au3"
-#include "Chips\Mimosa29.au3"
+
+Global $system = "USB"
+Global $hWnd
+Global $hCounter
+Global $vref = 650 ; Initial vref, will be adjusted during runtime, depricated
+$temperaturebefore = -10000
+
+#include "Functions\Header.au3" ; init global variables
+#include "Chips\Mimosa19.au3" ; declare Mi19 specific (virtual) functions
+#include "Chips\Mimosa29.au3" ; declare Mi29 specific (virtual) functions
#include "Chips\Mimosa32.au3"
#include "Chips\Mimosa32Ter.au3"
#include "Chips\Mimosa34.au3"
-#include "Functions\SetChipClock.au3"
-#include "Functions\CommonFunctions.au3"
-#include "Functions\Checkdata.au3"
-Global $vref = 650 ; Initial vref, will be adjusted during runtime
+#include "Chips\Pipper2.au3"
+#include "Functions\SetChipClock.au3" ; SetChipClock() is defined here
+#include "Functions\CommonFunctions.au3" ; some common global functions which should be able to be called from everywhere
+#include "Functions\Checkdata.au3" ; Ask the user to run with given configuration
+
+$savedir = "F:\currentrun"
+$storedir = "O:\" & $chipversion
+If DirGetSize($storedir) == -1 Then
+ DirCreate ( $storedir )
+EndIf
-;create virtual functions
-Func GotoMiTab()
+; create virtual functions
+; chip specific functions
+Func _GotoMiTab() ; go to Mimosa
Call($chipversion & "_GotoMiTab")
EndFunc ;==>GotoMiTab
-Func GetVref()
+Func _GetVref()
Return Call($chipversion & "_GetVref")
EndFunc ;==>GetVref
-Func SetVref($vref)
+Func _SetVref($vref)
Call($chipversion & "_SetVref", $vref)
EndFunc ;==>SetVref
-Func SetMiParameter($matrix, $vref)
+Func _SetMiParameter($matrix, $vref)
Call($chipversion & "_SetMiParameter", $matrix, $vref)
EndFunc ;==>SetMiParameter
-Func SelectBoard()
+Func _SelectBoard()
Call($chipversion & "_SelectBoard")
EndFunc ;==>SelectBoard
Func _CheckWindowExist() ; Check if Mimosa window exists
- If $chipversion <> "Mi29" And $chipversion <> "Mi19" Then
- CheckWindowExist()
- EndIf
+ Call($chipversion & "_CheckWindowExist")
EndFunc ;==>_CheckWindowExist
Func _CheckIfBoardOK()
- If $chipversion <> "Mi29" And $chipversion <> "Mi19" Then
- CheckIfBoardOK()
- EndIf
+ Call($chipversion & "_CheckIfBoardOK")
EndFunc ;==>_CheckIfBoardOK
Func _GotoTab($tabnum)
- If $chipversion <> "Mi29" And $chipversion <> "Mi19" Then
- GotoTab($tabnum)
- EndIf
+ Call($chipversion & "_GotoTab", $tabnum)
EndFunc ;==>_GotoTab
Func _GotoDebugTab()
- If $chipversion <> "Mi29" And $chipversion <> "Mi19" Then
- GotoDebugTab()
- EndIf
+ Call($chipversion & "_GotoDebugTab")
EndFunc ;==>_GotoDebugTab
Func _ProgramMi()
- If $chipversion <> "Mi29" And $chipversion <> "Mi19" Then
- ProgramMi()
- EndIf
+ Call($chipversion & "_ProgramMi")
EndFunc ;==>_ProgramMi
Func _TestSystem()
- If $chipversion <> "Mi29" And $chipversion <> "Mi19" Then
- TestSystem()
- Else ; mimosa 29 und 19 ausnahme
- Call($chipversion & "_TestSystem")
- EndIf
-EndFunc ;==>_TestSystem
+ Call($chipversion & "_TestSystem")
+EndFunc ;==>_TestSystems
Func _GetAverage($hWnd)
- If $chipversion <> "Mi29" Then
- Return GetAverage()
- Else ; mimosa 29 ausnahme
- Return Call($chipversion & "_GetAverage", $hWnd)
- EndIf
+ Return Call($chipversion & "_GetAverage", $hWnd)
EndFunc ;==>_GetAverage
+Func _GetCounter()
+;~ not chip specific
+;~ Return ControlGetText($hWnd, "", $hCounter)
+ Return Call($chipversion & "_GetCounter")
+EndFunc ;==>__GetCounter
+Func _StartRun()
+ Call($chipversion & "_StartRun")
+EndFunc
+Func _StopRun()
+ Call($chipversion & "_StopRun")
+EndFunc
+Func _SetClockType($clock)
+ Call($chipversion & "_SetClockType", $clock)
+EndFunc
+Func _GetVrefDelta()
+ Return Call($chipversion & "_GetVrefDelta")
+EndFunc
+
If (Not @error) Then ; Check again if everything went well
$totalruns = ReturnNumSuitRuns($chipversion, $chipinstalled, $radSource, "USB")
If $totalruns > 0 Then ; Check if we retrieved any data
Local $answer = MsgBox(4, "Total runs", "Number of suitable runs found at the moment: " & $totalruns)
- If $answer = 7 Then
+ If $answer = 7 Then ; Cancel
Exit
EndIf
RefreshGUISendNtfct("Starting with " & $totalruns & " runs.")
#include "Functions\ReadAndSaveSQLParameters.au3"
#include "Functions\WaitForTemperature.au3"
_CheckWindowExist()
- SelectBoard()
+ _SelectBoard()
_CheckIfBoardOK()
- ControlCommand("I2C control Software for Mimosa32", "", "[TEXT:Intern]", "Check")
- If ($clock <> "100") Then
- SetChipClock($clock)
- ControlCommand("I2C control Software for Mimosa32", "", "[TEXT:Extern]", "Check")
- EndIf
- GotoMiTab()
- SetMiParameter($matrix, $vref)
- ProgramMi()
+ _SetClockType($clock)
+ _GotoMiTab()
+ _SetMiParameter($matrix, $vref)
+ _ProgramMi()
_GUICtrlTab_SetCurFocus($hTab, 2) ; Go to "Run parameter" tab
Sleep(200)
;$savedir = ControlGetText($hWnd, "", "TEdit24") ; get directorys to save file to
Sleep(1000)
RefreshGUISendNtfct("Begin with runnumber " & $runnumber & ".")
$starttime = _NowCalc()
- StartRun()
+ _StartRun()
Sleep(1000)
If (WinExists("Avertissement")) Then
RefreshGUISendNtfct("Skipped run " & $runnumber & " could overwrite data.")
Sleep(200)
$j = 0
- If ($avg > 2150 Or $avg < 1500) Then ; change 1400 back to 1700
+ If ($avg > 1100 Or $avg < 900) Then ; change 1400 back to 1700; was 2150 and 1750 at 4.10.2016
Do
ControlClick($hWnd, "", "[TEXT:Stop Run;CLASS:TButton]")
- $vref = GetVref()
- $diff = $avg - 2000
+ $vref = _GetVref()
+ $diff = $avg - 1000 ; was 2000 at 4.10.2016
Select
- Case Abs($diff) > 600
- $vref = $vref + SGN($diff) * 100
+ Case Abs($diff) > 500
+ $vref = $vref + SGN($diff) * Number(_GetVrefDelta()*2)
Case Else
- $vref = $vref + SGN($diff) * 50
+ $vref = $vref + SGN($diff) * Number(_GetVrefDelta())
EndSelect
- If ($vref > 1000 Or $vref < 300) Then
- StopRun()
+ If ($vref > 1000 Or $vref < 200) Then
+ _StopRun()
RefreshGUISendNtfct("Skipped run " & $runnumber & ", vref value could not be set properly. Frequency: " & $clock)
_ArrayAdd($skippedruns, $runnumber)
Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(48, ''Warning'', ''Skipped run ' & $runnumber & ', vref value needs to be too low (<300) or too high (>1000), please check manually!'')"')
$suitrun = ReturnSuitRun($chipversion, $chipinstalled, $radSource, "USB")
ContinueLoop 2
EndIf
- SetVref($vref)
+ _SetVref($vref)
_ProgramMi()
WinWait($hWnd)
;_GUICtrlTab_SetCurFocus($hTab, 2) ; Go to "Run parameter" tab
- StartRun()
+ _StartRun()
WinWait("Avertissement")
ControlClick("Avertissement", "", "TButton2")
Sleep(1000)
Sleep(100)
$j = $j + 1
If ($j > 10) Then
- StopRun()
+ _StopRun()
RefreshGUISendNtfct("Skipped run " & $runnumber & ", vref value could not be set properly. Clock: " & $clock & " Mhz")
_ArrayAdd($skippedruns, $runnumber)
Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(48, ''Warning'', ''Skipped run ' & $runnumber & ', vref value needs to be too low (<300) or too high (>1000), please check manually!'')"')
$suitrun = ReturnSuitRun($chipversion, $chipinstalled, $radSource, "USB")
ContinueLoop 2
EndIf
- Until ($avg < 2300 And $avg > 1700)
+ Until ($avg < 1100 And $avg > 900)
EndIf
#include "Functions\Watchrun.au3"
_GUICtrlTab_SetCurFocus($hTab, 2) ; Go to "Run parameter" tab
Sleep(100)
- StopRun()
+ _StopRun()
Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\MoveFolder.au3" "' & $savedir & '" "' & $storedir & '" "' & $runnumber & '"')
#include "Functions\SaveToSQL.au3"
$totalrealruns = $totalrealruns + 1
[experimental setup]
-ChipVersion = Mi34
-ChipInstalled = 20
-RadSource = Sr90
+ChipVersion = Pipper2
+ChipInstalled = 1
+RadSource = Fe55
[various]
-Notify = 0
+Notify = 1
NotifyCustom = (Optional)
[experimental setup]
-ChipVersion = Mi19
-ChipInstalled = 10
-RadSource = none
+ChipVersion = Pipper2
+ChipInstalled = 1
+RadSource = Fe55
[various]
-Notify = 0
+Notify = 1
NotifyCustom = (Optional)