03-26-2012 11:48 AM - edited 03-26-2012 11:49 AM
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
03-27-2012 09:46 AM
After reading, I forgot to disconnect from TCP server.