Log in to create and rate content, and to follow, bookmark, and share content with other members.
AnsweredAssumed Answered
Wanted to read the values from the scanned channels using the VISA protocol "READ?"command. But this runs into a "timeoutexception". Though this seems like a hardware issue do we have a work around to get the values from the scanned channels using the VIS
Question asked by aish on Aug 6, 2019 Latest reply on Aug 6, 2019 by Tardz
Hi, if you use READ command, timeout problem may occur, but you must set the VISA parameter VI_ATTR_TMO_VALUE, default value is 2000ms (or 2sec).
For example in visual basic: errorStatus = viSetAttribute(viDATAlogger, VI_ATTR_TMO_VALUE, 15000)
viDATAlogger is GPIB address like "GPIB0::12::INSTR"
VI_ATTR_TMO_VALUE = timeout value
viSetAttribute: set 15,000ms (or 15sec) timeout value to VI_ATTR_TMO_VALUE parameter.
-----------------------
Another way is use INIT and FETCH commands, equivalent to READ command
When you use READ, data is not stored in memory.
Use this sequence without timeout problem: *ESR? read value of status events register to know when operation is terminated. DATA will be read when your scan will be finished.
SCPI command : INIT
SCPI command : *OPC
DO
put here pause of few msec to reduce GPIB communication
Hi, if you use READ command, timeout problem may occur, but you must set the VISA parameter VI_ATTR_TMO_VALUE, default value is 2000ms (or 2sec).
For example in visual basic: errorStatus = viSetAttribute(viDATAlogger, VI_ATTR_TMO_VALUE, 15000)
viDATAlogger is GPIB address like "GPIB0::12::INSTR"
VI_ATTR_TMO_VALUE = timeout value
viSetAttribute: set 15,000ms (or 15sec) timeout value to VI_ATTR_TMO_VALUE parameter.
-----------------------
Another way is use INIT and FETCH commands, equivalent to READ command
When you use READ, data is not stored in memory.
Use this sequence without timeout problem: *ESR? read value of status events register to know when operation is terminated. DATA will be read when your scan will be finished.
SCPI command : INIT
SCPI command : *OPC
DO
put here pause of few msec to reduce GPIB communication
SCPI command : *ESR?
end_of_measurement = Read value of this register
Loop until end_of_measurement =1
SCPI command : FETCH?
Regards
Yves