02-15-2006 06:39 PM
02-16-2006 12:06 AM - edited 02-16-2006 12:06 AM
Message Edited by Roberto Bozzolo on 02-16-2006 07:07 AM
02-16-2006 02:45 AM
02-16-2006 03:17 AM - edited 02-16-2006 03:17 AM
Well, he could simply use
Fmt (cDataPacketW, "%4c", cWord + 1);
cmd_written = ComWrt (1, cDataPacketW, 4);
But, Gary, I tried with your exact code and get 4 bytes written, so in my opinion the problem lies elsewhere.
Message Edited by Roberto Bozzolo on 02-16-2006 10:23 AM
02-16-2006 09:38 AM
12-20-2006 09:14 PM
Hello GaryZ21 ,
Did you solve this problem at this moment.
I also face this problem now. I can not convert the 0x81 0x81 0x00 0x00 0x32 to correct string. just received the first two words, because the string define the 0x00 is the end of string char.
If you solved this problem, Could you show me how to do? Thanks.
12-21-2006 12:00 AM - edited 12-21-2006 12:00 AM
Message Edited by Roberto Bozzolo on 12-21-2006 07:01 AM
12-21-2006 01:25 AM
12-21-2006 01:41 AM
You are having problems due to the use of strlen () instructions that stops at the first nul byte it finds. To transmit all bytes in the buffer you need to pass the exact number of bytes to ComWrt function: in your case this statement should work correctly:
ComWrt (1, Commands, 8);
12-21-2006 01:52 AM