NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

GetCommand

Following the directions in what information I could find this should work, however I get an "Index Out of Range"
error. Is there something the documentation does not cover?

Private Sub uiButtonUUT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles uiButtonUUT.Click
Try
Me.tsExeViewMgr.GetCommand(CommandKinds.CommandKind_ExecutionEntryPoints_Set, 0).Execute(True)

Catch ex As Exception
MessageBox.Show(Me, ex.Message, "Error")

End Try
End Sub
0 Kudos
Message 1 of 4
(3,174 Views)
a) Are you sure you shouldn't be passing a SequenceFileViewMgr instead on an ExecutionViewMgr? Typically, process model entry points apply to files, not executions, thus you probably have no entry points for your ExecutionViewMgr and therefore get the index out of range error when trying to access one.

b) If you really want to use entry points that can apply to executions but you don't always have them available, you can check if an entry point is available before getting a command to execute it. To do this, use code like the following:

int numInserted;
this.axApplicationMgr.NewCommands().InsertKind(CommandKinds.CommandKind_ExecutionEntryPoints_Set, this.axExecutionViewMgr, -1, "", "", out numInserted);
if (numInserted > 0)
{
// entry points exist, use them here
}
Message 2 of 4
(3,160 Views)
Good Answer, I went through the different managers until I found the one that worked, How would this work if you
wanted to check Execution entry points from the Sequence File View manager?
0 Kudos
Message 3 of 4
(3,149 Views)
Exactly the same. Just past this.axSequenceFileViewMgr instead of this.axExecutionViewMgr.
0 Kudos
Message 4 of 4
(3,138 Views)