NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

teststand XML Translator For LOOP Step

HI, I'm trying to write an XML translator usinc the C++ example. So far I made work "if" , "while" , "end" and i'm trying to make the "for" loop working as well but i have a issue when i insert the dataProperty.

The XML code i wrote id the following :

 

<Data dataProperty="InitializationExpr" type = "string">

<Value>

"Locals = 0"

</Value>

</Data><

Data dataProperty="ConditionExpr" type = "string">

<Value>

"Locals &lt; 10"

</Value>

</Data><

Data dataProperty="IncrementExpr" type = "string">

<Value>

"Locals += 1"

</Value>

</Data>

 

so the issie is that is i use the " " it works in the PropertyBrowser window but not in the For Loop window and if i dont use the " " is the opposite.

I even tried to change the property CustomLoop followinf the same syntax but it doesnt work:

 

<Data dataProperty="CustomLoop" type = "bool">

<Value>

true

</Value>

</Data>

 

can anybosy help me with this?

 

thank you 🙂

 

Luca

 

0 Kudos
Message 1 of 4
(3,485 Views)

Hello Luca,

 

I am curious why you do not specify a specifc local variable to use as the loop iteration variable.  You use "Locals", but do not specify a particular local (as in Locals.X or Locals.Count).  Additionally, this may be a simple typo or browser substitution, but the condition you outline reads Locals &lt; 10 rather than Local == 10 in my browser.  Although trivial and likely accurate in your original XML, you will want to ensure that this is indeed the case.

0 Kudos
Message 2 of 4
(3,460 Views)

If I use Locals.X == 10 it gives me an error in the Number of Loop field in the For Loop window. What i really would like to know is how to set the properties for every step because beside few of them that i can set with dataProperty="ConditionExpr" or dataProperty="TitleExpr" i dont know how to set the other ones.
For istance if i want to have a Sequence Call (I already wrote code so to have more then one Sequence) in a Sequence that calls another one i can have code like this:

<Sequence name="MainSequence">
<Step name="CallSeq2" type="SeqCall">

</Step>

</Sequence>
<Sequence name="MainSequence2">

</Sequence>

now I dont know how to pass values to the step so to fill the File Pathname and Sequence fields in the Module window 😞 can I use dataProperty? and in cas I can what is the Sintax?
thank you

Luca

0 Kudos
Message 3 of 4
(3,453 Views)

Hello Luca,

 

You should be able to use separate <data> tags within an existing <step> tag to set various values for the step.  This would take the following general form:

<Step...>

<Data dataProperty=""...>

<Value>...</Value>

</Data>

 

<Data dataProperty=""...>

<Value>...</Value>

</Data>

</Step>

Message Edited by Gist on 01-11-2009 07:23 PM
0 Kudos
Message 4 of 4
(3,427 Views)