NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find syntax errors in TestStand?

Solved!
Go to solution
Solution
Accepted by Marc Blumentritt

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

Message Edited by dug9000 on 03-31-2009 11:40 AM
0 Kudos
Message 11 of 21
(2,940 Views)

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

CLD
0 Kudos
Message 12 of 21
(2,928 Views)

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.

Josh W.
Certified TestStand Architect
Formerly blue
0 Kudos
Message 13 of 21
(2,915 Views)

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

CLD
0 Kudos
Message 14 of 21
(2,899 Views)

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

CLD
0 Kudos
Message 15 of 21
(2,896 Views)

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

0 Kudos
Message 16 of 21
(2,617 Views)

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

CLD
0 Kudos
Message 17 of 21
(2,578 Views)
Awesome!  Let me take a look at this.  Will need to downgrade to 8.2.1 to look at it. Thanks so much!
0 Kudos
Message 18 of 21
(2,517 Views)

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.

0 Kudos
Message 19 of 21
(2,246 Views)

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

0 Kudos
Message 20 of 21
(2,240 Views)