LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI and multiple TCP/IP connections with Labview RT

We have developed application where two different cRIO's (Running LabWiew RT) are acting as DAQ servers, and third PC application
developed in LabWindows CVI acts as client to display acquired data on TCP/IP form RT-DAQ's.
 
We have observed One of the two TCP/IP connection initiated by client automatically gets disconnected.
This is the first connection initiated by LabWindows CVI Client. Server Address and Port numbers are different for both the connections.
 
Please advise if anybody has solution.
 
Manoj
 
 
 
 
0 Kudos
Message 1 of 9
(4,269 Views)
When a CVI TCP connection is disconnected, the associated callback function is called with the TCP_DISCONNECT event. If the disconnection was due to some network or socket error, then this is passed to the callback in the errCode parameter. If there is no error, then it means the other endpoint (in your case, the second server) disconnected the connection - in this case, you should debug that endpoint to figure out why it is disconnecting.
0 Kudos
Message 2 of 9
(4,242 Views)

Thank you very much for your reply.

TCP_DISCONNEC events gets called. There is no error (error code checked). For development purpose I am using evaluation version of CVI. Is it limitation of evalution version to open only one TCP connection ? As I my system I have to coonect to two RT system. Connection disconnected is always the first connection opened. I tried to change the order of connection opening.

 

 

0 Kudos
Message 3 of 9
(4,216 Views)
No, the number of TCP connections are not limited in the evaluation version. But the execution time is limited to 10 minutes on Windows for programs built with an evaluation version of CVI - may be you are hitting this limit.
0 Kudos
Message 4 of 9
(4,201 Views)

Connection gets disconnected immediately when second connection is made with other RT system. Both RT with host works fine indepdently, but not at the same time.

I will give the details.

1) HOST PC WinXP, LabWindows Application. IP address 192.168.0.1

2) cRIO 9012 LabView RT Running PID application IP 192.168.0.2

3) cRIO 9012 LabView RT Running DAQ application IP 192.168.0.3 coonected to cFP chassis IP 192.168.0.4

All are connected using LAN Switch

Host tries to connect Sr. no 2 and Sr. No3. First connection gets disconnected by Receiving TCP_DISCONNECT Even in TCP/IP callback function, but second connection works fine, even order of connections is changed.

Problem is  How come first RT knows , second connection is initiated ?.

regards,

 

0 Kudos
Message 5 of 9
(4,189 Views)
It could be something in the LAN switch. Have you tried pinging the two server machines from the client XP machine? When the first connection gets disconnected, you could try reconnecting to it - this will probably cause the second connection to get disconnected. Have you tried running some other TCP client (say in LabVIEW) to connect to these two servers? Just to check if this issue is something particular to CVI or if it is some network configuration issue.
0 Kudos
Message 6 of 9
(4,174 Views)
Also, you could try connecting to each server from a separate client application, say, by running two instances of the shipping CVI client example. If the second connection results in the first connection getting disconnected in this case also, then I think it points to a network configuration issue.
0 Kudos
Message 7 of 9
(4,172 Views)
It Worked through LabWindows CVI also.
I changed some delay timing betwwen two connection opening function.
 
Earlier- Not Working Code
 
Initiate Connection to Server 1
Delay 25 Second- (Required as RT takes time to initiate-After this delay HOST is sure to send Read Commands)
 
Initiate Connection to Server 2
Delay 25 Second- (Required as RT takes time to initiate-After this delay HOST is sure to send Read Commands)
 
Now  Working Code is
 
Initiate Connection to Server 1
Delay 5 Second- (Required as RT takes time to initiate-After this delay HOST is sure to send Read Commands)
 
Initiate Connection to Server 2
Delay 25 Second- (Required as RT takes time to initiate-After this delay HOST is sure to send Read Commands)
 
It is working. I don't know How?
 
Also as per your suggestion through LABVIEW it works.
 
Thanks,
 
0 Kudos
Message 8 of 9
(4,118 Views)
Hey Multiple Connections and CVI,

Glad to hear everything is up and running in both pieces of software!  Looks like it was just an issue of adjusting the timing/delay.  Best of luck with the rest of your application!
Derrick S.
Product Manager
NI DIAdem
National Instruments
0 Kudos
Message 9 of 9
(4,084 Views)