NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Obtaining sessions names for Switch Executive routes or routegroups via NI Session Manager

Solved!
Go to solution

Hi,

 

I would like to know how to obtain Switch Executive Route groups and/or routes sessions for Teststand via the NI Session Manager. I am effectively obtaining a session to the virtualdevice, ie SE::MyVirtualDevice but seem unable to obtain sessions for route/routegroups.

 

The 

GetNames Method

Syntax

InstrSessionMgr.GetNames ( category, flags, filter) the InstrSessionMgr Class

 

seems to be able to satisfy that request since the GetNamesOptions Enumeration flags list these as possible options.


"Use these constants to specify the flags parameter of the InstrSessionMgr.GetNames method. The flags parameter specifies the types of names and the format of the names that the GetNames method returns.

  • IncludeCategoryPrefix–(Value: 0x08) Specifies that the names returned by InstrSessionMgr.GetNames include a category prefix.
  • ReturnHiddenNames–(Value: 0x04) Specifies that InstrSessionMgr.GetNames returns names that Session Manager recognizes but that you typically do not display to a user. Specifically, InstrSessionMgr.GetNames returns full virtual instrument names, such as "VPPVInstr->FlukeDMM" or "VInstr->tk252xg".
  • ReturnLogicalNames–(Value: 0x01) Specifies that InstrSessionMgr.GetNames returns logical names.
  • ReturnRouteGroups–(Value: 0x10) Specifies that InstrSessionMgr.GetNames returns switch execution route group names.
  • ReturnRoutes–(Value: 0x20) Specifies that InstrSessionMgr.GetNames returns National Instruments Switch Executive route names.
  • ReturnVirtualInstruments–(Value: 0x02) Specifies that InstrSessionMgr.GetNames returns IVI and VXIplug&play virtual instrument names and VISA resource names and returns National Instruments Switch Executive virtual device names."

But I dont seem to be able to retrieve routes or routegroups with this method and always get an empty array.

 

Any pointers on how to use this method with these two flags (with labview preferably but c or c++ will do too) would be appreciated.

 

Regards,

 

Cyril

Cyril Bouton
Active LabVIEW Developper
0 Kudos
Message 1 of 3
(3,374 Views)
Solution
Accepted by topic author Cyril

What are you passing in for your parameters?

 

 

You should be able to use SessionManager.GetNames("SE", 0x30, "virtualDeviceName").

 

Allen P.

NI

Message 2 of 3
(3,350 Views)

Thanks Allen,

 

Must have been sleepwalking when I wrote my code, as I was passing the entire string "SE::MyVirtualDevice" for the filter category....Smiley Happy

Works like a charm now..

 

Thank you

Cyril Bouton
Active LabVIEW Developper
0 Kudos
Message 3 of 3
(3,344 Views)