NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Difference in Scope between "ordinary" Step and StepType definition

Hi guys,

 

probably I'm not the first to hit this issue, but I haven't found anything on the forum....

 

I'm planning to invoke a sequence in the PreExpr of my step definitions (to add GUI messaging). As an example, I refer to this this.

It works invoking sequences without parameters. As soon as parameters for the sequence to be called are introduced, I get errors.

 

tserror.png

 

The PreExpr used is

RunState.Engine.NewExecution(SeqFileReference, "SeqName", Nothing, False, 0, Step) where Step is the container to be passed.

 

During debugging, I found out, that using this PreExpr with a standard step (in this case a Statement) placed in the sequence, everything works as expected.

So I removed the PreExpr from my Typedef and retried inserting the PreExpr into the step manually.  No luck...

 

tserror2.png

 

 

So... is there a context-wise difference between the PreExpr used in the (user) TypeDef of the step and the NI Typedef?

 

Cheers

Oli

 

BTW.... still on TS2013 / Win7

 

 

 

0 Kudos
Message 1 of 9
(4,601 Views)

Hi,

 

can you attach your sequence file?

 

Anna

Anna Vogl
Certified LabVIEW Developer
0 Kudos
Message 2 of 9
(4,526 Views)

Hi Anna,

 

the problem has magically disappeared when modifying a sequence to be posted here Smiley Embarassed

 

Now, that this is working I have stumbled over another issue I am not really understanding:

 

 

The PreExpr starts a sequence from a different seq file in new execution:

 

RunState.Engine.NewExecution(StationGlobals.SystemParameter.GUI_MsgProcessing_Seq, "PreExecutionMsgs", Nothing, False, 0x11, Step)

 

--> calling PreExecutionMsgs passing the Step container as Parameter

 

So I have defined the Parameters for the sequence as

 

PreExe_Par.png

 

Now... running my seqeunce having set a breakpoint in the sequence and taking a look at the variables I get this

 

PreExe_Par_run.png

 

Parameter.Step is shown as type Boolean instead of Container! Smiley Surprised

And.... where do all the other Parameters come from?

 

Accepting this for the moment, I decided to delete Step from the Parameter section of PreExecutionMsgs. At runtime, this results in no variables available in the Parameter section, which seems reasonable.

 

Re-implemeting the Step Parameter, it turns out, that both

 

RunState.Engine.NewExecution(StationGlobals.SystemParameter.GUI_MsgProcessing_Seq, "PreExecutionMsgs", Nothing, False, 0x11, Step)

(--> handing over Parameter to the sequence)

and

RunState.Engine.NewExecution(StationGlobals.SystemParameter.GUI_MsgProcessing_Seq, "PreExecutionMsgs", Nothing, False, 0x11)

(--> handing over NO Parameter to the sequence)

 

are working equally fine: Variables showing up as mentioned above for both cases. Smiley Surprised Smiley Surprised

 

What is the point I'm missing? The implementation seems to be working, but I'd like to understand what I'm doing before using it.

 

Cheers

Oli

0 Kudos
Message 3 of 9
(4,518 Views)

Hi Oli,

 

the change of the Parameter has no logic background. I have never seen, that the type of a variable in TestStand changed when executing it.

 

A thing, that could cause the change, is, when you click on the parameter or variable, you have to rightclick it to change the type. If you often use shortcuts, this might be the reason for accidently changing it.

 

As long, as it works for you now, I would leave it at that and watch the behavior and if it changes again. If so, you can try to use Ctrl+Z to see the last changes in the project.

 

Best,

Melanie

Best regards,
Melanie Eisfeld
Senior Applications Engineer, National Instruments Germany
Certified LabVIEW Developer
Certified TestStand Architect
0 Kudos
Message 4 of 9
(4,466 Views)

Hi Melanie,

 

it is very strange.... that's why I'm a bit suspicious.

 

Before changing all my custom step types, I'd like to be sure not to base on a bug / unwanted behaviour

 

Cheers

Oli

0 Kudos
Message 5 of 9
(4,458 Views)

Hi Oli,

 

I think, if that is an unexpected behavior, this would effect other users and there would be a lot of forums entries about it.

 

Melanie

Best regards,
Melanie Eisfeld
Senior Applications Engineer, National Instruments Germany
Certified LabVIEW Developer
Certified TestStand Architect
0 Kudos
Message 6 of 9
(4,456 Views)

Oli,

 

Can you attach a sequence file which shows the behavior, including your custom step type definition? We can take a look at it and see if the behavior occurs on our side as well.

0 Kudos
Message 7 of 9
(4,447 Views)

Hi Daniel,

 

Please find attached the files.

 

If you run MainSequence of PreExpr_Demo.seq, it will run several steps with different PreExpressions.

ExtRoutine.seq consists of three sequences:

 

  • PreExpr: Parameter is a PropertyObject
  • PreExpr_Cluster: Parameter is a cluster
  • Pre_Expr_noPar: no parameters defined

 

My findings are

 

  • As soon as I call a sequence using NewExecution() and pass Parameters within the call, the called sequence has parameters available. Also Parameters that have not been defined for the sequence. This also is true if there haven’t been any parameters defined for the sequence.
  • When the external sequence is called, the parameters don’t look like expected (see below)

 

For PropObject Parameter:

Step_Parameter_PropObj.png

 

For Cluster Parameter (not: Cluster has turned into Boolean)

 

Step_Parameter_Cluster.png

 

I'm happy to have this data available, but I would have expected to have it in a different arrangement.

 

 

 

0 Kudos
Message 8 of 9
(4,430 Views)

Hi,

 

so I have been in contact with the NI Support: this behaviour is not necessarily linked to own type definitions. It's rather a general thing.

 

There is a documented way to pass parameters to a subsequence using (local) variables: please refer to http://forums.ni.com/t5/NI-TestStand/NewExecution-sequenceArgsParam/td-p/2363606 for more information.

 

In this particular case, it turned out that TestStand seems to feature a kind of "dynamic parameter injection". Please refer to the sequence file attached as an example of this (AFAIK undocumented?) feature.

 

The type changed I have described in an earlier post is still not explainable.

 

Please ignore the the earlier attchement. due to some missing links to Typedef Properties, it won't work.  The current one features TestStand types only.

 

Cheers

Oli

 

 

 

 

0 Kudos
Message 9 of 9
(4,213 Views)