Hi,
HextoString() verwendet intern Binarytostring, das hat nichts mit dem zu tun, was ihr senden wollt....
Wenn also, wie im vorliegenden Fall, BYTES gesendet werden sollen, dann setzt man diesen string z.B. so zusammen:
Spoiler anzeigen
#include <String.au3>
Global Const $Byte1 = 0x01
Global Const $Byte2 = 0x02
Global Const $Byte3 = 0xFF
Global Const $Byte4 = BitXOR($Byte1, $Byte2, $Byte3)
$string=chr($byte1)&chr($byte2)&chr($byte3)&chr($byte4)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $string = ' & $string & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
;oder
$string=binarytostring("0x0102FFFC") ;hardkodiert
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $string = ' & $string & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
;oder
$string=binarytostring("0x"&hex($byte1,2)&hex($byte2,2)&hex($byte3,2)&hex($byte4,2))
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $string = ' & $string & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
;FALSCH!!!
$string=_HexToString($Byte1 & $Byte2 & $Byte3 & $Byte4)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $string = ' & $string & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
For $i=1 to stringlen($string)
$x=asc(stringmid($string,$i,1));asciicode der einzelnen zeichen
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $x = ' & $x & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
next