Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Instrument ID query failed(ivi-com)

Solved!
Go to solution

Hi All:

      I tried to verify the interchangeable function about ivi-com,So I used the fluke45 to replace the agilent34401,and the ivi-com driver is agilent's.
I have created a driver session for fluke45,It is complied to the agilent's ivi-com driver.
      But it works fine when I connect to 34401,it doesn't work when I connected to the fluke45.
      And when the code excute  fluke45.Initialize("GPIB0::22::INSTR", true, true, "") ;have a error message:Agilent34401: Instrument ID query failed.
      I checked the gpib address and it is right,I don't know why it is happened.
      Can you give some ideas about that?
      Thanks a lot.

0 Kudos
Message 1 of 6
(5,569 Views)
Solution
Accepted by topic author cat099

 Hello cat,

       There are IVI-C specific drivers for both of those instruments on IDNet (ni.com/idnet), I recommend using those since they are NI-Certified and NI-Supported.  If you want interchangeability, you should either call into the class interface of your IVI-COM instrument drivers or use the IVI-C Class Drivers.  Please answer the following questions:

 

1.  What development environment are you using?

2.  Are you using the IVI-C Class drivers?

3.  What is the main goal of your test application?

 

Thanks,

 

NathanT

Message 2 of 6
(5,546 Views)

Hi Nathan:

  Thanks for your reply.

  1.the develop enviroment is C sharp.

  2.i don't know how to use the ivi-c driver,i am not sure if your meaning is the ivi-c drivers NI supports,such as:niDMM;niScope;niSwitch.....

Cause i am a ivi and c# junior user,i don't know how to invoke the ivi-c driver in the .net enviroment. Only use ivi-com.Can you give some advices about that?

  3.i want to check the interchangeable function of my test programme,So i installed the agilent's ivi-com driver,and i creat a driver session for fluke45,but i have

not installed the fluke45's ivi-com driver,Only select the agilent's driver as the fluke45 software module in the NI-MAX configuration,i am not sure if it is right.So when

i connected to agilent34401,the test works fine,but when i connected to Fluke45,it didn't work.

 

some codes in below:

"mydmm" is a logical name,fluke45 is a driver session. 

 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Ivi.SessionFactory.Interop;
using Ivi.Dmm.Interop;
using Ivi.Driver.Interop;

namespace hp34401
{
    public partial class Form1 : Form
    {
        private IIviDmm fluke45 = null;
        public string value;
        public Form1()
        {
            InitializeComponent(); 
        }

        private void button1_Click(object sender, EventArgs e)
        {
           
            MessageBox.Show(fluke45.Identity.Identifier);
            fluke45.Function = IviDmmFunctionEnum.IviDmmFunction2WireRes;
            fluke45.Configure(IviDmmFunctionEnum.IviDmmFunctionDCVolts,1,1);
            double mytest = fluke45.Measurement.Read(1000);
            bool error = fluke45.Measurement.IsOverRange(mytest);
           
            if (error)
            {
                MessageBox.Show("this value is overrange");
            }
            else
            {
                value = mytest.ToString();
                textBox1.Text = value;


                MessageBox.Show(value);
            }
           
          
             // MessageBox.Show(id);
         
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            IviSessionFactoryClass sf = new IviSessionFactoryClass();
           
            fluke45 = (IIviDmm)sf.CreateDriver("mydmm");
          
            fluke45.Initialize("GPIB0::22::INSTR", true, true, "");
        }

        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            fluke45.Close();
        }
    }
}

0 Kudos
Message 3 of 6
(5,517 Views)

Hello cat,

       Thank you for answering all of my questions.  Each instrument or series of closely related instruments needs a separate software module that is installed by the IVI Instrument Specific Driver Installer.  The reason that the ID Query is failing is because the 34401 instrument driver is written for the 34401 and not the Fluke 45.  If you would like to control the Fluke 45, you should install an instrument specific driver for it.  Interchangeability is achieved by using the Class Driver (in IVI-C) or Class Interface (in IVI-COM) with a logical name that points to the driver session.  To interchange, all you need to do is change which driver session the logical name points to (assuming that the driver session is configured properly).

 

Here is a link to help you in C#.

 

Thanks,

 

NathanT
0 Kudos
Message 4 of 6
(5,498 Views)

Hi Nathan:

     Thanks a lot.

     If your meaning is i must install the specific driver for the instrument i used.And the specific driver must be ivi-com or ivi-c?

 

BR

0 Kudos
Message 5 of 6
(5,487 Views)

You might want to review some of the information available from the IVI Foundation.

 

Yes, you have to install the instrument specific driver and configure MAX to point to that driver. You can use either IVI-C or IVI-COM.

 

The important thing to remember is that your program cannot use the instrument specific driver. You have to use the class driver/interface.

0 Kudos
Message 6 of 6
(5,467 Views)