NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find syntax errors in TestStand?

Solved!
Go to solution

Hi,

 

I have about 70 sequences and I'm trying to find any syntax errors, which evaded my "error radar". How can I find these in TestStand without moving through every step (which would around 1000 and more steps!)? I'm missing something like the "syntax" check in LabVIEW, which indicates right in your face, if you brake the block diagram.

 

Thanks for any help.

Marc

CLD
0 Kudos
Message 1 of 21
(6,147 Views)

Marc -

There is not any built in way to automatically check all expressions in a sequence file. However, this is something that has been requested by other customers, and we would like to address this in the future. So right now you will have to do this manually. In the past I have used Find/Replace in Files feature to locate non-empty expressions and manually looked at the values and sometimes used use Goto Location on an expression listed in the Find Results pane. See attached screen shot for options...

Scott Richardson
https://testeract.com
0 Kudos
Message 2 of 21
(6,128 Views)

Hi Marc,

 

One possible way to catch some errors is to set your top level SequenceFile so that it "Preload when opening sequence file".

 

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 3 of 21
(6,126 Views)

Ray Farmer wrote:

One possible way to catch some errors is to set your top level SequenceFile so that it "Preload when opening sequence file".


Did not work for me. 

Any other ideas?

 

Marc

CLD
0 Kudos
Message 4 of 21
(6,071 Views)

Scott Richardson wrote:

There is not any built in way to automatically check all expressions in a sequence file.


Out of curiosity I try to do this inside LabVIEW. Right now I can read a step name of a loaded sequence (s. attachment). But how can I read (get the reference to) the step properties (I mean "Result", etc.)? Any idea?

 

Thanks for any input.

Marc

 

 

CLD
0 Kudos
Message 5 of 21
(6,065 Views)

You can call AsPropertyObject() on the step and use the PropertyObject interface of TestStand to traverse the subproperties. For each subproperty you can call PropertyObject.GetType and if the typename is "Expression" you can then call Engine.CheckExprSyntax() or Engine.CheckExpression() on it. This isn't trivial, but by doing this you can effectively write your own sequence file syntax checker.

 

Hope this helps,

-Doug

Message Edited by dug9000 on 03-30-2009 10:23 AM
0 Kudos
Message 6 of 21
(6,044 Views)

Checking expressions at edit time to make sure that they will evaluate correctly at run time is a tricky process.  For instance, what if you are dynamically creating an array at run time, and then iterating through that array.  Unless you give that array good default values (which may be difficult if it is an array of custom types), your expressions will not be correct at edit time, and could be flagged as errors.

 

However, this is a request that we have heard quite a bit, and NI is investigating ways to allow customers to validate their expressions before running a sequence.

 

In the meantime, one of the TestStand developers created a tool that does what Doug was describing: iterates through every property object in a file and if it is an expression, tries to evaluate it.  This tool is written as a sequence file in TestStand 4.1.  Please note that since it uses recursion to iterate through each property object, and since recursion with sequences can be rather slow, the performance of this tool may be improved by duplicating its functionality with a code module (rather than sequence steps).

 

Message Edited by Josh W. on 03-30-2009 02:20 PM
Josh W.
Certified TestStand Architect
Formerly blue
0 Kudos
Message 7 of 21
(6,032 Views)

Josh W. wrote:

Checking expressions at edit time to make sure that they will evaluate correctly at run time is a tricky process.  For instance, what if you are dynamically creating an array at run time, and then iterating through that array.  Unless you give that array good default values (which may be difficult if it is an array of custom types), your expressions will not be correct at edit time, and could be flagged as errors.


I'm just looking for spelling errors or if I deleted or renamed some variables, and then missed some steps, which used these variables. I'm not concerned about the right number of entries in arrays or similiar stuff.

 


Josh W. wrote:
In the meantime, one of the TestStand developers created a tool that does what Doug was describing: iterates through every property object in a file and if it is an expression, tries to evaluate it.  This tool is written as a sequence file in TestStand 4.1.  Please note that since it uses recursion to iterate through each property object, and since recursion with sequences can be rather slow, the performance of this tool may be improved by duplicating its functionality with a code module (rather than sequence steps).


That's cool. But it is possible, to get this in TestStand 4.0.1, which I'm using?

 

Thanks

Marc

CLD
0 Kudos
Message 8 of 21
(6,022 Views)

dug9000 wrote:

You can call AsPropertyObject() on the step and use the PropertyObject interface of TestStand to traverse the subproperties. For each subproperty you can call PropertyObject.GetType and if the typename is "Expression" you can then call Engine.CheckExprSyntax() or Engine.CheckExpression() on it. This isn't trivial, but by doing this you can effectively write your own sequence file syntax checker.


Thanks, this helped me alot! Now I have a good idea, how to check every step parameter inclusive the steps with tests!

 

Any idea, how I can get the properties of the loaded module (the inputs and outputs). There I use expressions, too. I tried to doTS.Step.Module and then TS.Module.AsPropertyObject(), but with this reference I could not get to the Inputs and Outputs.

 

 

Marc

CLD
0 Kudos
Message 9 of 21
(6,017 Views)
Here is the sequence saved in TestStand 4.0.  Before anyone asks, I can't save it back to 3.5 because it uses API in expressions; Sorry.
Josh W.
Certified TestStand Architect
Formerly blue
0 Kudos
Message 10 of 21
(6,002 Views)