Error -1073807346: The Given Session or Object Reference Is Invalid in NI VISA

Updated Nov 9, 2018

Reported In

Software

  • LabVIEW
  • Measurement & Automation Explorer (MAX)

Driver

  • NI-VISA

Issue Details

When I attempt to open a new VISA session to my instrument or use an existing session, I receive Error – 1073807346 VISA: (Hex 0xBFFF000E) The given session or object reference is invalid. 



How can I resolve this issue?

Solution

This error can happen for a number of reasons:
 
  • Wrong driver version NI 488.2 : check the version of NI 488.2 supports the GPIB hardware you use.
 
  • Incorrect Addressing: Verify that you are addressing your instrument correctly. To address your instrument, you can either use its VISA Alias or VISA Resource Name. These can be viewed in NI MAX on Windows or in the NI-VISA Configuration utility on Mac and Linux. For more information on how resource names are formatted, see the VISA Resource Name Control help.
 
  • Incorrect Port Settings: Go to the Device Manager and right click the port in which the instrument is connected to. Click in Properties and then the Port Settings tab. Click the  Restore Defaults button. You should then go to NI MAX and in the same port right the same port settings. 
 
  • Device Not Powered On: Verify that your device is connected correctly and powered on.
     
  • Missing Run-Time Engine: If you are deploying this application, verify that your deployment machine has the NI-VISA Run-Time Engine installed. See the Related Links section below for a link to the download page.
     
  • VISA Session Was Previously Closed: This error can also occur if the VISA session was unexpectedly closed during communication. The most common case in which this can happen is if the VISA resource is stored in a global variable. In this case, disabling the Automatically Close VISA Sessions option can prevent the error. In LabVIEW 6 and later, the Automatically Close VISA Sessions option is disabled by default. If it’s enabled on your system, you can disable it by following these steps:​​​
     
    • In LabVIEW 8.0 and later, select Tools»Options to display the Options dialog box. Then select Environment from the Category list. Uncheck the Automatically Close VISA Sessions checkbox and select OK.
       
    • In LabVIEW 6.and 7.x, select Tools»Options to display the Options dialog box. Then select Miscellaneous from the Category list. Uncheck the Automatically Close VISA Sessions checkbox and select OK.
Note: If you disable this option, then make sure you are calling VISA Close when you are finished communicating with the device.

Additional Information

The Automatically Close VISA Sessions option allows open VISA sessions to close automatically when the top-level VI goes idle. This option helps you avoid potential problems the next time you run the VI. As a result, when you try to access that VISA session using a global variable, you can get an invalid VISA session error if the option is enabled. 

WAS THIS ARTICLE HELPFUL?

Not Helpful