Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Conflicitng errors on a remote multimeter

Hey there, I am trying to set up 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 R#-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 7
(7,095 Views)
JS,
This sounds like a problem with the device. Are you using the GPIB or VISA interface to talk to the device? Can you post the code that you're running that causes this problem? Also, if you're using VB.NET, you might find it more beneficial in the future to post to the Measurement Studio for .NET forum.
0 Kudos
Message 2 of 7
(7,088 Views)
Just realized I should've posted in the .NET forum, I will repost there.
I am using a GPIB interface. The code I am trying to execute is incredibly simple, as I am just learning how to use measurement studio and how to interface with these type of devices.
I wanted to write a simple program to allow a user to type in a text command and write it to the connected device and then read the buffer back as a string. I was not too concerned with error checking and robustness considering this is my first measurement studio project.
Here is literally my entire program:

Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "
#End Region

Private m_Multimeter As Device

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
m_Multimeter = New Device(0, 22, 0, TimeoutValue.T10s) ' have also used the 2 argument version with (0, 22)
End Sub

Private Sub WriteButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WriteButton.Click
m_Multimeter.Write(CommandBox.Text)
End Sub

Private Sub ReadButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReadButton.Click
OutputBox.Text = m_Multimeter.ReadString()
End Sub
End Class

The command box is for the user to type in the text command to the device. This code worked fine for me two nights ago but when I opened the project the next day I started to get the conflicting error codes which I do not understand. I have tried rebooting the multimeter, rebooting the PC, and disconnecting the device from the PC, just to make sure it wasn't a fluke.
CLA, CCVID, Certified Instructor
0 Kudos
Message 3 of 7
(7,083 Views)
JS,

Are you using a National Instruments GPIB board? I believe that you have to manually assert the remote line (ibsre 0 1) in your VB code. If you are using an NI board then you can also set the board to assert REN when system controller...Can you send *IDN? and MEAS? in your VB code?

Craig H.
NI Applications Engineering
0 Kudos
Message 4 of 7
(7,058 Views)
Craig,

I am using a NI GPIB board. I have it hooked up to an Agilent 34401A multimeter. I have seemed to have solved the problem with the conflicting error codes. I added a board object and called "SetRemoteEnableLine()" in my initialization. That seemed to work fine.

When you say manual assert "isbre 0 1" I am unclear what you mean. If this is a command to write to a device or board it didn't work for me. My application hanged when I tried to write this to the board and my multimeter reported a syntax error when I tried to write this to the device. Could you explain more to me about what you mean by asserting ibsre 0 1?

Since I've added the SetRemoteEnableLine() call in my application I've been able to send any valid command and receive valid output. The problem I am having now is with detecting when there is an error waiting in the error queue of the device. Here is a link to that post(http://forums.ni.com/ni/board/message?board.id=232&message.id=1185), perhaps you know what I am doing wrong.

Thanks for your help. I definitely appreciate it.

~ Jeramy
CLA, CCVID, Certified Instructor
0 Kudos
Message 5 of 7
(7,054 Views)
Jeramy,

the IBSRE command is to set or clear the REN line...same as the 'SetRemoteEnableLine() in .NET (I guess I was lazy and didn't look up the proper .NET version...Sorry about that!)

With regards to your post here (http://forums.ni.com/ni/board/message?board.id=232&message.id=1185) did the last poster answer your question?

Craig H.
NI Applications Engineering
0 Kudos
Message 6 of 7
(7,034 Views)
Craig,

Thanks for your help. I didn't realize that the IBSRE line with REN was the equivalent of .SetRemoteEnableLine(), so it was my bad as well. I was just confused because I had read alot of posts about using IBSRE.

About the post: http://forums.ni.com/ni/board/message?board.id=232&message.id=1185

Glenn definitely helped to explain the Summary Register and Standard Event Register of the device I am working on and gave me a link to the manual. I was using the *SRE command completely wrong, but now I am using it correctly....I am just missing something. I made another post on that thread. If you could help, please go take a look at it. Thanks very much for your time.

~ Jeramy
CLA, CCVID, Certified Instructor
0 Kudos
Message 7 of 7
(7,026 Views)