livewire Posted May 16, 2007 Posted May 16, 2007 (edited) Is it possible to receive Binary data in AutoIt from a program other than AutoIt (for example...a C++ program that sends out one float)? I'm using beta version 3.2.3.14. My C++ program continuously sends out one float and I would like to display this number in AutoIt. Is this possible solely through AutoIt code? My code below does nothing when the UDP data of the float is received. expandcollapse popup#include <GUIConstants.au3> UDPStartup() $socket = UDPBind("127.0.0.1", 3333) If @error <> 0 Then MsgBox(0,"Testing","Error binding...") Exit EndIf #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Server", 338, 249, 193, 114) $Label1 = GUICtrlCreateLabel("", 72, 72, 400, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch $data = UDPRecv($socket, 50) If $data <> "" Then If IsBinary($data) Then GUICtrlSetData($Label1,"Binary: " & String($data)) Else GUICtrlSetData($Label1,"String: " & $data) EndIf EndIf WEnd Func OnAutoItExit() UDPCloseSocket($socket) UDPShutdown() EndFunc Thanks, Livewire Edited May 16, 2007 by livewire
livewire Posted May 18, 2007 Author Posted May 18, 2007 (edited) Nevermind...it works...it was my problem. What I was receiving was bigger than 50 bytes.$data = UDPRecv($socket, 50)-Livewire Edited May 18, 2007 by livewire
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now