NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Is is possible to retrieve a sequence context through a new engine object?

Solved!
Go to solution

This is my scenario:

 

1. Teststand calls a function in a CVI created DLL to do something. This function's prototype is void function(void);

2. Since no parameters are being passed can I get to the anonymous sequence context inside the dll call? I know this can be done by simply passing the "thiscontext" parameter in my function call, but I would like to resolve the context to perform additional run-time logging operations without rewriting my entire application.

 

void function(void)

{

  TSObj_Execution execution = 0;
  TSObj_Report report = 0;
  TSObj_Engine tsengine = 0;

 
  TS_NewEngine(NULL, &tsengine);
  /// Can I somehow use the TestStand engine to get the current sequence context?   

}

0 Kudos
Message 1 of 3
(4,180 Views)
Solution
Accepted by topic author DSPMAN

Hi Dspman,

 

Maybe this thread could be interresting http://forums.ni.com/ni/board/message?board.id=330&thread.id=18696

There is an example which shows how to share an Execution object to a "stand-alone" application.

if you have an ExecutionObject you will get the underlaying SequenceContext.

 

hope this helps

 

juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
Message 2 of 3
(4,164 Views)
So the suggestion that was posted is to push a reference to an object of interest to the external server and then update your void code to assume that it is there and pull the value. Assuming that you must use a sequence context object, you will have to either place the sequence context or it parent thread object, since you cannot get to the context that is invoking the function from the engine or execution object. If you just need an old context, you can create one from an engine object. Make sure that you cleanup this reference on the server so that it does not stick around longer than it is needed. You want to make sure that TestStand can properly cleanup on shutdown. I also assume that you will have only execution or application setting this type of value, because having two would clobber each other. Make sure you write your code such that it can handle a bad value on the server using proper exception or error handling. Since you will have to edit the code in the DLL, you might want to consider adding a second export that does take a sequence content parameter.
Scott Richardson
https://testeract.com
Message 3 of 3
(4,154 Views)