12-21-2015 09:33 AM
Goal
Get any errors from the GPIB card or Agilent DMM.
For example, if a command string has a syntax error, say " TRIG:COUNT,1" instead of the correct " TRIG:COUNT 1", I want to capture that error.
Setup
Windows 7 Pro 64 bit
Visual Studio 2015, creating a Windows executable in c#.
NI-488.2 14.0
NI-488.2 Runtime 14.0.1
NI-488.2 Support for .NET 4.5
NI PCI-GPIB card, using driver 14.0.0.49152
Agilent 34970A DMM/Switch Unit, GPIB address 10
Current State
Testing
I am not very experienced with OO/.NET, so this is hopefully a simple oversight on my part.
I am used to using the "classic" ibfind and ibdev commands and returning and checking the value of ibsta to get the error conditions. I have attached a screenshot of the Intellisense of the device.write command, showing the Exceptions for this call:
I thought the last two items above would pass thru any GPIB instrument command issues, but maybe I misunderstand the purpose.
If more information is required, I will supply.
Pete_SDI
12-21-2015 03:38 PM
12-22-2015 08:26 AM
12-22-2015 06:30 PM
Mr. Knutson,
Thank you for the information; I apologize for my ignorance with these newer approaches.
I may not be an expert in the instrument manual, but I am trying to determine if the error lines on the GPIB have been set, which I thought would happen if there was a syntax error on the command sent to the instrument (I thought the instrument would set an the 2-byte status (ibsta?), then I could send the ERR? query).
I wasn't intending to use the low level ib* commands, but the serialPort class from the System.IO.Ports & NationalInstruments.NI4882. I am not clear if these are using VISA or not.
Pete
12-23-2015 02:31 AM
12-23-2015 01:06 PM
No arguments about VISA being new.
I have had problems with vendor-specific instrument drivers in the early 2000s (and the vendor specific versions of VISA, NI vs Tek, vs Agilent), but I am willing to try the NI 34970 VISA driver.
If I do, should I be using the VisaNS interface (the .NET approach)?
Or do you have another suggestion for using the VISA driver within a c# project?
Pete_SDI
12-24-2015 07:18 AM
01-05-2016 10:16 AM
Dennis,
Thank you for your help.
I'm working to increase my understanding of the returned status when sending a GPIB command in the new VS Classes for GPIB (NationalInstruments.NI4882, System.IO.Ports.SerialPort) versus the old way (ibwrt). This newer way is using VISA underneath, I believe.
I'm pretty sure that the old way would show an argument error (for example, EARG (4), as shown in http://digital.ni.com/public.nsf/allkb/2FA525A8585A92E9862566EE002A3755), but I'm having a problem seeing the error (exception?) when using device.Write.
I will update this thread as a figure things out.
01-06-2016 09:45 PM