Dll Drivers - Newport XPS-Q8 Users Manual, Software Tools And Tutorial

Universal high-performance motion controller/driver
Hide thumbs Also See for XPS-Q8:
Table of Contents

Advertisement

XPS-Q8 Controller
XPSDocumentation V1.4.x (EDH0301En1060 — 10/17)
18.3

DLL Drivers

A DLL simplifies function calls from most programming languages. The DLL of the
XPS controller is located in the ..Admin/Public/Drivers/DLL folder of the XPS
controller. The files XPS_Q8_drivers.h and XPS_Q8_drivers.lib must be copied to the
project folder and the file XPS_Q8_drivers.dll to the folder of the executable file.
Once these files are added, for instance to a C++ project, the prototypes of the functions
can be called in the program with the respective syntax of the functions (parameters
number, type...). The file XPS_Q8_drivers.h can be opened to see the list of the
available functions and their prototypes.
For instance, the prototype of the function FirmwareVersionGet is as follows:
DLL int __stdcall FirmwareVersionGet (int SocketIndex, char * Version);
It requires two arguments (int and char*).
The maximum number of open sockets is 80. A supervisor can control as many XPS as
much as the network and bandwidth can support.
Example C++ code
char buffer [256] = {'\0'};
char pIPAddress[15] = {"192.168.33.236"};
int nPort = 5001;
double dTimeOut = 60;
int SocketID = -1;
// TCP / IP connection
SocketID = TCP_ConnectToServer(pIPAddress, nPort, dTimeOut);
if (SocketID == -1)
{
sprintf (buffer, "Connection to @ %s, port = %ld failed\n", pIPAddress,
nPort);
AfxMessageBox (buffer, MB_ICONSTOP);
}
else
{
AfxMessageBox("Connected to target", MB_ICONINFORMATION);
// Get controller version
FirmwareVersionGet (SocketID, buffer); // Get controller version
AfxMessageBox (buffer, MB_ICONINFORMATION);
// TCP / IP disconnection
TCP_CloseSocket(SocketID); // Close Socket
AfxMessageBox("Disconnected from target", MB_ICONINFORMATION);
}
200
Motion Tutorial

Advertisement

Table of Contents
loading

Table of Contents