ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problems with read long string from serial port

Hello,
 
I got problems to read a long string of 101 bytes from the serial port. Most times I read the 101 bytes but sometimes it will read 76 bytes or less, so the data will be infected with wrong values Smiley Sad
 
With reading short strings of 8 bytes I don't have this problem. I use the same vi to read the 101 bytes and I'm using labview 8.0 on windows XP. Is there a workaround for this?
 
Eddy
 
0 Kudos
Message 1 of 9
(3,976 Views)
How many byte count you set ?
________________________________________________________


Try to make everything Automatic
0 Kudos
Message 2 of 9
(3,968 Views)

A likely candidate is the timeout - if your timeout is too short, you won't always get all your data. Another potential problem is if you're using a termination character. Both can be changed by using the VISA Configure Serial Port VI.

If this didn't help, you should post your code, with more details about the problem.


___________________
Try to take over the world!
0 Kudos
Message 3 of 9
(3,961 Views)
Hello,
 
Between write and read I have 500 ms. IMHO this have to be enough. I have the vi attached. Please take a look.
 
Thanks
 
Eddy
0 Kudos
Message 4 of 9
(3,956 Views)

Hi,

       Can you save the sample as LV7.1

帖子被Yukee在12-06-2005 04:13 AM时编辑过了

________________________________________________________


Try to make everything Automatic
0 Kudos
Message 5 of 9
(3,956 Views)

Hello,

Saved as 7.1

Eddy

0 Kudos
Message 6 of 9
(3,947 Views)

Hi,

    I have modified your sample simply. see it and have a try.

________________________________________________________


Try to make everything Automatic
0 Kudos
Message 7 of 9
(3,924 Views)

Hello,

Thanks for your time, but it doesn't work Smiley Sad

The return count is zero. After more cycles it's still zero.

Eddy

0 Kudos
Message 8 of 9
(3,912 Views)

Here are some things to try:

Are you using flow control? (RTS/CTS or XON/XOFF).  If not, try using flow control.  Assert RTS, and set flow control to RTS/CTS on the init vi.

Make sure your baud rate, stop bits, parity are correct.

Disable the terminating character in the init vi if transferring binary data.

Increase wait time between writing and reading.

Try reading twice at the end to see if more data is coming.

 

Hope these suggestions help.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 9 of 9
(3,899 Views)