LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to programmaticaly cancel the changes made to TestStand StationGlobals

Hello,
I'm using Labwindows CVI to change the TestStand StationGlobals, like this:
 
...
GetObjHandleFromActiveXCtrl  (panelHandle, PANEL_APPLICATIONMGR,&AppManagerHandle);
 TSUI_ApplicationMgrStart     (AppManagerHandle, &errorInfo);
 TSUI_ApplicationMgrGetEngine (AppManagerHandle, &errorInfo,&EngineHandle);
 TS_EngineGetGlobals(EngineHandle,NULL,&Globals);
...
TS_PropertySetValString (GlobalsInitial, &errorInfo, "SoftwareVersion",0,String);
...
 CA_DiscardObjHandle(Globals);
   CA_DiscardObjHandle(EngineHandle);
   EngineHandle = 0;
   Globals = 0;
   TSUI_ApplicationMgrShutdown (AppManagerHandle, &errorInfo,&canExitNow);
 if (canExitNow)
  QuitUserInterface(0);
...
 
During the program I want to be able to cancel a change made by TS_PropertySetValString for instance.
How do I do it?
TS_PropertySetValString doesn't apply imediatly the changes but with TSUI_ApplicationMgrShutdown the changes take effect.
Is there a way to cancel those changes if we want to?
Thanks in advance.
Regards,
 
Daniel Coelho
 
 
Daniel Coelho
VISToolkit - http://www.vistoolkit.com - Your Real Virtual Instrument Solution
Controlar - Electronica Industrial e Sistemas, Lda
0 Kudos
Message 1 of 3
(3,256 Views)

Hello,

You cannot, unless you save the previous states and set it to your StationGlobals when you want to cancel the changes you have made.

Regards,

0 Kudos
Message 2 of 3
(3,240 Views)

Thank you for your quick reply.

That is what I'm trying to do, but how do I save the initial state?

And how do I set the StationGlobals with the initial state?

I tried the folowing cenario:

- creating two pointers to the initial station globals;

- during the program I use pointer1

- but if I want to cancel, I set a string StationGlobal.NoUse with "ABC" using the pointer2 witch should have the initial state of all the other stationglobals, hence, setting all the stationglobals with their inicial values again.

Doesn't work (I may be doing something wrong).

Hope I was clear.

Any hint?

I apreciate any help.

Thanks. My best regards,

Daniel Coelho

Daniel Coelho
VISToolkit - http://www.vistoolkit.com - Your Real Virtual Instrument Solution
Controlar - Electronica Industrial e Sistemas, Lda
0 Kudos
Message 3 of 3
(3,236 Views)