Zuerst auslesen (GuiCtrlRead) dann schreiben (GuiCtrlSetData).
Beiträge von funkey
-
-
Alles Gute ihr zwei!! Macht weiter so!
Für Raupi
-
-
Ist das nur bei mir so, oder ist das nur noch niemanden aufgefallen??

Die Prozente und die Anzahl der Stimmen können nicht stimmen!Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist. -
Hab mal wieder was kleines gebastelt. Vllt gefällt es ja dem einen oder anderen.
mfg funkey
Spoiler anzeigen
[autoit]Local $hGui = GUICreate("GuiCtrlLCDNumber by funkey", 800)
[/autoit] [autoit][/autoit] [autoit]Local $LCDNum1 = _GuiCtrlLCDNumber_Create(10, 10, 20, 30, 10, 0xff0000, 0xafafa0)
[/autoit] [autoit][/autoit] [autoit]
_GuiCtrlLCDNumber_SetValue($LCDNum1, "0123456789")Local $LCDNum2 = _GuiCtrlLCDNumber_Create(10, 70, 20, 40, 6)
[/autoit] [autoit][/autoit] [autoit]Local $LCDNum3 = _GuiCtrlLCDNumber_Create(10, 120, 120, 240, 6, 0xffa0, 0x0)
[/autoit] [autoit][/autoit] [autoit]_GuiCtrlLCDNumber_SetValue($LCDNum3, "345678")
[/autoit] [autoit][/autoit] [autoit]
If @error Then MsgBox(16, "Error " & @error, "The value you wanted to set is invalid!", 0, $hGui)GUISetState()
[/autoit] [autoit][/autoit] [autoit]AdlibRegister("_Update", 1000)
[/autoit] [autoit][/autoit] [autoit]Do
[/autoit] [autoit][/autoit] [autoit]
Sleep(20)
Until GUIGetMsg() = -3Func _Update()
[/autoit] [autoit][/autoit] [autoit]
_GuiCtrlLCDNumber_SetValue($LCDNum2, StringFormat("%s%s%s", @hour, @min, @SEC))
EndFuncFunc _GuiCtrlLCDNumber_Create($x, $y, $w = 20, $h = 40, $iCount = 1, $iCol = 0, $iBkCol = Default)
[/autoit] [autoit][/autoit] [autoit]
Local $aRet[3] = [GUICtrlCreateDummy()]
Local $iThick = $w / 8
For $i = 0 To $iCount - 1
GUICtrlCreateGraphic($x + $i * $w, $y, $w, $h, 0)
GUICtrlSetBkColor(-1, $iBkCol)GUICtrlCreateGraphic($x + $i * $w, $y, $w, $h, 0)
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetGraphic(-1, 24, $iThick) ;$GUI_GR_PENSIZE
GUICtrlSetGraphic(-1, 8, $iCol) ;$GUI_GR_COLOR
GUICtrlSetGraphic(-1, 6, 1.5*$iThick, $iThick) ;$GUI_GR_MOVE
GUICtrlSetGraphic(-1, 2, $w - 1.5*$iThick, $iThick) ;$GUI_GR_LINE
GUICtrlSetGraphic(-1, 24, $iThick/2) ;$GUI_GR_PENSIZE
GUICtrlSetGraphic(-1, 8, $iCol) ;$GUI_GR_COLOR
GUICtrlSetGraphic(-1, 14, $iThick, $iThick, $iThick/2, -30, 60) ;$GUI_GR_PIE
GUICtrlSetGraphic(-1, 14, $w - $iThick, $iThick, $iThick/2, 150, 60) ;$GUI_GR_PIE
GUICtrlCreateGraphic($x + $i * $w, $y, $w, $h, 0)
GUICtrlSetGraphic(-1, 24, $iThick) ;$GUI_GR_PENSIZE
GUICtrlSetGraphic(-1, 8, $iCol) ;$GUI_GR_COLOR
GUICtrlSetGraphic(-1, 6, 1.5*$iThick, $h/2) ;$GUI_GR_MOVE
GUICtrlSetGraphic(-1, 2, $w - 1.5*$iThick, $h/2) ;$GUI_GR_LINE
GUICtrlSetGraphic(-1, 24, $iThick/2) ;$GUI_GR_PENSIZE
GUICtrlSetGraphic(-1, 8, $iCol) ;$GUI_GR_COLOR
GUICtrlSetGraphic(-1, 14, $iThick, $h/2, $iThick/2, -30, 60) ;$GUI_GR_PIE
GUICtrlSetGraphic(-1, 14, $w - $iThick, $h/2, $iThick/2, 150, 60) ;$GUI_GR_PIE
GUICtrlCreateGraphic($x + $i * $w, $y, $w, $h, 0)
GUICtrlSetGraphic(-1, 24, $iThick) ;$GUI_GR_PENSIZE
GUICtrlSetGraphic(-1, 8, $iCol) ;$GUI_GR_COLOR
GUICtrlSetGraphic(-1, 6, 1.5*$iThick, $h-$iThick) ;$GUI_GR_MOVE
GUICtrlSetGraphic(-1, 2, $w - 1.5*$iThick, $h-$iThick) ;$GUI_GR_LINE
GUICtrlSetGraphic(-1, 24, $iThick/2) ;$GUI_GR_PENSIZE
GUICtrlSetGraphic(-1, 8, $iCol) ;$GUI_GR_COLOR
GUICtrlSetGraphic(-1, 14, $iThick, $h-$iThick, $iThick/2, -30, 60) ;$GUI_GR_PIE
GUICtrlSetGraphic(-1, 14, $w - $iThick, $h-$iThick, $iThick/2, 150, 60) ;$GUI_GR_PIE
GUICtrlCreateGraphic($x + $i * $w, $y, $w, $h, 0)
GUICtrlSetGraphic(-1, 24, $iThick) ;$GUI_GR_PENSIZE
GUICtrlSetGraphic(-1, 8, $iCol) ;$GUI_GR_COLOR
GUICtrlSetGraphic(-1, 6, $iThick/1.5, 2*$iThick) ;$GUI_GR_MOVE
GUICtrlSetGraphic(-1, 2, $iThick/1.5, $h/2 - $iThick) ;$GUI_GR_LINE
GUICtrlSetGraphic(-1, 24, $iThick/2) ;$GUI_GR_PENSIZE
GUICtrlSetGraphic(-1, 8, $iCol) ;$GUI_GR_COLOR
GUICtrlSetGraphic(-1, 14, $iThick/1.5, 1.5*$iThick, $iThick/2, -120, 60) ;$GUI_GR_PIE
GUICtrlSetGraphic(-1, 14, $iThick/1.5, $h/2 - $iThick/2, $iThick/2, 60, 60) ;$GUI_GR_PIEGUICtrlCreateGraphic($x + $i * $w, $y, $w, $h, 0)
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetGraphic(-1, 24, $iThick) ;$GUI_GR_PENSIZE
GUICtrlSetGraphic(-1, 8, $iCol) ;$GUI_GR_COLOR
GUICtrlSetGraphic(-1, 6, $w - $iThick/1.5, 2*$iThick) ;$GUI_GR_MOVE
GUICtrlSetGraphic(-1, 2, $w - $iThick/1.5, $h/2 - $iThick) ;$GUI_GR_LINE
GUICtrlSetGraphic(-1, 24, $iThick/2) ;$GUI_GR_PENSIZE
GUICtrlSetGraphic(-1, 8, $iCol) ;$GUI_GR_COLOR
GUICtrlSetGraphic(-1, 14, $w - $iThick/1.5, 1.5*$iThick, $iThick/2, -120, 60) ;$GUI_GR_PIE
GUICtrlSetGraphic(-1, 14, $w - $iThick/1.5, $h/2 - $iThick/2, $iThick/2, 60, 60) ;$GUI_GR_PIEGUICtrlCreateGraphic($x + $i * $w, $y, $w, $h, 0)
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetGraphic(-1, 24, $iThick) ;$GUI_GR_PENSIZE
GUICtrlSetGraphic(-1, 8, $iCol) ;$GUI_GR_COLOR
GUICtrlSetGraphic(-1, 6, $iThick/1.5, $h/2 + $iThick) ;$GUI_GR_MOVE
GUICtrlSetGraphic(-1, 2, $iThick/1.5, $h - 2*$iThick) ;$GUI_GR_LINE
GUICtrlSetGraphic(-1, 24, $iThick/2) ;$GUI_GR_PENSIZE
GUICtrlSetGraphic(-1, 8, $iCol) ;$GUI_GR_COLOR
GUICtrlSetGraphic(-1, 14, $iThick/1.5, $h/2 + $iThick/2, $iThick/2, -120, 60) ;$GUI_GR_PIE
GUICtrlSetGraphic(-1, 14, $iThick/1.5, $h - 1.5*$iThick, $iThick/2, 60, 60) ;$GUI_GR_PIEGUICtrlCreateGraphic($x + $i * $w, $y, $w, $h, 0)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
GUICtrlSetGraphic(-1, 24, $iThick) ;$GUI_GR_PENSIZE
GUICtrlSetGraphic(-1, 8, $iCol) ;$GUI_GR_COLOR
GUICtrlSetGraphic(-1, 6, $w - $iThick/1.5, $h/2 + $iThick) ;$GUI_GR_MOVE
GUICtrlSetGraphic(-1, 2, $w - $iThick/1.5, $h - 2*$iThick) ;$GUI_GR_LINE
GUICtrlSetGraphic(-1, 24, $iThick/2) ;$GUI_GR_PENSIZE
GUICtrlSetGraphic(-1, 8, $iCol) ;$GUI_GR_COLOR
GUICtrlSetGraphic(-1, 14, $w - $iThick/1.5, $h/2 + $iThick/2, $iThick/2, -120, 60) ;$GUI_GR_PIE
GUICtrlSetGraphic(-1, 14, $w - $iThick/1.5, $h - 1.5*$iThick, $iThick/2, 60, 60) ;$GUI_GR_PIE
Next
$aRet[1] = GUICtrlCreateDummy()
Return $aRet
EndFuncFunc _GuiCtrlLCDNumber_SetValue(ByRef $hLCDNumber, $sValue)
[/autoit]
If Not StringIsInt($sValue) Then Return SetError(1)
Local $iDigits = ($hLCDNumber[1] - $hLCDNumber[0] -1) / 8
If StringLen($sValue) > $iDigits Then Return SetError(2)
$sValue = StringFormat("%0" & $iDigits & "s", $sValue)
Local $aValue = StringSplit($sValue, "", 2)
For $i = 0 To $iDigits - 1
If StringMid($hLCDNumber[2], $i + 1, 1) = $aValue[$i] Then ContinueLoop
Switch $aValue[$i]
Case 0
GUICtrlSetState($hLCDNumber[0] + 2 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 3 + $i*8, 32)
GUICtrlSetState($hLCDNumber[0] + 4 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 5 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 6 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 7 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 8 + $i*8, 16)
Case 1
GUICtrlSetState($hLCDNumber[0] + 2 + $i*8, 32)
GUICtrlSetState($hLCDNumber[0] + 3 + $i*8, 32)
GUICtrlSetState($hLCDNumber[0] + 4 + $i*8, 32)
GUICtrlSetState($hLCDNumber[0] + 5 + $i*8, 32)
GUICtrlSetState($hLCDNumber[0] + 6 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 7 + $i*8, 32)
GUICtrlSetState($hLCDNumber[0] + 8 + $i*8, 16)
Case 2
GUICtrlSetState($hLCDNumber[0] + 2 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 3 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 4 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 5 + $i*8, 32)
GUICtrlSetState($hLCDNumber[0] + 6 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 7 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 8 + $i*8, 32)
Case 3
GUICtrlSetState($hLCDNumber[0] + 2 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 3 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 4 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 5 + $i*8, 32)
GUICtrlSetState($hLCDNumber[0] + 6 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 7 + $i*8, 32)
GUICtrlSetState($hLCDNumber[0] + 8 + $i*8, 16)
Case 4
GUICtrlSetState($hLCDNumber[0] + 2 + $i*8, 32)
GUICtrlSetState($hLCDNumber[0] + 3 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 4 + $i*8, 32)
GUICtrlSetState($hLCDNumber[0] + 5 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 6 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 7 + $i*8, 32)
GUICtrlSetState($hLCDNumber[0] + 8 + $i*8, 16)
Case 5
GUICtrlSetState($hLCDNumber[0] + 2 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 3 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 4 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 5 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 6 + $i*8, 32)
GUICtrlSetState($hLCDNumber[0] + 7 + $i*8, 32)
GUICtrlSetState($hLCDNumber[0] + 8 + $i*8, 16)
Case 6
GUICtrlSetState($hLCDNumber[0] + 2 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 3 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 4 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 5 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 6 + $i*8, 32)
GUICtrlSetState($hLCDNumber[0] + 7 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 8 + $i*8, 16)
Case 7
GUICtrlSetState($hLCDNumber[0] + 2 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 3 + $i*8, 32)
GUICtrlSetState($hLCDNumber[0] + 4 + $i*8, 32)
GUICtrlSetState($hLCDNumber[0] + 5 + $i*8, 32)
GUICtrlSetState($hLCDNumber[0] + 6 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 7 + $i*8, 32)
GUICtrlSetState($hLCDNumber[0] + 8 + $i*8, 16)
Case 8
GUICtrlSetState($hLCDNumber[0] + 2 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 3 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 4 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 5 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 6 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 7 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 8 + $i*8, 16)
Case 9
GUICtrlSetState($hLCDNumber[0] + 2 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 3 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 4 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 5 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 6 + $i*8, 16)
GUICtrlSetState($hLCDNumber[0] + 7 + $i*8, 32)
GUICtrlSetState($hLCDNumber[0] + 8 + $i*8, 16)
EndSwitch
Next
$hLCDNumber[2] = $sValue
EndFunc -
Das kannst du dir auch mal anschauen:
RestrictControlRegExp-UDF - Fehleingaben direkt verhindern, Eingabentypen festlegen
-
Das habe ich gestern auch schon wieder bemerkt. Ärgerlich.

-
Auch von mir noch alles Gute zum Geburtstag!!
[Blockierte Grafik: http://handball.grafenwoehr.com/wp-content/uploads/2009/09/HappyBirthday501.gif]
-
Alles Gute!
[Blockierte Grafik: http://chofmeiste.files.wordpress.com/2008/10/happy_birthday_rocker.jpg]
Edit
[Blockierte Grafik: http://www.lopteam.de/inc/tinymce_files/birthday-sexy.gif]
-
-
Ich hab das bis jetzt immer so gemacht:
Spoiler anzeigen
[autoit][/autoit] [autoit][/autoit] [autoit]$Word1 = _MakeWord_2(2, 3)
[/autoit] [autoit][/autoit] [autoit]
$Word2 = _WordFrom2Byte(2, 3)ConsoleWrite($Word1 & @cr)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
ConsoleWrite($Word2 & @cr)Func _WordFrom2Byte($iLo, $iHi)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
Return BitShift($iHi, -8) + $iLo
EndFuncFunc _MakeWord_2($iLo, $iHi)
[/autoit]
Local $tWord = DllStructCreate("SHORT")
Local $tBytes = DllStructCreate("BYTE;BYTE;", DllStructGetPtr($tWord))
DllStructSetData($tBytes, 1, $iLo)
DllStructSetData($tBytes, 2, $iHi)
Return DllStructGetData($tWord, 1)
EndFuncAber nur weil's kürzer ist.

Edit: Fehler korrigiert.
-
Hallo!
Hab nun das Demo-Skript fertig gestellt. Außerdem sind nun weitere Funktionen in der LibNoDave-UDF von mir übersetzt worden.Viel Spaß beim Testen, für Fragen bin ich jederzeit hier erreichbar.
vivus: Wenn du die S7onlinx.dll verwendest, dann hat der eingestellte COM-Port keinen Einfluss, das wird dann alles von den Siemens-Einstellungen geregelt.

-
-
Es geht auch schnell den Thread auf gelöst zu stellen.

-
[autoit]
_FileCountLines
[/autoit] -
Zitat
Dann müsst ihr natürlich noch FireFox haben (*lach*) und das AddOn MozRepl, ohne das das Programm nicht funktionieren kann. Das AddOn bekommt ihr hier:
http://wiki.github.com/bard/mozreplHast du MozRepl installiert?
-
Hier ein Workaround, da es sonst anscheinend wirklich nicht geht:
Spoiler anzeigen
[autoit]#include <GuiConstantsEx.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <GuiStatusBar.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>Local $hGUI, $hIcon, $hStatus
[/autoit] [autoit][/autoit] [autoit]
Local $aParts[4] = [75, 150, 300, 400]$hGUI = GUICreate("GUI", 400, 300)
[/autoit] [autoit][/autoit] [autoit]GUICtrlCreateLabel("", 0, 282, 75, 18, -1, 0x28)
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetBkColor(-1, -2)
GUICtrlSetTip(-1, "Tips funktionieren, wenn nur das Icon in dem Abschnitt oder Text den Abschnitt berschreitet")GUICtrlCreateLabel("", 75, 282, 75, 18, -1, 0x28)
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetBkColor(-1, -2)
GUICtrlSetTip(-1, "Erzwungene Tips werden anzeigt, wenn der Text nicht in die Box passt" & @CRLF & "blablabla")$hStatus = _GUICtrlStatusBar_Create($hGUI)
[/autoit] [autoit][/autoit] [autoit]_GUICtrlStatusBar_SetParts($hStatus, $aParts)
[/autoit] [autoit][/autoit] [autoit]
_GUICtrlStatusBar_SetText($hStatus, "Erzwungene Tips werden anzeigt, wenn der Text nicht in die Box passt", 1)$hIcon = _WinAPI_LoadShell32Icon(23)
[/autoit] [autoit][/autoit] [autoit]
_GUICtrlStatusBar_SetIcon($hStatus, 0, $hIcon)GUISetState()
[/autoit] [autoit][/autoit] [autoit]Do
[/autoit] [autoit][/autoit] [autoit]
Until GUIGetMsg() = $GUI_EVENT_CLOSE_WinAPI_DestroyIcon($hIcon)
[/autoit]
GUIDelete() -
Vielleicht findet das angehängte Tool ja einer der S7-Programmierer hier nützlich.
Man kann einfach über das TrayMenü den Kommunikationsweg zur SPS wechseln.mfg funkey!
-
Du musst den COM-Port des USB-Adapters herausfinden, wenn dieser aber keinen virtuellen COM-Port hat, dann die s7onlinx.dll verwenden.
Das Intervall würde ich zum testen nicht unter 1000 stellen. Remote-MPI-Adresse ist meistens 2. Rack sollte im Normalfall 0 sein, Slot bei einer S7-300 auf 2 stellen.
Ich stelle gleich die neue UDF und Demo online.thx for testing
-
Ist aber leider so.