Example Code

Controlling E5062A VNA with GPIB

    Other

  • VBA

Code and Documents

Attachment

Download All

Description

Hello,

 

I'm trying to setting up a connection between E5062A VNA and a computer (more precisely in VBA).

I just installed drivers ni-488.2_21.5_online and ni-visa_21.5_online. When my VNA is connected through GPIB/USB, I can see it with NI MAX software and I can even send the command *IDN? to obtain the VNA parameters :

01 [joined file 01.png]

 

My VBA code is :

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

Sub test()

 

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("GPIB0::1::INSTR")

 

 

'Equip.WriteString "*RST"

'Equip.WriteString ":SYST:PRES", True

 

End Sub

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

I'm trying to setting up the connection (this doesn't work) and tried a reset of VNA, but I already got an error with the "Dim ioMgr As VisaComLib.ResourceManager" line :

02 [joined file 02.png]

I already did a communication with a E5063A with only USB cables and a VBA soft and it worked, that's why I don't understand my mistakes. I also read some Keysight pdf docs with many pages but nothing really helped me. I'm sorry if I'm not in the good forum section.

 

Thanks a lot for future answers!

 

 

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
tolltroll
NI Employee (retired)
on

Hi axiome,

Your post looks like it would be better suited for the Instrument Control Discussion Forum. Would you mind creating a new post in that forum?

Thanks!

N

Contributors