From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
To download NI software, including the products shown below, visit ni.com/downloads.
This example shows how you can implement undo/redo support for a custom tool menu item in TestStand so that a user can easily revert changes made to the sequence file within the tool. This example covers the following concepts
When developing a custom tool in TestStand which makes changes to a target sequence file, it is beneficial to allow the user to undo the changes if necessary. The TestStand API provides methods to allow you to specify the start and end of the edits made by the tool so that the undo operation reverts only the changes made by the tool.
In order to support Undo and Redo for an edit to the sequence file, follow these steps:
ApplicationManager.BeginEdit()
Engine.GetInternalOption(InternalOption_ApplicationManager)Since the ApplicationManager class is defined in the TestStand UI control API, you must use an ActiveX step to interact with it; only the core and adapter APIs are available in expressions.
Locals.undoItem = RunState.Engine.NewUndoItemCreator(EditKind_ChangeObject, RunState.InitialSelection.SelectedFile, "")
Locals.undoItem.AsUndoItemCreator.BeginBatchEdit(RunState.InitialSelection.SelectedPropertyObjects)
RunState.InitialSelection.SelectedFile.IncChangeCount()
Locals.undoItem.AsUndoItemCreator.EndBatchEdit()
Locals.undoItem.AsUndoItemCreator.CreateAndPostUndoItem()
TestStand Tool Menu Item with Undo Support - TS 2019.zip
TestStand 2019 or Compatible
LabVIEW 2020 or Compatible (for modifying waveform editor dialog)
TestStand Tool Menu Item with Undo Support.zip
TestStand 2014 or Compatible
LabVIEW 2013 or Compatible (for modifying waveform editor dialog)
To install the example in the TestStand tool menu:
To use the Waveform Editor Tool
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.