From 12:00 AM CDT Sunday, October 17 - 11:30 AM CDT Sunday, October 17, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Modify local variables with C# dll

Solved!
Go to solution
 void AppMgr_UserMessage(UIMessage uiMsg)

{

 

  try

  {

    switch ((int)uiMsg.Event)

    {

      case 10200: //update the UI to reflect the current progress

        progressBar.Value = (int)uiMsg.NumericData;

        label.Text = uiMsg.StringData;

        break;

 

      case 10201: //Close the form, cleaning up the AppMgr Reference

        AppMgr = null;         this.Close();

        break;

 

//=========================================================

      case 10202: // Send text to the calling Test Stand App

        label.Text = "10202";

        uiMsg.AsPropertyObject().SetValString("Locals.opText", 0, "Something");

        break;

 

 //===========================================================

 

This is some code from your Floating .Net panel example

In the last case above I am trying to modify one of Test Stand's local variables. I think it is probably not sensible to cast uiMsg as a PropertyObject the way I have here.

I think it is more likely that I will have to pass the variable I want to modify from Test Stand to the DLL.

Not sure how to do this, any ideas ?

 

 

0 Kudos
Message 1 of 4
(4,260 Views)
Solution
Accepted by topic author krugman2

Hi Krugman2,

 

To do this you need the coresponding SequenceContext!

Try uiMsg.Thread.GetSequenceContext(0,frameId).AsPropertyObject()

 

Maybe this thread could be interresting:

http://forums.ni.com/ni/board/message?board.id=330&thread.id=17870&view=by_date_ascending&page=1

 

Greetings

 

Juergen

--Signature--
NIWeek 2017: Standardized HIL Test Automation With TestStand
NIWeek 2016: Capturing ATE Requirements With Requirements Gateway

Feedback or kudos are welcome
Message 2 of 4
(4,250 Views)
That worked well, thanks
0 Kudos
Message 3 of 4
(4,230 Views)

Bonjour, Est ce que il y a une possibilité de recuperer la version de test dans testStand et l'afficher dans une textbox en c# sachant que j'utilise le c#

0 Kudos
Message 4 of 4
(3,055 Views)