Global $system = "USB"
Global $hWnd
Global $hCounter
-$savedir = "F:\Mi32"
+$savedir = "O:\Mi34"
Global $vref = 650 ; Initial vref, will be adjusted during runtime
$temperaturebefore = -10000
WinWaitClose("Debug", 1000)
Return 0
EndFunc
+
+Func GetAverage()
+ Return ControlGetText($hWnd, "", "[TEXT:DispAvg;CLASS:TEdit]")
+EndFunc
Global $vi
Global $system = "PXI"
$savedir = "C:\data\currentrun"
-$storedir = "K:\Mi32"
+$storedir = "H:\Mi34"
Global $vref = 1000 ; Initial vref, will be adjusted during runtime
$temperaturebefore = -10000
$vi.SetControlValue("Auto update", "1")
Sleep(1000)
$vi.SetControlValue(" Load conf file" & @LF & "Upd clk shift", "1")
+ Sleep(1000)
EndFunc ;==>ProgramMi
Func SetMiParameter($matrix, $vref)
Func StopRun()
$vi.SetControlValue("Stop Run DUT", "1")
- Sleep(100)
+ Sleep(200)
+ $vi.SetControlValue("Stop Run DUT", "0")
+ Sleep(1000)
+ $vi.SetControlValue("Stop Run DUT", "1")
+ Sleep(200)
$vi.SetControlValue("Stop Run DUT", "0")
EndFunc
$excelLineBegin = "1100" ; Change this to the range of cells you want to be processed
$excelLineEnd = "4000"
Global $completelog = ""
+Global $comment = ""
$lastexcelcell = "Q"
$CellRange = "A" & $excelLineBegin & ":" & $lastexcelcell & $excelLineEnd
$returnval = MoveFolder($CmdLine[1], $CmdLine[2])
ElseIf ($CmdLine[0] = 3) Then
$returnval = MoveFolders($CmdLine[1], $CmdLine[2], $CmdLine[3])
-EndIf
+ EndIf
ConsoleWrite($returnval) ;### Debug Console
Exit $returnval
Func MoveFolders($src, $dst, $runnumber)
For $i = 0 To 2
- DirCopy ( $src & $runnumber-$i, $dst & $runnumber-$i )
- FileDelete($src & $runnumber-$i & "\*")
- DirRemove( $src & $runnumber-$i )
+ DirCopy ( $src & "\" & $runnumber-$i, $dst & "\" & $runnumber-$i )
+ DirRemove( $src & "\" & $runnumber-$i "\", 1)
Next
Return 0
EndFunc ;==>MoveFolder
\ No newline at end of file
If $temperaturechipstart = 100000 Then $temperaturechipstart = "NULL"
If $temperaturechipend = 100000 Then $temperaturechipstart = "NULL"
$datetime = @YEAR & "-" & @MON & "-" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC
-if (IsDeclared($storedir)) Then
- $path = $storedir & "\\" & $runnumber
+if (IsDeclared("storedir")) Then
+ $path = StringReplace ( $storedir, "\", "\\") & "\\" & $runnumber
Else
- $path = $savedir & "\\" & $runnumber
+ $path = StringReplace ( $savedir, "\", "\\") & "\\" & $runnumber
+EndIf
+$path = StringReplace ( $path, "/", "//")
+If StringLen($comment) > 0 Then
+ UpdateDBwithErrorRun($runid, $datetime, $temperaturechipstart, $temperaturechipend, $vref, $calcsec, $programversion, $path, $comment)
+ $comment = ""
+Else
+ UpdateDBwithRun($runid, $datetime, $temperaturechipstart, $temperaturechipend, $vref, $calcsec, $programversion, $path)
EndIf
-UpdateDBwithRun($runid, $datetime, $temperaturechipstart, $temperaturechipend, $vref, $calcsec, $programversion, $path)
EndIf
If $notifyDennis Then
- $oHTTP.Open("GET", "http://autoremotejoaomgcd.appspot.com/sendmessage?key=APA91bHCZjLkmISyt3lHjn-ym1Md9SymV5hKq05gxuPKXSMVm6e1rphU55sjiQNfQOIUpzoNqCU8kGXLwDJTRksMBRgk62dW5N_Go69dchFvfYqNIKKrvG26FGBPjKea06PU6IPxLPm0WWSM53k7QIQj0EZtMSNxpg&message=RadHard:%20System-" & $system & ":%20" & $text & "&password=mimosa")
+ $oHTTP.Open("GET", "http://autoremotejoaomgcd.appspot.com/sendmessage?key=APA91bE1HCR2s8feQdqsd627pLSiuEAYdDd6iqJdopTdGm06cs45P5f6_Z6lh_ody3zUmm9saW77jUwXLNTwlpEQHT3oUyh-vHfZmKptg3wdBMtYUr4kWqXhRbs3g0i36Y33-m4LFZb_toVrOn90J0Dkes5eMUTXaHu9Ko1pIUZgsqQ48whM3dY&message=RadHard:%20System-" & $system & ":%20" & $text & "&password=Mimosasasa")
$oHTTP.Send()
EndIf
WITH $oHTTP
Switch $system
Case "USB"
- .Open("GET", "http://cerberus.x-matter.uni-frankfurt.de:8700/tools/cooling/cooling.pl?/dev/USBCooling")
+ ;.Open("GET", "http://cerberus.x-matter.uni-frankfurt.de:8700/tools/cooling/cooling.pl?/dev/USBCooling")
+ .Open("GET", "http://cerberus.x-matter.uni-frankfurt.de:8700/tools/cooling/cooling.pl?/dev/PXICooling")
Case "PXI"
.Open("GET", "http://cerberus.x-matter.uni-frankfurt.de:8700/tools/cooling/cooling.pl?/dev/PXICooling")
EndSwitch
WITH $oHTTP
Switch $system
Case "USB"
- .Open("GET", "http://cerberus.x-matter.uni-frankfurt.de:8700/tools/cooling/cooling.pl?/dev/USBCooling&" & $command)
+ ;.Open("GET", "http://cerberus.x-matter.uni-frankfurt.de:8700/tools/cooling/cooling.pl?/dev/USBCooling&" & $command)
+ .Open("GET", "http://cerberus.x-matter.uni-frankfurt.de:8700/tools/cooling/cooling.pl?/dev/PXICooling&" & $command)
Case "PXI"
.Open("GET", "http://cerberus.x-matter.uni-frankfurt.de:8700/tools/cooling/cooling.pl?/dev/PXICooling&" & $command)
EndSwitch
$tempwaiti = 0 ; set the 5 minutes wait counter to zero if it reaches 6 -> 30 minutes passed
While Not $tempcorrent
$currenttemp = GetTemperatureForSure($system)
+ ;$currenttemp = 100000 ; delete me TODO
If $currenttemp == 100000 Then
RefreshGUISendNtfct("Could not get temperature. Will assume it is set correctly. Please check manually later.")
$tempcorrent = True
Sleep($TempWaitFor * 60 * 1000) ; wait for user specified minutes
EndIf
$temperaturebefore = $TempCooling ; if next run has the same needed temperature as this run, dont check for cooling water temperature, see the first lines of this file for details
-$temperaturechipstart = GetTemperatureForSure("Chip" & $system)
\ No newline at end of file
+$temperaturechipstart = GetTemperatureForSure("Chip" & $system)
+$temperaturechipend = $temperaturechipstart
\ No newline at end of file
EndIf
Sleep(10000)
If ($oldcounter == GetCounter()) 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.'')"')
- $completelog &= _NowCalc() & " Skipped run " & $runnumber & ", event counter froze." & @CRLF
- Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
- FileDelete($savedir & "\" & $runnumber & "\*")
- DirRemove($savedir & "\" & $runnumber)
- ContinueLoop 2
+ Sleep(10000)
+ If ($oldcounter == GetCounter()) 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.'')"')
+ $completelog &= _NowCalc() & " Skipped run " & $runnumber & ", event counter froze." & @CRLF
+ Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir & '\Functions\RefreshGUI.au3" "' & $completelog & '"')
+ $comment = "Event counter froze"
+ #include "SaveToSQL.au3"
+;~ UpdateDBwithErrorRun($runid, $datetime, $temperaturechipstart, $temperaturechipend, $vref, $calcsec, $programversion, $path, "Event counter froze")
+;~ FileDelete($savedir & "\" & $runnumber & "\*")
+;~ DirRemove($savedir & "\" & $runnumber)
+ ContinueLoop 2
+ EndIf
EndIf
$i = $i + 1
Until (GetCounter() > $events)
_MySQLEnd($sql)
EndFunc
+Func UpdateDBwithErrorRun($id, $datetime, $temperaturechipstart, $temperaturechipend, $vref, $calcsec, $programversion, $path, $comment)
+ $sql = GetSQLConnection()
+
+ $sqlstring = "UPDATE labbook SET " & _
+ "datetime='" & $datetime & "', " & _
+ "TempChipStart=" & $temperaturechipstart & ", " & _
+ "TempChipEnd=" & $temperaturechipend & ", " & _
+ "VRef=" & $vref & ", " & _
+ "Runtime=" & $calcsec & ", " & _
+ "MABSV='" & $programversion & "', " & _
+ "StorePath='" & $path & "', " & _
+ "MABS_comment='" & $comment & "' " & _
+ "WHERE id=" & $id
+
+ ConsoleWrite($sqlstring)
+ _Query($sql, $sqlstring)
+
+ _MySQLEnd($sql)
+EndFunc
+
Func ReturnNumSuitRuns($ChipGen, $ChipNum, $ChipRadiation, $RadiationSource, $System, $Clock=0)
$sql = GetSQLConnection()
$sqlstring = "ChipGen='" & $ChipGen & "' AND " & _
"ChipNum='" & $ChipNum & "' AND " & _
"RadiationSource='" & $RadiationSource & "' AND " & _
- "ChipRadiation=" & $ChipRadiation & " AND " & _
"System='" & $System & "' AND " & _
+ "MABS_comment IS NULL AND " & _
"(datetime='1970-01-01 00:00:00' OR datetime IS NULL OR datetime='0000-00-00 00:00:00')"
If $clock <> 0 Then $sqlstring = $sqlstring & " AND Clock=" & $Clock
_MySQLEnd($sql)
ConsoleWrite("ReturnNumSuitRuns: " & $number & @CRLF)
Return $number
+; "'ChipRadiation Ion'=" & $ChipRadiation & " AND " & _
EndFunc
$sqlstring = $sqlstring & "ChipGen='" & $ChipGen & "' AND "
$sqlstring = $sqlstring & "ChipNum='" & $ChipNum & "' AND "
$sqlstring = $sqlstring & "RadiationSource='" & $RadiationSource & "' AND "
- $sqlstring = $sqlstring & "ChipRadiation=" & $ChipRadiation & " AND "
+ ;$sqlstring = $sqlstring & "'ChipRadiation Ion'=" & $ChipRadiation & " AND "
$sqlstring = $sqlstring & "System='" & $System & "' AND "
+ $sqlstring = $sqlstring & "MABS_comment IS NULL AND "
$sqlstring = $sqlstring & "(datetime='1970-01-01 00:00:00' OR datetime IS NULL OR datetime='0000-00-00 00:00:00')"
If $clock <> 0 Then $sqlstring = $sqlstring & " AND Clock=" & $Clock
$sqlstring = $sqlstring & " LIMIT 1"
#include "Functions\WaitForTemperature.au3"
SetMiParameter($matrix, $vref)
ProgramMi()
- Sleep(200)
$vi.SetControlValue("Run directory", $savedir) ; get directorys to save file to
$vi.SetControlValue("Run Number", $runnumber)
$vi.SetControlValue("Events number in run", $events)
Case Else
$vref = $vref + SGN($diff) * 5
EndSelect
- If ($vref > 1500 Or $vref < 300) Then
+ If ($vref > 1500 Or $vref < 0) Then
StopRun()
RefreshGUISendNtfct("Skipped run " & $runnumber & ", vref value could not be set properly. Frequency: " & $clock)
Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(48, ''Warning'', ''Skipped run ' & $runnumber & ', vref value needs to be too low (<300) or too high (>1500), please check manually!'')"')
Func _TestSystem()
If $chipversion <> "Mi29" Then
TestSystem()
- Else ; mimosa 20 ausnahme
+ Else ; mimosa 29 ausnahme
Call($chipversion & "_TestSystem")
EndIf
EndFunc ;==>_TestSystem
Func _GetAverage($hWnd)
If $chipversion <> "Mi29" Then
- Return GetAverage($hWnd)
- Else ; mimosa 20 ausnahme
+ Return GetAverage()
+ Else ; mimosa 29 ausnahme
Return Call($chipversion & "_GetAverage", $hWnd)
EndIf
EndFunc ;==>_GetAverage
ProgramMi()
_GUICtrlTab_SetCurFocus($hTab, 2) ; Go to "Run parameter" tab
Sleep(200)
- $savedir = ControlGetText($hWnd, "", "TEdit24") ; get directorys to save file to
+ ;$savedir = ControlGetText($hWnd, "", "TEdit24") ; get directorys to save file to
+ ;GUICtrlSetState($hWnd, "", "TCheckBox6", "")
+ ControlSetText($hWnd, "", "TEdit24", "")
+ Sleep(100)
+ ControlFocus($hWnd, "", "TEdit24")
+ ControlSend($hWnd, "", "TEdit24", $savedir)
+ Sleep(100)
ControlSetText($hWnd, "", "TEdit23", "")
Sleep(100)
ControlFocus($hWnd, "", "TEdit23")
Sleep(1000)
If (WinExists("Avertissement")) Then
RefreshGUISendNtfct("Skipped run " & $runnumber & " could overwrite data.")
+ $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
[experimental setup]
ChipVersion = Mi34
-ChipInstalled = 3
+ChipInstalled = 5
ExcelPath = H:\dennis doering\Arbeitsprogramme\Mimosa34\LaborbuchMi34 - Neu2.xls
RadSource = Fe55
-Radiated = 3
+Radiated = 0
[various]
-Notify = 3
+Notify = 1
NotifyCustom = (Optional)
[experimental setup]
-ChipVersion = Mi32Ter
-ChipInstalled = 5d
+ChipVersion = Mi34
+ChipInstalled = 23
ExcelPath = H:\dennis doering\Arbeitsprogramme\Mimosa34\LaborbuchMi34 - Neu.xls
-RadSource = none
-Radiated = 0
+RadSource = Sr90
+Radiated =
[various]
Notify = 3
-NotifyCustom = (Optional)
+NotifyCustom = doering@physik.uni-frankfurt.de