Install Microsoft C/C++ onto your hard disk, load an example program, compile, and then run to verify that your C/C++ is set up properly.
Your program can be compiled 32bit or 64bit (i.e. target CPU set to"x86" or "x64") with instruNet software ≥ v3.6. To compile both Debug and Release, and both 32bit and 64bit versions of the examples, select Batch Build in the Build menu. For details, click here.
Duplicate the "Program Files (x86) \ instruNet \ Programming Interfaces \ Visual C & C++" directory and place the copy somewhere in your Documents folder. We will work with the copy, which contains the following source files: Inet_int.c/.cpp, Inet_int.h, Inet_Ex1.c, Inet_Ex2.c,
Open "iNet32_ExampleN.sln" with the Microsoft Developer Studio, select Set Default Configuration under Build, choose Win32 Debug, press OK, select Debug > Step Into under Build and watch it compile. You should not get any compiler errors or warnings. If it builds properly, it will begin to run under the debugger. Press the Step Over under Debug (i.e. F10) button to step through the example program. Note that "iNet32_Example1/2/3.sln" projects are C; and "iNet32_Example3_Cpp.sln" is C++.
Step through the example program to verify that the compiler, example files, driver, and computer are all working well together. Some lines of code open the instruNet World window, and pass control to instruNet World (until the user closes the instruNet World window to return back to the example program). Don't let this freak you out.
Read the example program source code and comments to get a feel for instruNet programming.
Modify the Example source code to meet your own needs.
Adding instruNet to an Existing C Project (not C++)
If you want to add instruNet to an existing C project:
In the file directory that contains your source code, add another directory called "instrunet". And within that new directory add two additional new directories:
Dupilicate files Inet_int.c, Inet_int.h, and iNet_mcs.h and place the copies into the instrunet_interface_DO_NOT_CHANGE directory.
Please try not to type into these files, since you might want to update them with new interface files from instrunet.com at a later date.
Select an example file that is most similar to what you are doing
(e.g. iNetEx2.c or iNetEx3.c),
copy it, rename it to inet_myIO.c, and then place it
into the instrunet_myIO directory.
Add inet_myIO.c and
inet_int.c to your project
(i.e. select Project, Add Existing).
Create a new empty file, name it inet_myIO.h, and
place it into the instrunet_myIO directory.
Add include "inet_myIO.h" to the top
of the inet_myIO.c file. Also place this at the top of your C or C++ files that contain code that will call subroutines within inet_myIo.c.
Rename the WinMain() function at the top of inet_myIo.c to
something different (e.g. void my_instrunet_io(void)).
Place a prototype for this new routine inside inet_myIo.h
(e.g. void my_instrunet_io(void);)
Now add a call to my_instrunet_io();
from within your C or C++ code.
Compile, link, run and test.
Modify the code within inet_myIo.h/c as needed.
Obviously, one can add more functions and structs to
inet_myIo.c, and call these from
your own C/C++ code.
Adding instruNet to an Existing C++ Project (not C)
Adding instruNet to an existing C++ project is similar to adding to an existing C project, described above,
except one adds the following files to the project (instead of .c code):
File inet_int.cpp is identical to inet_int.c,
except for the name of the file. The same is true with inet_ex3.cpp and
One can then call "Run_InstruNet_Code();" from any of the C++ files, as done in file
inet_example3_Cpp.cpp within project
From here, you can place your instruNet functions into file
and then call them from the rest of your C++ application.