Knowledge Base - Solution

MAP SCPI query timeout during read over VISA SOCKET connection

Thursday, April 14, 2022
Submitted by ryan.grace on August 12, 2023 - 7:36am
Problem: 
When connected to MAP using VISA SOCKET and sending SCPI queries, the read times out. A VISA timeout error will be returned, and below are a couple of examples. -> 0xBFFF0015 (VI_ERROR_TMO) Timeout expired before operation completed. -> VI_ERROR_TMO (-1073807339): Timeout expired before operation completed.
Solution: 
First, ensure no delay has been inserted between writing the SCPI query command, and reading the response. For a query, the read should be performed immediately after the write. Second, when using a VISA TCPIP instrument (INSTR) resource string for connection to MAP, that protocol implementation has a native mechanism to specify the end of a message. However, when using VISA TCPIP SOCKET resource string, you need to tell VISA how messages are terminated. Otherwise, VISA times out on the query (read) because it is doesn’t know where is the end of message and waits to read more bytes. All messages from MAP are terminated with a newline/linefeed character (0x0A = '\n'). The VISA termination character enable property should be set to true and the termination character set to 0x0A. VISA will then be able to detect the end of message and not timeout.

Support at Every Step

We provide support, services, comprehensive training and the resources you need. It’s all part of what we do to maximize the value of your VIAVI investment.

Value add services that compliment your VIAVI system solution and instrument portfolio to provide a total cost of ownership

Customer Service that provides Return Material Authorization (RMA) for repair and calibration

Technical education solutions, product training, and blended learning for technicians who are using new products or working with existing tools

Technical Assistance Center to assist you in using/configuring products or address issues regarding product performance