0

I am trying to read voltage measurements from my Unisource 4100 GPIB DMM. I know I can connect to the device because I get appropriate responses with the commands '*RST' and '*IDN?', however I cannot get any responses with other commands such as 'SYST:ERR?' or 'CONF:VOLT:DC 1000, 0.001'. I have tested out the code I am trying with on the Agilent 34410A and managed to get the responses I want, but not with the Unisource 4100. I am using the NI GPIB-USB-HS controller to interface with. I have included the code below. Should the SCPI commands not work for all GPIB interfaces? What changes would I have to make to elicit a response from the Unisource 4100?

I have included some code for reference:

using System;
using System.Collections.Generic;
using System.Threading;
using System.Text;
using Ivi.Visa.Interop;


namespace CsharpExample
{
    class VoltageExample
    {

    static void Main(string[] args)
    {

        VoltageExample DmmClass = new VoltageExample(); //Create an instance of this class so we can call functions from Main


            Ivi.Visa.Interop.ResourceManager rm = new Ivi.Visa.Interop.ResourceManager(); //Open up a new resource manager
            Ivi.Visa.Interop.FormattedIO488 myDmm = new Ivi.Visa.Interop.FormattedIO488(); //Open a new Formatted IO 488 session 

        try
        {
            string DutAddr = "GPIB0::12::INSTR"; //String for GPIB

            myDmm.IO = (IMessage)rm.Open(DutAddr, AccessMode.NO_LOCK, 10000, ""); //Open up a handle to the DMM with a 2 second timeout
            //myDmm.IO.Timeout = 20000;


            myDmm.IO.Clear(); //Send a device clear first
            myDmm.WriteString("*RST", true); //Reset the device
            myDmm.WriteString("*IDN?", true); //Get the IDN string                
            string IDN = myDmm.ReadString();
            Console.WriteLine(IDN); //report the DMM's identity

            myDmm.WriteString("*TST?", true); //Get the IDN string 
            Thread.Sleep(5000);             
            string TST = myDmm.ReadString();
            Console.WriteLine(TST); //report the DMM's identity

            myDmm.WriteString("SYST:ERR?", true); //Get the IDN string    
            string ERR = myDmm.ReadString();
            Console.WriteLine(ERR); //report the DMM's identity

            myDmm.WriteString("CONF:VOLT:DC 1000, 0.001", true);
            DateTime time = DateTime.Now;  //Timer to measure the time difference to get all the readings
            TimeSpan diff;
            Console.WriteLine("Measurement in Volts");
            for(int i = 0; i<10; i++){
                //Configure for DCV 100V range, 100uV resolution
                myDmm.WriteString("READ?", true);
                String DCVResult = myDmm.ReadString();
                Console.WriteLine("DCV Reading = " + DCVResult); //report the DCV reading
                DmmClass.CheckDMMError(myDmm); //Check if the DMM has any errors
                Thread.Sleep(1000);
                diff = DateTime.Now.Subtract(time);
                //diff = DateTime.Now.Subtract(time.AddSeconds(1).AddMilliseconds(20));
                Console.WriteLine("\t\t\t" + diff);
            }

            myDmm.WriteString("CONF:RES 100, MAX", true);
            Console.WriteLine("Measurement in Ohms");
            for (int i = 0; i < 10; i++)
            {

                //Configure for res 1000 Ohm range, 100uV resolution
                myDmm.WriteString("READ?", true);
                String OHMResult = myDmm.ReadString();
                Console.WriteLine("Resistance Measurement = " + OHMResult); //report the DCV reading
                DmmClass.CheckDMMError(myDmm); //Check if the DMM has any errors
                Thread.Sleep(500);
            }


        }
        catch (Exception e)
        {
            Console.WriteLine("Error occured: " + e.Message);
        }
        finally
        {
            //Close out your resources
            try { myDmm.IO.Close(); }
            catch{}
            try{ System.Runtime.InteropServices.Marshal.ReleaseComObject(myDmm);}
            catch {}
            try{
            System.Runtime.InteropServices.Marshal.ReleaseComObject(rm);
            }
            catch {}
            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();

        }

    }
  • Not all GPIB instruments support SCPI commands. In fact, a lot of them do not (even if they respond to *IDN? or *RST). As a first port of call I would dig out the manual - I have had a quick google but cannot find much for UniSource products - did the DVM come with a manual you can consult? – RPM Feb 03 '16 at 22:00
  • Not that I can find. I found the multimeter sitting around and decided to get it working. I spent some time as well looking around for the user manual as well as other Unisource manuals, however I did not have much luck – Danyon Chu Feb 04 '16 at 14:05
  • Hm. Well it is then really difficult to say what could be wrong with your code without the manual. It is perfectly possible that the instrument is not SCPI-compatible. Even if it is, it may not respond to all commands. Alternatively, it could be something as mundane as not using the correct termination character – RPM Feb 04 '16 at 20:37

0 Answers0