Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the difference between default (INST0) and SOCKET type of connection?

Hi,

 

I've definied two types of TCPIP connections to the one resource.

1. TCPIP0::xxx.yyy.www.zzz::5025::SOCKET

2. TCPIP0::xxx.yyy.www.zzz::INSTR

The rest of the connections properties remain the same.

Timeout for the connections is the same and equels 30sec.

 

I sent the *IDN? query to this revice over the net.

 

When I do the read after writing *IDN? command using first (SOCKET) connection string I get timeout error.

 

When I do the read after writing *IDN? command using second (INSTR) connection string I get NO timeout error and the string I expeced.

 

What change to the connection parameters I do need to apply for SOCKET type of connection?

 

What is the difference between two of them?

0 Kudos
Message 1 of 3
(8,238 Views)

When using a SCPI-RAW (SOCKET) connection, you have to:

 

1) make sure to send termination character (when WRITE), and

2) make sure to enable VI_ATTR_TERMCHAR_EN attribute

 

vs = viSetAttribute( vi, VI_ATTR_TERMCHAR_EN, VI_TRUE); 

unsigned long len;

char buf[64];

vs = viWrite( vi, "*IDN?\n", 6, &len);

vs = viRead( vi, buf, sizeof(buf), &len);

 

Differences are:

SOCKET is a non-protocol raw TCP connection,

INSTR is VXI-11 protocol

 

0 Kudos
Message 2 of 3
(8,220 Views)

Hi Makoto,

 

Thanks for your explanations.

 

Yes I can confirm that the EOL sign is important to do successful communication.

 

However, something is still no right. I can communicate with the device thru MAX (*IDN?) but when I do that from my application somewhow I get timeout.

 

App attached.

 

The device is connected to the internet now, so if you are intersted in spending some time debugging this I can drop the IP on your private e-mail box / message box.

 

Your help is really welcome.

0 Kudos
Message 3 of 3
(8,187 Views)