From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Change "Execution Options" mode dynamically

Solved!
Go to solution

1. I have a Custom Data Type called ConfigurePokaYoke.

 

Image1.png

 

2. I have a Step Type called Step_PokaYoke (It is a customized Sequence Call step). This has a field of my previous Custom Data Type.

 

Image2.png

 

3. When I insert a step of this type in my sequence I am able to open a window to modify its step variables (configure the step). I pass these variables as parameters when the Sequence Call load the other .seq file.

 

Image3.png

 

Image4.png

 

4. I know that if I want to put this step to run in a new thread I need to:

Right-click in my step, then select Specify Module, then select Module tab, then click the Execution Options listbox, then click in Use New Thread.

I know how to do that.

 

Image5.png

 

 

---

 

Sorry for the long previous 4 points. I just wanted to explain my process.

Here comes my question.

 

Is there a way to connect my step variable iRunInNewThread with how that particular step is going to run?

 

Example 1:

In my configuration window I put my Run in new Thread switch in NO, therefore my step variable iRunInNewThread is 0, therefore my step do NOT Use a new threat.

Image6.png

 

 

Example 2:

In my configuration window I put my Run in new Thread switch in YES, therefore my step variable iRunInNewThread is 1, therefore my step USE a new threat.

Image7.png

 

 Thanks in advance!

0 Kudos
Message 1 of 17
(5,030 Views)

Hi,

 

This is possible.

You have derived your Type from Sequence Call so it will only work on SequenceCalls!

So your Adaptermodule is from type SequenceCall. - This is important to know!

 

All you need is using your SequnceContext and get your Adaptermodule.

1. SequenceContext .Step

2. Step.Module as SequenceCallModule

3. Depending on iRunInNewThread SequenceCallModule.MultithreadingAndRemoteExecOption  = 0 or 1 (just see Help for constants)

Thats all

 

Regards

 

Juergen 

 

 

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
Message 2 of 17
(5,019 Views)

Hello j_dodek, thanks for the answer.

 

Yes, my customized SequenceCall (Step_PokaYoke) step is derived from the original SequenceCall step.

 

Image9.png

 

After reading your comment:

 

All you need is using your SequnceContext and get your Adaptermodule.

1. SequenceContext .Step

2. Step.Module as SequenceCallModule

3. Depending on iRunInNewThread SequenceCallModule.MultithreadingAndRemoteExecOption  = 0 or 1 (just see Help for constants)

Thats all

 

3. I now see the key property for my problem is the SequenceCallModule.MultithreadingAndRemoteExecOption.

 

But for the steps 1 and 2, I don't know where can I write that lines of code in TestStand, or where do I have to stablish those properties, where can I place the "SequenceCallModule.MultithreadingAndRemoteExecOption  = 0 or 1".

0 Kudos
Message 3 of 17
(5,010 Views)

Hi,

 

 

just place it there where you write the iRunInNewThread Property Value (hoping this the value of your switch control)

 

Regards

 

Juergen

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
Message 4 of 17
(5,002 Views)

Yes, the iRunInNewThread variable is the one related to my switch control.

 

Are you saying I need to write that code in my CVI DLL? I mean, in the DLL where I send the window data to TestStand, in there I need to modify the property .MultithreadingAndRemoteExecOption?

0 Kudos
Message 5 of 17
(4,994 Views)

Exactly,

just as one more hint. You can do your parametrization of your sequnce here as well, too.

I have done serveral custom steptypes in in this way. Very effective!

another thing you might think about is that it will work in both ways in your UI and in the UI-sequence module adapter.

That means there is no need for your variable iRunInNewThread because it is represented by SequeceModule Property MultithreadindAndRemoteExecOption so just link your switch to this
property.

 

Regards

 

Juergen 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
Message 6 of 17
(4,983 Views)

Good to know that, j_dodek.

 

I though I was able to modify the step property MultithreadingAndRemoteExecOption in the TestStand enviroment. Now I am going to try to learn how to do it from my DLL in CVI.

0 Kudos
Message 7 of 17
(4,977 Views)

If you coud share one of your file examples j_dodek, of how to do something similar, It would be great.

 

Yesterday I tried to do it all afternoon, but I did not success.

0 Kudos
Message 8 of 17
(4,958 Views)

Hi,

 

i am afraid that it is not possible to publicate one of my step types. They are not my property and they are not focusing your problem at all.
But i am able to do a small demo example in my leisure time.

I do not use CVI. I will do it in VS2010 C++. You will see the calls to TS are almost the same.

Which version of TS are you using?

 

Just give me some more time.

 

Juergen 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 9 of 17
(4,931 Views)

Hi, I am using TestStand Engine Version 2014 SP1 32-bit. Sequence Editor Version 14.0.1.103.

 

And thanks, It would be really helpful for me.

0 Kudos
Message 10 of 17
(4,924 Views)