Set svn:eol-style to "native".

This commit is contained in:
Ron Sluiter
2009-12-09 16:21:24 +00:00
parent 167aa48aea
commit d8f69754b0
37 changed files with 4975 additions and 4975 deletions
+59 -59
View File
@@ -1,59 +1,59 @@
/*
FILENAME... AerotechRegister.cc
USAGE... Register Aerotech motor device driver shell commands.
Version: 1.0
Modified By: weimer
Last Modified: 2008/04/10 05:52:37 PM
*/
/*****************************************************************
COPYRIGHT NOTIFICATION
*****************************************************************
(C) COPYRIGHT 1993 UNIVERSITY OF CHICAGO
This software was developed under a United States Government license
described on the COPYRIGHT_UniversityOfChicago file included as part
of this distribution.
**********************************************************************/
#include <iocsh.h>
#include "AerotechRegister.h"
#include "epicsExport.h"
extern "C"
{
// Aerotech Setup arguments
static const iocshArg setupArg0 = {"Max. controller count", iocshArgInt};
static const iocshArg setupArg1 = {"Polling rate", iocshArgInt};
// Aerotech Config arguments
static const iocshArg configArg0 = {"Card being configured", iocshArgInt};
static const iocshArg configArg1 = {"asyn port name", iocshArgString};
static const iocshArg configArg2 = {"asyn address", iocshArgInt};
static const iocshArg * const EnsembleSetupArgs[2] = {&setupArg0, &setupArg1};
static const iocshArg * const EnsembleConfigArgs[3] = {&configArg0, &configArg1, &configArg2};
static const iocshFuncDef setupEnsemble = {"EnsembleSetup", 2, EnsembleSetupArgs};
static const iocshFuncDef configEnsemble = {"EnsembleConfig", 2, EnsembleConfigArgs};
static void setupEnsembleCallFunc(const iocshArgBuf *args)
{
EnsembleSetup(args[0].ival, args[1].ival);
}
static void configEnsembleCallFunc(const iocshArgBuf *args)
{
EnsembleConfig(args[0].ival, args[1].sval, args[2].ival);
}
static void AerotechRegister(void)
{
iocshRegister(&setupEnsemble, setupEnsembleCallFunc);
iocshRegister(&configEnsemble, configEnsembleCallFunc);
}
epicsExportRegistrar(AerotechRegister);
} // extern "C"
/*
FILENAME... AerotechRegister.cc
USAGE... Register Aerotech motor device driver shell commands.
Version: 1.0
Modified By: weimer
Last Modified: 2008/04/10 05:52:37 PM
*/
/*****************************************************************
COPYRIGHT NOTIFICATION
*****************************************************************
(C) COPYRIGHT 1993 UNIVERSITY OF CHICAGO
This software was developed under a United States Government license
described on the COPYRIGHT_UniversityOfChicago file included as part
of this distribution.
**********************************************************************/
#include <iocsh.h>
#include "AerotechRegister.h"
#include "epicsExport.h"
extern "C"
{
// Aerotech Setup arguments
static const iocshArg setupArg0 = {"Max. controller count", iocshArgInt};
static const iocshArg setupArg1 = {"Polling rate", iocshArgInt};
// Aerotech Config arguments
static const iocshArg configArg0 = {"Card being configured", iocshArgInt};
static const iocshArg configArg1 = {"asyn port name", iocshArgString};
static const iocshArg configArg2 = {"asyn address", iocshArgInt};
static const iocshArg * const EnsembleSetupArgs[2] = {&setupArg0, &setupArg1};
static const iocshArg * const EnsembleConfigArgs[3] = {&configArg0, &configArg1, &configArg2};
static const iocshFuncDef setupEnsemble = {"EnsembleSetup", 2, EnsembleSetupArgs};
static const iocshFuncDef configEnsemble = {"EnsembleConfig", 2, EnsembleConfigArgs};
static void setupEnsembleCallFunc(const iocshArgBuf *args)
{
EnsembleSetup(args[0].ival, args[1].ival);
}
static void configEnsembleCallFunc(const iocshArgBuf *args)
{
EnsembleConfig(args[0].ival, args[1].sval, args[2].ival);
}
static void AerotechRegister(void)
{
iocshRegister(&setupEnsemble, setupEnsembleCallFunc);
iocshRegister(&configEnsemble, configEnsembleCallFunc);
}
epicsExportRegistrar(AerotechRegister);
} // extern "C"
+46 -46
View File
@@ -1,46 +1,46 @@
/*
FILENAME... AerotechRegister.h
USAGE... This file contains function prototypes for ACS IOC shell commands.
Version: 1.0
Modified By: weimer
Last Modified: 2008/04/10 05:52:48 PM
*/
/*
* Original Author: Ron Sluiter
* Date: 05/19/03
*
* Experimental Physics and Industrial Control System (EPICS)
*
* Copyright 1991, the Regents of the University of California,
* and the University of Chicago Board of Governors.
*
* This software was produced under U.S. Government contracts:
* (W-7405-ENG-36) at the Los Alamos National Laboratory,
* and (W-31-109-ENG-38) at Argonne National Laboratory.
*
* Initial development by:
* The Controls and Automation Group (AT-8)
* Ground Test Accelerator
* Accelerator Technology Division
* Los Alamos National Laboratory
*
* Co-developed with
* The Controls and Computing Group
* Accelerator Systems Division
* Advanced Photon Source
* Argonne National Laboratory
*
* Modification Log:
* -----------------
*/
#include "motor.h"
#include "motordrvCom.h"
#include "drvEnsemble.h"
/* Function prototypes. */
//extern RTN_STATUS EnsembleSetup(int, int);
//extern RTN_STATUS EnsembleConfig(int, const char *, int);
/*
FILENAME... AerotechRegister.h
USAGE... This file contains function prototypes for ACS IOC shell commands.
Version: 1.0
Modified By: weimer
Last Modified: 2008/04/10 05:52:48 PM
*/
/*
* Original Author: Ron Sluiter
* Date: 05/19/03
*
* Experimental Physics and Industrial Control System (EPICS)
*
* Copyright 1991, the Regents of the University of California,
* and the University of Chicago Board of Governors.
*
* This software was produced under U.S. Government contracts:
* (W-7405-ENG-36) at the Los Alamos National Laboratory,
* and (W-31-109-ENG-38) at Argonne National Laboratory.
*
* Initial development by:
* The Controls and Automation Group (AT-8)
* Ground Test Accelerator
* Accelerator Technology Division
* Los Alamos National Laboratory
*
* Co-developed with
* The Controls and Computing Group
* Accelerator Systems Division
* Advanced Photon Source
* Argonne National Laboratory
*
* Modification Log:
* -----------------
*/
#include "motor.h"
#include "motordrvCom.h"
#include "drvEnsemble.h"
/* Function prototypes. */
//extern RTN_STATUS EnsembleSetup(int, int);
//extern RTN_STATUS EnsembleConfig(int, const char *, int);
+20 -20
View File
@@ -1,20 +1,20 @@
# Makefile
TOP = ../..
include $(TOP)/configure/CONFIG
# The following are used for debugging messages.
#USR_CXXFLAGS += -DDEBUG
DBD += devAerotech.dbd
LIBRARY_IOC = Aerotech
# Aerotech driver support.
SRCS += AerotechRegister.cc
SRCS += devEnsemble.cc drvEnsemble.cc
Aerotech_LIBS += motor asyn
Aerotech_LIBS += $(EPICS_BASE_IOC_LIBS)
include $(TOP)/configure/RULES
# Makefile
TOP = ../..
include $(TOP)/configure/CONFIG
# The following are used for debugging messages.
#USR_CXXFLAGS += -DDEBUG
DBD += devAerotech.dbd
LIBRARY_IOC = Aerotech
# Aerotech driver support.
SRCS += AerotechRegister.cc
SRCS += devEnsemble.cc drvEnsemble.cc
Aerotech_LIBS += motor asyn
Aerotech_LIBS += $(EPICS_BASE_IOC_LIBS)
include $(TOP)/configure/RULES
+5 -5
View File
@@ -1,5 +1,5 @@
# Aerotech Ensemble Driver support.
device(motor,VME_IO,devEnsemble,"Ensemble")
driver(drvEnsemble)
registrar(AerotechRegister)
# Aerotech Ensemble Driver support.
device(motor,VME_IO,devEnsemble,"Ensemble")
driver(drvEnsemble)
registrar(AerotechRegister)
+759 -759
View File
File diff suppressed because it is too large Load Diff
+81 -81
View File
@@ -1,81 +1,81 @@
/*
FILENAME... drvEnsemble.h
USAGE... This file contains Aerotech Ensemble driver "include" information.
Version: $Revision: 1.3 $
Modified By: $Author: sluiter $
Last Modified: $Date: 2009-05-01 18:13:42 $
*/
/*
* Original Author: Chad Weimer
* Date: 10/16/97
*
* Experimental Physics and Industrial Control System (EPICS)
*
* Copyright 1991, the Regents of the University of California,
* and the University of Chicago Board of Governors.
*
* This software was produced under U.S. Government contracts:
* (W-7405-ENG-36) at the Los Alamos National Laboratory,
* and (W-31-109-ENG-38) at Argonne National Laboratory.
*
* Initial development by:
* The Controls and Automation Group (AT-8)
* Ground Test Accelerator
* Accelerator Technology Division
* Los Alamos National Laboratory
*
* Co-developed with
* The Controls and Computing Group
* Accelerator Systems Division
* Advanced Photon Source
* Argonne National Laboratory
*
* Modification Log:
* -----------------
* .00 04-01-08 caw initialized from drvMM4000.h (Newport)
*/
#ifndef INCdrvEnsembleh
#define INCdrvEnsembleh 1
#include "motor.h"
#include "motordrvCom.h"
#include "asynDriver.h"
#include "asynOctetSyncIO.h"
// The following should be defined to have the same value as
// the Ensemble parameters specified
#define ASCII_EOS_CHAR '\n' // AsciiCmdEOSChar
#define ASCII_EOS_STR "\n"
#define ASCII_ACK_CHAR '%' // AsciiCmdAckChar
#define ASCII_NAK_CHAR '!' // AsciiCmdNakChar
#define ASCII_FAULT_CHAR '#' // AsciiCmdFaultChar
#define ASCII_TIMEOUT_CHAR '$' // AsciiCmdTimeoutChar
#define BUFF_SIZE 100 /* Maximum length of string to/from Ensemble */
/* Ensemble specific data is stored in this structure. */
struct Ensemblecontroller
{
asynUser *pasynUser; /* For RS-232/Ethernet */
int asyn_address; /* Use for GPIB or other address with asyn */
char asyn_port[80]; /* asyn port name */
int axes[MAX_AXIS];
double drive_resolution[MAX_AXIS];
int res_decpts[MAX_AXIS]; /* Drive resolution significant dec. pts. */
double home_preset[MAX_AXIS]; /* Controller's home preset position (XF command). */
epicsUInt32 home_dparam[MAX_AXIS]; /* Controller's HomeDirection parameter. */
CommStatus status; /* Controller communication status. */
};
/* Function prototypes. */
extern RTN_STATUS EnsembleSetup(int, int);
extern RTN_STATUS EnsembleConfig(int, const char *, int);
#endif /* INCdrvEnsembleh */
/*
FILENAME... drvEnsemble.h
USAGE... This file contains Aerotech Ensemble driver "include" information.
Version: $Revision: 1.3 $
Modified By: $Author: sluiter $
Last Modified: $Date: 2009-05-01 18:13:42 $
*/
/*
* Original Author: Chad Weimer
* Date: 10/16/97
*
* Experimental Physics and Industrial Control System (EPICS)
*
* Copyright 1991, the Regents of the University of California,
* and the University of Chicago Board of Governors.
*
* This software was produced under U.S. Government contracts:
* (W-7405-ENG-36) at the Los Alamos National Laboratory,
* and (W-31-109-ENG-38) at Argonne National Laboratory.
*
* Initial development by:
* The Controls and Automation Group (AT-8)
* Ground Test Accelerator
* Accelerator Technology Division
* Los Alamos National Laboratory
*
* Co-developed with
* The Controls and Computing Group
* Accelerator Systems Division
* Advanced Photon Source
* Argonne National Laboratory
*
* Modification Log:
* -----------------
* .00 04-01-08 caw initialized from drvMM4000.h (Newport)
*/
#ifndef INCdrvEnsembleh
#define INCdrvEnsembleh 1
#include "motor.h"
#include "motordrvCom.h"
#include "asynDriver.h"
#include "asynOctetSyncIO.h"
// The following should be defined to have the same value as
// the Ensemble parameters specified
#define ASCII_EOS_CHAR '\n' // AsciiCmdEOSChar
#define ASCII_EOS_STR "\n"
#define ASCII_ACK_CHAR '%' // AsciiCmdAckChar
#define ASCII_NAK_CHAR '!' // AsciiCmdNakChar
#define ASCII_FAULT_CHAR '#' // AsciiCmdFaultChar
#define ASCII_TIMEOUT_CHAR '$' // AsciiCmdTimeoutChar
#define BUFF_SIZE 100 /* Maximum length of string to/from Ensemble */
/* Ensemble specific data is stored in this structure. */
struct Ensemblecontroller
{
asynUser *pasynUser; /* For RS-232/Ethernet */
int asyn_address; /* Use for GPIB or other address with asyn */
char asyn_port[80]; /* asyn port name */
int axes[MAX_AXIS];
double drive_resolution[MAX_AXIS];
int res_decpts[MAX_AXIS]; /* Drive resolution significant dec. pts. */
double home_preset[MAX_AXIS]; /* Controller's home preset position (XF command). */
epicsUInt32 home_dparam[MAX_AXIS]; /* Controller's HomeDirection parameter. */
CommStatus status; /* Controller communication status. */
};
/* Function prototypes. */
extern RTN_STATUS EnsembleSetup(int, int);
extern RTN_STATUS EnsembleConfig(int, const char *, int);
#endif /* INCdrvEnsembleh */
+5 -5
View File
@@ -1,5 +1,5 @@
# Micro Mo MVP 2001 Driver support.
device(motor,VME_IO,devMVP2001,"MVP2001")
driver(drvMVP2001)
#variable(drvMVP2001debug)
# Micro Mo MVP 2001 Driver support.
device(motor,VME_IO,devMVP2001,"MVP2001")
driver(drvMVP2001)
#variable(drvMVP2001debug)
Executable → Regular
View File
Executable → Regular
View File
View File
Executable → Regular
+286 -286
View File
@@ -1,286 +1,286 @@
/*///////////////////////////////////////////////////////////////////////////////
* Socket.cpp
*/
#include "Socket.h"
#define TIMEOUT 300
#define SMALL_BUFFER_SIZE 256
#define MAX_NB_SOCKETS 100
void Delay(double timedelay);
CAsyncSocket m_sConnectSocket[MAX_NB_SOCKETS];
BOOL UsedSocket[MAX_NB_SOCKETS] = { FALSE};
double TimeoutSocket[MAX_NB_SOCKETS];
int NbSockets = 0;
/***************************************************************************************/
int ConnectToServer(char *Ip_Address, int Ip_Port, double TimeOut)
{
int flag = 1;
int socketID = 0;
DWORD sockPendingFlag = 1;
if (!AfxSocketInit())
{
AfxMessageBox("Fatal Error: MFC Socket initialization failed");
return -1;
}
/* Select a socket number */
if (NbSockets < MAX_NB_SOCKETS)
{
while ((UsedSocket[socketID] == TRUE) && (socketID < MAX_NB_SOCKETS))
socketID++;
if (socketID == MAX_NB_SOCKETS)
return -1;
}
else
return -1;
UsedSocket[socketID] = TRUE;
NbSockets++;
/* Socket creation */
if ((m_sConnectSocket[socketID].Create() == 0)
|| (m_sConnectSocket[socketID].SetSockOpt(TCP_NODELAY,(char *)&flag,(int)sizeof( flag ),IPPROTO_TCP) == 0))
{
UsedSocket[socketID] = FALSE;
NbSockets--;
return -1;
}
/* Connect */
if (m_sConnectSocket[socketID].Connect(Ip_Address,Ip_Port) == 0)
{
int SocketError = m_sConnectSocket[socketID].GetLastError();
if (SocketError != WSAEWOULDBLOCK)
{
UsedSocket[socketID] = FALSE;
NbSockets--;
return -1;
}
}
/* Set timeout */
if (TimeOut > 0)
{
if (TimeOut < 1e-3)
TimeoutSocket[socketID] = 1e-3;
else
TimeoutSocket[socketID] = TimeOut;
}
else
TimeoutSocket[socketID] = TIMEOUT;
/* Socket array */
struct fd_set *Sockets = new struct fd_set;
FD_ZERO(Sockets);
FD_SET(m_sConnectSocket[socketID], Sockets);
/* Time structure */
struct timeval *TimeOutStruct = new struct timeval;
TimeOutStruct->tv_sec = (long) TimeoutSocket[socketID];
TimeOutStruct->tv_usec = (long) ((TimeoutSocket[socketID] - (long)TimeoutSocket[socketID])* 1e9);
/* Checking connection is ok */
int SelectReturn = select(0, NULL, Sockets, NULL, TimeOutStruct);
if (SelectReturn == SOCKET_ERROR
|| SelectReturn == 0)
{
UsedSocket[socketID] = FALSE;
NbSockets--;
return -1;
}
/* Force no pending */
if (m_sConnectSocket[socketID].IOCtl(FIONBIO,&sockPendingFlag) == 0)
{
m_sConnectSocket[socketID].Close();
UsedSocket[socketID] = FALSE;
NbSockets--;
return -1;
}
/* Delay unless -1 return for the first API */
Sleep(10);
/* Return socket ID */
return socketID;
}
/***************************************************************************************/
void SetTCPTimeout(int SocketIndex, double TimeOut)
{
if ((SocketIndex >= 0) && (SocketIndex < MAX_NB_SOCKETS) && (UsedSocket[SocketIndex] == TRUE))
{
if (TimeOut > 0)
{
if (TimeOut < 1e-3)
TimeoutSocket[SocketIndex] = 1e-3;
else
TimeoutSocket[SocketIndex] = TimeOut;
}
}
}
/***************************************************************************************/
void SendAndReceive(int socketID, char sSendString[], char sReturnString[], int iReturnStringSize)
{
char sSocketBuffer[SMALL_BUFFER_SIZE + 1] = {'\0'};
int iReceiveByteNumber = 0;
int iErrorNo = 0;
fd_set readFds;
int iSelectStatus;
double dTimeout;
struct timeval cTimeout;
clock_t start, stop;
if ((socketID >= 0) && (socketID < MAX_NB_SOCKETS) && (UsedSocket[socketID] == TRUE))
{
/* Clear receive buffer */
do
{
iReceiveByteNumber = m_sConnectSocket[socketID].Receive(sSocketBuffer,SMALL_BUFFER_SIZE);
}
while (iReceiveByteNumber != SOCKET_ERROR);
sReturnString[0] = '\0';
/* Send String to controller and wait for response */
m_sConnectSocket[socketID].Send(sSendString,strlen(sSendString));
/* Get reply with timeout */
dTimeout = TimeoutSocket[socketID];
do
{
/* Get time */
start = clock();
/* Check reply */
iReceiveByteNumber = m_sConnectSocket[socketID].Receive(sSocketBuffer,SMALL_BUFFER_SIZE);
iErrorNo = GetLastError() & 0xffff;
/* Wait for reply */
if ((iReceiveByteNumber == SOCKET_ERROR) && (iErrorNo == WSAEWOULDBLOCK))
{
FD_ZERO(&readFds);
FD_SET(m_sConnectSocket[socketID].m_hSocket, &readFds);
cTimeout.tv_sec = (long)dTimeout;
cTimeout.tv_usec = (long)((dTimeout - (long)dTimeout) * 1e6);
iSelectStatus = select(FD_SETSIZE, (fd_set *)&readFds, (fd_set *) NULL, (fd_set *) NULL, &cTimeout);
if ((iSelectStatus > 0) && (FD_ISSET(m_sConnectSocket[socketID].m_hSocket, &readFds)))
iReceiveByteNumber = m_sConnectSocket[socketID].Receive(sSocketBuffer,SMALL_BUFFER_SIZE);
else
{
iErrorNo = GetLastError() & 0xffff;
sprintf(sSocketBuffer,"-2,%s,EndOfAPI",sSendString);
strncpyWithEOS(sReturnString, sSocketBuffer, strlen(sSocketBuffer), iReturnStringSize);
iReceiveByteNumber = SOCKET_ERROR;
}
}
/* Concatenation */
if ((iReceiveByteNumber >= 0) && (iReceiveByteNumber <= SMALL_BUFFER_SIZE))
{
sSocketBuffer[iReceiveByteNumber] = '\0';
strncat(sReturnString, sSocketBuffer, iReturnStringSize - strlen(sReturnString) - 1);
}
/* Calculate new timeout */
stop = clock();
dTimeout = dTimeout - (double)(stop - start) / CLOCKS_PER_SEC;
if (dTimeout < 1e-3)
dTimeout = 1e-3;
}
while ((iReceiveByteNumber != SOCKET_ERROR) && (strstr(sReturnString, "EndOfAPI") == NULL));
}
else
sReturnString[0] = '\0';
return;
}
/***************************************************************************************/
void CloseSocket(int socketID)
{
if ((socketID >= 0) && (socketID < MAX_NB_SOCKETS))
{
if (UsedSocket[socketID] == TRUE)
{
m_sConnectSocket[socketID].Close();
UsedSocket[socketID] = FALSE;
TimeoutSocket[socketID] = TIMEOUT;
NbSockets--;
}
}
}
/***************************************************************************************/
char * GetError(int socketID)
{
if ((socketID >= 0) && (socketID < MAX_NB_SOCKETS))
{
int error = m_sConnectSocket[socketID].GetLastError();
switch (error)
{
case WSANOTINITIALISED:
return (_T("A successful AfxSocketInit must occur before using this API."));
case WSAENETDOWN:
return(_T("The Windows Sockets implementation detected that the network subsystem failed."));
case WSAEADDRINUSE:
return(_T("The specified address is already in use."));
case WSAEINPROGRESS:
return(_T("A blocking Windows Sockets call is in progress."));
case WSAEADDRNOTAVAIL:
return(_T("The specified address is not available from the local machine."));
case WSAEAFNOSUPPORT:
return(_T("Addresses in the specified family cannot be used with this socket."));
case WSAECONNREFUSED:
return(_T("The attempt to connect was rejected."));
case WSAEDESTADDRREQ:
return(_T("A destination address is required."));
case WSAEFAULT:
return(_T("The nSockAddrLen argument is incorrect."));
case WSAEINVAL:
return(_T("Invalid host address."));
case WSAEISCONN:
return(_T("The socket is already connected."));
case WSAEMFILE:
return(_T("No more file descriptors are available."));
case WSAENETUNREACH:
return(_T("The network cannot be reached from this host at this time."));
case WSAENOBUFS:
return(_T("No buffer space is available. The socket cannot be connected."));
case WSAENOTSOCK:
return(_T("The descriptor is not a socket."));
case WSAETIMEDOUT:
return(_T("Attempt to connect timed out without establishing a connection."));
case WSAEWOULDBLOCK:
return(_T("The socket is marked as nonblocking and the connection cannot be completed immediately."));
case WSAEPROTONOSUPPORT:
return(_T("The specified port is not supported."));
case WSAEPROTOTYPE:
return(_T("The specified port is the wrong type for this socket."));
case WSAESOCKTNOSUPPORT:
return(_T("The specified socket type is not supported in this address family."));
}
return(_T(""));
}
else
return(_T(""));
}
/***************************************************************************************/
void strncpyWithEOS(char * szStringOut, const char * szStringIn, int nNumberOfCharToCopy, int nStringOutSize)
{
if (nNumberOfCharToCopy < nStringOutSize)
{
strncpy (szStringOut, szStringIn, nNumberOfCharToCopy);
szStringOut[nNumberOfCharToCopy] = '\0';
}
else
{
strncpy (szStringOut, szStringIn, nStringOutSize - 1);
szStringOut[nStringOutSize - 1] = '\0';
}
}
/*///////////////////////////////////////////////////////////////////////////////
* Socket.cpp
*/
#include "Socket.h"
#define TIMEOUT 300
#define SMALL_BUFFER_SIZE 256
#define MAX_NB_SOCKETS 100
void Delay(double timedelay);
CAsyncSocket m_sConnectSocket[MAX_NB_SOCKETS];
BOOL UsedSocket[MAX_NB_SOCKETS] = { FALSE};
double TimeoutSocket[MAX_NB_SOCKETS];
int NbSockets = 0;
/***************************************************************************************/
int ConnectToServer(char *Ip_Address, int Ip_Port, double TimeOut)
{
int flag = 1;
int socketID = 0;
DWORD sockPendingFlag = 1;
if (!AfxSocketInit())
{
AfxMessageBox("Fatal Error: MFC Socket initialization failed");
return -1;
}
/* Select a socket number */
if (NbSockets < MAX_NB_SOCKETS)
{
while ((UsedSocket[socketID] == TRUE) && (socketID < MAX_NB_SOCKETS))
socketID++;
if (socketID == MAX_NB_SOCKETS)
return -1;
}
else
return -1;
UsedSocket[socketID] = TRUE;
NbSockets++;
/* Socket creation */
if ((m_sConnectSocket[socketID].Create() == 0)
|| (m_sConnectSocket[socketID].SetSockOpt(TCP_NODELAY,(char *)&flag,(int)sizeof( flag ),IPPROTO_TCP) == 0))
{
UsedSocket[socketID] = FALSE;
NbSockets--;
return -1;
}
/* Connect */
if (m_sConnectSocket[socketID].Connect(Ip_Address,Ip_Port) == 0)
{
int SocketError = m_sConnectSocket[socketID].GetLastError();
if (SocketError != WSAEWOULDBLOCK)
{
UsedSocket[socketID] = FALSE;
NbSockets--;
return -1;
}
}
/* Set timeout */
if (TimeOut > 0)
{
if (TimeOut < 1e-3)
TimeoutSocket[socketID] = 1e-3;
else
TimeoutSocket[socketID] = TimeOut;
}
else
TimeoutSocket[socketID] = TIMEOUT;
/* Socket array */
struct fd_set *Sockets = new struct fd_set;
FD_ZERO(Sockets);
FD_SET(m_sConnectSocket[socketID], Sockets);
/* Time structure */
struct timeval *TimeOutStruct = new struct timeval;
TimeOutStruct->tv_sec = (long) TimeoutSocket[socketID];
TimeOutStruct->tv_usec = (long) ((TimeoutSocket[socketID] - (long)TimeoutSocket[socketID])* 1e9);
/* Checking connection is ok */
int SelectReturn = select(0, NULL, Sockets, NULL, TimeOutStruct);
if (SelectReturn == SOCKET_ERROR
|| SelectReturn == 0)
{
UsedSocket[socketID] = FALSE;
NbSockets--;
return -1;
}
/* Force no pending */
if (m_sConnectSocket[socketID].IOCtl(FIONBIO,&sockPendingFlag) == 0)
{
m_sConnectSocket[socketID].Close();
UsedSocket[socketID] = FALSE;
NbSockets--;
return -1;
}
/* Delay unless -1 return for the first API */
Sleep(10);
/* Return socket ID */
return socketID;
}
/***************************************************************************************/
void SetTCPTimeout(int SocketIndex, double TimeOut)
{
if ((SocketIndex >= 0) && (SocketIndex < MAX_NB_SOCKETS) && (UsedSocket[SocketIndex] == TRUE))
{
if (TimeOut > 0)
{
if (TimeOut < 1e-3)
TimeoutSocket[SocketIndex] = 1e-3;
else
TimeoutSocket[SocketIndex] = TimeOut;
}
}
}
/***************************************************************************************/
void SendAndReceive(int socketID, char sSendString[], char sReturnString[], int iReturnStringSize)
{
char sSocketBuffer[SMALL_BUFFER_SIZE + 1] = {'\0'};
int iReceiveByteNumber = 0;
int iErrorNo = 0;
fd_set readFds;
int iSelectStatus;
double dTimeout;
struct timeval cTimeout;
clock_t start, stop;
if ((socketID >= 0) && (socketID < MAX_NB_SOCKETS) && (UsedSocket[socketID] == TRUE))
{
/* Clear receive buffer */
do
{
iReceiveByteNumber = m_sConnectSocket[socketID].Receive(sSocketBuffer,SMALL_BUFFER_SIZE);
}
while (iReceiveByteNumber != SOCKET_ERROR);
sReturnString[0] = '\0';
/* Send String to controller and wait for response */
m_sConnectSocket[socketID].Send(sSendString,strlen(sSendString));
/* Get reply with timeout */
dTimeout = TimeoutSocket[socketID];
do
{
/* Get time */
start = clock();
/* Check reply */
iReceiveByteNumber = m_sConnectSocket[socketID].Receive(sSocketBuffer,SMALL_BUFFER_SIZE);
iErrorNo = GetLastError() & 0xffff;
/* Wait for reply */
if ((iReceiveByteNumber == SOCKET_ERROR) && (iErrorNo == WSAEWOULDBLOCK))
{
FD_ZERO(&readFds);
FD_SET(m_sConnectSocket[socketID].m_hSocket, &readFds);
cTimeout.tv_sec = (long)dTimeout;
cTimeout.tv_usec = (long)((dTimeout - (long)dTimeout) * 1e6);
iSelectStatus = select(FD_SETSIZE, (fd_set *)&readFds, (fd_set *) NULL, (fd_set *) NULL, &cTimeout);
if ((iSelectStatus > 0) && (FD_ISSET(m_sConnectSocket[socketID].m_hSocket, &readFds)))
iReceiveByteNumber = m_sConnectSocket[socketID].Receive(sSocketBuffer,SMALL_BUFFER_SIZE);
else
{
iErrorNo = GetLastError() & 0xffff;
sprintf(sSocketBuffer,"-2,%s,EndOfAPI",sSendString);
strncpyWithEOS(sReturnString, sSocketBuffer, strlen(sSocketBuffer), iReturnStringSize);
iReceiveByteNumber = SOCKET_ERROR;
}
}
/* Concatenation */
if ((iReceiveByteNumber >= 0) && (iReceiveByteNumber <= SMALL_BUFFER_SIZE))
{
sSocketBuffer[iReceiveByteNumber] = '\0';
strncat(sReturnString, sSocketBuffer, iReturnStringSize - strlen(sReturnString) - 1);
}
/* Calculate new timeout */
stop = clock();
dTimeout = dTimeout - (double)(stop - start) / CLOCKS_PER_SEC;
if (dTimeout < 1e-3)
dTimeout = 1e-3;
}
while ((iReceiveByteNumber != SOCKET_ERROR) && (strstr(sReturnString, "EndOfAPI") == NULL));
}
else
sReturnString[0] = '\0';
return;
}
/***************************************************************************************/
void CloseSocket(int socketID)
{
if ((socketID >= 0) && (socketID < MAX_NB_SOCKETS))
{
if (UsedSocket[socketID] == TRUE)
{
m_sConnectSocket[socketID].Close();
UsedSocket[socketID] = FALSE;
TimeoutSocket[socketID] = TIMEOUT;
NbSockets--;
}
}
}
/***************************************************************************************/
char * GetError(int socketID)
{
if ((socketID >= 0) && (socketID < MAX_NB_SOCKETS))
{
int error = m_sConnectSocket[socketID].GetLastError();
switch (error)
{
case WSANOTINITIALISED:
return (_T("A successful AfxSocketInit must occur before using this API."));
case WSAENETDOWN:
return(_T("The Windows Sockets implementation detected that the network subsystem failed."));
case WSAEADDRINUSE:
return(_T("The specified address is already in use."));
case WSAEINPROGRESS:
return(_T("A blocking Windows Sockets call is in progress."));
case WSAEADDRNOTAVAIL:
return(_T("The specified address is not available from the local machine."));
case WSAEAFNOSUPPORT:
return(_T("Addresses in the specified family cannot be used with this socket."));
case WSAECONNREFUSED:
return(_T("The attempt to connect was rejected."));
case WSAEDESTADDRREQ:
return(_T("A destination address is required."));
case WSAEFAULT:
return(_T("The nSockAddrLen argument is incorrect."));
case WSAEINVAL:
return(_T("Invalid host address."));
case WSAEISCONN:
return(_T("The socket is already connected."));
case WSAEMFILE:
return(_T("No more file descriptors are available."));
case WSAENETUNREACH:
return(_T("The network cannot be reached from this host at this time."));
case WSAENOBUFS:
return(_T("No buffer space is available. The socket cannot be connected."));
case WSAENOTSOCK:
return(_T("The descriptor is not a socket."));
case WSAETIMEDOUT:
return(_T("Attempt to connect timed out without establishing a connection."));
case WSAEWOULDBLOCK:
return(_T("The socket is marked as nonblocking and the connection cannot be completed immediately."));
case WSAEPROTONOSUPPORT:
return(_T("The specified port is not supported."));
case WSAEPROTOTYPE:
return(_T("The specified port is the wrong type for this socket."));
case WSAESOCKTNOSUPPORT:
return(_T("The specified socket type is not supported in this address family."));
}
return(_T(""));
}
else
return(_T(""));
}
/***************************************************************************************/
void strncpyWithEOS(char * szStringOut, const char * szStringIn, int nNumberOfCharToCopy, int nStringOutSize)
{
if (nNumberOfCharToCopy < nStringOutSize)
{
strncpy (szStringOut, szStringIn, nNumberOfCharToCopy);
szStringOut[nNumberOfCharToCopy] = '\0';
}
else
{
strncpy (szStringOut, szStringIn, nStringOutSize - 1);
szStringOut[nStringOutSize - 1] = '\0';
}
}
Executable → Regular
+14 -14
View File
@@ -1,14 +1,14 @@
/*///////////////////////////////////////////////////////////////////////////////
* Socket.h
*/
#ifdef _WIN
#include <afxsock.h> // MFC socket extensions
#endif
int ConnectToServer (char *Ip_Address, int Ip_Port, double TimeOut);
void SetTCPTimeout (int SocketID, double Timeout);
void SendAndReceive(int socketID, char sSendString[], char sReturnString[], int iReturnStringSize);
void CloseSocket (int SocketID);
char * GetError (int SocketID);
void strncpyWithEOS(char * szStringOut, const char * szStringIn, int nNumberOfCharToCopy, int nStringOutSize);
/*///////////////////////////////////////////////////////////////////////////////
* Socket.h
*/
#ifdef _WIN
#include <afxsock.h> // MFC socket extensions
#endif
int ConnectToServer (char *Ip_Address, int Ip_Port, double TimeOut);
void SetTCPTimeout (int SocketID, double Timeout);
void SendAndReceive(int socketID, char sSendString[], char sReturnString[], int iReturnStringSize);
void CloseSocket (int SocketID);
char * GetError (int SocketID);
void strncpyWithEOS(char * szStringOut, const char * szStringIn, int nNumberOfCharToCopy, int nStringOutSize);
+216 -216
View File
@@ -1,216 +1,216 @@
/*///////////////////////////////////////////////////////////////////
// Created header file XPS_C8_drivers.h for API headings
*/
#ifdef _WIN32
#ifndef DLL
#ifdef _DLL /* _DLL is defined by EPICS if we are being compiled to call DLLs */
#define DLL _declspec(dllimport)
#else
#define DLL
#endif
#endif
#else
#define DLL
#define __stdcall
#endif
#ifdef __cplusplus
extern "C"
{
#else
typedef int bool;
#endif
DLL int __stdcall TCP_ConnectToServer(char *Ip_Address, int Ip_Port, double TimeOut);
DLL void __stdcall TCP_SetTimeout(int SocketIndex, double Timeout);
DLL void __stdcall TCP_CloseSocket(int SocketIndex);
DLL char * __stdcall TCP_GetError(int SocketIndex);
DLL char * __stdcall GetLibraryVersion(void);
DLL int __stdcall ElapsedTimeGet (int SocketIndex, double * ElapsedTime); /* Return elapsed time from controller power on */
DLL int __stdcall ErrorStringGet (int SocketIndex, int ErrorCode, char * ErrorString); /* Return the error string corresponding to the error code */
DLL int __stdcall FirmwareVersionGet (int SocketIndex, char * Version); /* Return firmware version */
DLL int __stdcall TCLScriptExecute (int SocketIndex, char * TCLFileName, char * TaskName, char * ParametersList); /* Execute a TCL script from a TCL file */
DLL int __stdcall TCLScriptExecuteAndWait (int SocketIndex, char * TCLFileName, char * TaskName, char * InputParametersList, char * OutputParametersList); /* Execute a TCL script from a TCL file and wait the end of execution to return */
DLL int __stdcall TCLScriptKill (int SocketIndex, char * TaskName); /* Kill TCL Task */
DLL int __stdcall TimerGet (int SocketIndex, char * TimerName, int * FrequencyTicks); /* Get a timer */
DLL int __stdcall TimerSet (int SocketIndex, char * TimerName, int FrequencyTicks); /* Set a timer */
DLL int __stdcall Reboot (int SocketIndex); /* Reboot the controller */
DLL int __stdcall Login (int SocketIndex, char * Name, char * Password); /* Log in */
DLL int __stdcall CloseAllOtherSockets (int SocketIndex); /* Close all socket beside the one used to send this command */
DLL int __stdcall EventAdd (int SocketIndex, char * PositionerName, char * EventName, char * EventParameter, char * ActionName, char * ActionParameter1, char * ActionParameter2, char * ActionParameter3); /* ** OBSOLETE ** Add an event */
DLL int __stdcall EventGet (int SocketIndex, char * PositionerName, char * EventsAndActionsList); /* ** OBSOLETE ** Read events and actions list */
DLL int __stdcall EventRemove (int SocketIndex, char * PositionerName, char * EventName, char * EventParameter); /* ** OBSOLETE ** Delete an event */
DLL int __stdcall EventWait (int SocketIndex, char * PositionerName, char * EventName, char * EventParameter); /* ** OBSOLETE ** Wait an event */
DLL int __stdcall EventExtendedConfigurationTriggerSet (int SocketIndex, int NbElements, char * ExtendedEventNameList, char * EventParameter1List, char * EventParameter2List, char * EventParameter3List, char * EventParameter4List); /* Configure one or several events */
DLL int __stdcall EventExtendedConfigurationTriggerGet (int SocketIndex, char * EventTriggerConfiguration); /* Read the event configuration */
DLL int __stdcall EventExtendedConfigurationActionSet (int SocketIndex, int NbElements, char * ExtendedActionNameList, char * ActionParameter1List, char * ActionParameter2List, char * ActionParameter3List, char * ActionParameter4List); /* Configure one or several actions */
DLL int __stdcall EventExtendedConfigurationActionGet (int SocketIndex, char * ActionConfiguration); /* Read the action configuration */
DLL int __stdcall EventExtendedStart (int SocketIndex, int * ID); /* Launch the last event and action configuration and return an ID */
DLL int __stdcall EventExtendedAllGet (int SocketIndex, char * EventActionConfigurations); /* Read all event and action configurations */
DLL int __stdcall EventExtendedGet (int SocketIndex, int ID, char * EventTriggerConfiguration, char * ActionConfiguration); /* Read the event and action configuration defined by ID */
DLL int __stdcall EventExtendedRemove (int SocketIndex, int ID); /* Remove the event and action configuration defined by ID */
DLL int __stdcall EventExtendedWait (int SocketIndex); /* Wait events from the last event configuration */
DLL int __stdcall GatheringConfigurationGet (int SocketIndex, char * Type); /*Read different mnemonique type */
DLL int __stdcall GatheringConfigurationSet (int SocketIndex, int NbElements, char * TypeList); /* Configuration acquisition */
DLL int __stdcall GatheringCurrentNumberGet (int SocketIndex, int * CurrentNumber, int * MaximumSamplesNumber); /* Maximum number of samples and current number during acquisition */
DLL int __stdcall GatheringStopAndSave (int SocketIndex); /* Stop acquisition and save data */
DLL int __stdcall GatheringDataAcquire (int SocketIndex); /* Acquire a configured data */
DLL int __stdcall GatheringDataGet (int SocketIndex, int IndexPoint, char * DataBufferLine); /* Get a data line from gathering buffer */
DLL int __stdcall GatheringReset (int SocketIndex); /* Empty the gathered data in memory to start new gathering from scratch */
DLL int __stdcall GatheringExternalConfigurationSet (int SocketIndex, int NbElements, char * TypeList); /* Configuration acquisition */
DLL int __stdcall GatheringExternalConfigurationGet (int SocketIndex, char * Type); /* Read different mnemonique type */
DLL int __stdcall GatheringExternalCurrentNumberGet (int SocketIndex, int * CurrentNumber, int * MaximumSamplesNumber); /* Maximum number of samples and current number during acquisition */
DLL int __stdcall GatheringExternalStopAndSave (int SocketIndex); /* Stop acquisition and save data */
DLL int __stdcall GlobalArrayGet (int SocketIndex, int Number, char * ValueString); /* Get global array value */
DLL int __stdcall GlobalArraySet (int SocketIndex, int Number, char * ValueString); /* Set global array value */
DLL int __stdcall GPIOAnalogGet (int SocketIndex, int NbElements, char * GPIONameList, double AnalogValue[]); /* Read analog input or analog output for one or few input */
DLL int __stdcall GPIOAnalogSet (int SocketIndex, int NbElements, char * GPIONameList, double AnalogOutputValue[]); /* Set analog output for one or few output */
DLL int __stdcall GPIOAnalogGainGet (int SocketIndex, int NbElements, char * GPIONameList, int AnalogInputGainValue[]); /* Read analog input gain (1, 2, 4 or 8) for one or few input */
DLL int __stdcall GPIOAnalogGainSet (int SocketIndex, int NbElements, char * GPIONameList, int AnalogInputGainValue[]); /* Set analog input gain (1, 2, 4 or 8) for one or few input */
DLL int __stdcall GPIODigitalGet (int SocketIndex, char * GPIOName, unsigned short * DigitalValue); /* Read digital output or digital input */
DLL int __stdcall GPIODigitalSet (int SocketIndex, char * GPIOName, unsigned short Mask, unsigned short DigitalOutputValue); /* Set Digital Output for one or few output TTL */
DLL int __stdcall GroupAnalogTrackingModeEnable (int SocketIndex, char * GroupName, char * Type); /* Enable Analog Tracking mode on selected group */
DLL int __stdcall GroupAnalogTrackingModeDisable (int SocketIndex, char * GroupName); /* Disable Analog Tracking mode on selected group */
DLL int __stdcall GroupCorrectorOutputGet (int SocketIndex, char * GroupName, int NbElements, double CorrectorOutput[]); /* Return corrector outputs */
DLL int __stdcall GroupHomeSearch (int SocketIndex, char * GroupName); /* Start home search sequence */
DLL int __stdcall GroupHomeSearchAndRelativeMove (int SocketIndex, char * GroupName, int NbElements, double TargetDisplacement[]); /* Start home search sequence and execute a displacement */
DLL int __stdcall GroupInitialize (int SocketIndex, char * GroupName); /* Start the initialization */
DLL int __stdcall GroupInitializeWithEncoderCalibration (int SocketIndex, char * GroupName); /* Start the initialization with encoder calibration */
DLL int __stdcall GroupJogParametersSet (int SocketIndex, char * GroupName, int NbElements, double Velocity[], double Acceleration[]); /* Modify Jog parameters on selected group and activate the continuous move */
DLL int __stdcall GroupJogParametersGet (int SocketIndex, char * GroupName, int NbElements, double Velocity[], double Acceleration[]); /* Get Jog parameters on selected group */
DLL int __stdcall GroupJogCurrentGet (int SocketIndex, char * GroupName, int NbElements, double Velocity[], double Acceleration[]); /* Get Jog current on selected group */
DLL int __stdcall GroupJogModeEnable (int SocketIndex, char * GroupName); /* Enable Jog mode on selected group */
DLL int __stdcall GroupJogModeDisable (int SocketIndex, char * GroupName); /* Disable Jog mode on selected group */
DLL int __stdcall GroupKill (int SocketIndex, char * GroupName); /* Kill the group */
DLL int __stdcall GroupMoveAbort (int SocketIndex, char * GroupName); /* Abort a move */
DLL int __stdcall GroupMoveAbsolute (int SocketIndex, char * GroupName, int NbElements, double TargetPosition[]); /* Do an absolute move */
DLL int __stdcall GroupMoveRelative (int SocketIndex, char * GroupName, int NbElements, double TargetDisplacement[]); /* Do a relative move */
DLL int __stdcall GroupMotionDisable (int SocketIndex, char * GroupName); /* Set Motion disable on selected group */
DLL int __stdcall GroupMotionEnable (int SocketIndex, char * GroupName); /* Set Motion enable on selected group */
DLL int __stdcall GroupPositionCurrentGet (int SocketIndex, char * GroupName, int NbElements, double CurrentEncoderPosition[]); /* Return current positions */
DLL int __stdcall GroupPositionSetpointGet (int SocketIndex, char * GroupName, int NbElements, double SetPointPosition[]); /* Return setpoint positions */
DLL int __stdcall GroupPositionTargetGet (int SocketIndex, char * GroupName, int NbElements, double TargetPosition[]); /* Return target positions */
DLL int __stdcall GroupReferencingActionExecute (int SocketIndex, char * PositionerName, char * ReferencingAction, char * ReferencingSensor, double ReferencingParameter); /* Execute an action in referencing mode */
DLL int __stdcall GroupReferencingStart (int SocketIndex, char * GroupName); /* Enter referencing mode */
DLL int __stdcall GroupReferencingStop (int SocketIndex, char * GroupName); /* Exit referencing mode */
DLL int __stdcall GroupStatusGet (int SocketIndex, char * GroupName, int * Status); /* Return group status */
DLL int __stdcall GroupStatusStringGet (int SocketIndex, int GroupStatusCode, char * GroupStatusString); /* Return the group status string corresponding to the group status code */
DLL int __stdcall GroupVelocityCurrentGet (int SocketIndex, char * GroupName, int NbElements, double CurrentVelocity[]); /* Return current velocities */
DLL int __stdcall KillAll (int SocketIndex); /* Put all groups in 'Not initialized' state */
DLL int __stdcall PositionerAnalogTrackingPositionParametersGet (int SocketIndex, char * PositionerName, char * GPIOName, double * Offset, double * Scale, double * Velocity, double * Acceleration); /* Read dynamic parameters for one axe of a group for a future analog tracking position */
DLL int __stdcall PositionerAnalogTrackingPositionParametersSet (int SocketIndex, char * PositionerName, char * GPIOName, double Offset, double Scale, double Velocity, double Acceleration); /* Update dynamic parameters for one axe of a group for a future analog tracking position */
DLL int __stdcall PositionerAnalogTrackingVelocityParametersGet (int SocketIndex, char * PositionerName, char * GPIOName, double * Offset, double * Scale, double * DeadBandThreshold, int * Order, double * Velocity, double * Acceleration); /* Read dynamic parameters for one axe of a group for a future analog tracking velocity */
DLL int __stdcall PositionerAnalogTrackingVelocityParametersSet (int SocketIndex, char * PositionerName, char * GPIOName, double Offset, double Scale, double DeadBandThreshold, int Order, double Velocity, double Acceleration); /* Update dynamic parameters for one axe of a group for a future analog tracking velocity */
DLL int __stdcall PositionerBacklashGet (int SocketIndex, char * PositionerName, double * BacklashValue, char * BacklaskStatus); /* Read backlash value and status */
DLL int __stdcall PositionerBacklashSet (int SocketIndex, char * PositionerName, double BacklashValue); /* Set backlash value */
DLL int __stdcall PositionerBacklashEnable (int SocketIndex, char * PositionerName); /* Enable the backlash */
DLL int __stdcall PositionerBacklashDisable (int SocketIndex, char * PositionerName); /* Disable the backlash */
DLL int __stdcall PositionerCorrectorNotchFiltersSet (int SocketIndex, char * PositionerName, double NotchFrequency1, double NotchBandwith1, double NotchGain1, double NotchFrequency2, double NotchBandwith2, double NotchGain2); /* Update filters parameters */
DLL int __stdcall PositionerCorrectorNotchFiltersGet (int SocketIndex, char * PositionerName, double * NotchFrequency1, double * NotchBandwith1, double * NotchGain1, double * NotchFrequency2, double * NotchBandwith2, double * NotchGain2); /* Read filters parameters */
DLL int __stdcall PositionerCorrectorPIDFFAccelerationSet (int SocketIndex, char * PositionerName, bool ClosedLoopStatus, double KP, double KI, double KD, double KS, double IntegrationTime, double DerivativeFilterCutOffFrequency, double GKP, double GKI, double GKD, double KForm, double FeedForwardGainAcceleration); /* Update corrector parameters */
DLL int __stdcall PositionerCorrectorPIDFFAccelerationGet (int SocketIndex, char * PositionerName, bool * ClosedLoopStatus, double * KP, double * KI, double * KD, double * KS, double * IntegrationTime, double * DerivativeFilterCutOffFrequency, double * GKP, double * GKI, double * GKD, double * KForm, double * FeedForwardGainAcceleration); /* Read corrector parameters */
DLL int __stdcall PositionerCorrectorPIDFFVelocitySet (int SocketIndex, char * PositionerName, bool ClosedLoopStatus, double KP, double KI, double KD, double KS, double IntegrationTime, double DerivativeFilterCutOffFrequency, double GKP, double GKI, double GKD, double KForm, double FeedForwardGainVelocity); /* Update corrector parameters */
DLL int __stdcall PositionerCorrectorPIDFFVelocityGet (int SocketIndex, char * PositionerName, bool * ClosedLoopStatus, double * KP, double * KI, double * KD, double * KS, double * IntegrationTime, double * DerivativeFilterCutOffFrequency, double * GKP, double * GKI, double * GKD, double * KForm, double * FeedForwardGainVelocity); /* Read corrector parameters */
DLL int __stdcall PositionerCorrectorPIDDualFFVoltageSet (int SocketIndex, char * PositionerName, bool ClosedLoopStatus, double KP, double KI, double KD, double KS, double IntegrationTime, double DerivativeFilterCutOffFrequency, double GKP, double GKI, double GKD, double KForm, double FeedForwardGainVelocity, double FeedForwardGainAcceleration, double Friction); /* Update corrector parameters */
DLL int __stdcall PositionerCorrectorPIDDualFFVoltageGet (int SocketIndex, char * PositionerName, bool * ClosedLoopStatus, double * KP, double * KI, double * KD, double * KS, double * IntegrationTime, double * DerivativeFilterCutOffFrequency, double * GKP, double * GKI, double * GKD, double * KForm, double * FeedForwardGainVelocity, double * FeedForwardGainAcceleration, double * Friction); /* Read corrector
parameters */
DLL int __stdcall PositionerCorrectorPIPositionSet (int SocketIndex, char * PositionerName, bool ClosedLoopStatus, double KP, double KI, double IntegrationTime); /* Update corrector parameters */
DLL int __stdcall PositionerCorrectorPIPositionGet (int SocketIndex, char * PositionerName, bool * ClosedLoopStatus, double * KP, double * KI, double * IntegrationTime); /* Read corrector parameters */
DLL int __stdcall PositionerCorrectorTypeGet (int SocketIndex, char * PositionerName, char * CorrectorType); /* Read corrector type */
DLL int __stdcall PositionerCurrentVelocityAccelerationFiltersSet (int SocketIndex, char * PositionerName, double CurrentVelocityCutOffFrequency, double CurrentAccelerationCutOffFrequency); /* Set current velocity and acceleration cut off frequencies */
DLL int __stdcall PositionerCurrentVelocityAccelerationFiltersGet (int SocketIndex, char * PositionerName, double * CurrentVelocityCutOffFrequency, double * CurrentAccelerationCutOffFrequency); /* Get current velocity and acceleration cut off frequencies */
DLL int __stdcall PositionerDriverStatusGet (int SocketIndex, char * PositionerName, int * DriverStatus); /* Read positioner driver status */
DLL int __stdcall PositionerDriverStatusStringGet (int SocketIndex, int PositionerDriverStatus, char * PositionerDriverStatusString); /* Return the positioner driver status string corresponding to the positioner error code */
DLL int __stdcall PositionerEncoderAmplitudeValuesGet (int SocketIndex, char * PositionerName, double * MaxSinusAmplitude, double * CurrentSinusAmplitude, double * MaxCosinusAmplitude, double * CurrentCosinusAmplitude); /* Read analog interpolated encoder amplitude values */
DLL int __stdcall PositionerEncoderCalibrationParametersGet (int SocketIndex, char * PositionerName, double * SinusOffset, double * CosinusOffset, double * DifferentialGain, double * PhaseCompensation); /* Read analog interpolated encoder calibration parameters */
DLL int __stdcall PositionerErrorGet (int SocketIndex, char * PositionerName, int * ErrorCode); /* Read and clear positioner error code */
DLL int __stdcall PositionerErrorRead (int SocketIndex, char * PositionerName, int * ErrorCode); /* Read only positioner error code without clear it */
DLL int __stdcall PositionerErrorStringGet (int SocketIndex, int PositionerErrorCode, char * PositionerErrorString); /* Return the positioner status string corresponding to the positioner error code */
DLL int __stdcall PositionerHardwareStatusGet (int SocketIndex, char * PositionerName, int * HardwareStatus); /* Read positioner hardware status */
DLL int __stdcall PositionerHardwareStatusStringGet (int SocketIndex, int PositionerHardwareStatus, char * PositionerHardwareStatusString); /* Return the positioner hardware status string corresponding to the positioner error code */
DLL int __stdcall PositionerHardInterpolatorFactorGet (int SocketIndex, char * PositionerName, int * InterpolationFactor); /* Get hard interpolator parameters */
DLL int __stdcall PositionerHardInterpolatorFactorSet (int SocketIndex, char * PositionerName, int InterpolationFactor); /* Set hard interpolator parameters */
DLL int __stdcall PositionerMaximumVelocityAndAccelerationGet (int SocketIndex, char * PositionerName, double * MaximumVelocity, double * MaximumAcceleration); /* Return maximum velocity and acceleration of the positioner */
DLL int __stdcall PositionerMotionDoneGet (int SocketIndex, char * PositionerName, double * PositionWindow, double * VelocityWindow, double * CheckingTime, double * MeanPeriod, double * TimeOut); /* Read motion done parameters */
DLL int __stdcall PositionerMotionDoneSet (int SocketIndex, char * PositionerName, double PositionWindow, double VelocityWindow, double CheckingTime, double MeanPeriod, double TimeOut); /* Update motion done parameters */
DLL int __stdcall PositionerPositionCompareGet (int SocketIndex, char * PositionerName, double * MinimumPosition, double * MaximumPosition, double * PositionStep, bool * EnableState); /* Read position compare parameters */
DLL int __stdcall PositionerPositionCompareSet (int SocketIndex, char * PositionerName, double MinimumPosition, double MaximumPosition, double PositionStep); /* Set position compare parameters */
DLL int __stdcall PositionerPositionCompareEnable (int SocketIndex, char * PositionerName); /* Enable position compare */
DLL int __stdcall PositionerPositionCompareDisable (int SocketIndex, char * PositionerName); /* Disable position compare */
DLL int __stdcall PositionersEncoderIndexDifferenceGet (int SocketIndex, char * PositionerName, double * distance); /* Return the difference between index of primary axis and secondary axis (only after homesearch) */
DLL int __stdcall PositionerSGammaExactVelocityAjustedDisplacementGet (int SocketIndex, char * PositionerName, double DesiredDisplacement, double * AdjustedDisplacement); /* Return adjusted displacement to get exact velocity */
DLL int __stdcall PositionerSGammaParametersGet (int SocketIndex, char * PositionerName, double * Velocity, double * Acceleration, double * MinimumTjerkTime, double * MaximumTjerkTime); /* Read dynamic parameters for one axe of a group for a future displacement */
DLL int __stdcall PositionerSGammaParametersSet (int SocketIndex, char * PositionerName, double Velocity, double Acceleration, double MinimumTjerkTime, double MaximumTjerkTime); /* Update dynamic parameters for one axe of a group for a future displacement */
DLL int __stdcall PositionerSGammaPreviousMotionTimesGet (int SocketIndex, char * PositionerName, double * SettingTime, double * SettlingTime); /* Read SettingTime and SettlingTime */
DLL int __stdcall PositionerStageParameterGet (int SocketIndex, char * PositionerName, char * ParameterName, char * ParameterValue); /* Return the stage parameter */
DLL int __stdcall PositionerStageParameterSet (int SocketIndex, char * PositionerName, char * ParameterName, char * ParameterValue); /* Save the stage parameter */
DLL int __stdcall PositionerTimeFlasherGet (int SocketIndex, char * PositionerName, double * MinimumPosition, double * MaximumPosition, double * PositionStep, bool * EnableState); /* Read time flasher parameters */
DLL int __stdcall PositionerTimeFlasherSet (int SocketIndex, char * PositionerName, double MinimumPosition, double MaximumPosition, double TimeInterval); /* Set time flasher parameters */
DLL int __stdcall PositionerTimeFlasherEnable (int SocketIndex, char * PositionerName); /* Enable time flasher */
DLL int __stdcall PositionerTimeFlasherDisable (int SocketIndex, char * PositionerName); /* Disable time flasher */
DLL int __stdcall PositionerUserTravelLimitsGet (int SocketIndex, char * PositionerName, double * UserMinimumTarget, double * UserMaximumTarget); /* Read UserMinimumTarget and UserMaximumTarget */
DLL int __stdcall PositionerUserTravelLimitsSet (int SocketIndex, char * PositionerName, double UserMinimumTarget, double UserMaximumTarget); /* Update UserMinimumTarget and UserMaximumTarget */
DLL int __stdcall PositionerCorrectorAutoTuning (int SocketIndex, char * PositionerName, int TuningMode, double * KP, double * KI, double * KD); /* Astrom&Hagglund based auto-tuning */
DLL int __stdcall PositionerAccelerationAutoScaling (int SocketIndex, char * PositionerName, double * Scaling); /* Astrom&Hagglund based auto-scaling */
DLL int __stdcall MultipleAxesPVTVerification (int SocketIndex, char * GroupName, char * TrajectoryFileName); /* Multiple axes PVT trajectory verification */
DLL int __stdcall MultipleAxesPVTVerificationResultGet (int SocketIndex, char * PositionerName, char * FileName, double * MinimumPosition, double * MaximumPosition, double * MaximumVelocity, double * MaximumAcceleration); /* Multiple axes PVT trajectory verification result get */
DLL int __stdcall MultipleAxesPVTExecution (int SocketIndex, char * GroupName, char * TrajectoryFileName, int ExecutionNumber); /* Multiple axes PVT trajectory execution */
DLL int __stdcall MultipleAxesPVTParametersGet (int SocketIndex, char * GroupName, char * FileName, int * CurrentElementNumber); /* Multiple axes PVT trajectory get parameters */
DLL int __stdcall MultipleAxesPVTPulseOutputSet (int SocketIndex, char * GroupName, int StartElement, int EndElement, double TimeInterval); /* Configure pulse output on trajectory */
DLL int __stdcall MultipleAxesPVTPulseOutputGet (int SocketIndex, char * GroupName, int * StartElement, int * EndElement, double * TimeInterval); /* Get pulse output on trajectory configuration */
DLL int __stdcall SingleAxisSlaveModeEnable (int SocketIndex, char * GroupName); /* Enable the slave mode */
DLL int __stdcall SingleAxisSlaveModeDisable (int SocketIndex, char * GroupName); /* Disable the slave mode */
DLL int __stdcall SingleAxisSlaveParametersSet (int SocketIndex, char * GroupName, char * PositionerName, double Ratio); /* Set slave parameters */
DLL int __stdcall SingleAxisSlaveParametersGet (int SocketIndex, char * GroupName, char * PositionerName, double * Ratio); /* Get slave parameters */
DLL int __stdcall SpindleSlaveModeEnable (int SocketIndex, char * GroupName); /* Enable the slave mode */
DLL int __stdcall SpindleSlaveModeDisable (int SocketIndex, char * GroupName); /* Disable the slave mode */
DLL int __stdcall SpindleSlaveParametersSet (int SocketIndex, char * GroupName, char * PositionerName, double Ratio); /* Set slave parameters */
DLL int __stdcall SpindleSlaveParametersGet (int SocketIndex, char * GroupName, char * PositionerName, double * Ratio); /* Get slave parameters */
DLL int __stdcall GroupSpinParametersSet (int SocketIndex, char * GroupName, double Velocity, double Acceleration); /* Modify Spin parameters on selected group and activate the continuous move */
DLL int __stdcall GroupSpinParametersGet (int SocketIndex, char * GroupName, double * Velocity, double * Acceleration); /* Get Spin parameters on selected group */
DLL int __stdcall GroupSpinCurrentGet (int SocketIndex, char * GroupName, double * Velocity, double * Acceleration); /* Get Spin current on selected group */
DLL int __stdcall GroupSpinModeStop (int SocketIndex, char * GroupName, double Acceleration); /* Stop Spin mode on selected group with specified acceleration */
DLL int __stdcall XYLineArcVerification (int SocketIndex, char * GroupName, char * TrajectoryFileName); /* XY trajectory verification */
DLL int __stdcall XYLineArcVerificationResultGet (int SocketIndex, char * PositionerName, char * FileName, double * MinimumPosition, double * MaximumPosition, double * MaximumVelocity, double * MaximumAcceleration); /* XY trajectory verification result get */
DLL int __stdcall XYLineArcExecution (int SocketIndex, char * GroupName, char * TrajectoryFileName, double Velocity, double Acceleration, int ExecutionNumber); /* XY trajectory execution */
DLL int __stdcall XYLineArcParametersGet (int SocketIndex, char * GroupName, char * FileName, double * Velocity, double * Acceleration, int * CurrentElementNumber); /* XY trajectory get parameters */
DLL int __stdcall XYLineArcPulseOutputSet (int SocketIndex, char * GroupName, double StartLength, double EndLength, double PathLengthInterval); /* Configure pulse output on trajectory */
DLL int __stdcall XYLineArcPulseOutputGet (int SocketIndex, char * GroupName, double * StartLength, double * EndLength, double * PathLengthInterval); /* Get pulse output on trajectory configuration */
DLL int __stdcall XYZSplineVerification (int SocketIndex, char * GroupName, char * TrajectoryFileName); /* XYZ trajectory verifivation */
DLL int __stdcall XYZSplineVerificationResultGet (int SocketIndex, char * PositionerName, char * FileName, double * MinimumPosition, double * MaximumPosition, double * MaximumVelocity, double * MaximumAcceleration); /* XYZ trajectory verification result get */
DLL int __stdcall XYZSplineExecution (int SocketIndex, char * GroupName, char * TrajectoryFileName, double Velocity, double Acceleration); /* XYZ trajectory execution */
DLL int __stdcall XYZSplineParametersGet (int SocketIndex, char * GroupName, char * FileName, double * Velocity, double * Acceleration, int * CurrentElementNumber); /* XYZ trajectory get parameters */
DLL int __stdcall EEPROMCIESet (int SocketIndex, int CardNumber, char * ReferenceString); /* XYZ trajectory get parameters */
DLL int __stdcall EEPROMDACOffsetCIESet (int SocketIndex, int PlugNumber, double DAC1Offset, double DAC2Offset); /* XYZ trajectory get parameters */
DLL int __stdcall EEPROMDriverSet (int SocketIndex, int PlugNumber, char * ReferenceString); /* XYZ trajectory get parameters */
DLL int __stdcall EEPROMINTSet (int SocketIndex, int CardNumber, char * ReferenceString); /* XYZ trajectory get parameters */
DLL int __stdcall CPUCoreAndBoardSupplyVoltagesGet (int SocketIndex, double * VoltageCPUCore, double * SupplyVoltage1P5V, double * SupplyVoltage3P3V, double * SupplyVoltage5V, double * SupplyVoltage12V, double * SupplyVoltageM12V, double * SupplyVoltageM5V, double * SupplyVoltage5VSB); /* XYZ trajectory get parameters */
DLL int __stdcall CPUTemperatureAndFanSpeedGet (int SocketIndex, double * CPUTemperature, double * CPUFanSpeed); /* XYZ trajectory get parameters */
DLL int __stdcall ActionListGet (int SocketIndex, char * ActionList); /* Action list */
DLL int __stdcall ActionExtendedListGet (int SocketIndex, char * ActionList); /* Action extended list */
DLL int __stdcall APIExtendedListGet (int SocketIndex, char * Method); /* API method list */
DLL int __stdcall APIListGet (int SocketIndex, char * Method); /* API method list without extended API */
DLL int __stdcall ErrorListGet (int SocketIndex, char * ErrorsList); /* Error list */
DLL int __stdcall EventListGet (int SocketIndex, char * EventList); /* General event list */
DLL int __stdcall GatheringListGet (int SocketIndex, char * list); /* Gathering type list */
DLL int __stdcall GatheringExtendedListGet (int SocketIndex, char * list); /* Gathering type extended list */
DLL int __stdcall GatheringExternalListGet (int SocketIndex, char * list); /* External Gathering type list */
DLL int __stdcall GroupStatusListGet (int SocketIndex, char * GroupStatusList); /* Group status list */
DLL int __stdcall HardwareInternalListGet (int SocketIndex, char * InternalHardwareList); /* Internal hardware list */
DLL int __stdcall HardwareDriverAndStageGet (int SocketIndex, int PlugNumber, char * DriverName, char * StageName); /* Smart hardware */
DLL int __stdcall ObjectsListGet (int SocketIndex, char * ObjectsList); /* Group name and positioner name */
DLL int __stdcall PositionerErrorListGet (int SocketIndex, char * PositionerErrorList); /* Positioner error list */
DLL int __stdcall PositionerHardwareStatusListGet (int SocketIndex, char * PositionerHardwareStatusList); /* Positioner hardware status list */
DLL int __stdcall PositionerDriverStatusListGet (int SocketIndex, char * PositionerDriverStatusList); /* Positioner driver status list */
DLL int __stdcall ReferencingActionListGet (int SocketIndex, char * list); /* Get referencing action list */
DLL int __stdcall ReferencingSensorListGet (int SocketIndex, char * list); /* Get referencing sensor list */
DLL int __stdcall GatheringUserDatasGet (int SocketIndex, double * UserData1, double * UserData2, double * UserData3, double * UserData4, double * UserData5, double * UserData6, double * UserData7, double * UserData8); /* Return UserDatas values */
DLL int __stdcall TestTCP (int SocketIndex, char * InputString, char * ReturnString); /* Test TCP/IP transfert */
#ifdef __cplusplus
}
#endif
/*///////////////////////////////////////////////////////////////////
// Created header file XPS_C8_drivers.h for API headings
*/
#ifdef _WIN32
#ifndef DLL
#ifdef _DLL /* _DLL is defined by EPICS if we are being compiled to call DLLs */
#define DLL _declspec(dllimport)
#else
#define DLL
#endif
#endif
#else
#define DLL
#define __stdcall
#endif
#ifdef __cplusplus
extern "C"
{
#else
typedef int bool;
#endif
DLL int __stdcall TCP_ConnectToServer(char *Ip_Address, int Ip_Port, double TimeOut);
DLL void __stdcall TCP_SetTimeout(int SocketIndex, double Timeout);
DLL void __stdcall TCP_CloseSocket(int SocketIndex);
DLL char * __stdcall TCP_GetError(int SocketIndex);
DLL char * __stdcall GetLibraryVersion(void);
DLL int __stdcall ElapsedTimeGet (int SocketIndex, double * ElapsedTime); /* Return elapsed time from controller power on */
DLL int __stdcall ErrorStringGet (int SocketIndex, int ErrorCode, char * ErrorString); /* Return the error string corresponding to the error code */
DLL int __stdcall FirmwareVersionGet (int SocketIndex, char * Version); /* Return firmware version */
DLL int __stdcall TCLScriptExecute (int SocketIndex, char * TCLFileName, char * TaskName, char * ParametersList); /* Execute a TCL script from a TCL file */
DLL int __stdcall TCLScriptExecuteAndWait (int SocketIndex, char * TCLFileName, char * TaskName, char * InputParametersList, char * OutputParametersList); /* Execute a TCL script from a TCL file and wait the end of execution to return */
DLL int __stdcall TCLScriptKill (int SocketIndex, char * TaskName); /* Kill TCL Task */
DLL int __stdcall TimerGet (int SocketIndex, char * TimerName, int * FrequencyTicks); /* Get a timer */
DLL int __stdcall TimerSet (int SocketIndex, char * TimerName, int FrequencyTicks); /* Set a timer */
DLL int __stdcall Reboot (int SocketIndex); /* Reboot the controller */
DLL int __stdcall Login (int SocketIndex, char * Name, char * Password); /* Log in */
DLL int __stdcall CloseAllOtherSockets (int SocketIndex); /* Close all socket beside the one used to send this command */
DLL int __stdcall EventAdd (int SocketIndex, char * PositionerName, char * EventName, char * EventParameter, char * ActionName, char * ActionParameter1, char * ActionParameter2, char * ActionParameter3); /* ** OBSOLETE ** Add an event */
DLL int __stdcall EventGet (int SocketIndex, char * PositionerName, char * EventsAndActionsList); /* ** OBSOLETE ** Read events and actions list */
DLL int __stdcall EventRemove (int SocketIndex, char * PositionerName, char * EventName, char * EventParameter); /* ** OBSOLETE ** Delete an event */
DLL int __stdcall EventWait (int SocketIndex, char * PositionerName, char * EventName, char * EventParameter); /* ** OBSOLETE ** Wait an event */
DLL int __stdcall EventExtendedConfigurationTriggerSet (int SocketIndex, int NbElements, char * ExtendedEventNameList, char * EventParameter1List, char * EventParameter2List, char * EventParameter3List, char * EventParameter4List); /* Configure one or several events */
DLL int __stdcall EventExtendedConfigurationTriggerGet (int SocketIndex, char * EventTriggerConfiguration); /* Read the event configuration */
DLL int __stdcall EventExtendedConfigurationActionSet (int SocketIndex, int NbElements, char * ExtendedActionNameList, char * ActionParameter1List, char * ActionParameter2List, char * ActionParameter3List, char * ActionParameter4List); /* Configure one or several actions */
DLL int __stdcall EventExtendedConfigurationActionGet (int SocketIndex, char * ActionConfiguration); /* Read the action configuration */
DLL int __stdcall EventExtendedStart (int SocketIndex, int * ID); /* Launch the last event and action configuration and return an ID */
DLL int __stdcall EventExtendedAllGet (int SocketIndex, char * EventActionConfigurations); /* Read all event and action configurations */
DLL int __stdcall EventExtendedGet (int SocketIndex, int ID, char * EventTriggerConfiguration, char * ActionConfiguration); /* Read the event and action configuration defined by ID */
DLL int __stdcall EventExtendedRemove (int SocketIndex, int ID); /* Remove the event and action configuration defined by ID */
DLL int __stdcall EventExtendedWait (int SocketIndex); /* Wait events from the last event configuration */
DLL int __stdcall GatheringConfigurationGet (int SocketIndex, char * Type); /*Read different mnemonique type */
DLL int __stdcall GatheringConfigurationSet (int SocketIndex, int NbElements, char * TypeList); /* Configuration acquisition */
DLL int __stdcall GatheringCurrentNumberGet (int SocketIndex, int * CurrentNumber, int * MaximumSamplesNumber); /* Maximum number of samples and current number during acquisition */
DLL int __stdcall GatheringStopAndSave (int SocketIndex); /* Stop acquisition and save data */
DLL int __stdcall GatheringDataAcquire (int SocketIndex); /* Acquire a configured data */
DLL int __stdcall GatheringDataGet (int SocketIndex, int IndexPoint, char * DataBufferLine); /* Get a data line from gathering buffer */
DLL int __stdcall GatheringReset (int SocketIndex); /* Empty the gathered data in memory to start new gathering from scratch */
DLL int __stdcall GatheringExternalConfigurationSet (int SocketIndex, int NbElements, char * TypeList); /* Configuration acquisition */
DLL int __stdcall GatheringExternalConfigurationGet (int SocketIndex, char * Type); /* Read different mnemonique type */
DLL int __stdcall GatheringExternalCurrentNumberGet (int SocketIndex, int * CurrentNumber, int * MaximumSamplesNumber); /* Maximum number of samples and current number during acquisition */
DLL int __stdcall GatheringExternalStopAndSave (int SocketIndex); /* Stop acquisition and save data */
DLL int __stdcall GlobalArrayGet (int SocketIndex, int Number, char * ValueString); /* Get global array value */
DLL int __stdcall GlobalArraySet (int SocketIndex, int Number, char * ValueString); /* Set global array value */
DLL int __stdcall GPIOAnalogGet (int SocketIndex, int NbElements, char * GPIONameList, double AnalogValue[]); /* Read analog input or analog output for one or few input */
DLL int __stdcall GPIOAnalogSet (int SocketIndex, int NbElements, char * GPIONameList, double AnalogOutputValue[]); /* Set analog output for one or few output */
DLL int __stdcall GPIOAnalogGainGet (int SocketIndex, int NbElements, char * GPIONameList, int AnalogInputGainValue[]); /* Read analog input gain (1, 2, 4 or 8) for one or few input */
DLL int __stdcall GPIOAnalogGainSet (int SocketIndex, int NbElements, char * GPIONameList, int AnalogInputGainValue[]); /* Set analog input gain (1, 2, 4 or 8) for one or few input */
DLL int __stdcall GPIODigitalGet (int SocketIndex, char * GPIOName, unsigned short * DigitalValue); /* Read digital output or digital input */
DLL int __stdcall GPIODigitalSet (int SocketIndex, char * GPIOName, unsigned short Mask, unsigned short DigitalOutputValue); /* Set Digital Output for one or few output TTL */
DLL int __stdcall GroupAnalogTrackingModeEnable (int SocketIndex, char * GroupName, char * Type); /* Enable Analog Tracking mode on selected group */
DLL int __stdcall GroupAnalogTrackingModeDisable (int SocketIndex, char * GroupName); /* Disable Analog Tracking mode on selected group */
DLL int __stdcall GroupCorrectorOutputGet (int SocketIndex, char * GroupName, int NbElements, double CorrectorOutput[]); /* Return corrector outputs */
DLL int __stdcall GroupHomeSearch (int SocketIndex, char * GroupName); /* Start home search sequence */
DLL int __stdcall GroupHomeSearchAndRelativeMove (int SocketIndex, char * GroupName, int NbElements, double TargetDisplacement[]); /* Start home search sequence and execute a displacement */
DLL int __stdcall GroupInitialize (int SocketIndex, char * GroupName); /* Start the initialization */
DLL int __stdcall GroupInitializeWithEncoderCalibration (int SocketIndex, char * GroupName); /* Start the initialization with encoder calibration */
DLL int __stdcall GroupJogParametersSet (int SocketIndex, char * GroupName, int NbElements, double Velocity[], double Acceleration[]); /* Modify Jog parameters on selected group and activate the continuous move */
DLL int __stdcall GroupJogParametersGet (int SocketIndex, char * GroupName, int NbElements, double Velocity[], double Acceleration[]); /* Get Jog parameters on selected group */
DLL int __stdcall GroupJogCurrentGet (int SocketIndex, char * GroupName, int NbElements, double Velocity[], double Acceleration[]); /* Get Jog current on selected group */
DLL int __stdcall GroupJogModeEnable (int SocketIndex, char * GroupName); /* Enable Jog mode on selected group */
DLL int __stdcall GroupJogModeDisable (int SocketIndex, char * GroupName); /* Disable Jog mode on selected group */
DLL int __stdcall GroupKill (int SocketIndex, char * GroupName); /* Kill the group */
DLL int __stdcall GroupMoveAbort (int SocketIndex, char * GroupName); /* Abort a move */
DLL int __stdcall GroupMoveAbsolute (int SocketIndex, char * GroupName, int NbElements, double TargetPosition[]); /* Do an absolute move */
DLL int __stdcall GroupMoveRelative (int SocketIndex, char * GroupName, int NbElements, double TargetDisplacement[]); /* Do a relative move */
DLL int __stdcall GroupMotionDisable (int SocketIndex, char * GroupName); /* Set Motion disable on selected group */
DLL int __stdcall GroupMotionEnable (int SocketIndex, char * GroupName); /* Set Motion enable on selected group */
DLL int __stdcall GroupPositionCurrentGet (int SocketIndex, char * GroupName, int NbElements, double CurrentEncoderPosition[]); /* Return current positions */
DLL int __stdcall GroupPositionSetpointGet (int SocketIndex, char * GroupName, int NbElements, double SetPointPosition[]); /* Return setpoint positions */
DLL int __stdcall GroupPositionTargetGet (int SocketIndex, char * GroupName, int NbElements, double TargetPosition[]); /* Return target positions */
DLL int __stdcall GroupReferencingActionExecute (int SocketIndex, char * PositionerName, char * ReferencingAction, char * ReferencingSensor, double ReferencingParameter); /* Execute an action in referencing mode */
DLL int __stdcall GroupReferencingStart (int SocketIndex, char * GroupName); /* Enter referencing mode */
DLL int __stdcall GroupReferencingStop (int SocketIndex, char * GroupName); /* Exit referencing mode */
DLL int __stdcall GroupStatusGet (int SocketIndex, char * GroupName, int * Status); /* Return group status */
DLL int __stdcall GroupStatusStringGet (int SocketIndex, int GroupStatusCode, char * GroupStatusString); /* Return the group status string corresponding to the group status code */
DLL int __stdcall GroupVelocityCurrentGet (int SocketIndex, char * GroupName, int NbElements, double CurrentVelocity[]); /* Return current velocities */
DLL int __stdcall KillAll (int SocketIndex); /* Put all groups in 'Not initialized' state */
DLL int __stdcall PositionerAnalogTrackingPositionParametersGet (int SocketIndex, char * PositionerName, char * GPIOName, double * Offset, double * Scale, double * Velocity, double * Acceleration); /* Read dynamic parameters for one axe of a group for a future analog tracking position */
DLL int __stdcall PositionerAnalogTrackingPositionParametersSet (int SocketIndex, char * PositionerName, char * GPIOName, double Offset, double Scale, double Velocity, double Acceleration); /* Update dynamic parameters for one axe of a group for a future analog tracking position */
DLL int __stdcall PositionerAnalogTrackingVelocityParametersGet (int SocketIndex, char * PositionerName, char * GPIOName, double * Offset, double * Scale, double * DeadBandThreshold, int * Order, double * Velocity, double * Acceleration); /* Read dynamic parameters for one axe of a group for a future analog tracking velocity */
DLL int __stdcall PositionerAnalogTrackingVelocityParametersSet (int SocketIndex, char * PositionerName, char * GPIOName, double Offset, double Scale, double DeadBandThreshold, int Order, double Velocity, double Acceleration); /* Update dynamic parameters for one axe of a group for a future analog tracking velocity */
DLL int __stdcall PositionerBacklashGet (int SocketIndex, char * PositionerName, double * BacklashValue, char * BacklaskStatus); /* Read backlash value and status */
DLL int __stdcall PositionerBacklashSet (int SocketIndex, char * PositionerName, double BacklashValue); /* Set backlash value */
DLL int __stdcall PositionerBacklashEnable (int SocketIndex, char * PositionerName); /* Enable the backlash */
DLL int __stdcall PositionerBacklashDisable (int SocketIndex, char * PositionerName); /* Disable the backlash */
DLL int __stdcall PositionerCorrectorNotchFiltersSet (int SocketIndex, char * PositionerName, double NotchFrequency1, double NotchBandwith1, double NotchGain1, double NotchFrequency2, double NotchBandwith2, double NotchGain2); /* Update filters parameters */
DLL int __stdcall PositionerCorrectorNotchFiltersGet (int SocketIndex, char * PositionerName, double * NotchFrequency1, double * NotchBandwith1, double * NotchGain1, double * NotchFrequency2, double * NotchBandwith2, double * NotchGain2); /* Read filters parameters */
DLL int __stdcall PositionerCorrectorPIDFFAccelerationSet (int SocketIndex, char * PositionerName, bool ClosedLoopStatus, double KP, double KI, double KD, double KS, double IntegrationTime, double DerivativeFilterCutOffFrequency, double GKP, double GKI, double GKD, double KForm, double FeedForwardGainAcceleration); /* Update corrector parameters */
DLL int __stdcall PositionerCorrectorPIDFFAccelerationGet (int SocketIndex, char * PositionerName, bool * ClosedLoopStatus, double * KP, double * KI, double * KD, double * KS, double * IntegrationTime, double * DerivativeFilterCutOffFrequency, double * GKP, double * GKI, double * GKD, double * KForm, double * FeedForwardGainAcceleration); /* Read corrector parameters */
DLL int __stdcall PositionerCorrectorPIDFFVelocitySet (int SocketIndex, char * PositionerName, bool ClosedLoopStatus, double KP, double KI, double KD, double KS, double IntegrationTime, double DerivativeFilterCutOffFrequency, double GKP, double GKI, double GKD, double KForm, double FeedForwardGainVelocity); /* Update corrector parameters */
DLL int __stdcall PositionerCorrectorPIDFFVelocityGet (int SocketIndex, char * PositionerName, bool * ClosedLoopStatus, double * KP, double * KI, double * KD, double * KS, double * IntegrationTime, double * DerivativeFilterCutOffFrequency, double * GKP, double * GKI, double * GKD, double * KForm, double * FeedForwardGainVelocity); /* Read corrector parameters */
DLL int __stdcall PositionerCorrectorPIDDualFFVoltageSet (int SocketIndex, char * PositionerName, bool ClosedLoopStatus, double KP, double KI, double KD, double KS, double IntegrationTime, double DerivativeFilterCutOffFrequency, double GKP, double GKI, double GKD, double KForm, double FeedForwardGainVelocity, double FeedForwardGainAcceleration, double Friction); /* Update corrector parameters */
DLL int __stdcall PositionerCorrectorPIDDualFFVoltageGet (int SocketIndex, char * PositionerName, bool * ClosedLoopStatus, double * KP, double * KI, double * KD, double * KS, double * IntegrationTime, double * DerivativeFilterCutOffFrequency, double * GKP, double * GKI, double * GKD, double * KForm, double * FeedForwardGainVelocity, double * FeedForwardGainAcceleration, double * Friction); /* Read corrector
parameters */
DLL int __stdcall PositionerCorrectorPIPositionSet (int SocketIndex, char * PositionerName, bool ClosedLoopStatus, double KP, double KI, double IntegrationTime); /* Update corrector parameters */
DLL int __stdcall PositionerCorrectorPIPositionGet (int SocketIndex, char * PositionerName, bool * ClosedLoopStatus, double * KP, double * KI, double * IntegrationTime); /* Read corrector parameters */
DLL int __stdcall PositionerCorrectorTypeGet (int SocketIndex, char * PositionerName, char * CorrectorType); /* Read corrector type */
DLL int __stdcall PositionerCurrentVelocityAccelerationFiltersSet (int SocketIndex, char * PositionerName, double CurrentVelocityCutOffFrequency, double CurrentAccelerationCutOffFrequency); /* Set current velocity and acceleration cut off frequencies */
DLL int __stdcall PositionerCurrentVelocityAccelerationFiltersGet (int SocketIndex, char * PositionerName, double * CurrentVelocityCutOffFrequency, double * CurrentAccelerationCutOffFrequency); /* Get current velocity and acceleration cut off frequencies */
DLL int __stdcall PositionerDriverStatusGet (int SocketIndex, char * PositionerName, int * DriverStatus); /* Read positioner driver status */
DLL int __stdcall PositionerDriverStatusStringGet (int SocketIndex, int PositionerDriverStatus, char * PositionerDriverStatusString); /* Return the positioner driver status string corresponding to the positioner error code */
DLL int __stdcall PositionerEncoderAmplitudeValuesGet (int SocketIndex, char * PositionerName, double * MaxSinusAmplitude, double * CurrentSinusAmplitude, double * MaxCosinusAmplitude, double * CurrentCosinusAmplitude); /* Read analog interpolated encoder amplitude values */
DLL int __stdcall PositionerEncoderCalibrationParametersGet (int SocketIndex, char * PositionerName, double * SinusOffset, double * CosinusOffset, double * DifferentialGain, double * PhaseCompensation); /* Read analog interpolated encoder calibration parameters */
DLL int __stdcall PositionerErrorGet (int SocketIndex, char * PositionerName, int * ErrorCode); /* Read and clear positioner error code */
DLL int __stdcall PositionerErrorRead (int SocketIndex, char * PositionerName, int * ErrorCode); /* Read only positioner error code without clear it */
DLL int __stdcall PositionerErrorStringGet (int SocketIndex, int PositionerErrorCode, char * PositionerErrorString); /* Return the positioner status string corresponding to the positioner error code */
DLL int __stdcall PositionerHardwareStatusGet (int SocketIndex, char * PositionerName, int * HardwareStatus); /* Read positioner hardware status */
DLL int __stdcall PositionerHardwareStatusStringGet (int SocketIndex, int PositionerHardwareStatus, char * PositionerHardwareStatusString); /* Return the positioner hardware status string corresponding to the positioner error code */
DLL int __stdcall PositionerHardInterpolatorFactorGet (int SocketIndex, char * PositionerName, int * InterpolationFactor); /* Get hard interpolator parameters */
DLL int __stdcall PositionerHardInterpolatorFactorSet (int SocketIndex, char * PositionerName, int InterpolationFactor); /* Set hard interpolator parameters */
DLL int __stdcall PositionerMaximumVelocityAndAccelerationGet (int SocketIndex, char * PositionerName, double * MaximumVelocity, double * MaximumAcceleration); /* Return maximum velocity and acceleration of the positioner */
DLL int __stdcall PositionerMotionDoneGet (int SocketIndex, char * PositionerName, double * PositionWindow, double * VelocityWindow, double * CheckingTime, double * MeanPeriod, double * TimeOut); /* Read motion done parameters */
DLL int __stdcall PositionerMotionDoneSet (int SocketIndex, char * PositionerName, double PositionWindow, double VelocityWindow, double CheckingTime, double MeanPeriod, double TimeOut); /* Update motion done parameters */
DLL int __stdcall PositionerPositionCompareGet (int SocketIndex, char * PositionerName, double * MinimumPosition, double * MaximumPosition, double * PositionStep, bool * EnableState); /* Read position compare parameters */
DLL int __stdcall PositionerPositionCompareSet (int SocketIndex, char * PositionerName, double MinimumPosition, double MaximumPosition, double PositionStep); /* Set position compare parameters */
DLL int __stdcall PositionerPositionCompareEnable (int SocketIndex, char * PositionerName); /* Enable position compare */
DLL int __stdcall PositionerPositionCompareDisable (int SocketIndex, char * PositionerName); /* Disable position compare */
DLL int __stdcall PositionersEncoderIndexDifferenceGet (int SocketIndex, char * PositionerName, double * distance); /* Return the difference between index of primary axis and secondary axis (only after homesearch) */
DLL int __stdcall PositionerSGammaExactVelocityAjustedDisplacementGet (int SocketIndex, char * PositionerName, double DesiredDisplacement, double * AdjustedDisplacement); /* Return adjusted displacement to get exact velocity */
DLL int __stdcall PositionerSGammaParametersGet (int SocketIndex, char * PositionerName, double * Velocity, double * Acceleration, double * MinimumTjerkTime, double * MaximumTjerkTime); /* Read dynamic parameters for one axe of a group for a future displacement */
DLL int __stdcall PositionerSGammaParametersSet (int SocketIndex, char * PositionerName, double Velocity, double Acceleration, double MinimumTjerkTime, double MaximumTjerkTime); /* Update dynamic parameters for one axe of a group for a future displacement */
DLL int __stdcall PositionerSGammaPreviousMotionTimesGet (int SocketIndex, char * PositionerName, double * SettingTime, double * SettlingTime); /* Read SettingTime and SettlingTime */
DLL int __stdcall PositionerStageParameterGet (int SocketIndex, char * PositionerName, char * ParameterName, char * ParameterValue); /* Return the stage parameter */
DLL int __stdcall PositionerStageParameterSet (int SocketIndex, char * PositionerName, char * ParameterName, char * ParameterValue); /* Save the stage parameter */
DLL int __stdcall PositionerTimeFlasherGet (int SocketIndex, char * PositionerName, double * MinimumPosition, double * MaximumPosition, double * PositionStep, bool * EnableState); /* Read time flasher parameters */
DLL int __stdcall PositionerTimeFlasherSet (int SocketIndex, char * PositionerName, double MinimumPosition, double MaximumPosition, double TimeInterval); /* Set time flasher parameters */
DLL int __stdcall PositionerTimeFlasherEnable (int SocketIndex, char * PositionerName); /* Enable time flasher */
DLL int __stdcall PositionerTimeFlasherDisable (int SocketIndex, char * PositionerName); /* Disable time flasher */
DLL int __stdcall PositionerUserTravelLimitsGet (int SocketIndex, char * PositionerName, double * UserMinimumTarget, double * UserMaximumTarget); /* Read UserMinimumTarget and UserMaximumTarget */
DLL int __stdcall PositionerUserTravelLimitsSet (int SocketIndex, char * PositionerName, double UserMinimumTarget, double UserMaximumTarget); /* Update UserMinimumTarget and UserMaximumTarget */
DLL int __stdcall PositionerCorrectorAutoTuning (int SocketIndex, char * PositionerName, int TuningMode, double * KP, double * KI, double * KD); /* Astrom&Hagglund based auto-tuning */
DLL int __stdcall PositionerAccelerationAutoScaling (int SocketIndex, char * PositionerName, double * Scaling); /* Astrom&Hagglund based auto-scaling */
DLL int __stdcall MultipleAxesPVTVerification (int SocketIndex, char * GroupName, char * TrajectoryFileName); /* Multiple axes PVT trajectory verification */
DLL int __stdcall MultipleAxesPVTVerificationResultGet (int SocketIndex, char * PositionerName, char * FileName, double * MinimumPosition, double * MaximumPosition, double * MaximumVelocity, double * MaximumAcceleration); /* Multiple axes PVT trajectory verification result get */
DLL int __stdcall MultipleAxesPVTExecution (int SocketIndex, char * GroupName, char * TrajectoryFileName, int ExecutionNumber); /* Multiple axes PVT trajectory execution */
DLL int __stdcall MultipleAxesPVTParametersGet (int SocketIndex, char * GroupName, char * FileName, int * CurrentElementNumber); /* Multiple axes PVT trajectory get parameters */
DLL int __stdcall MultipleAxesPVTPulseOutputSet (int SocketIndex, char * GroupName, int StartElement, int EndElement, double TimeInterval); /* Configure pulse output on trajectory */
DLL int __stdcall MultipleAxesPVTPulseOutputGet (int SocketIndex, char * GroupName, int * StartElement, int * EndElement, double * TimeInterval); /* Get pulse output on trajectory configuration */
DLL int __stdcall SingleAxisSlaveModeEnable (int SocketIndex, char * GroupName); /* Enable the slave mode */
DLL int __stdcall SingleAxisSlaveModeDisable (int SocketIndex, char * GroupName); /* Disable the slave mode */
DLL int __stdcall SingleAxisSlaveParametersSet (int SocketIndex, char * GroupName, char * PositionerName, double Ratio); /* Set slave parameters */
DLL int __stdcall SingleAxisSlaveParametersGet (int SocketIndex, char * GroupName, char * PositionerName, double * Ratio); /* Get slave parameters */
DLL int __stdcall SpindleSlaveModeEnable (int SocketIndex, char * GroupName); /* Enable the slave mode */
DLL int __stdcall SpindleSlaveModeDisable (int SocketIndex, char * GroupName); /* Disable the slave mode */
DLL int __stdcall SpindleSlaveParametersSet (int SocketIndex, char * GroupName, char * PositionerName, double Ratio); /* Set slave parameters */
DLL int __stdcall SpindleSlaveParametersGet (int SocketIndex, char * GroupName, char * PositionerName, double * Ratio); /* Get slave parameters */
DLL int __stdcall GroupSpinParametersSet (int SocketIndex, char * GroupName, double Velocity, double Acceleration); /* Modify Spin parameters on selected group and activate the continuous move */
DLL int __stdcall GroupSpinParametersGet (int SocketIndex, char * GroupName, double * Velocity, double * Acceleration); /* Get Spin parameters on selected group */
DLL int __stdcall GroupSpinCurrentGet (int SocketIndex, char * GroupName, double * Velocity, double * Acceleration); /* Get Spin current on selected group */
DLL int __stdcall GroupSpinModeStop (int SocketIndex, char * GroupName, double Acceleration); /* Stop Spin mode on selected group with specified acceleration */
DLL int __stdcall XYLineArcVerification (int SocketIndex, char * GroupName, char * TrajectoryFileName); /* XY trajectory verification */
DLL int __stdcall XYLineArcVerificationResultGet (int SocketIndex, char * PositionerName, char * FileName, double * MinimumPosition, double * MaximumPosition, double * MaximumVelocity, double * MaximumAcceleration); /* XY trajectory verification result get */
DLL int __stdcall XYLineArcExecution (int SocketIndex, char * GroupName, char * TrajectoryFileName, double Velocity, double Acceleration, int ExecutionNumber); /* XY trajectory execution */
DLL int __stdcall XYLineArcParametersGet (int SocketIndex, char * GroupName, char * FileName, double * Velocity, double * Acceleration, int * CurrentElementNumber); /* XY trajectory get parameters */
DLL int __stdcall XYLineArcPulseOutputSet (int SocketIndex, char * GroupName, double StartLength, double EndLength, double PathLengthInterval); /* Configure pulse output on trajectory */
DLL int __stdcall XYLineArcPulseOutputGet (int SocketIndex, char * GroupName, double * StartLength, double * EndLength, double * PathLengthInterval); /* Get pulse output on trajectory configuration */
DLL int __stdcall XYZSplineVerification (int SocketIndex, char * GroupName, char * TrajectoryFileName); /* XYZ trajectory verifivation */
DLL int __stdcall XYZSplineVerificationResultGet (int SocketIndex, char * PositionerName, char * FileName, double * MinimumPosition, double * MaximumPosition, double * MaximumVelocity, double * MaximumAcceleration); /* XYZ trajectory verification result get */
DLL int __stdcall XYZSplineExecution (int SocketIndex, char * GroupName, char * TrajectoryFileName, double Velocity, double Acceleration); /* XYZ trajectory execution */
DLL int __stdcall XYZSplineParametersGet (int SocketIndex, char * GroupName, char * FileName, double * Velocity, double * Acceleration, int * CurrentElementNumber); /* XYZ trajectory get parameters */
DLL int __stdcall EEPROMCIESet (int SocketIndex, int CardNumber, char * ReferenceString); /* XYZ trajectory get parameters */
DLL int __stdcall EEPROMDACOffsetCIESet (int SocketIndex, int PlugNumber, double DAC1Offset, double DAC2Offset); /* XYZ trajectory get parameters */
DLL int __stdcall EEPROMDriverSet (int SocketIndex, int PlugNumber, char * ReferenceString); /* XYZ trajectory get parameters */
DLL int __stdcall EEPROMINTSet (int SocketIndex, int CardNumber, char * ReferenceString); /* XYZ trajectory get parameters */
DLL int __stdcall CPUCoreAndBoardSupplyVoltagesGet (int SocketIndex, double * VoltageCPUCore, double * SupplyVoltage1P5V, double * SupplyVoltage3P3V, double * SupplyVoltage5V, double * SupplyVoltage12V, double * SupplyVoltageM12V, double * SupplyVoltageM5V, double * SupplyVoltage5VSB); /* XYZ trajectory get parameters */
DLL int __stdcall CPUTemperatureAndFanSpeedGet (int SocketIndex, double * CPUTemperature, double * CPUFanSpeed); /* XYZ trajectory get parameters */
DLL int __stdcall ActionListGet (int SocketIndex, char * ActionList); /* Action list */
DLL int __stdcall ActionExtendedListGet (int SocketIndex, char * ActionList); /* Action extended list */
DLL int __stdcall APIExtendedListGet (int SocketIndex, char * Method); /* API method list */
DLL int __stdcall APIListGet (int SocketIndex, char * Method); /* API method list without extended API */
DLL int __stdcall ErrorListGet (int SocketIndex, char * ErrorsList); /* Error list */
DLL int __stdcall EventListGet (int SocketIndex, char * EventList); /* General event list */
DLL int __stdcall GatheringListGet (int SocketIndex, char * list); /* Gathering type list */
DLL int __stdcall GatheringExtendedListGet (int SocketIndex, char * list); /* Gathering type extended list */
DLL int __stdcall GatheringExternalListGet (int SocketIndex, char * list); /* External Gathering type list */
DLL int __stdcall GroupStatusListGet (int SocketIndex, char * GroupStatusList); /* Group status list */
DLL int __stdcall HardwareInternalListGet (int SocketIndex, char * InternalHardwareList); /* Internal hardware list */
DLL int __stdcall HardwareDriverAndStageGet (int SocketIndex, int PlugNumber, char * DriverName, char * StageName); /* Smart hardware */
DLL int __stdcall ObjectsListGet (int SocketIndex, char * ObjectsList); /* Group name and positioner name */
DLL int __stdcall PositionerErrorListGet (int SocketIndex, char * PositionerErrorList); /* Positioner error list */
DLL int __stdcall PositionerHardwareStatusListGet (int SocketIndex, char * PositionerHardwareStatusList); /* Positioner hardware status list */
DLL int __stdcall PositionerDriverStatusListGet (int SocketIndex, char * PositionerDriverStatusList); /* Positioner driver status list */
DLL int __stdcall ReferencingActionListGet (int SocketIndex, char * list); /* Get referencing action list */
DLL int __stdcall ReferencingSensorListGet (int SocketIndex, char * list); /* Get referencing sensor list */
DLL int __stdcall GatheringUserDatasGet (int SocketIndex, double * UserData1, double * UserData2, double * UserData3, double * UserData4, double * UserData5, double * UserData6, double * UserData7, double * UserData8); /* Return UserDatas values */
DLL int __stdcall TestTCP (int SocketIndex, char * InputString, char * ReturnString); /* Test TCP/IP transfert */
#ifdef __cplusplus
}
#endif
Executable → Regular
+49 -49
View File
@@ -1,49 +1,49 @@
#include "strtok_r.h"
#include <stdlib.h>
char* strtok_r(char *s, const char *delim, char **lasts)
{
char *spanp;
int c, sc;
char *tok;
if (s == NULL && (s = *lasts) == NULL)
return (NULL);
/*
* Skip (span) leading delimiters (s += strspn(s, delim), sort of).
*/
cont:
c = *s++;
for (spanp = (char *)delim; (sc = *spanp++) != 0;) {
if (c == sc)
goto cont;
}
if (c == 0) { /* no non-delimiter characters */
*lasts = NULL;
return (NULL);
}
tok = s - 1;
/*
* Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
* Note that delim must have one NUL; we stop if we see that, too.
*/
for (;;) {
c = *s++;
spanp = (char *)delim;
do {
if ((sc = *spanp++) == c) {
if (c == 0)
s = NULL;
else
s[-1] = 0;
*lasts = s;
return (tok);
}
} while (sc != 0);
}
}
#include "strtok_r.h"
#include <stdlib.h>
char* strtok_r(char *s, const char *delim, char **lasts)
{
char *spanp;
int c, sc;
char *tok;
if (s == NULL && (s = *lasts) == NULL)
return (NULL);
/*
* Skip (span) leading delimiters (s += strspn(s, delim), sort of).
*/
cont:
c = *s++;
for (spanp = (char *)delim; (sc = *spanp++) != 0;) {
if (c == sc)
goto cont;
}
if (c == 0) { /* no non-delimiter characters */
*lasts = NULL;
return (NULL);
}
tok = s - 1;
/*
* Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
* Note that delim must have one NUL; we stop if we see that, too.
*/
for (;;) {
c = *s++;
spanp = (char *)delim;
do {
if ((sc = *spanp++) == c) {
if (c == 0)
s = NULL;
else
s[-1] = 0;
*lasts = s;
return (tok);
}
} while (sc != 0);
}
}
Executable → Regular
+2 -2
View File
@@ -1,2 +1,2 @@
/* strtok_r prototype */
char* strtok_r(char *, const char *, char **);
/* strtok_r prototype */
char* strtok_r(char *, const char *, char **);
Executable → Regular
View File
View File
View File
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File
View File
Executable → Regular
View File
View File
View File
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File
+32 -32
View File
@@ -1,32 +1,32 @@
The Animatics SmartMotor EPICS device driver supports both single and daisy
chained serial connections.
For RS232 daisy chained applications, the following program must be down loaded
to each motor in the chain. Set "#" below to the address of each consecutive
motor; starting with 1.
SADDR#
ECHO
LIMD <- Omit from firmware 4.77 and above.
LIMH
END
For RS232 or RS485 non-daisy-chained applications, the EPICS device driver
requires that echo mode be turned off (ECHO_OFF).
From the Animatics "SmartMotor User's Guide";
"A single RS-232 SmartMotor can operate in either state, but a daisy chain of
RS-232 SmartMotors must operate in ECHO mode for data to get through the
network. RS-485 SmartMotors must operate in the ECHO_OFF mode or there will be
data collisions."
Device Driver Design Restriction and Limitations
================================================
- This device driver only supports SmartMotor firmware versions 4.15
and above.
- A network of RS-485 SmartMotor's is not supported by this device driver.
- Non-daisy-chained SmartMotor's (i.e., a serial port for each SmartMotor) must
have their echo mode turned off (ECHO_OFF).
The Animatics SmartMotor EPICS device driver supports both single and daisy
chained serial connections.
For RS232 daisy chained applications, the following program must be down loaded
to each motor in the chain. Set "#" below to the address of each consecutive
motor; starting with 1.
SADDR#
ECHO
LIMD <- Omit from firmware 4.77 and above.
LIMH
END
For RS232 or RS485 non-daisy-chained applications, the EPICS device driver
requires that echo mode be turned off (ECHO_OFF).
From the Animatics "SmartMotor User's Guide";
"A single RS-232 SmartMotor can operate in either state, but a daisy chain of
RS-232 SmartMotors must operate in ECHO mode for data to get through the
network. RS-485 SmartMotors must operate in the ECHO_OFF mode or there will be
data collisions."
Device Driver Design Restriction and Limitations
================================================
- This device driver only supports SmartMotor firmware versions 4.15
and above.
- A network of RS-485 SmartMotor's is not supported by this device driver.
- Non-daisy-chained SmartMotor's (i.e., a serial port for each SmartMotor) must
have their echo mode turned off (ECHO_OFF).
+162 -162
View File
@@ -1,162 +1,162 @@
file {
name="i:\epics\synApps5-1beta2\ipUnidig\ipUnidigApp\op\adl\IpUnidig_more.adl"
version=030003
}
display {
object {
x=140
y=349
width=180
height=100
}
clr=14
bclr=4
cmap=""
gridSpacing=5
gridOn=0
snapToGrid=0
}
"color map" {
ncolors=65
colors {
ffffff,
ececec,
dadada,
c8c8c8,
bbbbbb,
aeaeae,
9e9e9e,
919191,
858585,
787878,
696969,
5a5a5a,
464646,
2d2d2d,
000000,
00d800,
1ebb00,
339900,
2d7f00,
216c00,
fd0000,
de1309,
be190b,
a01207,
820400,
5893ff,
597ee1,
4b6ec7,
3a5eab,
27548d,
fbf34a,
f9da3c,
eeb62b,
e19015,
cd6100,
ffb0ff,
d67fe2,
ae4ebc,
8b1a96,
610a75,
a4aaff,
8793e2,
6a73c1,
4d52a4,
343386,
c7bb6d,
b79d5c,
a47e3c,
7d5627,
58340f,
99ffff,
73dfff,
4ea5f9,
2a63e4,
0a00b8,
ebf1b5,
d4db9d,
bbc187,
a6a462,
8b8239,
73ff6b,
52da3b,
3cb420,
289315,
1a7309,
}
}
text {
object {
x=-10
y=8
width=200
height=20
}
"basic attribute" {
clr=14
}
textix="$(P)$(R)"
align="horiz. centered"
}
menu {
object {
x=40
y=70
width=100
height=20
}
control {
chan="$(P)$(R).SCAN"
clr=14
bclr=51
}
}
oval {
object {
x=115
y=39
width=20
height=20
}
"basic attribute" {
clr=15
}
"dynamic attribute" {
vis="if zero"
chan="$(P)$(R)"
}
}
"text update" {
object {
x=46
y=39
width=60
height=20
}
monitor {
chan="$(P)$(R).VAL"
clr=14
bclr=51
}
align="horiz. centered"
format="hexadecimal"
limits {
}
}
oval {
object {
x=115
y=39
width=20
height=20
}
"basic attribute" {
clr=20
}
"dynamic attribute" {
vis="if not zero"
chan="$(P)$(R)"
}
}
file {
name="i:\epics\synApps5-1beta2\ipUnidig\ipUnidigApp\op\adl\IpUnidig_more.adl"
version=030003
}
display {
object {
x=140
y=349
width=180
height=100
}
clr=14
bclr=4
cmap=""
gridSpacing=5
gridOn=0
snapToGrid=0
}
"color map" {
ncolors=65
colors {
ffffff,
ececec,
dadada,
c8c8c8,
bbbbbb,
aeaeae,
9e9e9e,
919191,
858585,
787878,
696969,
5a5a5a,
464646,
2d2d2d,
000000,
00d800,
1ebb00,
339900,
2d7f00,
216c00,
fd0000,
de1309,
be190b,
a01207,
820400,
5893ff,
597ee1,
4b6ec7,
3a5eab,
27548d,
fbf34a,
f9da3c,
eeb62b,
e19015,
cd6100,
ffb0ff,
d67fe2,
ae4ebc,
8b1a96,
610a75,
a4aaff,
8793e2,
6a73c1,
4d52a4,
343386,
c7bb6d,
b79d5c,
a47e3c,
7d5627,
58340f,
99ffff,
73dfff,
4ea5f9,
2a63e4,
0a00b8,
ebf1b5,
d4db9d,
bbc187,
a6a462,
8b8239,
73ff6b,
52da3b,
3cb420,
289315,
1a7309,
}
}
text {
object {
x=-10
y=8
width=200
height=20
}
"basic attribute" {
clr=14
}
textix="$(P)$(R)"
align="horiz. centered"
}
menu {
object {
x=40
y=70
width=100
height=20
}
control {
chan="$(P)$(R).SCAN"
clr=14
bclr=51
}
}
oval {
object {
x=115
y=39
width=20
height=20
}
"basic attribute" {
clr=15
}
"dynamic attribute" {
vis="if zero"
chan="$(P)$(R)"
}
}
"text update" {
object {
x=46
y=39
width=60
height=20
}
monitor {
chan="$(P)$(R).VAL"
clr=14
bclr=51
}
align="horiz. centered"
format="hexadecimal"
limits {
}
}
oval {
object {
x=115
y=39
width=20
height=20
}
"basic attribute" {
clr=20
}
"dynamic attribute" {
vis="if not zero"
chan="$(P)$(R)"
}
}
+146 -146
View File
@@ -1,146 +1,146 @@
file {
name="j:\epics\R3.13.1\CARS\CARSApp\op\adl\trajectoryPlot.adl"
version=020306
}
display {
object {
x=729
y=391
width=400
height=230
}
clr=14
bclr=0
cmap=""
gridSpacing=5
gridOn=0
snapToGrid=0
}
"color map" {
ncolors=65
colors {
ffffff,
ececec,
dadada,
c8c8c8,
bbbbbb,
aeaeae,
9e9e9e,
919191,
858585,
787878,
696969,
5a5a5a,
464646,
2d2d2d,
000000,
00d800,
1ebb00,
339900,
2d7f00,
216c00,
fd0000,
de1309,
be190b,
a01207,
820400,
5893ff,
597ee1,
4b6ec7,
3a5eab,
27548d,
fbf34a,
f9da3c,
eeb62b,
e19015,
cd6100,
ffb0ff,
d67fe2,
ae4ebc,
8b1a96,
610a75,
a4aaff,
8793e2,
6a73c1,
4d52a4,
343386,
c7bb6d,
b79d5c,
a47e3c,
7d5627,
58340f,
99ffff,
73dfff,
4ea5f9,
2a63e4,
0a00b8,
ebf1b5,
d4db9d,
bbc187,
a6a462,
8b8239,
73ff6b,
52da3b,
3cb420,
289315,
1a7309,
}
}
"cartesian plot" {
object {
x=0
y=30
width=400
height=200
}
plotcom {
xlabel="Point"
ylabel="Position"
clr=14
bclr=0
}
style="line"
count="2000"
trace[0] {
ydata="$(Y)"
data_clr=20
}
x_axis {
rangeStyle="auto-scale"
}
y1_axis {
rangeStyle="auto-scale"
}
y2_axis {
rangeStyle="auto-scale"
}
}
"text update" {
object {
x=69
y=11
width=85
height=20
}
monitor {
chan="$(M).DESC"
clr=14
bclr=0
}
align="horiz. right"
limits {
}
}
text {
object {
x=161
y=11
width=80
height=20
}
"basic attribute" {
clr=14
}
textix="$(TITLE)"
}
file {
name="j:\epics\R3.13.1\CARS\CARSApp\op\adl\trajectoryPlot.adl"
version=020306
}
display {
object {
x=729
y=391
width=400
height=230
}
clr=14
bclr=0
cmap=""
gridSpacing=5
gridOn=0
snapToGrid=0
}
"color map" {
ncolors=65
colors {
ffffff,
ececec,
dadada,
c8c8c8,
bbbbbb,
aeaeae,
9e9e9e,
919191,
858585,
787878,
696969,
5a5a5a,
464646,
2d2d2d,
000000,
00d800,
1ebb00,
339900,
2d7f00,
216c00,
fd0000,
de1309,
be190b,
a01207,
820400,
5893ff,
597ee1,
4b6ec7,
3a5eab,
27548d,
fbf34a,
f9da3c,
eeb62b,
e19015,
cd6100,
ffb0ff,
d67fe2,
ae4ebc,
8b1a96,
610a75,
a4aaff,
8793e2,
6a73c1,
4d52a4,
343386,
c7bb6d,
b79d5c,
a47e3c,
7d5627,
58340f,
99ffff,
73dfff,
4ea5f9,
2a63e4,
0a00b8,
ebf1b5,
d4db9d,
bbc187,
a6a462,
8b8239,
73ff6b,
52da3b,
3cb420,
289315,
1a7309,
}
}
"cartesian plot" {
object {
x=0
y=30
width=400
height=200
}
plotcom {
xlabel="Point"
ylabel="Position"
clr=14
bclr=0
}
style="line"
count="2000"
trace[0] {
ydata="$(Y)"
data_clr=20
}
x_axis {
rangeStyle="auto-scale"
}
y1_axis {
rangeStyle="auto-scale"
}
y2_axis {
rangeStyle="auto-scale"
}
}
"text update" {
object {
x=69
y=11
width=85
height=20
}
monitor {
chan="$(M).DESC"
clr=14
bclr=0
}
align="horiz. right"
limits {
}
}
text {
object {
x=161
y=11
width=80
height=20
}
"basic attribute" {
clr=14
}
textix="$(TITLE)"
}
+1418 -1418
View File
File diff suppressed because it is too large Load Diff
+1675 -1675
View File
File diff suppressed because it is too large Load Diff