Tektronix Technical Forums are maintained by community involvement. Feel free to post questions or respond to questions by other members. Should you require a time-sensitive answer, please contact your local Tektronix support center here.

Open / Close Socket locks up 3706A

Post Reply
Wade_Patrick
Posts: 8
Joined: December 8th, 2015, 1:03 pm
Country: United States

Open / Close Socket locks up 3706A

Post by Wade_Patrick » December 8th, 2015, 1:11 pm

System 3706A with 1.53c, has (2) 2602A SMU TSP linked to it. Use a standard TCP/IP socket connection (port 5025) to open and close a socket over and over again (thousands of times), on 3706A, and although it will allow the connection and simple display.settext("hello") type commands, not much else will respond.

One clue, if you press the "EXIT (LOCAL)" button on the 3706A front panel, it will start working again on the next socket connect.

Tried every reset function I can find. Tried abort functions. Tried display.sendkey(75). local lock on and off. display.getlastkey() doesn't return anything.

Obviously, there is something running on one of the three devices, that's the 3706A is waiting for, and the EXIT button aborts that function.

Most of these systems will run for days or weeks without hanging up, some hang up all the time. It's killing production up time.

Wade_Patrick
Posts: 8
Joined: December 8th, 2015, 1:03 pm
Country: United States

Re: Open / Close Socket locks up 3706A

Post by Wade_Patrick » December 8th, 2015, 3:38 pm

"Fatal Error e02 p2D" "Disconnect DUT and cycle power" ????

Andrea C
Keithley Applications
Keithley Applications
Posts: 1263
Joined: October 15th, 2010, 10:35 am
Country: United States
Contact:

Re: Open / Close Socket locks up 3706A

Post by Andrea C » December 9th, 2015, 6:22 am

Can you shift to use of the VXI-11 connection rather than raw socket?

TCPIP0::XXX.XXX.XXX.XXX::inst0::INSTR

Wade_Patrick
Posts: 8
Joined: December 8th, 2015, 1:03 pm
Country: United States

Re: Open / Close Socket locks up 3706A

Post by Wade_Patrick » December 9th, 2015, 9:18 am

NO

Wade_Patrick
Posts: 8
Joined: December 8th, 2015, 1:03 pm
Country: United States

Re: Open / Close Socket locks up 3706A

Post by Wade_Patrick » December 11th, 2015, 7:36 am

int32_t simple_loop_test( void )
{
struct sockaddr_in dest;
const char *ipaddress_default = { "192.168.1.235" };
int port_default = 5025;
int mytrue = 1;
int sockfd = 0;
int bytes_read;
int bytes_read_cumm;
char rtn_buffer[MAXBUF];
char send_buffer[100];
int loopcount = 1;

while( 1 )
{
printf( "LOOP%i:\n" , loopcount++ );

sockfd = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
if( sockfd <= 0 )
{
perror("Socket");
return false;
}

//---Initialize server address/port struct---//
printf( "Connecting to SMU @ IP Address: %s\n", ipaddress_default );
bzero(&dest, sizeof(dest));
dest.sin_family = AF_INET;
dest.sin_addr.s_addr = inet_addr( ipaddress_default );
dest.sin_port = htons( port_default );

//---Connect to server---//
if( connect(sockfd, (struct sockaddr *)&dest, sizeof(dest)) != 0 )
{
perror("Connect");
return false;
}

if( setsockopt( sockfd, IPPROTO_TCP, TCP_NODELAY, &mytrue, sizeof(mytrue) ) != 0 )
{
perror("setsockopt");
return false;
}

if( ioctl(sockfd, FIONBIO, &mytrue) != 0 )
{
perror( "ioctl" );
return false;
}

strcpy( send_buffer, "reset()\n*IDN?\n" );
write( sockfd, send_buffer, strlen(send_buffer) );

bytes_read_cumm = 0;
while( 1 )
{
memset( rtn_buffer, 0, sizeof(rtn_buffer) );
bytes_read = recv( sockfd, &rtn_buffer[0], sizeof(rtn_buffer), 0 );
if( bytes_read > 0 )
{
printf( "Recv (%i bytes): %s", bytes_read, rtn_buffer );
bytes_read_cumm += bytes_read;
if( bytes_read_cumm == 54 )
break;
}
}
printf( "All 54 bytes expected, where received.\n" );

strcpy( send_buffer, "print(node[2].description)\r\n" );
write( sockfd, send_buffer, strlen(send_buffer) );
printf( "SENT: %s", send_buffer );

bytes_read_cumm = 0;
while( 1 )
{
memset( rtn_buffer, 0, sizeof(rtn_buffer) );
bytes_read = recv( sockfd, &rtn_buffer[0], sizeof(rtn_buffer), 0 );
if( bytes_read > 0 )
{
printf( "Recv (%i bytes): %s", bytes_read, rtn_buffer );
bytes_read_cumm += bytes_read;
if( bytes_read_cumm == 41 )
break;
}
}
printf( "All 41 bytes expected, where received.\n" );

strcpy( send_buffer, "print(node[3].description)\n" );
write( sockfd, send_buffer, strlen(send_buffer) );
printf( "SENT: %s", send_buffer );

bytes_read_cumm = 0;
while( 1 )
{
memset( rtn_buffer, 0, sizeof(rtn_buffer) );
bytes_read = recv( sockfd, &rtn_buffer[0], sizeof(rtn_buffer), 0 );
if( bytes_read > 0 )
{
printf( "Recv (%i bytes): %s", bytes_read, rtn_buffer );
bytes_read_cumm += bytes_read;
if( bytes_read_cumm == 41 )
break;
}
}
printf( "All 41 bytes expected, where received.\n" );


if( sockfd == 0 )
return( 0 );
shutdown( sockfd, SHUT_WR );
usleep( 100000 );
while( 1 )
{
bytes_read = recv( sockfd, rtn_buffer, 1, 0 );
if( (bytes_read == 0) || (bytes_read == -1) )
break;
}
close(sockfd);
}

return( true );
}



OUTUPUT RESULTS:

LOOP STARTED @0
.....
Connecting to SMU @ IP Address: 192.168.1.235
Recv (54 bytes): KEITHLEY INSTRUMENTS INC.,MODEL 3706A,04081452,01.53c
All 54 bytes expected, where received.
SENT: print(node[2].description)
Recv (41 bytes): Keithley Instruments SMU 2602A - 1314283
All 41 bytes expected, where received.
SENT: print(node[3].description)
Recv (41 bytes): Keithley Instruments SMU 2602A - 1291771
All 41 bytes expected, where received.
LOOP2695:
Connecting to SMU @ IP Address: 192.168.1.235
Recv (54 bytes): KEITHLEY INSTRUMENTS INC.,MODEL 3706A,04081452,01.53c
All 54 bytes expected, where received.
SENT: print(node[2].description)
Recv (41 bytes): Keithley Instruments SMU 2602A - 1314283
All 41 bytes expected, where received.
SENT: print(node[3].description)
Recv (41 bytes): Keithley Instruments SMU 2602A - 1291771
All 41 bytes expected, where received.
LOOP2696:
Connecting to SMU @ IP Address: 192.168.1.235
Recv (54 bytes): KEITHLEY INSTRUMENTS INC.,MODEL 3706A,04081452,01.53c
All 54 bytes expected, where received.
SENT: print(node[2].description)
Recv (41 bytes): Keithley Instruments SMU 2602A - 1314283
All 41 bytes expected, where received.
SENT: print(node[3].description)
Recv (41 bytes): Keithley Instruments SMU 2602A - 1291771
All 41 bytes expected, where received.
LOOP2697:
Connecting to SMU @ IP Address: 192.168.1.235
^C
# ./smu --ham
-executing: "./smu --ham"
LOOP1:
Connecting to SMU @ IP Address: 192.168.1.235

Andrea C
Keithley Applications
Keithley Applications
Posts: 1263
Joined: October 15th, 2010, 10:35 am
Country: United States
Contact:

Re: Open / Close Socket locks up 3706A

Post by Andrea C » December 14th, 2015, 5:54 am

I'll do some testing on my end.

If feasible, can you see if you experience the issue with only the 3706A (and not the TSP-LINKed instruments)?

With your comment about pressing exit button and it will work on next attempt to connect leads me to believe you have a dead socket. If you can detect this condition, your error handling could try connecting on port 5030 and then close, then retry on port 5025.

Wade_Patrick
Posts: 8
Joined: December 8th, 2015, 1:03 pm
Country: United States

Re: Open / Close Socket locks up 3706A

Post by Wade_Patrick » December 14th, 2015, 7:38 am

Yep, I pulled the relay cards from the 3706A, and disconnected the TSP link completely/physically, removed all node[2] and node[3] command calls, and the error still happens. Tried calling 5030 port, it made no difference. The socket isn't completely dead, since I can still make display.settext() calls and see the display update.

V. Woerdeman also contacted me, and is trying this for me right now.

Wade

Post Reply

Return to “Series 3700 Switch System/Multimeter and Plug-In Cards”

Who is online

Users browsing this forum: No registered users and 2 guests