NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Kind of expression for enabling configuration entry point

I need to enable a configuration entry point not only with the "classic" 'CurrentUserHasPrivilege()' (of Engine obj) expression but also if a certain callback is present in the model client file.
I try to use RunState, ThisContext and Execution objects but without results.
Any suggestion?
Many thanks
Luigi Magni (System Engineer - CTA)
0 Kudos
Message 1 of 8
(4,044 Views)
Luigi,
you need to
- Add the Configuration Entry Point;
- Add a step into the Configuration Entry Point and put a breakpoint on that step;
- Run the Configuation Entry Point. When the sequence stops at the breakpoint, change to the context tab to see what variables are accessible at this point;
- At the bottom, there is a property for the ProcessModelClient which refers to the client sequence file. This has all the properties about the client sequence file, including the sequences in the sequence file;
- Right-click on the path and choose "Copy Property Path" so you can paste the path into your Configuration Entry Point

For example: in your client seqfile say you have a MyCB callback. If this callback is present, there will be a Property "RunState.ProcessMod
elClient.Data.Seq["MyCB"]".
You can use the function "PropertyExists" to see if the property exists.

Regards,
AlessioD
National Instruments
0 Kudos
Message 2 of 8
(4,044 Views)
Hi,

With the PropertyExists() you will need to format the string "RunState.ProcessModelClient.Data.Seq[\"MyCB\"]" to get it excepted.

eg PropertyExists("RunState.ProcessModelClient.Data.Seq[\"MyCB\"]")

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 3 of 8
(4,044 Views)
Thank you so much Alessio and Ray,

but I have already tried this solution but without apreciable result cause the voice in the menu remain always disabled, my expression is:
CurrentUserHasPrivilege("ConfigModel") && PropertyExists("RunState.ProcessModelClient.Data.Seq[\"TestOptions\"]")

The problem seems to be that when the Engine try to execute the EvalEntryPointEnabledExpression() the evaluation returns an error (I have tried using directly the calls to the ActiveX TestStand API).
Only StationGlobals or TemporaryGlobals are accessible for evaluation...

Have you more suggestions?

Thank you for your help and time.

Sincerely
Luigi
Luigi Magni (System Engineer - CTA)
0 Kudos
Message 4 of 8
(4,044 Views)
Thank you so much Alessio,

but I have already tried this solution but without apreciable result cause the voice in the menu remain always disabled, my expression is:
CurrentUserHasPrivilege("ConfigModel") && PropertyExists("RunState.ProcessModelClient.Data.Seq[\"TestOptions\"]")


The problem seems to be that when the Engine try to execute the EvalEntryPointEnabledExpression() the evaluation returns an error (I have tried using directly the calls to the ActiveX TestStand API).
Only StationGlobals or TemporaryGlobals are accessible for evaluation...


Have you more suggestions?


Thank you for your help and time.


Sincerely
Luigi
Luigi Magni (System Engineer - CTA)
0 Kudos
Message 5 of 8
(4,044 Views)
Luigi,

you say you are getting an error. Are you able to provide us with more info on the problem:
1) A screenshot of the error statement
2) Software versions installed on your machine
3) It would be really helpful if you attached a simple example sequence that would allow us to reproduce the problem you are experiencing

Regards,
AlessioD
National Instruments
0 Kudos
Message 6 of 8
(4,044 Views)
Hi LuigiM,

I set the enabled expression to the following:
PropertyExists("RunState.InitialSelection.SelectedFile.Data.Seq[\"MySequence\"]")

To one of the Configure Entry Point callback sequence in the process model e.g. the Configure Report Option.
As you can see, the Report option will only be enabled if there is a sequence call 'MySequence' in the the active sequencefile.

This seems to work quite well.
The RunState.ProcessModelClient only appears to be available once the SequenceFile is executing.

Hope this helps
Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 7 of 8
(4,044 Views)
Thank you very much Ray,

you are right! In fact I have understood that the RunState.ProcessModelClient property wasn't accessible by the Engine when it call the EvalEntryPointEnabledExpression function and in fact it use the InitialSelection property that is set by the Editor...

Thank for your help.

Sincerely
Luigi
Luigi Magni (System Engineer - CTA)
0 Kudos
Message 8 of 8
(4,044 Views)