NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem by Message Popup Teststand

Solved!
Go to solution

Norbert_B a écrit :

Yes, you miss-typed "step" as "setp" (red marked in the expression)......

 

Norbert


sorry but I also do not find button on Message Popup step when I'm writing "step.", below is a list of suggestions on teststand ( I  see only the button 1,2 up to 5)

0 Kudos
Message 11 of 22
(2,693 Views)

Ah, seen only the typo.... there is another issue in your expression as i presumed: Delete the leading and postponing quotation mark.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 12 of 22
(2,687 Views)

Norbert_B a écrit :

Ah, seen only the typo.... there is another issue in your expression as i presumed: Delete the leading and postponing quotation mark.

 

Norbert


I have removed the quotes and I tried two method, but both have the error

Download All
0 Kudos
Message 13 of 22
(2,681 Views)

crossrulz a écrit :

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


I created a string in array as you can see on the attachment because my Locals.Can_Type must be equal to a string but I get an error

0 Kudos
Message 14 of 22
(2,680 Views)

As you can see in your second screenshot, the ButtonHit equals 0 in your execution. That is only possible, if the PostExpression is not part of the MessagePopup step.

 

Norbert

 

EDIT: I see that the dialog is no runtime error, but an evaluation warning. Sorry for the confusion. Obviously, you haven't executed the sequence yet. Do it.....

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 15 of 22
(2,676 Views)

Norbert_B a écrit :

As you can see in your second screenshot, the ButtonHit equals 0 in your execution. That is only possible, if the PostExpression is not part of the MessagePopup step.

 

Norbert

 

EDIT: I see that the dialog is no runtime error, but an evaluation warning. Sorry for the confusion. Obviously, you haven't executed the sequence yet. Do it.....


I did, but I always get an error
and I dont understand why I see  always warning Step.button0label

0 Kudos
Message 16 of 22
(2,659 Views)

You need to tell the analyzer to ignore that error.  Use this as your PostExpression:

Locals.CanType = #NoValidation(Locals.CanTypeArray[Step.Result.ButtonHit-1])

 

The #NoValidation is a flag to tell the analyzer to not pre-evaluate the expression.  The ButtonHit is default to 0, but after actually running, the value will be greater than 0 since the first button will return 1.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 17 of 22
(2,655 Views)

crossrulz a écrit :

You need to tell the analyzer to ignore that error.  Use this as your PostExpression:

Locals.CanType = #NoValidation(Locals.CanTypeArray[Step.Result.ButtonHit-1])

 

The #NoValidation is a flag to tell the analyzer to not pre-evaluate the expression.  The ButtonHit is default to 0, but after actually running, the value will be greater than 0 since the first button will return 1.


sorry, I can not open the document because you do not have the same version as me and when I use your suggestion I get an error

and when I removed the # I get another error

Download All
0 Kudos
Message 18 of 22
(2,652 Views)
Solution
Accepted by topic author sonnyanderson

sonnyanderson wrote:

sorry, I can not open the document because you do not have the same version as me and when I use your suggestion I get an error


Ah, you have a version from before that function.  In that case do this:

Locals.CanType = Locals.CanTypeArray[max(Step.Result.ButtonHit-1,0)]

 

This will force the index to be no less than 0.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 19 of 22
(2,645 Views)

thx thx this functionSmiley Happy

 

forgiveness is that you can explain to me how you doing? that is what you used? and why ? please

0 Kudos
Message 20 of 22
(2,643 Views)