Create an RTX64 project in Visual Studio
To create an RTX64 project in Visual Studio:
- Start Visual Studio.
- In Visual Studio, on the File menu, click New > Project.
- On the Create a new Project page, in the templates list, scroll down to find the RTX64 Application template and select it, and then click Next.
- In the Configure your new project page, in the Project name box, enter a name for this project and click Create. In this guide, we use "RT_Project_01" as our project name.
- On the Create a RTX64 RTSS Application page, there are several options to select. You can change them to meet your needs. In this guide we use the default settings. When you're done, click Finish.
- In Solution Explorer, right-click the project name "RT_Project_01" and then click Properties.
- In the RT_Project_01 Property Pages dialog box, in the Configuration list, click All Configurations.
- In the left pane, expand the C/C++ list and click General.
- In the right area, in the Additional Include Directories box, after $(RTX64SDKDir4)include;, enter "$(KINGSTARSDKDir4)include;" without space.
- In the left pane, expand the Linker list and click General.
- In the Configuration list, make sure it is All Configurations. In the right area, in the Additional Library Directories box, after $(RTX64SDKDir4)lib\$(Rtx64Platform);, enter "$(KINGSTARSDKDir4)lib\amd64;" without space.
- In the left pane, in the Linker list, click Input.
- In the right area, in the Additional Dependencies box, enter the following strings depending on the build target:
- RtssDebug and RtssRelease builds: enter "
startupCRT.lib;libcmtd.lib;libcpmtd.lib;libucrtd.lib;libvcruntimed.lib;rtx_rtss.lib;ksapi_rtss.lib
" without space. - Debug and Release builds: enter "
rtapi.lib;ksapi.lib
" without space. - After you finish adding the paths, click Apply and click OK.
- In Solution Explorer, in Header Files, double-click RT_Project_01.h to open it.
- Under #endif // UNDER_RTSS, enter the following code:
- In the toolbar, click IntervalZero Real-Time Debugger to test the build. If it's successful, the application will run and exit.
NOTE: If Visual Studio tells you it can't find RTX64 SDK, go to C:\Program Files\IntervalZero\KINGSTAR SDK\<Version Number>\VSExtensions. Double-click RTXProjectWizard.vsix to install the RTX64 templates.
The complete string is $(RTX64SDKDir4)include;$(KINGSTARSDKDir4)include;%(AdditionalIncludeDirectories)
.
The complete string is $(RTX64SDKDir4)lib\$(Rtx64Platform);$(KINGSTARSDKDir4)lib\amd64;%(AdditionalLibraryDirectories)
.
RtssDebug
RtssRelease
Debug
Release
#include <ksapi.h>
#include <ksmotion.h>
NOTE: If the project doesn't run, in Solution Explorer, right-click RT_Project_01 and click Unload Project. Next, right-click RT_Project_01 (unloaded) and click Reload Project. Run the project again.