06-02-2016 11:23 AM
I have a sequence where I need to determine its pass fail status by comparing two values. The values are returned by different LabVIEW vis', say. Locals.ValueReturnedByVI_1 and another value say Locals.ValueReturnedByVI_2. Now, I intend to compare those values using a If-Else Condition and determine whether this sequence has passed or failed.
If (Locals.ValueReturnedByVI_1 == Locals.ValueReturnedByVI_2)
/*This sequence has failed*/
else
/*This sequence has passed*/
End
I dont know what should be done inside the conditon blocks to state the pass-fail of the sequence.
Or is there a better way to do this?
Solved! Go to Solution.
06-02-2016 11:35 AM
Hi,
You could try a ternary condiiton statement in the Post-Expression function of the sequence.
Something like;
Step.Result.Status = (Locals.ValueReturnedByVI_1 == Local.ValueReturnedByVI_2)?"Failed":"Passed"
Curt
06-02-2016 01:01 PM
Another option would be to use a Pass/Fail Test step with no adapter. Set the Data Source Expression to Locals.ValueReturnedByVI_1 == Locals.ValueReturnedByVI_2.
The biggest difference I can think of is how the result would be displayed in a report. I would keep that in mind as you choose how to approach this.
06-03-2016 07:04 AM - edited 06-03-2016 07:06 AM
I used this method. The result generated is according to the formats we follow.
Thank you Steven and Curt for the help.