Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the National Instruments IVI driver IviDmmLib in Visual Basic 6 . VB6

Hi

I have this script in VB6 (visual basic 6). This script is trying to access the
IVI class driver from NI called IviDmmLib as described below. I do not want to
use the IVIConfigStore system I want to access the instrument directly by
initializing each one myself to a VISAGPIB address.

I have already got the VISA///GPIB interface to work on its own using
using the IVI foundation method FormattedIO488 as below
==============================================================================
Private Sub cmdRUN_Click()
' in project reference do not forget to add as a project reference
' VISA COM 3.0 Type Library . This is for the NI driver
' and not the Agilent drivers
Dim Result As String
Dim VGaddress As String
Dim ioMgr As VisaComLib.ResourceManager
Set ioMgr = New VisaComLib.ResourceManager
Dim VGb As VisaComLib.FormattedIO488
Set VGb = New VisaComLib.FormattedIO488
VGaddress = Trim(Text_input.Text) 'Read text from a text box on a form
'Use Trim() to remove leading/trailing
'spaces from Vgaddress
Label_output.Caption = "Talking to address :: " + VGaddress + vbLf
Set VGb.IO = ioMgr.Open(VGaddress)
VGb.IO.Timeout = 10000
VGb.WriteString ("*IDN?") ' Poll instrument at vgaddress with *IDN?
Label_output.Caption = Label_output.Caption + "Sending IEC bus command *IDN? " + vbLf
Result = VGb.ReadString ' read result from instrument
Label_output.Caption = Label_output.Caption + "Information return by instrument " + vbLf
Label_output.Caption = Label_output.Caption + Result + vbLf
VGb.IO.Close
End Sub
===============================================================================
Now the issue is how to do the same thing with the IVIDmm driver. I have got
most of the text correct the difficult bit is to set up the IVIDmm driver at
the beginning of the procedure routine. This is the area where some help
is needed.
===============================================================================
Ref Library IviDmmLib ::: Ref IviDmm 3.0 Type Library
( C:\Program Files\IVI Foundation\IVI\Bin\IviDmmTypeLib.dll )
==============================================================================

The programm thats the issue
----------------------------

Private Sub Command1_Click()
Dim Dmm As IIviDmm
'Dim Dmm as New
'Set Dmm = Factory.CreateDriver("IviDmm")
' Set dmm = New IviDmmLib.IIviDmm
Dmm.Initialize "VISA://192.168.3.25/GPIB0::26::INSTR", False, True
Dmm.Function = IviDmmFunctionDCVolts
Dmm.Configure IviDmmFunctionDCVolts, 1.5, 0.001
Dmm.Trigger.Delay = 0.01
Label_output = Dmm.Measurement.Read(1000)
Dmm.Close
End Sub
==============================================================================
Please can you have a look at the above script and advise me on how to get the
script to work.
Thank you for your help and assistance.
==============================================================================

0 Kudos
Message 1 of 2
(4,214 Views)

This is a duplicated post. Please see this thread.

 

SBA-IVIDriversVB6 - Please avoid duplicating your posts in this way.

 

Best Regards,

 

Christian Hartshorne

NI|UK

 

 

 

0 Kudos
Message 2 of 2
(4,192 Views)