02-18-2010 12:19 PM
Hello,
I am using LV2009 for linux.
I am trying to communicate between my Java code and LV, on localhost, using TCP/IP. I am sending the data: "Hello1\r\n", "Hello1\r\n", "Hello1\r\n" from java to LV. At LV end, I am using the CRLF mode to read the data sent. I am not receiving any data at LV end. I do not want to use the standard mode, because the length of data sent could vary each time. I also tried using Immediate mode, but again I am not seeing any thing on LV.
Please help.
Regards,
-H
Solved! Go to Solution.
02-18-2010 12:59 PM
One approach you can take which I use regularly is to have your reads in two parts. Your first read would wait longer which would also act as your data timeout. It would look for a single character. The second read would be within a loop and read until it sees your CR and LF characters or other termination characters. This read would have a short timeout since at this point you should get all of your data.
Another alternative is to have a parallel task which does nothing but read from the connection. Anything it reads it would post to a queue. A second task would then process this data. It may need to dequeue several items to get the entire message but it would be responsible for parsing the data. The queue would essentially act as a buffer. You would also need a shift register on this loop to hold the partial messages.
A third alternative would be to use VISA for the connection and use its read attribrutes which include the option to read until you get a termination character.
02-18-2010 01:08 PM
Hello Mark,
My problem here is that I am not receiving any thing at the data output. I have also tried changing the timeout value to -1, but it doesnot help either.
-H
02-18-2010 02:49 PM
I think I was missing the number of bytes as an input to the 'bytes to read'. Attached is the corrected vi.
Regards,
-H
03-24-2010 12:08 PM
I am having the same problem.
Could you post your vi for version 8.6?
Thanks!
Nick
03-24-2010 12:14 PM
03-25-2010 03:29 AM
It still says that the vi version (9.0) is newer than my version (8.6)...
Could you retry it?
Thanks
03-25-2010 03:33 AM