I am using NiVisaCom (with NI-VISA 2.6) on a small system and have a problem. When openning the instrument with an ResourceManager.Open() method call, there are multiple viOpen calls are recorded in the spy log. (See the SPY log attached) My program calls Open method only once per an instrument but I don't know why viOpen() are invoked twice for the same i/o resource. Also I believe that OpenDefaultRM call is needed only once per a process, but it is definitely invoked whenever I call ResourceManager.Open or VisaSession.Init. Below is an example from MS-Excel VBA using NiVisaCom. The attached SPY log is what generated by the rm.Open("ASRL1::INSTR") call only. The Resource Manager I used is NI SRM, not GRM. The same symptom also happens
with NI GPIB.
Dim rm As VisaComLib.ResourceManager
Set rm = CreateObject("NIVisaCom.NIResourceManager")
Dim m As VisaComLib.IMessage
Set m = rm.Open("ASRL1::INSTR")
Dim s As VisaComLib.ISerial
Set s = m
s.BaudRate = 9600
s.Parity = ASRL_PAR_NONE
s.DataBits = 8
s.StopBits = ASRL_STOP_ONE
s.FlowControl = ASRL_FLOW_NONE
m.TerminationCharacter = 10
m.TerminationCharacterEnabled = true
m.Close
regards,
Makoto Kondo