From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

IVI +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 10
(8,048 Views)

Hi,

 

I have a few quick questions to help us clarify exactly where the issue is coming from and how to resolve this. What instruments are you trying to control and what interface do they use? Along the same lines which drivers have you got for these instruments. Why are you reluctant to use IVIConfigStore? It would greatly reduce the footprint of your code doing so.

Regards

Andrew George @ NI UK
0 Kudos
Message 2 of 10
(7,977 Views)

Hi Andrew

 

using something similar to the code below

==============================================================================

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
==============================================================================
 I would like to have direct access to the dmm without using the IVIConfigstore . Please can you advise me


how to this to this ,,,

 

Thanks

 

SBA

0 Kudos
Message 3 of 10
(7,949 Views)

Hi Andrew

 

This is an example from Agilent . I want to create solution which is independant of Agilent or Keithley or Fluke

 

Option Explicit

' Set up using Agilent IVICOM driver for Agilent33401
Dim dmm As New Agilent33401
Dim ividmm As IIviDmm


Private Sub btnTest_Click()
Set ividmm = dmm
ividmm.Initialize "GPIB::23", False, True, "Simulate=False"
ividmm.Configure IviDmmFunctionDCVolts, 1.5, 0.001
ividmm.Trigger.Delay = 0.01
lblResult.Caption = ividmm.Measurement.Read(1000)
ividmm.Close
End Sub

' ===============================================================================================

' Ref   http://www.ivifoundation.org/downloads/IVI%20short%20guides%20May%205-6%20%2009/IVI%20GSG%20VBasic%2...

' ===============================================================================================

 

Please advise me how to make this work ... There is no documentation anywhere on the internet on hwo to make this work.

 

Best wishes

 

SBA

 

 

0 Kudos
Message 4 of 10
(7,948 Views)

Well the Agilient Ivi drivers are supported by Agilient Technologies... Why are you asking NI?


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 10
(7,943 Views)

Sorry- Out of time to edit.

 

The MFGs (Keithley, NI, Agilient, Tectronixs (Fluke)

 

write ther own message parsers and hold their equipment to their own specifications.  IEEE 488.2 (SCPI) tried to standardize these messages and message formats for many "types" of equipment.  Not all "GPIB" equipment is truly IEEE488.2 COMPLIANT (some Keithly and Fluke DMMs are notacibly non-compliant).  So is the soon to be obsolete 33401-----for that reason!  the 34401 is a subset of the 19060's thecnology called the 3458A DDMM (Digitizing Digital Multi Meter).  This was based on th HPDML (Hewlette-Packard Digilal Multi-meter Language) a pre-cursor to SCPI.  so the 33401 speaks with an accent- (analogous to you reading "King James" english!)

 

Frankly, compliance to IEEE488.2 seems to limit equipment to a "least potential application" in my observations.  Why buy "Top quality" and limit the device to the definitions of the language you know?


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 10
(7,939 Views)

Hi Jeff

 

Accents are nice but you limit understandability if you drift away from a standard.

History forgives much and older instruments are not to blame for a later standard, but scpi can be extended to support all features of an instrument. 

And politeness aks from people to be understandable.....

 

have a nice weekend

greetings from the Netherlands
0 Kudos
Message 7 of 10
(7,930 Views)

Hi Albert & Jeff

 

Thank you for interest and commments. The agilent example was more of illustration of what I am trying to achieve but all the

same it is using an aligent IVI-COM driver

 

Really what I trying to learn how to do is use the drivers for IIviDmm so that I can have DMM driver which will work with most DMM

and be independant of any particular test equipment vender.

 

If you have any information which may help me  move closer to the solution I would be very happy if either you posted the information

 up on the NI forum board.

 

I hope and wish both of you are having a good weekend. Thank you for your time & comments.

 

Best wishes & regards

 

SBA

 

0 Kudos
Message 8 of 10
(7,924 Views)

I am sorry if I come off too hard.

 

not all instruments, and not all IVI.com drivers meet the ivi standards. PERIOD.  so, what will we do?  Bit-h or deal with it? The facts are we...the end users DO need to just accept the fact that not all "488.2 compliant" devices meet the SCPI standard...  If that is untrue in the Netherlands please,, let me in.


"Should be" isn't "Is" -Jay
Message 9 of 10
(7,906 Views)

Hello SBA,

 

The Drivers are written by the independent vendors specifically to support their instruments, therefore I would strongly advise that you use the drivers already written by the vendors rather than trying to create your own. We do not support Agilent, Fluke, Kiethley etc. Instruments and therefore we would not be able to comment on the specifics of each device, not to mention, much as Jeff has stated these instruments do not all follow the same standards and therefore a universal high level interface driver was written (the IVI driver). I would suggest contacting the appropriate vendor for information on the specific calls required for their instruments, and would strongly suggest that you use the IVI driver as is without making modifications. I wish you the best of luck with your  application.

Regards

Andrew George @ NI UK
0 Kudos
Message 10 of 10
(7,888 Views)