NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Validate Evaluvation Type

Hi Ppl...

I'm Using this  Expression.ValidateEvaluvationType method. I want to check whether the expression is a conditional expression. So I have checked for boolean type.

 Please tell me if its correct. I'm getting error tellling the input parameter is invalid.

I create an expression using Engine.NewExpression.

Set Expression.Text property to the expression.

I created a Evaluvation type from Engine.NewEvaluvationTypes with inital propertyValueTypes argument set to 2.

passes this as validEvaluvationTypes. 

And I have passed a variant constant as additional constants.

and sequence as property object for Evaulvation Context.

 

Can someone give me a sample code.

 

Thanks 

Message Edited by lordsathish on 12-08-2008 07:43 AM
0 Kudos
Message 1 of 4
(3,755 Views)

Hi,

 

What is the version of TS you are using?

 

Can you post the sequence file so that others may be able to try it out and reply back. It seems you are facing problem with the datatype.

 

 Vaibhav

.......^___________________^
....../ '---_BOT ____________ ]
...../_==O;;;;;;;;_______.:/
.....),---.(_(____)/.....
....// (..) ),----/....
...//____//......
..//____//......
.//____//......
..-------
0 Kudos
Message 2 of 4
(3,674 Views)

Hi...

I'm not using TestStand to check the expressions. I'm using LabVIEW to check them. My TestStand version is 4.1 and LabVIEW version is 8.6.

I'll try to post the VI's soon.

 

Thanks

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

Give this a try:

 

Locals.myExpression = RunState.Engine.NewExpression()

Locals.myExpression.AsExpression.Text = "Locals.myValue == 2"

Locals.myEvalType = RunState.Engine.NewEvaluationTypes(PropValTypeFlag_Boolean)

Locals.myExpression.AsExpression.ValidateEvaluationType(Locals.myEvalType, Locals.myArray, ThisContext, 0, Locals.Error, Locals.StartIndex, Locals.EndIndex)

 

 

Where myExpression and myEvalType are object references and Locals.myArray is an empty array of object references.

 

This seemed to work on my end just fine.

 

Also, why are you passing 2 as the propertyValueTypes argument? This should be 1 for boolean since you want to check if it is a conditional expression.
TestStand Help: PropertyValueTypeFlags Constants

 

Jervin Justin
NI TestStand Product Manager
Message 4 of 4
(3,645 Views)