NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

SetAutoCloseExecution

(Sequential Model + Simple Operator Interface)

 

Is it possible to Automaticaly close each execution after the sequence and reporting is done ?

 

Can someone give an example of how to set the "ApplicationMgr.SetAutoCloseExecution" if that is the relevant thing to do .....

 

 

0 Kudos
Message 1 of 6
(3,917 Views)

@NikolajEgeskovOstergaard wrote:
[...]

 Can someone give an example of how to set the "ApplicationMgr.SetAutoCloseExecution" if that is the relevant thing to do .....


Add this to the Config AppMgr VI in your UI.

 

Norbert

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

hi

 

so that would not be something to set in the sequence ?

 

Can you elaborate on how to implement that in the "simple operator interface" (attached)

 

thanks

0 Kudos
Message 3 of 6
(3,912 Views)

The Application Manager is something which is present in UIs. You should not implement code in a sequence depending on specific UIs!

 

You will add this in the LoadForm before you call AppMgr.Start.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 6
(3,909 Views)

Below is my mainform _load code.

axApplicationMgr.SetAutoCloseExecution( ????, true);

What do i need as "reference" to the execution ?

private void MainForm_Load(object sender, System.EventArgs e)
		{
			try
			{
				// If this UI is running in a CLR other than the one TestStand uses,
				// then it needs its own GCTimer for that version of the CLR. If it's running in the
				// same CLR as TestStand then the engine's gctimer enabled by the ApplicationMgr
				// is sufficient. See the API help for Engine.DotNetGarbageCollectionInterval for more details.
				if (System.Environment.Version.ToString() != axApplicationMgr.GetEngine().DotNetCLRVersion)
					this.GCTimer.Enabled = true;

				// connect TestStand comboboxes 
				axSequenceFileViewMgr.ConnectSequenceFileList(axFilesComboBox, true);
				axSequenceFileViewMgr.ConnectSequenceList(axSequencesComboBox);

				// specify what information to display in each execution list combobox entry (the expression string looks extra complicated here because we have to escape the quotes for the C# compiler.)
				axExecutionViewMgr.ConnectExecutionList(axExecutionsComboBox).DisplayExpression = @"""%CurrentExecution% - "" + (""%UUTSerialNumber%"" == """" ? """" : (ResStr(""TSUI_OI_MAIN_PANEL"",""SERIAL_NUMBER"") + "" %UUTSerialNumber% - "")) + (""%TestSocketIndex%"" == """" ? """" : (ResStr(""TSUI_OI_MAIN_PANEL"",""SOCKET_NUMBER"") + "" %TestSocketIndex% - "")) + ""%ModelState%""";

				// connect sequence view to execution view manager									  
				axExecutionViewMgr.ConnectExecutionView(axSequenceView, ExecutionViewOptions.ExecutionViewConnection_NoOptions);

				// connect report view to execution view manager									  
				axExecutionViewMgr.ConnectReportView(axReportView);

				// connect TestStand buttons to commands
                axExecutionViewMgr.ConnectCommand(axCloseExecutionButton, CommandKinds.CommandKind_Close, 0, CommandConnectionOptions.CommandConnection_EnableImage);
				axApplicationMgr.ConnectCommand(axTerminateAllButton, CommandKinds.CommandKind_TerminateAll, 0, CommandConnectionOptions.CommandConnection_EnableImage);
				//axApplicationMgr.ConnectCommand(axLoginLogoutButton, CommandKinds.CommandKind_LoginLogout, 0, CommandConnectionOptions.CommandConnection_EnableImage);
				axApplicationMgr.ConnectCommand(axExitButton, CommandKinds.CommandKind_Exit, 0, CommandConnectionOptions.CommandConnection_EnableImage);
				axSequenceFileViewMgr.ConnectCommand(axOpenFileButton, CommandKinds.CommandKind_OpenSequenceFiles, 0, CommandConnectionOptions.CommandConnection_EnableImage);
				axSequenceFileViewMgr.ConnectCommand(axCloseFileButton, CommandKinds.CommandKind_Close, 0, CommandConnectionOptions.CommandConnection_EnableImage);
				//axSequenceFileViewMgr.ConnectCommand(axEntryPoint1Button, CommandKinds.CommandKind_ExecutionEntryPoints_Set, 0, CommandConnectionOptions.CommandConnection_EnableImage);
				axSequenceFileViewMgr.ConnectCommand(axEntryPoint2Button, CommandKinds.CommandKind_ExecutionEntryPoints_Set, 1, CommandConnectionOptions.CommandConnection_EnableImage);
				//axSequenceFileViewMgr.ConnectCommand(axRunSelectedButton, CommandKinds.CommandKind_RunCurrentSequence, 0, CommandConnectionOptions.CommandConnection_EnableImage);
				//axExecutionViewMgr.ConnectCommand(axBreakResumeButton, CommandKinds.CommandKind_BreakResume, 0, CommandConnectionOptions.CommandConnection_EnableImage);
				//axExecutionViewMgr.ConnectCommand(axTerminateRestartButton, CommandKinds.CommandKind_TerminateRestart, 0, CommandConnectionOptions.CommandConnection_EnableImage);

				// show all step groups at once in the sequence view
				axExecutionViewMgr.StepGroupMode = StepGroupModes.StepGroupMode_AllGroups;

                axApplicationMgr.SetAutoCloseExecution( ????, true);
                                
                axApplicationMgr.Start();   // start up the TestStand User Interface Components. this also logs in the user

               
            }
0 Kudos
Message 5 of 6
(3,859 Views)

Ah, ok, sorry that i messed that one up.

 

As you require a specific execution as parameter, the position is the code i stated before is not correct.

I hope you are familiar with UI Messages. You can use as example the UIMsg StartExecution to configure this. You have to pass the AppMgr to the callback in such case as user parameter.

 

Norbert

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