08-20-2009 09:27 AM
GerdW wrote:
And you didn't state if your example string is in hex display or plain ASCII and does it contain that checksum at the end or not (not that any combination will result in the expected result...)
Hi GerdW,
Well the problem that I have is that I want to send this string ,for example 0xAA 30 D2 03, which is in hex and these are the exact bytes that I want to send but after you use the String To Byte Array, the bytes change their values: AA becomes 170 in decimal and I am sending 170 as byte. How to avoid this.
I suppose that's way I am getting a wrong result and now I am stuck on how to send this string as unsigned word or in other words unchanged - the first byte is AA, second 30 and so on and so forth.
Thanks for the help,
Iliya
08-20-2009 09:36 AM
Hi igurov,
again this HEX or BCD or ASCII discussion?
Ok, what does the string really look like? Is it hex display "AA30" (byte array 170, 48 in decimal), or is it normal display "AA30" (byte array 65,65,51,48)?
You better edit my example and set the string you want to process as default value!
And btw. 0xAA is 170 in decimal...
08-20-2009 09:56 AM
hi,
I admit that I am a bit confused now.
The requirements are that let's say the first four bytes represent the BCD coding of a serial number. So for a serial number AA30D203 I have to send the command Byte0 - Byte 3 0xAA; 0x30; 0xD2;0x03. So I was confused because when I have a hex display AA30... I am sending the byte array 170, 48.... I guess that's the way it should be.
Thx one more time
Iliya