10-23-2019 11:58 AM
Hai, I am working with Visual Basics 2019 to control two devices using GPIB-USB-HS+. I could control one device by following syntax.
Imports NationalInstruments.VisaNS
Dim GPIB_ResourceString1 As String
GPIB_ResourceString1 = "GPIB0::8::INSTR"
mbSession = CType(ResourceManager.GetLocalManager().Open(GPIB_ResourceString),
MessageBasedSession)
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.
10-24-2019 09:11 AM
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 ?").
11-04-2019 05:06 AM
Thank you for the reply, It works. We also need to define mbsession2 As MessageBasedSession.