LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

LabWindows/CVI communication problem with LXI

Hello All,

 

I tried to control an Agilent 34972A DAQ using LabWindows/CVI on the etherner (LXI) port.

It is working until 6 commands, but after the 6th, nothing happens, only a message appears "Connection closed" with error code 14.

 

If I restart my program, it works again, or if I restart the DAQ, it works again, too.

 

Does anybody know what is the problem?

 

if ((DEBUG=ConnectToTCPServer (&TCP_handle, port, ip, NULL, 0, timeout))<0)
{
MessagePopup ("Communication failure!", "Connection problem between the unit and the PC.");
sprintf(error_message, "TCP library error message: %s\nSystem error message: %s",
GetTCPErrorString (DEBUG), GetTCPSystemErrorString());
MessagePopup ("Error", error_message);
}
else
 { 
 ClientTCPWrite (TCP_handle, command, strlen (command), timeout);
Delay(delay);
 ClientTCPRead(TCP_handle, answer, sizeof(answer), timeout);

//Write response to "RESPONSE" field
SetCtrlVal(panelHandle, PANEL_RESPONSE, answer);

 

Thanks,

Balazs 

 

0 Kudos
Message 1 of 2
(2,813 Views)

After reading, I forgot to disconnect from TCP server.

0 Kudos
Message 2 of 2
(2,797 Views)