Hai, I am working with Visual Basics 2019 to control two devices using GPIB-USB-HS+. I could control one device by following syntax.
Dim GPIB_ResourceString1 As String
GPIB_ResourceString1 = "GPIB0::8::INSTR"
mbSession = CType(ResourceManager.GetLocalManager().Open(GPIB_ResourceString),
mbSession.Write("OUTX 0 ;")
response = mbSession.Query("OUTX ?").
Then how to control two devices with GPIBs? I could connect the two devices using two GPIBs, but not able to send command and read the response from a specific device. Can anyone help me in this? Thank you in advance.
Solved! Go to Solution.
Firstly, if you are just starting out with this code then NI advises not using NationalInstruments.VisaNS but switch to Ivi.Visa. The syntax is very similar.
Secondly, unless I am missing the point of your question. You just need the one GPIB controller and do this for the second instrument:
Dim GPIB_ResourceString2 As String
GPIB_ResourceString2 = "GPIB0::16::INSTR"
mbSession2 = CType(ResourceManager.GetLocalManager().Open(GPIB_ResourceString2), MessageBasedSession)
mbSession2.Write("OUTX 0 ;")
response2 = mbSession2.Query("OUTX ?").