10-21-2011 02:52 AM
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)
10-21-2011 03:12 AM - edited 10-21-2011 03:13 AM
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
)
10-21-2011 09:29 AM
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