NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Show custom step Description from a local variable.

Hi,
I am working on C#.Net with TestStand, wherein I call dlls made in C# to TestStand modules. I am facing the following problem.
 
I want  to show  custom step Description from a local variable.
I am able to see the local value string in Step Description but only after reloading the sequence.
Is there any way to see on prompt ?  I mean when the local varialble receives any value it will be seen on step's description.
 
Regards
Sreedhar
0 Kudos
Message 1 of 12
(5,598 Views)

Add some strings to your custom step

Step.xxx
Step.yyy

For the

Step Description Expression try :-

"{ xxx = " + str(Evaluate (Step.xxx)) + ", \nyyy = " + str(Evaluate(Step.yyy)) + " }"

Step.xxx Step.yyy contain the local variable you want to display as in locals.x locals.y

These should update the description when the sequence is running.

 

Message Edited by Rupert Hewitt on 07-11-2006 12:19 PM

0 Kudos
Message 2 of 12
(5,584 Views)
 
0 Kudos
Message 3 of 12
(5,574 Views)

Thanks Ropert.

The suggestion you have given is Good one.

but my problem is little different.

I am assigning value to local variable by doing right click on Edit option. ( where my C# dll will launches a form and takes user input which will be stored in

Test stand local variable on click of OK button.)

Problem: Assignment of value to Local variable is done. the same variable is taken in Description. but i am not able to see that description. though local variable is containing value. but if i save the sequence then description appears.

so, It seems that it requires some refresh functionality or external trigger.

0 Kudos
Message 4 of 12
(5,578 Views)

Hi Sreedhar,

I made myself a generic edit box.

I'm using CVI so not quite the same as your c# code

I pass in

const char *Property "Step.xxx" - where im storing my output

When i've finished assigning / finding what I want to store use

TS_SetPropertyToCtrlValEx (panelHandle, PANEL_XXXX, testData->seqContextCVI, Property, errMsg)

TS_IncSequenceFileChangeCount (testData->seqContextCVI, &errorInfo)

Then with the evaluation of the previous message you see the value.

Rupert

 

Message Edited by Rupert Hewitt on 07-12-2006 03:36 AM

0 Kudos
Message 5 of 12
(5,570 Views)

Thanks Rupert for prompt response.

Well, where you have written this line of code.

TS_SetPropertyToCtrlValEx (panelHandle, PANEL_XXXX, testData->seqContextCVI, Property, errMsg)

TS_IncSequenceFileChangeCount (testData->seqContextCVI, &errorInfo)

if you have written this code in ur CVI Example then i can't do that bcs i have not accessed any test stand api in my C# code.

i think it is nothing with C# or CVI. bcs Value of local variable is assigned. but as i changing step property. reload of step requires. refresh.

Manoj.

 

0 Kudos
Message 6 of 12
(5,562 Views)

Do you not have access to any Teststand API functions in c# ?

If not maybe you should consider writing a generic edit dialog in cvi, c or labview ? Although your test code is in C# the edit dialog doesnt have to be in the same language.

 

 

0 Kudos
Message 7 of 12
(5,560 Views)
Hey Sreedhar,

You should be able to do something very similar to what Rupert is attemping to do in C# with the API.  I quickly tested something like that here, and I was able to get the Step Description to update.  I created a step that calls a C# assembly.  In the assembly I changed a local variable on which my step description was based off of.  As soon as the step had finished executing the Step Description changed.  I have put the code below that I used to change the variable.  Locals.Description is the local variable that my step description was based off of.  Hope this helps!

PropertyObject propertyObject = seqContext.AsPropertyObject();
propertyObject.SetValString("Locals.Description", 0, "my value");
Pat P.
Software Engineer
National Instruments
0 Kudos
Message 8 of 12
(5,538 Views)
Hi everybody...

I have'got the same problem.

Unfortunately I DO NOT want to use TestStand's APIs.

Do someone know how to proceed? I was hoping some parameters in the step type panel could perform an auto-update of description, but I didn't find anything. Maybe I'll try to use a step.XXX variable for description, just to ensure if it's running.
0 Kudos
Message 9 of 12
(5,438 Views)
Hi Gaadek,

You don't have to use the API to change the description of a step.  However, you do have to create a custom step type so that you can modify what variable is used for the description of a step.  The step description should update when the variable that is being used for the description is changed.


Pat P.
Software Engineer
National Instruments
0 Kudos
Message 10 of 12
(5,412 Views)