Hi,
exactly what is the string?
You might find that you have a null "/0" in the string you're sending, so ComWrt is only seeing the text before this. (In this case, use ComWrtByte instead, but you have to send each character separately to do this).
What value does the ComWrt return to you? i.e.
char buf[100];
Fmt(buf,"%s","Hello, World!");
if (ComWrt (2, buf, 13) != 13)
/* Operation was unsuccessful. */;
ComWrt sends bytes from the output queue to the serial device under interrupt control without program intervention. If you close the port before all bytes are sent, you lose the bytes that remain in the queue. To guarantee that all bytes are removed from the output queue before you close the port, call GetOutQLen. GetOutQLen returns the number of bytes
that remain in the output queue.
try putting a breakpoint just after the ComWrt, and see how many characters you get out then.
Your port monitoring software might also be having a problem with white spaces etc. You could try connecting pins 2 and 3 (Tx and Rx) with a paper clip, and then you could read back on the same port to check the data is really sent in your software. (You need to turn off the handshaking if these are the only two pins you're connecting.
Hope that helps
Thanks
Sacha Emery
National Instruments (UK)
// it takes almost no time to rate an answer