Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA COM strange behaviour

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
0 Kudos
Message 1 of 2
(4,054 Views)
Makoto:

Both things you have observed are intended behavior for this release.

The multiple resource manager sessions are harmless. We use 1 RM session per I/O session for easier isolation between components. We will continue to do so in the future.

The viOpen for multiple I/O sessions is something that will disappear in the next NI-VISA release. The NI SRM component needed certain information that was only available after opening a session. In the VISA 3.0 specification (and the next NI-VISA release) we will be adding a function to provide more information at parse time (without opening the session).

Neither symptom you observed should have any negative side effects. Let us know if it caused any problems for you.

Dan Mondrik
Senior Softwar
e Engineer, NI-VISA
National Instruments
0 Kudos
Message 2 of 2
(4,054 Views)