03-31-2009 11:39 AM - edited 03-31-2009 11:40 AM
All of the subproperties of a step including module properties such as the parameters can accessed by traversing the step's subproperties using the PropertyObject API.
You can use PropertyObject.GetNumSubproperties and PropertyObject.GetNthSubProperty to recurse through all of the subproperties of a step. The parameters are typically stored in an array so you will need to traverse arrays as well. You can use PropertyObject.GetType() to determine if a property is an array and if so you can use PropertyObject.GetDimensions to determine the element type. If the element type is container you can traverse the array elements using PropertyObject.GetPropertyObjectByOffset(). Basically you'd need to write a recursive algorithm (probably like the one in the example Josh attached) to traverse all subproperties and array elements that are propertyobjects and look for all properties of type "Expression".
Additionally you can see all of these subproperties of a step in the variables view if you turn on show hidden properties: bring up the station options dialog box and go to the preferences tab and check the "Show Hidden Properties" checkbox.
-Doug
04-01-2009 01:00 AM
Hi Josh,
thanks for the sequence. I just run it and stumbled over an error (s. attachment). That's certainly a syntax change from 4.0 to 4.1. Can you give me a hint how to debug this?
Marc
04-01-2009 09:01 AM
Marc,
You are absolutely correct that some API changed between 4.0 and 4.1. I have resaved the sequence to be compatible with the 4.0 API. All that I had to do is change the Type property (which doesn't exist in 4.0) to the GetType() or GetTypeDisplayString() method. From there, I could access all the properties we were checking against.
04-02-2009 01:38 AM
Thanks Josh,
this version is working for me. But with the help of Doug I managed to write a LabVIEW-VI, which is working better (see my answer to Doug below).
Marc
04-02-2009 01:46 AM
Thanks Doug,
with your help I finally managed to write a VI, which parses trough all steps of all seqcences in a seqcences file and checks every expression. Compared to the "CheckExpressions40.seq" it is working better. I did not check every possibility, but when I added a syntax error (not existing variable) in a precondition of a sequence under test, my VI could find it, while CheckExpressions40.seq did not find it.
I also added the possibility to check sequence files, which are called inside the sequence under test.
Thanks again,
Marc
06-09-2010 02:52 PM
I also found that the CheckExpressions.seq could not find a non-existent variable (even though clearly marked red in the TS sequence). Could you post this vi that you developed?
Thanks, Denise
06-12-2010 06:34 AM
DeniseTucker wrote:I also found that the CheckExpressions.seq could not find a non-existent variable (even though clearly marked red in the TS sequence). Could you post this vi that you developed?
Thanks, Denise
Hi,
funny, that you are asking just now for this. I have started two weeks ago to work on my code for debugging TS sequences. I have attached the code inside the ZIP-File (LV8.5). The code is in German. I hope, this will not be a problem. For unknown reasons the code works for me, but when I close the project, LabVIEW crashes?!
The code works for syntax errors and it does find steps, where I call VIs or Sequences, which do not exist anymore (e.g. because I changed the name of the file or sequence). What I try to do now, is to find all steps, where I call VIs or Sequences, which inputs and outputs or parameters have changed or the number of them have changed (e.g. I modified a sequence, deleting one parameter. I want to find all steps, calling this sequence, because the sequence containing these steps will not run). My problem is, I have no clue how to do this. Perhaps you have an idea?
Marc
06-15-2010 09:03 AM
11-30-2010 09:43 AM
Consider upgrading to TestStand 2010 which comes with a Sequence Analyzer that helps you find problems, such as expression errors, in sequences before you execute them.
11-30-2010 01:58 PM
Definitely interested in 2010. What's the word on speed and (dare I say it) bugs in that version? I'm currently using TS 4.0.1f1