Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Ni-VISA commands in EXCEL VBA (64bits) not working (viOpenDefaultRM, viwrite, viread etc.)

Hi, I am working on using EXCEL VBA for lab automation including controlling lab instrument (v/i/load); downloading screen capture etc. 

 

In VBA reference, I included

  • VISA-COM 5.13 Library,
  • VISA-COM 488.2 Formatted I/O 5.13  (with or without this doesn't really make any difference of non-function of viXXX command)
  • Keysight VISA COM  Resource Manager 2.0;

 

The VBA doesn't recognize any viXXX command such as viOpenDefaultRM etc. 

Question: Is this caused by visa32.dll not compatible with Excell 64 or other reasons?  Any advise? 

Thanks for your time and support!

 

BTW, 

The VBA does work with the following syntax: 

------------------------------------------------------------------------------

Dim ioMgr As VisaComLib.ResourceManager
Dim Equip As VisaComLib.FormattedIO488

Set ioMgr = New VisaComLib.ResourceManager
Set Equip = New VisaComLib.FormattedIO488
Set Equip.IO = ioMgr.Open("USB0::0x0699::0x0503::C010200::0::INSTR")

Equip.WriteString "*IDN?"
MsgBox Equip.ReadString

Equip.IO.Close

-------------------------------------------------------------------------------------

0 Kudos
Message 1 of 2
(1,844 Views)

VISA 5.13 sounds very old. Is that NI VISA or the VISA installation from Keysight? Not sure about the Keysight versions but 5.13 would be definitely way pre 64-bit support for the NI versions. So either install a recent NI version of NI VISA or check with Keysight what you need to be able to use the driver from VBA from a 64-bit application.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 2
(1,715 Views)