From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-07-2014 05:25 AM - edited 01-07-2014 05:48 AM
Hello
sorry my English ist not perfekt:smiley sad:
I have created an opportunity to make a choice of 5 elements on Message (Foto) so that when if you selected Can1, only Can1 be executed and to achieve this I have to go on Propreties-> Expression -> Post expression to write a condition where Locals.CanType declared is equals one of Buttons
in an example Teststand "computer6" I saw it on writing this expression at term Post Expression :
Locals.CPUType = ((Step.Result.ButtonHit == 2) "AMD": "INTEL") << this condition is valid for 2 buttons >>
The problem is: how can I write a condition on the Post valid expression for 5 buttons ie that we must choose between the CanX, Can1, Can2, Can3 or Can4.
thank you in advance
Solved! Go to Solution.
01-07-2014 06:20 AM - edited 01-07-2014 06:20 AM
What do you want to store in your local variable "CanType"?
Is it a string which reflects the label of the button?
I doubt that you need a case construct at all.
Possibly, something like "Locals.CanType = Evaluate("Step.Button"+Str(Step.Result.ButtonHit)+"Label")" could do the trick.
hope this helps,
Norbert
01-07-2014 07:03 AM
Another simple option is to create an array with the possible values and then just index the value that was chosen with the button.
Locals.CanType = CanTypeArray[Step.Result.ButtonHit-1] //If the array is 0 based, you will need to subtract 1 from the ButtonHit result
01-07-2014 08:49 AM
hello
Can_Type is a String und i want to store the pressed button with him
01-07-2014 09:20 AM - edited 01-07-2014 09:31 AM
hello
Can_Type is a String und I want to store the pressed button with him.
I have used the first method but I get an error :
Systax Error:
Unexpected token : Step
I have already created Sequences eg CanxSequence, Can1Sequence and I would really like the calls with CallSequence , see below two picture.
Where can I create the Can_Typearray to use the second option
sorry for the question,I am a beginner in teststand
01-07-2014 09:26 AM
sonnyanderson wrote:
Where can I create the Can_Typearray to use the second option
Just create a Local variable and populate it with the values you want.
01-07-2014 09:38 AM
sonnyanderson wrote:[...]
I have used the first method but I get an error :
Systax Error:
Unexpected token : Step
Obviously, there is an error in the expression. Are you sure that you placed the quotation marks (") correctly? You must not have quotation marks containing the whole expression, as this suppresses evaluation (as it is stated as a string!)
The expression is placed as POST expression of the MESSAGE POPUP step?
Norbert
01-08-2014 01:22 AM - edited 01-08-2014 01:26 AM
Obviously, there is an error in the expression. Are you sure that you placed the quotation marks (") correctly? You must not have quotation marks containing the whole expression, as this suppresses evaluation (as it is stated as a string!)
The expression is placed as POST expression of the MESSAGE POPUP step?
Norbert
I JUST COPY PASTE THIS TIME CI, but STILL MY STEP RED
01-08-2014 03:08 AM
Yes, you miss-typed "step" as "setp" (red marked in the expression)......
Norbert
01-08-2014 03:58 AM
Norbert_B a écrit :
Yes, you miss-typed "step" as "setp" (red marked in the expression)......
Norbert
there always wrong, but this time I'm typing