Guten abend zusammen habe da nen prop mit meiner schleife
[autoit]#Include <Constants.au3>
#include <GUIConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
$DLLFileAndPath = @ScriptDir & "/inpout32.dll"
$PortAddress = "0x378"
Dim $on = 1, $off = 0
[/autoit][autoit][/autoit][autoit][/autoit][autoit]#Region ### START Koda GUI section ### Form=C:\Dokumente und Einstellungen\tester\Desktop\LPT MSR - Lauflicht.kxf
$Form1 = GUICreate("LPT MSR - Lauflicht Steuerung", 354, 266, 567, 275)
$Slider = GUICtrlCreateSlider(16, 160, 158, 45)
$multi = GUICtrlCreateInput("10", 16, 232, 45, 21)
GUICtrlSetCursor (-1, 5)
$Label1 = GUICtrlCreateLabel("Geschwindigkeit", 16, 136, 82, 17)
$Label2 = GUICtrlCreateLabel("Time Multiplikator", 16, 208, 86, 17)
$Label3 = GUICtrlCreateLabel("Zeit/ms", 120, 208, 40, 17)
$output_T = GUICtrlCreateInput("", 120, 232, 50, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_READONLY))
$Einzeln = GUICtrlCreateRadio("Einzeln", 16, 8, 113, 17)
$Paarweise = GUICtrlCreateRadio("Paarweise", 16, 40, 113, 17)
$Schlange = GUICtrlCreateRadio("Schlange", 16, 72, 113, 17)
$Start = GUICtrlCreateButton("Start", 184, 232, 75, 25, 0)
$Richtung = GUICtrlCreateCheckbox("Richtung", 16, 104, 97, 17)
$Refresh = GUICtrlCreateButton("Refresh", 264, 232, 75, 25, 0)
$Ausgabe = GUICtrlCreateGroup("Ausgabe", 192, 8, 137, 217)
$B0 = GUICtrlCreateRadio("Lampe 1", 208, 32, 113, 17)
$B1 = GUICtrlCreateRadio("Lampe 2", 208, 56, 113, 17)
$B2 = GUICtrlCreateRadio("Lampe 3", 208, 80, 113, 17)
$B3 = GUICtrlCreateRadio("Lampe 4", 208, 104, 113, 17)
$B4 = GUICtrlCreateRadio("Lampe 5", 208, 128, 113, 17)
$B5 = GUICtrlCreateRadio("Lampe 6", 208, 152, 113, 17)
$B6 = GUICtrlCreateRadio("Lampe 7", 208, 176, 113, 17)
$B7 = GUICtrlCreateRadio("Lampe 8", 208, 200, 113, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Refresh
SetLPTPortPins($PortAddress, $off, $off, $off, $off, $off, $off, $off, $off)
EndSwitch
$time = GUICtrlRead($Slider) * GUICtrlRead($multi)
GUICtrlSetData($output_T, $time)
Select
Case $nMsg = $Start And BitAND(GUICtrlRead($Einzeln), $GUI_CHECKED) = $GUI_CHECKED
einzeln()
Case $nMsg = $Start And BitAND(GUICtrlRead($Paarweise), $GUI_CHECKED) = $GUI_CHECKED
[/autoit][autoit][/autoit][autoit]Case $nMsg = $Start And BitAND(GUICtrlRead($Schlange), $GUI_CHECKED) = $GUI_CHECKED
EndSelect
WEnd
[/autoit][autoit][/autoit][autoit][/autoit][autoit]Func einzeln()
GUICtrlSetData($Start, "Stop")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Start
ExitLoop
EndSwitch
SetLPTPortPins($PortAddress, $on, $off, $off, $off, $off, $off, $off, $off)
Sleep($time)
SetLPTPortPins($PortAddress, $off, $on, $off, $off, $off, $off, $off, $off)
Sleep($time)
SetLPTPortPins($PortAddress, $off, $off, $on, $off, $off, $off, $off, $off)
Sleep($time)
SetLPTPortPins($PortAddress, $off, $off, $off, $on, $off, $off, $off, $off)
Sleep($time)
SetLPTPortPins($PortAddress, $off, $off, $off, $off, $on, $off, $off, $off)
Sleep($time)
SetLPTPortPins($PortAddress, $off, $off, $off, $off, $off, $on, $off, $off)
Sleep($time)
SetLPTPortPins($PortAddress, $off, $off, $off, $off, $off, $off, $on, $off)
Sleep($time)
SetLPTPortPins($PortAddress, $off, $off, $off, $off, $off, $off, $off, $on)
WEnd
GUICtrlSetData($Start, "Start")
EndFunc
;Functions -> where the action happens!
Func SetLPTPortPins($WriteAddress, $Bit0, $Bit1, $Bit2, $Bit3, $Bit4, $Bit5, $Bit6, $Bit7)
;Convert bits to BCD
$BCD = 0
If $Bit0 = 1 Then $BCD = $BCD + 1
If $Bit1 = 1 Then $BCD = $BCD + 2
If $Bit2 = 1 Then $BCD = $BCD + 4
If $Bit3 = 1 Then $BCD = $BCD + 8
If $Bit4 = 1 Then $BCD = $BCD + 16
If $Bit5 = 1 Then $BCD = $BCD + 32
If $Bit6 = 1 Then $BCD = $BCD + 64
If $Bit7 = 1 Then $BCD = $BCD + 128
;pass the call to inpout32.dll
DllCall( $DLLFileAndPath, "int", "Out32", "int", $WriteAddress, "int", $BCD)
EndFunc ;==>SetLPTPortPins