NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Choose From List of Compared Statements

Group,
     I'm still learning TestStand, please understand.  I'm using TestStand 3.0 for this question.  Essentially I have a list of 12 local variables that have unique messages that set a radio up to 0dB.  Each 0dB message is slightlty different(Euro, US, Japan, Korean, CD, ICDX etc).  I'd like to pass one message to a single variable and use that varialble for the remainder of my sequence file.  At the start of a sequence file run the radio to be tested can be different.  Below is a pre-condition for one of the Statements I'm wresting with to solve my problem.  A scanner reads the four digit text.  The four digit text is compared below for a radios with the same 0dB point.
 
(ThisContext.Locals.SerNumBroadcastCode == "FCFZ") || (ThisContext.Locals.SerNumBroadcastCode == "FCHB") || (ThisContext.Locals.SerNumBroadcastCode == "FCHD") || (ThisContext.Locals.SerNumBroadcastCode == "FCHC") || (ThisContext.Locals.SerNumBroadcastCode == "FCJJ") || (ThisContext.Locals.SerNumBroadcastCode == "FCJR") || (ThisContext.Locals.SerNumBroadcastCode == "FCJL") || (ThisContext.Locals.SerNumBroadcastCode == "FCJP")
If the above is true I want to pass ThisContext.Locals.KorICDX into ThisContext.Locals.dB0.  If false disregard.  Go to next Statement for comparison.
 
(ThisContext.Locals.SerNumBroadcastCode == "FCF2") || (ThisContext.Locals.SerNumBroadcastCode == "FCH2") || (ThisContext.Locals.SerNumBroadcastCode == "FCH3") || (ThisContext.Locals.SerNumBroadcastCode == "FCH4") || (ThisContext.Locals.SerNumBroadcastCode == "FCJ6") || (ThisContext.Locals.SerNumBroadcastCode == "FCJ4") || (ThisContext.Locals.SerNumBroadcastCode == "FCJ5") || (ThisContext.Locals.SerNumBroadcastCode == "FCJ5")
 
I hope I explained my problem adequately.  The biggest difficulty I have is determining how to ensure only a true comparision does the assignment and a false comparison is disregarded.  Any assistance would be awesome.  TIA
Tony
0 Kudos
Message 1 of 2
(2,547 Views)
I'm going to simplify your expressions to TestA and TestB. Simply replace the text with your comparision.  Also, you don't need to say "ThisContext.Locals.X", you can just say "Locals.X".  They are the same.

It sounds like you want:

If TestA Then
 Locals.dB0 = Locals.KorICDX
Else
 Locals.dB0 = Locals.dB0   (you'll see why I need this)
End

If thats the case, you can use the following expression:

Locals.dB0 = (TestA)?Locals.KorICDX:Locals.dB0

The other option is to use a statement step with a precondition.

Hope this helps! 

Allen P.
NI
Message 2 of 2
(2,540 Views)