03-24-2009 02:49 AM
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
Solved! Go to Solution.
03-24-2009 10:04 AM
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...
03-24-2009 10:31 AM
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
03-30-2009 01:53 AM
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
03-30-2009 03:28 AM
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
03-30-2009 10:22 AM - edited 03-30-2009 10:23 AM
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
03-30-2009 02:19 PM - edited 03-30-2009 02:20 PM
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).
03-31-2009 12:43 AM
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
03-31-2009 01:55 AM
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
03-31-2009 11:11 AM