The API for 32 and 64 bit operating systems are located in two different folders:
- "TE-USB-Suite\TE_USB_FX2_CyAPI_SampleApplication\TE_USB_FX2_CyAPI_SampleApplication\DLL32"
- "TE-USB-Suite\TE_USB_FX2_CyAPI_SampleApplication\TE_USB_FX2_CyAPI_SampleApplication\DLL64"
These folders come from the folder "FileToExportForApplication" in the project folder "TE-USB-Suite\TE_USB_FX2_CyAPI".
"FileToExportForApplication" contains "TE_USB_FX2_CyAPI.h", "CyAPI.h" and two folders; "DLL32" and "DLL64". "DLL32" and "DLL64" folders contain files with the same name but compiled respectively for 32 or 64 bit operating systems.
Note |
---|
title | The header file "TE_USB_FX2_CyAPI.h" to use with DLL should be picked from "TE-USB-Suite\TE_USB_FX2_CyAPI\FileToExportForApplication" |
---|
|
Two different header files exist: - one is used for the creation of TE_USB_FX2_CyAPI.dll DLL (not inside "FileToExportForApplication", used to create the TE_USB_FX2_CyAPI.dll DLL from source code and CyAPI.lib).
- another header file (with the same name) is exported for the creation of application programs that use TE_USB_FX2_CyAPI.dll DLL ("FileToExportForApplication").
The latter has some additional lines with regard to the former. This happens to solve some compilation/linking problems that could rise in applications compiling/linking. The lines of difference are the followings (added to TE_USB_FX2_CyAPI.h used for applications). Code Block |
---|
| #pragma once
//#include <WinDef.h> NO, it fails at 32 bit
#include <windows.h>
#include "CyAPI.h"
typedef unsigned char byte; |
|
You shall select 32 or 64 bit for the compilation. To do this you shall:
- in "Explore Solution" panel (top right window), right click the second line (between "Solution" and "External Dependencies")
- select "Properties"
- left click "Configuration Management" (top right)
- in "Active Solution Platform", select Win32 or x64
- click "Close"
- click "OK"
To create a program, you shall copy these files to the project folder.
User programs should load these libraries and initialize module connection to get access to API functions. To do this, you shall:
- copy "TE_USB_FX2_CyAPI.h", "TE_USB_FX2_CyAPI.dll", "TE_USB_FX2_CyAPI.lib", "CyAPI.h" and "CyAPI.lib" to the project folder (for example "TE-USB-Suite\TE_USB_FX2_CyAPI_SampleApplication\TE_USB_FX2_CyAPI_SampleApplication");
- open the C++ project (double click the "TE_USB_FX2_CyAPI_SampleApplication" icon in the folder "TE-USB-Suite\TE_USB_FX2_CyAPI_SampleApplication");
- open "Explore Solution" if it is not already open (Ctrl +W or left click "Visualize>Explore Solution");
- in the right panel "Explore Solution", right click "Header File";
- select "Add". A new window "Add Header File" will opens;
- the term "Look In" shall have automatically selected the correct folder ("TE-USB-Suite\TE_USB_FX2_CyAPI_SampleApplication\TE_USB_FX2_CyAPI_SampleApplication"). If it is not so, you shall select the folder where you have copied the previous DLLs and header files;
- left click one of the two header files ("CyAPI.h" or "TE_USB_FX2_CyAPI.h");
- select "OK";
- repeat steps from 4 to 8 for the second header file;
- in the right panel "Explore Solution", right click "Resource File";
- select Add. A new window "Add Resource File" will opens;
- the term "Look In" shall have automatically selected the correct folder ("TE-USB-Suite\TE_USB_FX2_CyAPI_SampleApplication\TE_USB_FX2_CyAPI_SampleApplication"). If is not so, you shall select the folder where you have copied the previous DLLs and header files;
- left click one of the three DLL files ("TE_USB_FX2_CyAPI.dll", "TE_USB_FX2_CyAPI.lib" or "CyAPI.lib");
- select "OK";
- repeat steps from 10 to 14 for the second and third DLL file (if you want add the *.lib file also).
Note |
---|
To compile the project it is strictly necessary only "TE_USB_FX2_CyAPI.dll", the two lib files are optional. |