When using VISA Open to connect to a Tektronix AFG2021 function generator, occasional errors are generated. It works fine 90% of the time but the remaining 10% reports errors such as:
-1073807297 A format specifier in the format string is invalid.
-1073807343 Insufficient location information or the device or resource is not present in the system.
-1073807360 Unknown system error (miscellaneous error).
-1073807229 Invalid length specified
-1073807302 Unable to start operation because setup is invalid (due to attributes being set to an inconsistent state)
Occasionally the code will hang inside VISA Open and requires Task Manager to close LabVIEW.
I am using the 64 bit version of LabVIEW but I have tried the 32bit with similar results. I have also tried installing on another PC and upgrading the firmware on the instrument with no improvement. In the past I have had success communicating with a Tektronix AFG1022 function generator with no issues.
I suspect that there could be some sort of driver issue but I really don't know where to start. When the instrument is plugged into the USB for the first time Windows reports that the device is not recognized but if I search for a driver online, a suitable one is found and device appears as a "USB Test and Measurement Device" in device manager. MAX finds the instrument however it reports the AFG2021 as unknown model and manufacturer. Is there a way I can verify that the correct driver is being used?
System Info:
LabVIEW Full 2017 f2
Windows 7 Professional
AFG3000 series driver available from NI website
NI VISA 17.5
Thanks,
David