From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW 2013 TCP timing lose message

Dear,

 

my be anyone of you hase faces the same difficulties.

Open a TCP connection, creating some smal messages and sending these to the target.

Doing this within a none times loop will case lose messages.

Anyone faced this problem too?

In my case I first send three messages within a timed loop.

Everythin ist OK as shown in the wireshark protokoll.

Now the consumer goes to the next case and sends another message.

This message starts the target mesurement data streaming.

It should allways be transmitted - within the right mode - but it has not be trandmitted.

As one can see within the wireshark protocol.

In this case my app waits a little bit of time closes the Ethernet vonnevtion and tries to do the same again to start the data streaming on the client.

 

By unsing a delay structure of 5ms the problem disapears-

 

My questions are:

   - Has anyone seen this too?

   - Can this problem be solved with TCP_nodelay in the ethernet card configuration?

   - Is it a windows 7 problem?

   - Is it a LabVIEW problem?

   - How can I bee sture that the problem is solved?

 

The missing command can be found in message number 88 and 89 of the wireshark protocol.

Than the client starts streaming data as wanted before.

 

Now that I have "solved" the problem or build a workaround I like to know how reliable it is.

 

Any other Ideas are wellcome.

 

Best regards

 

Martin

 

0 Kudos
Message 1 of 13
(3,071 Views)

@Kunze wrote:
[...]

Now that I have "solved" the problem or build a workaround I like to know how reliable it is.

[...]

Martin

 


Hi Martin.  I never had the idea to place a TCP Write in a Timed Loop.  What is your intended behaviour when an iteration of the timed loop does not succeed in writing the data?  Go on to the next iteration and send the next string?

I have always used TCP functions in conjuction with an appropriate timeout. So I cannot see the need for using a Timed Loop.

0 Kudos
Message 2 of 13
(3,042 Views)

Dear Guenter

 

As you can see the TCP functions have a timeout of some sec.

The problem is:

When you remove the timed loop and just replace it with a row of TCP send commands you'll lose messages.

They will simply not be send and lost in space.

One can prove that using wireshark.

 

To say it with oder words:

I first had a block diagram where all TCP write VIs have been in a row with 2s timeout.

The Target didn't get all messages or messages are randomly lost.

Not because of the fact that the target is slow (the target is an I5 processor board).

!!! None of the TCP write VIs in a row showed an error. !!!

Its simply the fact that messages are lost somewhere in space.

So I did this "workaround" by establishing a short time before the next message will be send.

Using a times loop or structure doesn't lead to a change into the GUI thread like using the Wait VI.

 

I have controlled all this using wireshark.

Have a look into the wireshark protocol file please.

 

The question is simple:

Where is the TCP data and where will it be lost?

Wireshark shows that the data doesn't reach the interface.

Btw. please don't start discussions about net traffic and wireshark. There is no Nettraffic abouve some percent, the source computer is an I5 too and the connection is a straight cable of < 50 cm.

 

OK the messages are more or less smal (some Bytes of data) but size should not matter in this case.

Except there is a TCP_nodelay or a LV problem and than the question comes up how to solve this issue.

 

 

Kind regards

 

Martin

 

0 Kudos
Message 3 of 13
(3,004 Views)

Hi Martin,

can you please upload your VIs?
So it is easier to find out what happens.

Regards
Robert

0 Kudos
Message 4 of 13
(2,897 Views)

Dear Robert

 

Beg me pardon but it's to much code in this consumer ans so many sub VIs that it doesn't make sense from my point of view to upload it.

The realy nesseary information is that the packages sent cary just 8 to 10 Bytes.

 

Regards

 

Martin

0 Kudos
Message 5 of 13
(2,888 Views)

Hi Martin

Because of you have much code a sample code would be useful. With pictures I can´t debug the code. In the second picture I can´t see what happens in the timed loop, too.

Why you aren’t using network streams for transmitting the data? There is a whitepaper for lossless data transmitting with network streams.
http://www.ni.com/white-paper/12267/en/

Regards
Robert

0 Kudos
Message 6 of 13
(2,873 Views)

Dear Robert,

 

may be I should give it a try.

Since there arn't many messages to send to the client I thought a normal TCP connection is OK.

Looking at the wire shark protokoll shows that the message isn't dent while LV doesn't produce an error message.

That is the point I don't understand.

Looks like a mutex or TCP_nofelay problem and NOT a coding issue.

 

Best regards

 

Martin

0 Kudos
Message 7 of 13
(2,864 Views)

Hi Martin,

what says the “TCP Write” VI how many bytes are written?


With pictures I can´t debug the code. In the second picture I can´t see what happens in the timed loop, too.

Regards
Robert

0 Kudos
Message 8 of 13
(2,849 Views)

Dear Robert,

 

The Sender just need three messages to fetch config. data from the device and one to start the measurement on the target.

After that the target streams measurement data to the server.

None of these four messages is longer than 8 to 20 Bytes of data.

You can verify this by using wireshark and loading the Ethernet protocol capture.

The server has the IP 192.168.1.32 while the target has 192.168.1.1

 

Kind regards

 

Martin

0 Kudos
Message 9 of 13
(2,803 Views)

Hi Martin,

without answering my questions I can´t help you.

I have an additional question.
Do you have checked the transmitted data?
I see that the checksum is wrong but what is with the data?

Regards
Robert

0 Kudos
Message 10 of 13
(2,799 Views)