LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI Switch getting the current topology

I am using a PXI-2527 and I have a need to change the topology during the test. I would like to be able to get the current topology and compare it with what I need for that test. That way I only change it if needed. I have looked through all the available VIs and property nodes but can not find one that returns the current topology. Is this available?

 

0 Kudos
Message 1 of 6
(3,784 Views)

Hi dirque-

 

     Here is a KnowledgeBase article that discusses how to do this.  It specifically mentions how to do it in text-based programming, but the VI you would use in LabVIEW is niSwitch Initialize with Options.vi.  Here is the explanation from the LabVIEW Help pages:

 

"Returns a session handle used to identify the switch module in all subsequent NI-SWITCH calls and optionally sets the initial state of the session.

This VI creates a new IVI instrument driver session for the switch module specified in the resource name. If multiple topologies are valid for that device, NI-SWITCH uses the default topology specified in MAX. The topology is also configurable in option string."

 

     I hope this helps.  Best of luck with your application!

Gary P.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(3,767 Views)

No, that does not help.

 

I want to find out what the current topology is, not set one. The goal is to save time by NOT re-initializing the switch unless I have to change the topology. That vi, which I am already using, always sets a new topology.

 

 

0 Kudos
Message 3 of 6
(3,758 Views)

dirque-

 

     My mistake, I thought you were trying to do something more difficult than what you are actually trying to do.

 

     The current topology is set with the niSwitch Initialize with Topology.vi.  It has an input string that enumerates the topology for the switch.  That is the current topology.  Why don't you just take that topology input string and compare it to a string that contains the topology name that you need?  Then you can change the topology using the VI I referenced above.

Gary P.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 6
(3,741 Views)

There is no way to read the current topology that is set.  Or at least that I know of.  Maybe there is some secret property node that could return this value.

 

Create a variable to store the current topology enum.  When you set the topology, store it into the variable.  Now you have something to compare against.  You could use a Global or a Local, or even a shift register to store the topology.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 6
(3,734 Views)

I spoke too soon.  There is a property node that returns the currently set topology.  The property you are looking for is Inherent IVI Attributes -> Advanced Session Information -> Driver Setup.  This returns a string of the topology setup.

 

- tbob

Inventor of the WORM Global
Message 6 of 6
(3,730 Views)