Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

USBTMC viread timeout error

Hi,

 

I have a USB TMC Pattern Generator PSPL 12060. I am using NI MAX version 4.6, and is able to detect the instrument. When I try to communicate with the instrument, there's no problem writing SCPI commands to the instrument. I can set the instrument parameters without problem.

 

The problem occurs for the query statements because I keep on getting timeout error. I've tried the basic query statement (eg:*IDN?), and keep on getting the same error 0xBFFF0015 (VI_ERROR_TMO)

Please advise if I've missed out any settings.

 

These are the settings that I used. Changing the TMO_VALUE does not help to solve the timeout error.
VI_ATTR_TMO_VALUE = 8000
VI_ATTR_MAX_QUEUE_LENGTH = 50
VI_ATTR_SEND_END_EN = VI_TRUE
VI_ATTR_TERMCHAR = 0x0A
VI_ATTR_TERMCHAR_EN = VI_FALSE
VI_ATTR_IO_PROT = 1
VI_ATTR_USB_MAX_INTR_SIZE = 2
Thanks and your help is highly appreciated.
YWOoi

 

0 Kudos
Message 1 of 4
(4,305 Views)

Likely the instrument may not terminate the response with EOM (End Of Message, defined in USBTMC spec).

 

Try enable the termchar attribute, which is effective on read action.

 

VI_ATTR_TERMCHAR_EN = VI_TRUE
I believe this will work as long as the instrument contains 0x0A (LF) termination code at the end of response string.

 

Or try to append 0x0A after *IDN? when sending like "*IDN?\n"

 

0 Kudos
Message 2 of 4
(4,241 Views)

Hello,

 

I am using the USBTMC.vi example as my starting point to create a LabVIEW to USB Interface or a small data aquistion system. I get the same error, ie. "0xBFFF0015 Timeout expired before operation complete completion".  

 

How can the VI_ATTR_TERMCHAR_EN = VI_TRUE be setup in the USBTMC.vi example ?. I do not see a function within Instrument I/O, VISA that can be used to set the VI_ATTR_TERMCHAR_EN.

0 Kudos
Message 3 of 4
(4,162 Views)

Your code is not sending the control character. You are sending the characters '\' and 'n'. As has been endlessly discussed, you need to right click on the string constant and select '\' Codes Display.

 

Also, there is a VISA property to set the write termination character.

0 Kudos
Message 4 of 4
(4,156 Views)