11-21-2013 01:01 AM
Hi,
I am currently reading data using TCP IP Read. The output of the board that i am reading is random in terms of the length of data (not by alot but by a couple of bytes.
I have checked to see why CRLF is not working when i read this data and it looks as if the output of the board ends with LFCR and not CRLF.
Is it possible to create a new "Mode" for the TCP Read?
Does anyone have any suggestions to a simple way around this. I have looked and there doesnt seem to be any solutions to this.
I dont have control over what is coming from the board so my only solution will be to control what i read from LabView side.
Thanks alot
Alex
11-21-2013 01:27 AM
Cant you set end of read to just CR?
/Y
11-21-2013 01:52 AM
@detox92234 wrote:
Does anyone have any suggestions to a simple way around this. I have looked and there doesnt seem to be any solutions to this.
I don't know if you would consider this simple, but the answer that comes to mind is to write a wrapper for the function which will read one byte at a time in a while loop and look for the LFCR termination. Note that if you do get some bytes, you will need to adjust the timeout for the subsequent reads to compensate for the time that already passed.
11-21-2013 05:38 AM
What board are you trying to read from? Is it something you (or your company) developed and you are now trying to test it? I would consider this a bug in the firware.
11-22-2013 02:46 PM
Hi,
Thanks for the quick response. Could you please explain how to do this?
I can only see the options of standard, immediate, buffered, CRLF is it possible to create my own modes?
Thanks again
Alex
11-22-2013 02:55 PM
Hi,
The boards are developed by the company i work for yes, but i do not have access to the source code to modify it.
It is a pain but what can i do,
I am basically reading an output that give me a string followed by a LFCR but as i cannot set it to read a certain ammount of bytes, and the last value outputed is constantly changing im not sure what else i can do to isolate the one full string of data.
Any help is greatly appreciated
Thanks
11-22-2013 07:52 PM
I'd guess you can use Immidiate mode to read a byte at a time and search for the end sign?
/Y
12-03-2013 04:02 PM
HI,
Just to let you know, i got it sorted by altering the firmware of the board to end strings with CRLF and not LFCR.
But thanks anyway.
Alex
12-03-2013 04:05 PM
That sounds like what Crossrulz was telling you in his message #4.
12-04-2013 07:02 AM
@RavensFan wrote:
That sounds like what Crossrulz was telling you in his message #4.
Not only does it sound like it, it is EXACTLY what I recommended. It's always the simple answer that works the best.