I have an issue when exporting a datalog on the N6705B. I am using the AgilentN67xx version 1.4.4.0 IVI driver from Keysight to control the instrument remotely. To access the driver I am using ctypes to access the IVI-C part of the driver.
This is what I try to do in general steps. They are mostly successful, except for one detail:
- Initialize connection: OK
- Configure voltage/current for output channel 1: OK
- Configure datalog sample interval and duration: OK
- Initialize datalog: OK
- Trigger datalog: OK
- Stop datalog: OK
- Export datalog data to .csv and read the file from instrument: ERROR
- Close, etc
I check for errors after each call to a driver function. The instrument returns no errors until after I call the driver function AgN67xx_ExportDlog to export the datalog (this function sends MMEMory:EXPort:DLOG). After this function call, any other function call will generate the instrument error -420: Query UNTERMINATED. I am guessing that the export function doesn't finished completely. However, this does not seem to affect the operation of the driver: I am still able to read the file from the instrument.
Another note, this error only occurs for somewhat large files, some hundreds of kilobytes or larger.
I have attached a complete overview of the function calls that lead to the error, with comments and parameters to further explain what I am doing.
This is what I try to do in general steps. They are mostly successful, except for one detail:
- Initialize connection: OK
- Configure voltage/current for output channel 1: OK
- Configure datalog sample interval and duration: OK
- Initialize datalog: OK
- Trigger datalog: OK
- Stop datalog: OK
- Export datalog data to .csv and read the file from instrument: ERROR
- Close, etc
I check for errors after each call to a driver function. The instrument returns no errors until after I call the driver function AgN67xx_ExportDlog to export the datalog (this function sends MMEMory:EXPort:DLOG). After this function call, any other function call will generate the instrument error -420: Query UNTERMINATED. I am guessing that the export function doesn't finished completely. However, this does not seem to affect the operation of the driver: I am still able to read the file from the instrument.
Another note, this error only occurs for somewhat large files, some hundreds of kilobytes or larger.
I have attached a complete overview of the function calls that lead to the error, with comments and parameters to further explain what I am doing.
I definitely think the issue here is that the export function is not complete before you try to read the file back. I did a quick benchmark at my PC and the export of am 11 MB file to .csv took about 75 seconds. I would recommend either putting a delay of some sort or using the AgN67xx_SystemsWaitForOperationComplete function with something like a 90 s maximum timeout. Once the file is exported, you can resume with the file readback.
Let us know if that works.