Using NI Switch Executive in Visual C++
- Updated2023-02-21
- 2 minute(s) read
Using NI Switch Executive in Visual C++
This topic assumes that you are using the Microsoft Visual C++ ADE to manage your code development and that you are familiar with the ADE.
Follow these steps to develop an NI Switch Executive application in Visual C++:
- Open an existing or new Visual C++ project.
- Create source files of type C source code (.c) or C++ source code (.cpp) and add them to the project. Make sure that you include the NI Switch Executive header file, nise.h, in your source code files as follows: #include "nise.h".
- Specify the directory that contains the NI Switch Executive header file under the Preprocessor»Additional include directories settings in your compiler—for Visual C++ 6.0 these files are under Project»Settings»C/C++. The NI Switch Executive header files are located at <SwitchExecutive>\API\C.
- Add the NI Switch Executive import library nise.lib to the project under Link»General»Object/Library Modules. The NI Switch Executive import library files are located in the <SwitchExecutive>\API\C directory within your NI Switch Executive directory.
Tip The nise.h file includes visatypes.h from NI-VISA. If the compiler is having trouble locating that file, you can add your VXIPnP include directory (e.g. "c:\vxipnp\winnt\include") to the project's list of directories to include from. - Add NI Switch Executive function calls to your application.
- Build your application.
String Passing
To pass strings, pass a pointer to the first element of the character array. Be sure that the string is null-terminated.
Parameter Passing
By default, C passes parameters by value. Remember to pass pointers to variables when you need to pass by address.