NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

StationID. How to get it from within LV module.

Hi,

 

As in subject.

 

Altghough there is a property in the engine classes called StationOptions.StationID it is not accessible from the LV.

 

How to read this value from insidae of the LV module?

 

I do know I can use RunState.Root.Locals.StationInfo.StationID, but I'd like to acces it using TS API.

 

Thanks.

0 Kudos
Message 1 of 5
(5,144 Views)

Hello,

 

You can get a reference to the Engine from the context, then to the StationOptions, and so on : 

 

SationID.png

 

Hope this helps...

Message 2 of 5
(5,137 Views)

Why I don't have it when I access IEngine from the App manager then?

 

Capture.PNG

0 Kudos
Message 3 of 5
(5,124 Views)

Try with a Property node instead of a method :

StationIDFromAppManager.png

 

Note, I'm pretty sure that in a code module, it's not a good idea to place an Application Manager control, Cf. TestStand User Interface Controls : "An application that uses the TestStand User Interface Controls must have a single Application Manager control that exists for the duration of the application."

0 Kudos
Message 4 of 5
(5,121 Views)

To Mathieu's point, if this code is going to be in a code module called from TestStand, you could either:

 

A) Pass the StationID in directly

 

B) Pass the Sequence Context in (very common in code modules) and access the Engine object through that.

 

If you're running the code externally from TestStand, you can use the Application Manager control mentioned previously.

Message 5 of 5
(5,107 Views)