Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

What driver or VISA do I need to control instrument like oscilloscope using MS Excel VBA thru USB?

Hello,

 

I am new to automation but just needing to do it. Would anyone help me identify what NI Driver or if it's VISA do I need for me to control oscilloscope using MS Excel thru USB?

 

Thanks in advance.

0 Kudos
Message 1 of 9
(8,650 Views)

The NI driver that is used for USB communication is NI-VISA development. You will also need the wiindows driver from the scope vendor.

0 Kudos
Message 2 of 9
(8,637 Views)

Would there be trial version of NI Visa which is free for a certain period of time. Just for me to try, and then will get a full version once I am successful with my project?

0 Kudos
Message 3 of 9
(8,606 Views)
It's free if you use NI hardware or software. The development version is available for download but you should check with your local Sales Engineer or call NI.
0 Kudos
Message 4 of 9
(8,596 Views)

I already installed NI Visa, and I am now working on VBA codes in MS Excel to control oscilloscope:

Below are the codes but I am having run time error in opening a communication to the instrument, though I can already control the instrument using a built in software. But on excel I have problem.

I already added the 'VISA COM 3.0' and 'VISA COM 488.2 Formatted I/O' in the References, is there something I still need to do?

 

 

'''*******************************

Function AcquireIDN()

Dim ioMgr As VisaComLib.ResourceManager
Dim instrAny As VisaComLib.FormattedIO488
Dim idn As String

'instrAddress = 1
Set ioMgr = New VisaComLib.ResourceManager
Set instrAny = New VisaComLib.FormattedIO488
Set instrAny.IO = ioMgr.Open("USB::0x0699::0x040F::C012694::INSTR")   '''I am having run time error '-2147221487 (80040011)' in this specific line... 

instrument.WriteString "*IDN?"
idn = instrument.ReadString()
ActiveSheet.Cells(1, 1) = idn

End Function


'''*******************************

0 Kudos
Message 5 of 9
(8,588 Views)
Sorry, I've never used excel for instrument communication. Perhaps an Excel specific forum would be better.
0 Kudos
Message 6 of 9
(8,581 Views)

HI,,

 

Usually there is a number after the USB in the resource name. Try a zero or 1 after USB.

 

"USB0::0x0699::0x040F::C012694::INSTR"

 

Curt

0 Kudos
Message 7 of 9
(8,551 Views)

I have a similar problem.

 

I am trying to read an RTD channel from an NI PXI-4357 input module in a NI-PXIe chassis.

 

I tried the following codes to connect to the module, but encounter "Type mismatch" error
on the ioMgr.Open statement:

Sub ReadRTD()

    Dim ioMgr As VisaComLib.ResourceManager
    Set ioMgr = New VisaComLib.ResourceManager

    Dim pxi4357 As VisaComLib.FormattedIO488
    Set pxi4357 = New VisaComLib.FormattedIO488

    Set pxi4357.IO = ioMgr.Open("PXI24::0::INSTR")
    .
    .
    .
End Sub

 

I have search through the web for programming examples and these codes are identical to those I've found. What have I done wrong?

 

Besides, anybody know how do I select a particular input channel for reading? Where can I find programming reference/manual
on the VBA VisaComLib?

 

Thanks in advance

0 Kudos
Message 8 of 9
(8,439 Views)

You don't need the VISA manual for this, you need the Oscope instrument programming manual. You never did state which Oscope you are using. Go to the NI web section for drivers and type in tyour manufacturer and model number and find the driver for the scope. You might look at the examples they will most likely have in the instrument manual showing how to address and command the instrument.

0 Kudos
Message 9 of 9
(8,430 Views)