04-05-2007 05:24 AM
Please let me know how to avoid reading back while writing, is there any status checks for doing this.
And please let me know whether the above functions are appropriate for reading.
Thanks in advance.
Regards
Siva
04-05-2007 12:46 PM
04-07-2007 05:17 AM
Hi Menchar,
Thanks for your reply.
My device is not echoing the charecters that it has received.
The question is when i am trynig to send some thing through the device, it is recieving what ever i have sent along with the reply from the device which i need.
It is becoming difficult to seperate them and print only the reply which i need.
I cant use LWRS_RXFLAG because "the destination or target device is controlled by us now and we are not sure that definetly we will include a carriage return at the end of what ever we have sent to host " so i need to capture everything.
Thanks and Regards
Siva
04-09-2007 11:52 AM - edited 04-09-2007 11:52 AM
Siva -
Are you making sure the chars you're writing to the Text Control are in the form of a string? Text controls are like string controls, you must use a string with SetCtrlVal.
The rs-232 library calls read bytes, not strings. You have to turn the bytes read into a string by adding a null char '\0' at the end of the bytes read. You can do this with
readcomdata[read_byte] = '\0';
Otherwise, when you write to the text control it'll keep writing until it finds a null (0) byte. Maybe this accounts for the "extra" stuff you're seeing.
Menchar
Message Edited by menchar on 04-09-2007 09:59 AM