11-11-2018 07:41 AM
Hi All
I want to control a DMM 34411A with Visual Basic 2008, but the program does not connect to the device for usb.
Installed: NI-VISA 15.5, ICP15, Keysight io libraries, System Windows XP. In NI-VISA Interactive Control the device is determined.
In Visual Basic Add VisaCom 5.5 and Ivi.Visa.Interop .
Option Explicit On
Imports System
Imports System.ComponentModel
Imports System.Threading
Imports System.IO.Ports
Imports Ivi.Visa.Interop
Public Class Form1
Dim ioMgr As Ivi.Visa.Interop.ResourceManager
Dim myInstr As Ivi.Visa.Interop.FormattedIO488
Dim idn As String
Dim ResourseStr As String = "USB0::0x0957::0x0A07::MY53002107::0::INSTR"
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
ioMgr = New Ivi.Visa.Interop.ResourceManager
myInstr = New Ivi.Visa.Interop.FormattedIO488
Try
myInstr.IO = ioMgr.Open(ResourseStr)
Catch ex As Exception
MsgBox("Could not Connect!", vbOKOnly, "Error Opening Connect")
End Try
myInstr.IO.Timeout = 1000
myInstr.WriteString("*idn?")
idn = myInstr.ReadString()
RichTextBox2.Text &= idn
myInstr.IO.Clear()
myInstr.IO.Clear()
End Sub
End Class
Thank you in advance.
11-12-2018 05:48 PM
Hi Glenden,
To get a better scope of whats going on, can you answer the following question:
- Does your device show up in NI MAX under devices and interfaces?
- If yes, but as a USB raw device see: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019KvOSAU
- If no, does it show up in the windows device manager?
This will let us know if we need to focus on getting the device recognized, or if this is isolated to the code its self.
Thanks
11-13-2018 11:58 AM
Hi,
Yes, device show up in NI MAX. There was determined the VISA address: "USB0::0x0957::0x0A07::MY53002107::0::INSTR".
I'm trying to open the device in vb.net with the command:
myInstr.IO = ioMgr.Open("USB0::0x0957::0x0A07::MY53002107::0::INSTR")
and determine its IDN with the command:
myInstr.WriteString("*idn?")
This problem may be due to incorrect .Net Framework in vb.net 2008? I can set the maximum .Net Framework 3.5.
11-14-2018 11:44 AM
This problem was due to a conflict between the two drivers: NI VISA and Agilent VISA. In NI MAX-Conflict Manager, I set NI VISA disable, and programm in vb.net works.
Thanks Noah for the answer.
11-14-2018 12:19 PM
Hi Glenden, Sorry I wasn't more help, Glad you were able to resolve your issue!