Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Conflicting errors on remote multimeter (moved post)

Hey there, I am trying to set up a GPIB interface for an Agilent multimeter, specifically the 34401A, using Measurement Studio and VB .NET. I can query the device type and it returns the appropriate multimeter description. However, when I attempt to send a command such as "MEAS:RES?" I reveive error code 550, claiming that the meter received a "READ?" command while in local mode. The problem is that the device should default to remote mode anyway. When I attempt to set the device into remote mode manually I get error code 514 - command only allowed in RS-232 interface. Does anyone know what may be going on here or where I can look (besides the manuals) for some help?
CLA, CCVID, Certified Instructor
0 Kudos
Message 1 of 4
(3,448 Views)
More info -
It turns out that the multimeter was not in fact in remote mode, though the *idn? command worked fine. It seems that the only way I can get the device into remote mode is to open up the MXB file in the solution. This seems to set the device to remote mode and the executables that I build from the solution work fine. If I do NOT open the MXB file at least once before I build the solution then the device will not default to remote mode and the executable built from the solution will yield the "received READ? command while in local mode" error. Again, I cannot manually set the device to remote mode within my code via a command or I will receive an "only allowed in RS-232 interface" error. I know I must be missing something. It does not seem right to have to use the NI task helper system in order to get the device to work properly.
CLA, CCVID, Certified Instructor
0 Kudos
Message 2 of 4
(3,442 Views)
Opening the MXB file is a little different from using the GPIB interface - the IIOA assistant always uses NI-VISA to communicate with the device, and does more when opening a session than what the GPIB interface alone would do. Try the following:
In your code, after creating the NI4882.Device object, call SetRemoteEnableLine() on it. This should put the device in a state where it will support remote operation. The command to set the instrument to remote mode is there for serial because the serial bus doesn't have a Remote Enable (REN) line like GPIB.

If you want to completely restore the state of the device, call GoToLocal() on the device before disposing it. This will put the dmm back into local mode.
0 Kudos
Message 3 of 4
(3,437 Views)
Glenn - Thanks very much for your help. I created a Board then called SetRemoteEnableLine() on it after creating the device and that did the trick.
CLA, CCVID, Certified Instructor
0 Kudos
Message 4 of 4
(3,429 Views)