LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Using CommandKinds in "regular" code (CVI)

Hi

The TestStand3.0 API offers a variety of commands for connections different managers with different view-objects. (ApplicationMgr connects to a caption, for example). In the simple interface (CVI) that comes with TS3.0, there is button (Close) that closes the sequence files and clears all the views in the window (reportView, sequenceView, sequenceCombo).

I want to use the CommandKind_Close in regular code. I'm making a interface, where the user can select a desired test according to different selections. Now, when the user clicks "load test" the interface loads the sequence. The problem is, that when I want to load another sequence after that, is that the all the different views and captions are still connected to the old
sequence and it execution. Now, how can I know what commands and callbacks the CommandKind_Close actually does so I can write it in normal code?

Best regards,
Aleksi Sandqvist
0 Kudos
Message 1 of 3
(2,693 Views)
Aleksi,

I'm excited to hear that you are using TestStand 3.0. There are many new features that make using TestStand even easier than before.

Regarding your question about the CommandKind_Close, the TestStand UI Controls API (Help>>TestStand Help>>TestStand UI Controls API Reference) states the following definition:
CommandKind_Close�(Value: 21) Closes the currently selected sequence file or execution. This command applies to the ExecutionView Manager and SequenceFileView Manager controls.
The actions that this performs are encapsulated inside that command kind. If you prefer to execute the command programmatically rather than linking the command to a visible TestStand UI object, you can use the method Command.Execute.

Also, if you prefer not to use these TestStand UI methods, each method within the TestStand Engine is documented as well. You can use the TestStand API to make calls to the TestStand Engine within your Operator Interface. However, if you use the TestStand API directly in addition to using the visible and manager TestStand controls, the visible and manager controls will not be automatically updated. This is because if you explicitly tell the engine to open a sequence file, the manager controls are not aware that this action took place. However, if you use the manager controls to load a sequence file, the manager controls are not only aware of the change, but they can also notify all of the other visible and manager TestStand controls to have them update their information as well.

I recommend focusing on using as much of the new TestStand 3.0 manager and visible UI controls as possible, as they make programming much easier. For some examples on how they work, consider looking at the shipping operator interfaces found in \Operator Interfaces\NI\Full-Featured and \Operator Interfaces\NI\Simple. The Simple examples have less features but are easier to use when first starting. The Full-Featured version have the all of the capabilities of the Sequence Editor, except for the ability to develop of course. In these examples, note how they solely use the new TestStand UI controls to assign certain actions to specific visible controls. Each of the assignments that you see can also be performed programmatically, rather than having a user interact with the application.

I hope this helps. If you have more questions, please let us know.

Regards,
Shannon R.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(2,693 Views)
Hi Shannon!

That was exactly what I was looking for. The Command.Execute did the trick. It's funny, that I've read the same help files you quoted above, but didn't get any bells ringing...

I actually made an operator interface with TS2.0 and now I'm doing one with the TS3.0. I must say, that the activeX components make programming much more easier, but in a way they limit you in some ways. The reason why I posted this question, was that I wanted to use only the UI controls, because I had a slight fear, that combining the traditional methods of TS Engine and the new ActiveX controls would in the long run result in some problems... Thank you once more!

Best regards,
Aleksi Sandqvist
0 Kudos
Message 3 of 3
(2,693 Views)