01-04-2011 11:37 AM
I know that we are able to create a user interface using C++ in TestStand. However I don't quite understand how I can actually use C++ in here. Can you please give me an example how C++ can be implemented as a user interface in TestStand? Thank you!
01-04-2011 12:44 PM
The TestStand development environment comes with example user interfaces written in LabVIEW, C++ using MFC, CSharp, CVI and VB.Net.
The examples are in \Program Files\National Instruments\TestStand X.X\UserInterfaces. There are both full-featured and simple examples. The simple examples represent something that you would deploy as part of a run-time solution.
You should be able to load one of the examples using the appropriate development environment, compile it, and run...
Regardless of which environment you use, you will need to become familiar with the TestStand API in order to make anything other than cosmetic changes...
01-04-2011 12:55 PM
Thank you for your reply...I saw the examples now but i have 2 questions
a) I open the C++ example (National Instruments\TestStand\UserInterface\C++(MFC)\Source Code. I open the examples using Microsoft Visual C++. Is that why I am getting compilation error? Should I open using NI TestStand? Some reasons it could not locate the header files.
b) what is an Editor Mode and Operator Mode?
c) I tried to look into the manuals for TestStand API but could not find it.
Thank you so much for the help!
01-04-2011 02:06 PM
@faithict wrote:
Thank you for your reply...I saw the examples now but i have 2 questions
a) I open the C++ example (National Instruments\TestStand\UserInterface\C++(MFC)\Source Code. I open the examples using Microsoft Visual C++. Is that why I am getting compilation error? Should I open using NI TestStand? Some reasons it could not locate the header files.
b) what is an Editor Mode and Operator Mode?
c) I tried to look into the manuals for TestStand API but could not find it.
Thank you so much for the help!
a. You would not open the C++ example with TestStand, you would use Visual C++. If you receive compile or load errors (specifically header files) you probably need to add one or more TestStand paths to your C++ development environment path. I am not a Visual C++ programmer, so I can't help you with that.
b. Editor mode is the mode that the TestStand IDE provides. You can develop (if you want or need to) a custom version of the TestStand editor that allows you to create, edit and run seqences. The OI (Operator Interface or mode) is what a technician or operator uses to only run a test. There is no option to rearrange tests or edit parameters. This is typically used on a manufacturing floor or at a technician's bench.
c. For info regarding the TestStand API and C++, see this NI forum post
01-04-2011 05:10 PM
To elaborate on (b), the full featured user-interface examples can be toggled between editor or operate-only modes. By default, the hot-key for this is ctrl-alt-shift-insert. You can also specify /editor or /operatorinterface when launching these examples from the command line or from a Windows shortcut.
Programmatically speaking, refer to ApplicationMgr.IsEditor.
01-04-2011 05:13 PM
after getting the path set correctly for the Microsoft Visual C++, I still don't quite understand how this interface would run in TestStand. In other words, how these 2 work together. Can you please elaborate more? Thanks!
01-04-2011 05:22 PM - edited 01-04-2011 05:26 PM
The interface is a standalone application. It has the ability to load and execute TestStand sequence files (and debug, and show reports, and etc.)
The source code is available in many languages (including C++) so you can customize the application if it doesn't exactly meet your needs as it is.
All the User interfaces are installed pre-built. You can run the full-featured ones from the Start Menu. Example: Start Menu>>All Programs>>National Instruments>>TestStand x.x>>User Interfaces>>C++>>Editor Mode.
01-04-2011 06:03 PM
Hi,
The operator interface runs in a separate process than TestStand. In the windows task manager there will be two separate processes. TestStand only runs in memory as a Microsoft Com Server (like an ActiveX Automation Server). It can never run by itself. First the Sequence Editor or UI application is launched, and then it instantiates TestStand. The two then communicate through Microsoft Com. This makes the UI completely decoupled from TestStand executions. Therefore any C++ problems is strictly a Visual Studio issue.
The UI is just a thin viewer to use for starting and watching executions. All data acquisition and control tasks should reside within TestStand sequences and never within the UI code/application. There should be documentation about this in the TestStand Reference Manual and at ni.com. I recommend taking the TestStand class. It has a good section on the UI, among other things.
cc
01-05-2011 09:53 AM
To clarify, the TestStand engine is an in-process com-server. Thus, every application (.exe) that uses the TestStand API has its own instance of the TestStand engine that lives in that application's operating system process.
The NI SequenceEditor is an application that uses the TestStand API. The Full-Featured User Interface examples are other applications that also use the TestStand API. If you launch one of those applications, you will not see a separate task manager entry for the TestStand engine because it lives within the application's process.
You might see a separate entry for a "TestStand Service", but that is just a small utility needed for certain housekeeping operations. It is not the TestStand engine.