LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB instrument control

You will have to excuse me but I really new at this,

 

With this example uses GPIB

 

I want to do the same thing with a USB interface instrument:

 

 

How would the below program change?

 

Public RM As VisaComLib.ResourceManager 'Resource manager
Public PS As VisaComLib.FormattedIO488 'IO Object

Private Sub CommandButton1_Click()
Set RM = New VisaComLib.ResourceManager 'Resource Manager Object created
Set PS = New VisaComLib.FormattedIO488 'FormattedIO488 Object created
Set PS.IO = RM.Open("GPIB0::12::INSTR") 'IO Object created (enter VISA address of ENA)

PS.IO.Timeout = 10000 'Timeout time in msec

PS.WriteString ("*IDN?")
Sheet1.Cells(6, 2) = PS.ReadString

PS.IO.Close
Set PS = Nothing
Set RM = Nothing

End Sub

 

0 Kudos
Message 1 of 4
(559 Views)

Highly recommended "really new" goes and learns LabVIEW.  The "below program" isn't necessarily LabVIEW.  Recommend asking in CVI.  But also recommend "really new" go learn CVI. 

 

It's important to know how to ask the question and understand the answer.

0 Kudos
Message 2 of 4
(556 Views)

In theory if you are using VISA then the only change needed is "GPIB0::12::INSTR" would be replaced with the USB ID, something like "USB0::0x0B21::0x0025::39314B433337343138::INSTR".

 

That's the magic of VISA. 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 4
(525 Views)

thank you very much - about what I thought but it was nice to have a confirmed...

0 Kudos
Message 4 of 4
(482 Views)