LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP functions

Hi,

     Iam trying to send data from labview to some other language other than labview through TCP and receiving data from other language to Labview.Iam able to do that but the problem is while Iam stoping the VI or Iam stoping the other program labview is generating Error66 in TCP read.Please check my VI.Iam a beginner in labview.Iam using two while loops.How to stop the VI by clicking any of the stop button?Is there any critical errors?Please reply

 

Also what does this mean "latest standard issued by National Instruments"?What are the latest standards?

0 Kudos
Message 1 of 10
(3,298 Views)

Since you're closing the connection abruptly, error 66 is an expected error. This is something you have to look for.

 

I'm not sure I understand why you are using 2 listeners. Based on this, it appears the other program opens 2 connections to your LabVIEW code, on 2 different ports. It uses one to send data and the other to receive. TCP/IP is bi-directional, so you only need one connection.

 

I do not understand what you are referring to by "latest standard issued by National Instruments". Where did you read this?

0 Kudos
Message 2 of 10
(3,273 Views)

Thanks for your reply.

I don't understand then how will I close the connection?

If Iam using only one Tcp listener,You mean both the read and write operations should be done through one port only?right?Can you briefly explain what all changes have to be make in the code?Also how I stop the VI as I have two parellel while loops?

 

I already told Iam a beginner.So after seeing my code one of my friend said that you have'nt used the  "latest standard issued by National Instruments".And he have'nt explained what is it.

0 Kudos
Message 3 of 10
(3,254 Views)

Here is an example of a client server implementation in LabVIEW. This may be a bit more advanced but you can take a look at it and see how it works.

 



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 10
(3,248 Views)

Hi Mark,

              Thanks for the example.But while stoping the VI it is generating error 56 and error66.

0 Kudos
Message 5 of 10
(3,231 Views)

@jkuttu wrote:

Hi Mark,

              Thanks for the example.But while stoping the VI it is generating error 56 and error66.


Both are expected. Error 56 is a timeout and error 66 indicates the connection has been closed by the other side.

 



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 10
(3,213 Views)

Hi Mark,

                So we are not able to avoid that?right?So is this error harms a good programming style?

Please reply.

0 Kudos
Message 7 of 10
(3,211 Views)

It is a legitimate error and it is up to the program to handle it accordingly. This does not violate any type of good programming style. For example, it is not uncommon for our code to ignore read timeout errors when we are simply waiting for communication from another device. We don't know when the message will arrive so we simply chose to ignore the timeout error. The alternative of waiting forever is not that good since there is no way to abort the read programatically. therefore, we set a short timeout and throw it away knowing it just means we didn't get any data at that time. Error 66 requires a bit more. You may want to try to reestablish the connection or it can be used to simply signify a client has been removed from the system. How that error is handled will depend on the application itself.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 8 of 10
(3,209 Views)

Hi Mark,

              So,in the example given by you,how the Error66 can be handled?

0 Kudos
Message 9 of 10
(3,202 Views)

Hi

 

the error was already handled in the example by Mark.

The last-but-one vi, the Error to Warning vi will convert the error 66 to a warning.

 

 

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 10 of 10
(3,187 Views)