Sorry if my explanation was confusing. I have just the one GPIB card in the computer, but it's connected to several pieces of equipment. I've included a short bit of VB code that illustrates the problem.
The code should program dev1 to 20 volts, clear dev2, and then program dev1 to 10 volts. In reality, after dev2 is cleared, the second command to dev1 does not go through. Instead, I can see that the command gets routed to dev2 because when I step through the program, I get an invalid command error on dev2 when the line dev1.Write("P0.0100K") is excecuted (and another for the next line). Upon further infestigation, I have found that the problem is eliminated if a regular command is sent to dev2 after the clear (eliminate the comment in my code) . Then, subsequent commands go to dev1 as desired. Is there something about the clear command that I don't understand that makes this the predicted behavior?
Any insight would be greatly appreciated,
-Alex Gerdemann
University of Illinois Urbana-Champaign
Imports NationalInstruments.NI4882
Module Module1
Dim dev1, dev2 As Device
Sub Main()
dev1 = New Device(0,5)
dev1.Clear()
dev1.Write("P0.0200K")
dev1.Write("G")
dev2 = New Device(0,4)
dev2.Clear()
' dev2.Write("VOLT 4")
dev1.Write("P0.0100K")
dev1.Write("G")
End Sub
End Module