VISAInterface: Timeout configuration error.
Hi All,
I'm currently implementing some drivers for a Dc supply using VISAInterface.
I noticed that the Timeout has been multiplied x1000 when I run VISAInterface.execute_command(command)
When I run 'execute_command' with default timeout, the timeout that I defined in the constructor is multiplied x1000.
When I run 'execute_command' setting the timeout as argument, the timeout is set correctly.
Example:
# main.py
import os
import openhtf as htf
from spintop_openhtf import TestPlan, PhaseResult
from spintop_openhtf.plugs.visa import VISAInterface
""" Test Plan """
# This defines the name of the testbench.
plan = TestPlan('DcSupply')
dcsupply_plug = VISAInterface.as_plug('dcsupply_plug',instrument='TCPIP::0.0.0.0::5025::SOCKET')
@plan.testcase('DcSupply-Test')
@plan.plug(dcsupply=dcsupply_plug)
def dcsupply_connect(test,dcsupply):
try:
dcsupply.open() # default timeout set to 5000 ms
dcsupply.instr.read_termination ='\n'
dcsupply.instr.write_termination = '\n'
dcsupply.execute_command('INST OUTP1',timeout=10) #timeout is set to 10000 ms
dcsupply.execute_command('VOLT 3.3') # timeout is set to 5000000 ms
dcsupply.execute_command('VOLT 5') # timeout is set again to 5000000 ms, i.e the default value has not been overwritten in the last execution of the command.
test.logger.info('Dc Supply open.')
except Exception as e:
test.logger.info(f'Dc Supply open failed. {e}')
return PhaseResult.STOP
if __name__ == '__main__':
plan.no_trigger()
plan.run_console(once=True)
P/S: Sorry that I'm not fixing the code by my self but I'm not enough confident with it.
For debugging the visa connection I'm using NI IO Trace that comes with NI MAX.