08-12-2009 01:46 AM - edited 08-12-2009 01:51 AM
Hello,
I have to do the following thing. I have the date/time string, let's say 08:45:23, 12.08.09, where the hour, the minutes, the seconds, the day, the month and the year represent hex number or in other words I have the following command:
Byte 0 - Byte 5
0x08; 0x45; 0x23; 0x12; 0x08; 0x09;
Now I want to write this command in a binary file in order to send thefile later throught serial RS232 connection.
Now, I am not sure whether I write the command in the binary file in the correct format. What I simply do is to write it as a string
("084523120809"). Is this the correct way. I guess no, because when transmitted it does not work as expected.
How can I write this string as a HEX command in the binary file?
Thanks for the replies in advance
IG
08-12-2009 01:47 AM
08-12-2009 01:49 AM
Hi igurov,
which string do you have to send to your RS232 device?
Mike
08-12-2009 01:52 AM
08-12-2009 10:50 AM
08-13-2009 12:42 AM - edited 08-13-2009 12:44 AM
08-13-2009 03:21 PM
08-13-2009 04:06 PM
08-13-2009 05:06 PM
GerdW wrote:maybe igurov has to send BCD numbers?
Well, that would certainly make more sense.
08-19-2009 12:54 AM
I know exactly what the difference between decimal and hex is!? But I am not sure whether you understand what I really want.
I have a specific requirements and mainly that I have to write the string of date/time as hex value in a file and then send it via serial connection. Please, tell me, where in the whole story sth does not make sense to you.
Or maybe a command like byte0- byte6 0x19;0x08;0x09;0x07;0x53;0x24 does not make sense to you !?