I want to ask you ,how to send Hex command to RS232, For example, i need send 5401499CFF00 as hex To RS232,now i just use ComWrt(1,"5401499CFF00",strlen("5401499CFF00"));
but you know it is not my meaning,could you tell me how to do?
You want to send 0x5401499CFF00, which is a 6-byte hexidecimal number. This is very different than "5401499CFF00", which is a 13-byte (including nul terminator) ASCII string. Try something like this:
Also note that if you do want to send a string in the future, you should specify the size as strlen(yourstring) + 1, just as you would if using a memory copy function. ComWrt and the rest of the serial library functions operate on data as raw bytes; they don't assume the data are nul-terminated strings, so if you want to send the nul terminator (which you do), you have to explicitly include it in the count.