NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

write in variable runtime with C# UI and TestStand

Hello,

    I am modfying the C# UI interface for testStand. I have a variable in TestStand -> Locals, and I want write in this variable fromr the C# UI.

    How can I write or read TestStand variable ?

Thank's

Grégory
0 Kudos
Message 1 of 8
(4,731 Views)

Hi Gregory,

I assume you what to write/read when your Uut or an execution is running.
If I am right i would fire a PostUIMessage from the execution to C# Ui.
On reveiving this message in your UI will be able to get a handle to SequenceContext
now your world is open.

Greetings

Juergen   

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 2 of 8
(4,718 Views)
Thank's for your response,

    In fact I have a checkBox in C# UI, and I want write state of checkbox in parameter(variable) in Testand.
    I will test your solution and give you a feedback.

Grégory
0 Kudos
Message 3 of 8
(4,708 Views)
I have found some code on the forum, I muss use propertyObject for read or write a parameter.

this code is :

Private void Example (Step stepObj)

{

PropertyObject propertyObj;

String errorString;



propertyObj = stepObj.AsPropertyObject();

errorString = propertyObj.GetValString("Result.Error.Msg",0);

}

What is stepObj? where can I find them?

thank's.

0 Kudos
Message 4 of 8
(4,705 Views)

Hi,

    In fact I have a checkBox in C# UI, and I want write state of checkbox in parameter(variable) in Testand.
    I will test your solution and give you a feedback.

If I understand you correctly, you want to pass the state of a checkbox to a parameter in a Sequence.

What you dont specific is whether this is during the execution of the Sequence or not.

I think your best bet would be to write the state of your Checkbox to the StationGlobals. Then let your Sequence pickup the value from the StationGlobals.

Regards

Ray

Regards
Ray Farmer
0 Kudos
Message 5 of 8
(4,696 Views)
Hi Ray,
 
I agree your suggestion.
 
Hi  Costello,
 
for more information on C# and TS take a look at the example <ProgramFolder>\National Instruments\TestStand 4.0\Examples\Demo\DotNet
 
Greetings
 
Juergen


Message Edited by j_dodek on 06-12-2008 01:01 AM
--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 6 of 8
(4,693 Views)
Hello Ray, you have understand my problem. I have try to write in StationGlobal, but It don't functions, I have Testand 4.1.
I have try some exemple for write in StationGlobal, but any function.
Have you an exemple?


Hi Juergen, I have see the computer exemple, but that is not a GUI exemple, that is a dll.


0 Kudos
Message 7 of 8
(4,684 Views)
I have uses StationGlobals :
axApplicationMgr.GetEngine().Globals.SetValBoolean("modeManuel",0,false);


0 Kudos
Message 8 of 8
(4,641 Views)