04-11-2013 11:17 AM
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?
04-15-2013 02:56 AM - edited 04-15-2013 02:57 AM
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
04-19-2013 07:17 AM
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.