NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Howto get engine via .NetAdpter

Hi short question
I'd like to access the Engine Class from within Teststand to obtain adaper info or further engine properties and methods.

i.e.
When calling

Use Existing Object(NationalInstruments.TestStand.Interop.API.EngineClass).UniqueEngineId
and passing Runstate.Engine as Paramter for Use Existing Object it throws an error.

(I am aware the UniqueEngineId can be accessed via RunState.Engine.UniqueEngineID. The Above is just an Example)

thx
Marcos V. Bischoff
0 Kudos
Message 1 of 3
(3,093 Views)

I solved this myself
The Engine itself cannot be used via the .NETAdapter, as I aksed above
But in a Expression the Adapter Ref can be set like this

Locals.LabViewAdapterRef = RunState.Engine.GetAdapterByKeyName(Locals.LabViewAdapterKeyName)

then the object ref can be used in a .Net Step to retrieve the Adapter Properties and Methods.
(In my cse i wanted to have the LabVIEW Version Info =>

Use Existing Object(Locals.LabViewAdapterRef ).CurrentLabVIEWServerVersion

)

thx
Marcos V. Bischoff
0 Kudos
Message 2 of 3
(3,092 Views)

The engine can be used with the .NET adapter, you are just using the wrong class. You need to use the IEngine interface instead of EngineClass. EngineClass is a hybrid class that is part .NET part COM and can only be created by .NET code.

 

Hope this helps explain what you are seeing better. Let me know if you have any questions.

-Doug

0 Kudos
Message 3 of 3
(3,083 Views)