LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

missing data rs232

I repeat this quatsion because I have the same problem and can not find a solution.

I have a serial connection to the modem using VISA in Labview 6i.
I have a good connection with the other modem and then recieve a file. This file is good untill I go over 1000 - 1100 lines. From this point complete lines are missing.

Q : Where is the data?
Q : Example of modem-connection?"

Thanks
0 Kudos
Message 1 of 4
(3,118 Views)
It sounds like you have most of things working if you can get 1000-1100 lines of data.

If you posted some code we may be of greater assistance.

Form what you have said there appears to be a number of things that could be going on.

1) You are not reading the data fast enough.

2) Data is being currupted in transit.

3) File contents are being seen as flow control.

Posting code would help us answer if 1 is an issue.

Doing the copy from one machine to another next to it could help shed light on 2.

Create a huge file of all "A"'s could rule 3.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 4
(3,118 Views)
It sounds like you should be doing 1 of 2 things (or possibly both) that you are not doing:
1) Call VISA Set I/O Buffer Size with mask 16 and a size greater than what you expect to receive. This generally should be less than 32KB for it to work cross platform.
2) Use flow control so the other side will stop sending data if your OS buffer ever fills up.

Good luck,
Dan Mondrik
Senior Software Engineer, NI-VISA
National Instruments
0 Kudos
Message 3 of 4
(3,118 Views)
Serial comm:

1) Use large buffers (64K if possible).

2) Use RTS/CTS (HW) handshaking if possible.

3) Implement a while loop that just determines the # of bytes
available, reads those bytes, and stuffs them into a named queue so
that a different loop can then process them (to disk or wherever). If
you do this you shouldn't lose any data unless there is a hardware
problem (bad cable, long cable, etc.)

You can signal your processing loop from your serial reading loop
using a set occurrence / wait on occurrence.

Douglas De Clue
LabVIEW developer
ddeclue@bellsouth.net

Dan Mondrik wrote in message news:<50650000000500000021920000-1027480788000@exchange.ni.com>...
> It sounds like you should be doing 1 of 2 things (or possibly both)
> th
at you are not doing:
> 1) Call VISA Set I/O Buffer Size with mask 16 and a size greater than
> what you expect to receive. This generally should be less than 32KB
> for it to work cross platform.
> 2) Use flow control so the other side will stop sending data if your
> OS buffer ever fills up.
>
> Good luck,
> Dan Mondrik
> Senior Software Engineer, NI-VISA
> National Instruments
0 Kudos
Message 4 of 4
(3,118 Views)