Added simple, asyn (phase-3) driver for Newport Hexapod. Needed to prefix the calls in hxp_drivers.cpp with HXP to avoid conflicts with XPS_C8_drivers.cpp.

This commit is contained in:
kmpeters
2013-03-20 20:06:21 +00:00
parent 911e7a0015
commit 55268e7dd7
6 changed files with 7534 additions and 0 deletions
+385
View File
@@ -0,0 +1,385 @@
/*
FILENAME... HXPDriver.cpp
USAGE... Motor driver support for the Newport Hexapod controller.
Note: This driver was tested with the v1.3.x of the firmware
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <iocsh.h>
#include <epicsThread.h>
#include <epicsString.h>
#include <asynOctetSyncIO.h>
#include "HXPDriver.h"
#include "hxp_drivers.h"
#include <epicsExport.h>
#define NINT(f) (int)((f)>0 ? (f)+0.5 : (f)-0.5)
#define NUM_AXES 6
#define GROUP "HEXAPOD"
#define CS "Work"
#define MRES 0.00001
static const char *driverName = "HXPDriver";
/** Creates a new HXPController object.
* \param[in] portName The name of the asyn port that will be created for this driver
* \param[in] IPAddress The Newport hexapod controller's ip address
* \param[in] IPPort TCP/IP port used to communicate with the hexapod controller
* \param[in] movingPollPeriod The time between polls when any axis is moving
* \param[in] idlePollPeriod The time between polls when no axis is moving
*/
HXPController::HXPController(const char *portName, const char *IPAddress, int IPPort,
double movingPollPeriod, double idlePollPeriod)
: asynMotorController(portName, NUM_AXES, NUM_HXP_PARAMS,
0, // No additional interfaces beyond those in base class
0, // No additional callback interfaces beyond those in base class
ASYN_CANBLOCK | ASYN_MULTIDEVICE,
1, // autoconnect
0, 0) // Default priority and stack size
{
int axis;
HXPAxis *pAxis;
static const char *functionName = "HXPController::HXPController";
axisNames_ = epicsStrDup("XYZUVW");
IPAddress_ = epicsStrDup(IPAddress);
IPPort_ = IPPort;
// This socket is used for polling by the controller and all axes
pollSocket_ = HXPTCP_ConnectToServer((char *)IPAddress, IPPort, HXP_POLL_TIMEOUT);
if (pollSocket_ < 0) {
printf("%s:%s: error calling TCP_ConnectToServer for pollSocket\n",
driverName, functionName);
}
HXPFirmwareVersionGet(pollSocket_, firmwareVersion_);
for (axis=0; axis<NUM_AXES; axis++) {
pAxis = new HXPAxis(this, axis);
}
startPoller(movingPollPeriod, idlePollPeriod, 2);
}
/** Creates a new HXPController object.
* Configuration command, called directly or from iocsh
* \param[in] portName The name of the asyn port that will be created for this driver
* \param[in] HXPPortName The name of the drvAsynIPPPort that was created previously to connect to the Newport hexapod controller
* \param[in] numAxes The number of axes that this controller supports
* \param[in] movingPollPeriod The time in ms between polls when any axis is moving
* \param[in] idlePollPeriod The time in ms between polls when no axis is moving
*/
extern "C" int HXPCreateController(const char *portName, const char *IPAddress, int IPPort,
int movingPollPeriod, int idlePollPeriod)
{
HXPController *pHXPController
= new HXPController(portName, IPAddress, IPPort, movingPollPeriod/1000., idlePollPeriod/1000.);
pHXPController = NULL;
return(asynSuccess);
}
/** Reports on status of the driver
* \param[in] fp The file pointer on which report information will be written
* \param[in] level The level of report detail desired
*
* If details > 0 then information is printed about each axis.
* After printing controller-specific information it calls asynMotorController::report()
*/
void HXPController::report(FILE *fp, int level)
{
fprintf(fp, "Newport hexapod motor driver %s, numAxes=%d, moving poll period=%f, idle poll period=%f\n",
this->portName, NUM_AXES, movingPollPeriod_, idlePollPeriod_);
// Call the base class method
asynMotorController::report(fp, level);
}
/** Returns a pointer to an HXPAxis object.
* Returns NULL if the axis number encoded in pasynUser is invalid.
* \param[in] pasynUser asynUser structure that encodes the axis index number. */
HXPAxis* HXPController::getAxis(asynUser *pasynUser)
{
return static_cast<HXPAxis*>(asynMotorController::getAxis(pasynUser));
}
/** Returns a pointer to an HXPAxis object.
* Returns NULL if the axis number encoded in pasynUser is invalid.
* \param[in] axisNo Axis index number. */
HXPAxis* HXPController::getAxis(int axisNo)
{
return static_cast<HXPAxis*>(asynMotorController::getAxis(axisNo));
}
// These are the HXPAxis methods
/** Creates a new HXPAxis object.
* \param[in] pC Pointer to the HXPController to which this axis belongs.
* \param[in] axisNo Index number of this axis, range 0 to pC->numAxes_-1.
*
* Initializes register numbers, etc.
*/
HXPAxis::HXPAxis(HXPController *pC, int axisNo)
: asynMotorAxis(pC, axisNo),
pC_(pC)
{
axisName_ = pC_->axisNames_[axisNo];
sprintf(positionerName_, "%s.%c", GROUP, (char) axisName_);
// Couldn't a negative timeout be used here instead?
moveSocket_ = HXPTCP_ConnectToServer(pC_->IPAddress_, pC->IPPort_, HXP_POLL_TIMEOUT);
/* Set the poll rate on the moveSocket to a negative number, which means that SendAndReceive should do only a write, no read */
HXPTCP_SetTimeout(moveSocket_, -0.1);
pollSocket_ = pC_->pollSocket_;
/* Enable gain support so that the CNEN field can be used to send
the init command to clear a motor fault for stepper motors, even
though they lack closed-loop support. */
setIntegerParam(pC_->motorStatusGainSupport_, 1);
}
/** Reports on status of the axis
* \param[in] fp The file pointer on which report information will be written
* \param[in] level The level of report detail desired
*
* After printing device-specific information calls asynMotorAxis::report()
*/
void HXPAxis::report(FILE *fp, int level)
{
if (level > 0) {
fprintf(fp, " axis %d\n", axisNo_);
fprintf(fp, " axisName %c\n", axisName_);
}
// Call the base class method
asynMotorAxis::report(fp, level);
}
asynStatus HXPAxis::move(double position, int relative, double baseVelocity, double slewVelocity, double acceleration)
{
int status;
double cur_pos[NUM_AXES];
double rel_pos[NUM_AXES] = {};
double *pos;
static const char *functionName = "HXPAxis::move";
if (relative) {
rel_pos[axisNo_] = position * MRES;
pos = rel_pos;
status = HXPHexapodMoveIncremental(moveSocket_, GROUP, CS, pos[0], pos[1], pos[2], pos[3], pos[4], pos[5]);
if (status != 0 && status != -27) {
asynPrint(pasynUser_, ASYN_TRACE_ERROR,
"%s:%s: Error performing HexapodMoveIncremental[%s,%d] %d\n",
driverName, functionName, pC_->portName, axisNo_, status);
/* Error -27 is caused when the motor record changes dir i.e. when it aborts a move! */
return asynError;
}
} else {
// get current positions before moving (could an error overflow the array?)
status = HXPGroupPositionCurrentGet(pollSocket_, GROUP, 6, (double *) &cur_pos);
cur_pos[axisNo_] = position * MRES;
pos = cur_pos;
status = HXPHexapodMoveAbsolute(moveSocket_, GROUP, CS, pos[0], pos[1], pos[2], pos[3], pos[4], pos[5]);
if (status != 0 && status != -27) {
asynPrint(pasynUser_, ASYN_TRACE_ERROR,
"%s:%s: Error performing HexapodMoveAbsolute[%s,%d] %d\n",
driverName, functionName, pC_->portName, axisNo_, status);
/* Error -27 is caused when the motor record changes dir i.e. when it aborts a move! */
return asynError;
}
}
return asynSuccess;
}
asynStatus HXPAxis::home(double baseVelocity, double slewVelocity, double acceleration, int forwards)
{
// static const char *functionName = "HXPAxis::home";
// kill all
HXPGroupKill(moveSocket_, GROUP);
// initialize
HXPGroupInitialize(moveSocket_, GROUP);
// home
HXPGroupHomeSearch(moveSocket_, GROUP);
return asynSuccess;
}
asynStatus HXPAxis::stop(double acceleration )
{
int status;
//static const char *functionName = "HXPAxis::stop";
status = HXPGroupMoveAbort(moveSocket_, GROUP);
return asynSuccess;
}
asynStatus HXPAxis::setClosedLoop(bool closedLoop)
{
int status;
static const char *functionName = "HXPAxis::setClosedLoop";
if (closedLoop) {
status = HXPGroupMotionEnable(pollSocket_, GROUP);
if (status) {
asynPrint(pasynUser_, ASYN_TRACE_ERROR,
"%s:%s: [%s,%d]: error calling GroupMotionEnable status=%d\n",
driverName, functionName, pC_->portName, axisNo_, status);
} else {
asynPrint(pasynUser_, ASYN_TRACE_FLOW,
"%s:%s: set XPS %s, axis %d closed loop enable\n",
driverName, functionName, pC_->portName, axisNo_);
}
} else {
status = HXPGroupMotionDisable(pollSocket_, GROUP);
if (status) {
asynPrint(pasynUser_, ASYN_TRACE_ERROR,
"%s:%s: [%s,%d]: error calling GroupMotionDisable status=%d\n",
driverName, functionName, pC_->portName, axisNo_, status);
} else {
asynPrint(pasynUser_, ASYN_TRACE_FLOW,
"%s:%s: motorAxisSetInteger set XPS %s, axis %d closed loop disable\n",
driverName, functionName, pC_->portName, axisNo_);
}
}
return (asynStatus)status;
}
/** Polls the axis.
* This function reads the motor position, the limit status, the home status, the moving status,
* and the drive power-on status.
* It calls setIntegerParam() and setDoubleParam() for each item that it polls,
* and then calls callParamCallbacks() at the end.
* \param[out] moving A flag that is set indicating that the axis is moving (true) or done (false). */
asynStatus HXPAxis::poll(bool *moving)
{
int status;
//char readResponse[25];
static const char *functionName = "HXPAxis::poll";
status = HXPGroupStatusGet(pollSocket_,
GROUP,
&axisStatus_);
if (status) {
asynPrint(pasynUser_, ASYN_TRACE_ERROR,
"%s:%s: [%s,%d]: error calling GroupStatusGet status=%d; pollSocket=%d\n",
driverName, functionName, pC_->portName, axisNo_, status, pollSocket_);
goto done;
}
asynPrint(pasynUser_, ASYN_TRACE_FLOW,
"%s:%s: [%s,%d]: %s axisStatus=%d\n",
driverName, functionName, pC_->portName, axisNo_, positionerName_, axisStatus_);
/* Set the status */
//setIntegerParam(pC_->HXPStatus_, axisStatus_);
/* If the group is not moving then the axis is not moving */
if ((axisStatus_ < 43) || (axisStatus_ > 48))
moving_ = false;
else
moving_ = true;
/* Set the axis done parameter */
*moving = moving_;
//if (deferredMove_) *moving = true;
setIntegerParam(pC_->motorStatusDone_, *moving?0:1);
/*Read the controller software limits in case these have been changed by a TCL script.*/
/*Test for states that mean we cannot move an axis (disabled, uninitialised, etc.)
and set problem bit in MSTA.*/
if ((axisStatus_ < 10) || ((axisStatus_ >= 20) && (axisStatus_ <= 42)) ||
(axisStatus_ == 50) || (axisStatus_ == 64)) {
if ( (pC_->noDisableError_ > 0) && (axisStatus_==20) ) {
setIntegerParam(pC_->motorStatusProblem_, 0);
} else {
asynPrint(pasynUser_, ASYN_TRACE_FLOW,
"%s:%s: [%s,%d]: in unintialised/disabled/not referenced. XPS State Code: %d\n",
driverName, functionName, pC_->portName, axisNo_, axisStatus_);
setIntegerParam(pC_->motorStatusProblem_, 1);
}
} else {
setIntegerParam(pC_->motorStatusProblem_, 0);
}
status = HXPGroupPositionCurrentGet(pollSocket_,
positionerName_,
1,
&encoderPosition_);
if (status) {
asynPrint(pasynUser_, ASYN_TRACE_ERROR,
"%s:%s: [%s,%d]: error calling GroupPositionCurrentGet status=%d\n",
driverName, functionName, pC_->portName, axisNo_, status);
goto done;
}
//setDoubleParam(pC_->motorEncoderPosition_, (encoderPosition_/stepSize_));
setDoubleParam(pC_->motorEncoderPosition_, encoderPosition_ / MRES);
status = HXPGroupPositionSetpointGet(pollSocket_,
positionerName_,
1,
&setpointPosition_);
if (status) {
asynPrint(pasynUser_, ASYN_TRACE_ERROR,
"%s:%s: [%s,%d]: error calling GroupPositionSetpointGet status=%d\n",
driverName, functionName, pC_->portName, axisNo_, status);
goto done;
}
//setDoubleParam(pC_->motorPosition_, (setpointPosition_/stepSize_));
setDoubleParam(pC_->motorPosition_, setpointPosition_ / MRES);
// limit check?
// dir flag?
done:
setIntegerParam(pC_->motorStatusProblem_, status ? 1:0);
callParamCallbacks();
return status ? asynError : asynSuccess;
}
/** Code for iocsh registration */
static const iocshArg HXPCreateControllerArg0 = {"Port name", iocshArgString};
static const iocshArg HXPCreateControllerArg1 = {"IP address", iocshArgString};
static const iocshArg HXPCreateControllerArg2 = {"Port", iocshArgInt};
static const iocshArg HXPCreateControllerArg3 = {"Moving poll period (ms)", iocshArgInt};
static const iocshArg HXPCreateControllerArg4 = {"Idle poll period (ms)", iocshArgInt};
static const iocshArg * const HXPCreateControllerArgs[] = {&HXPCreateControllerArg0,
&HXPCreateControllerArg1,
&HXPCreateControllerArg2,
&HXPCreateControllerArg3,
&HXPCreateControllerArg4};
static const iocshFuncDef HXPCreateControllerDef = {"HXPCreateController", 5, HXPCreateControllerArgs};
static void HXPCreateControllerCallFunc(const iocshArgBuf *args)
{
HXPCreateController(args[0].sval, args[1].sval, args[2].ival, args[3].ival, args[4].ival);
}
static void HXPRegister(void)
{
iocshRegister(&HXPCreateControllerDef, HXPCreateControllerCallFunc);
}
extern "C" {
epicsExportRegistrar(HXPRegister);
}
+64
View File
@@ -0,0 +1,64 @@
/*
FILENAME... HXPDriver.h
USAGE... Motor driver support for the Newport Hexapod controller.
*/
#include "asynMotorController.h"
#include "asynMotorAxis.h"
#define MAX_HXP_AXES 6
#define HXP_POLL_TIMEOUT 2.0
#define HXP_MOVE_TIMEOUT 100000.0 // "Forever"
// No controller-specific parameters yet
#define NUM_HXP_PARAMS 0
class HXPAxis : public asynMotorAxis
{
public:
/* These are the methods we override from the base class */
HXPAxis(class HXPController *pC, int axis);
void report(FILE *fp, int level);
asynStatus move(double position, int relative, double min_velocity, double max_velocity, double acceleration);
asynStatus home(double min_velocity, double max_velocity, double acceleration, int forwards);
asynStatus stop(double acceleration);
asynStatus poll(bool *moving);
asynStatus setClosedLoop(bool closedLoop);
private:
HXPController *pC_; /* Pointer to the asynMotorController to which this axis belongs.
Abbreviated because it is used very frequently */
int moveSocket_;
int pollSocket_;
char axisName_;
char positionerName_[12];
double encoderPosition_;
double setpointPosition_;
int axisStatus_;
double mres_;
int moving_;
friend class HXPController;
};
class HXPController : public asynMotorController {
public:
HXPController(const char *portName, const char *HXPPortName, int numAxes, double movingPollPeriod, double idlePollPeriod);
void report(FILE *fp, int level);
HXPAxis* getAxis(asynUser *pasynUser);
HXPAxis* getAxis(int axisNo);
private:
char *IPAddress_;
int IPPort_;
int pollSocket_;
// only needed for profile moves
//int moveSocket_;
char firmwareVersion_[100];
char *axisNames_;
int HXPStatus_;
int noDisableError_;
friend class HXPAxis;
};
+3
View File
@@ -51,6 +51,9 @@ Newport_SRCS += XPSAxis.cpp
ifdef SNCSEQ
Newport_SRCS += XPS_trajectoryScan.st
endif
#
Newport_SRCS += hxp_drivers.cpp
Newport_SRCS += HXPDriver.cpp
# strtok_r needed on WIN32
Newport_SRCS_WIN32 += strtok_r.c
+1
View File
@@ -13,6 +13,7 @@ registrar(NewportRegister)
registrar(XPSGatheringRegister)
registrar(XPSRegister)
registrar(XPSRegister3)
registrar(HXPRegister)
registrar(XPSInterposeRegister)
registrar(drvXPSAsynAuxRegister)
registrar(MM4005_trajectoryScanRegistrar)
File diff suppressed because it is too large Load Diff
+177
View File
@@ -0,0 +1,177 @@
/*************************************************
* XPS_API.h *
* *
* Description: *
* XPS functions *
*************************************************/
#ifdef _WIN32
#ifndef DLL
#define DLL _declspec(dllimport)
#endif
#else
#define DLL
#define __stdcall
#endif
#ifdef __cplusplus
extern "C"
{
#else
#typedef int bool; /* C does not know bool, only C++ */
#endif
DLL int __stdcall HXPTCP_ConnectToServer(char *Ip_Address, int Ip_Port, double TimeOut);
DLL void __stdcall HXPTCP_SetTimeout(int SocketIndex, double Timeout);
DLL void __stdcall HXPTCP_CloseSocket(int SocketIndex);
DLL char * __stdcall HXPTCP_GetError(int SocketIndex);
DLL char * __stdcall HXPGetLibraryVersion(void);
DLL int __stdcall HXPControllerMotionKernelTimeLoadGet (int SocketIndex, double * CPUTotalLoadRatio, double * CPUCorrectorLoadRatio, double * CPUProfilerLoadRatio, double * CPUServitudesLoadRatio); /* Get controller motion kernel time load */
DLL int __stdcall HXPElapsedTimeGet (int SocketIndex, double * ElapsedTime); /* Return elapsed time from controller power on */
DLL int __stdcall HXPErrorStringGet (int SocketIndex, int ErrorCode, char * ErrorString); /* Return the error string corresponding to the error code */
DLL int __stdcall HXPFirmwareVersionGet (int SocketIndex, char * Version); /* Return firmware version */
DLL int __stdcall HXPTCLScriptExecute (int SocketIndex, char * TCLFileName, char * TaskName, char * ParametersList); /* Execute a TCL script from a TCL file */
DLL int __stdcall HXPTCLScriptExecuteAndWait (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 HXPTCLScriptKill (int SocketIndex, char * TaskName); /* Kill TCL Task */
DLL int __stdcall HXPTimerGet (int SocketIndex, char * TimerName, int * FrequencyTicks); /* Get a timer */
DLL int __stdcall HXPTimerSet (int SocketIndex, char * TimerName, int FrequencyTicks); /* Set a timer */
DLL int __stdcall HXPReboot (int SocketIndex); /* Reboot the controller */
DLL int __stdcall HXPLogin (int SocketIndex, char * Name, char * Password); /* Log in */
DLL int __stdcall HXPCloseAllOtherSockets (int SocketIndex); /* Close all socket beside the one used to send this command */
DLL int __stdcall HXPEventAdd (int SocketIndex, char * PositionerName, char * EventName, char * EventParameter, char * ActionName, char * ActionParameter1, char * ActionParameter2, char * ActionParameter3); /* ** OBSOLETE ** Add an event */
DLL int __stdcall HXPEventGet (int SocketIndex, char * PositionerName, char * EventsAndActionsList); /* ** OBSOLETE ** Read events and actions list */
DLL int __stdcall HXPEventRemove (int SocketIndex, char * PositionerName, char * EventName, char * EventParameter); /* ** OBSOLETE ** Delete an event */
DLL int __stdcall HXPEventWait (int SocketIndex, char * PositionerName, char * EventName, char * EventParameter); /* ** OBSOLETE ** Wait an event */
DLL int __stdcall HXPEventExtendedConfigurationTriggerSet (int SocketIndex, int NbElements, char * ExtendedEventNameList, char * EventParameter1List, char * EventParameter2List, char * EventParameter3List, char * EventParameter4List); /* Configure one or several events */
DLL int __stdcall HXPEventExtendedConfigurationTriggerGet (int SocketIndex, char * EventTriggerConfiguration); /* Read the event configuration */
DLL int __stdcall HXPEventExtendedConfigurationActionSet (int SocketIndex, int NbElements, char * ExtendedActionNameList, char * ActionParameter1List, char * ActionParameter2List, char * ActionParameter3List, char * ActionParameter4List); /* Configure one or several actions */
DLL int __stdcall HXPEventExtendedConfigurationActionGet (int SocketIndex, char * ActionConfiguration); /* Read the action configuration */
DLL int __stdcall HXPEventExtendedStart (int SocketIndex, int * ID); /* Launch the last event and action configuration and return an ID */
DLL int __stdcall HXPEventExtendedAllGet (int SocketIndex, char * EventActionConfigurations); /* Read all event and action configurations */
DLL int __stdcall HXPEventExtendedGet (int SocketIndex, int ID, char * EventTriggerConfiguration, char * ActionConfiguration); /* Read the event and action configuration defined by ID */
DLL int __stdcall HXPEventExtendedRemove (int SocketIndex, int ID); /* Remove the event and action configuration defined by ID */
DLL int __stdcall HXPEventExtendedWait (int SocketIndex); /* Wait events from the last event configuration */
DLL int __stdcall HXPGatheringConfigurationGet (int SocketIndex, char * Type); /* Read different mnemonique type */
DLL int __stdcall HXPGatheringConfigurationSet (int SocketIndex, int NbElements, char * TypeList); /* Configuration acquisition */
DLL int __stdcall HXPGatheringCurrentNumberGet (int SocketIndex, int * CurrentNumber, int * MaximumSamplesNumber); /* Maximum number of samples and current number during acquisition */
DLL int __stdcall HXPGatheringStopAndSave (int SocketIndex); /* Stop acquisition and save data */
DLL int __stdcall HXPGatheringDataAcquire (int SocketIndex); /* Acquire a configured data */
DLL int __stdcall HXPGatheringDataGet (int SocketIndex, int IndexPoint, char * DataBufferLine); /* Get a data line from gathering buffer */
DLL int __stdcall HXPGatheringReset (int SocketIndex); /* Empty the gathered data in memory to start new gathering from scratch */
DLL int __stdcall HXPGatheringRun (int SocketIndex, int DataNumber, int Divisor); /* Start a new gathering */
DLL int __stdcall HXPGatheringStop (int SocketIndex); /* Stop the data gathering (without saving to file) */
DLL int __stdcall HXPGatheringExternalConfigurationSet (int SocketIndex, int NbElements, char * TypeList); /* Configuration acquisition */
DLL int __stdcall HXPGatheringExternalConfigurationGet (int SocketIndex, char * Type); /* Read different mnemonique type */
DLL int __stdcall HXPGatheringExternalCurrentNumberGet (int SocketIndex, int * CurrentNumber, int * MaximumSamplesNumber); /* Maximum number of samples and current number during acquisition */
DLL int __stdcall HXPGatheringExternalStopAndSave (int SocketIndex); /* Stop acquisition and save data */
DLL int __stdcall HXPGlobalArrayGet (int SocketIndex, int Number, char * ValueString); /* Get global array value */
DLL int __stdcall HXPGlobalArraySet (int SocketIndex, int Number, char * ValueString); /* Set global array value */
DLL int __stdcall HXPDoubleGlobalArrayGet (int SocketIndex, int Number, double * DoubleValue); /* Get double global array value */
DLL int __stdcall HXPDoubleGlobalArraySet (int SocketIndex, int Number, double DoubleValue); /* Set double global array value */
DLL int __stdcall HXPGPIOAnalogGet (int SocketIndex, int NbElements, char * GPIONameList, double AnalogValue[]); /* Read analog input or analog output for one or few input */
DLL int __stdcall HXPGPIOAnalogSet (int SocketIndex, int NbElements, char * GPIONameList, double AnalogOutputValue[]); /* Set analog output for one or few output */
DLL int __stdcall HXPGPIOAnalogGainGet (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 HXPGPIOAnalogGainSet (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 HXPGPIODigitalGet (int SocketIndex, char * GPIOName, unsigned short * DigitalValue); /* Read digital output or digital input */
DLL int __stdcall HXPGPIODigitalSet (int SocketIndex, char * GPIOName, unsigned short Mask, unsigned short DigitalOutputValue); /* Set Digital Output for one or few output TTL */
DLL int __stdcall HXPGroupCorrectorOutputGet (int SocketIndex, char * GroupName, int NbElements, double CorrectorOutput[]); /* Return corrector outputs */
DLL int __stdcall HXPGroupHomeSearch (int SocketIndex, char * GroupName); /* Start home search sequence */
DLL int __stdcall HXPGroupHomeSearchAndRelativeMove (int SocketIndex, char * GroupName, int NbElements, double TargetDisplacement[]); /* Start home search sequence and execute a displacement */
DLL int __stdcall HXPGroupInitialize (int SocketIndex, char * GroupName); /* Start the initialization */
DLL int __stdcall HXPGroupInitializeWithEncoderCalibration (int SocketIndex, char * GroupName); /* Start the initialization with encoder calibration */
DLL int __stdcall HXPGroupKill (int SocketIndex, char * GroupName); /* Kill the group */
DLL int __stdcall HXPGroupMoveAbort (int SocketIndex, char * GroupName); /* Abort a move */
DLL int __stdcall HXPGroupMoveAbsolute (int SocketIndex, char * GroupName, int NbElements, double TargetPosition[]); /* Do an absolute move */
DLL int __stdcall HXPGroupMoveRelative (int SocketIndex, char * GroupName, int NbElements, double TargetDisplacement[]); /* Do a relative move */
DLL int __stdcall HXPGroupMotionDisable (int SocketIndex, char * GroupName); /* Set Motion disable on selected group */
DLL int __stdcall HXPGroupMotionEnable (int SocketIndex, char * GroupName); /* Set Motion enable on selected group */
DLL int __stdcall HXPGroupPositionCorrectedProfilerGet (int SocketIndex, char * GroupName, double PositionX, double PositionY, double * CorrectedProfilerPositionX, double * CorrectedProfilerPositionY); /* Return corrected profiler positions */
DLL int __stdcall HXPGroupPositionCurrentGet (int SocketIndex, char * GroupName, int NbElements, double CurrentEncoderPosition[]); /* Return current positions */
DLL int __stdcall HXPGroupPositionSetpointGet (int SocketIndex, char * GroupName, int NbElements, double SetPointPosition[]); /* Return setpoint positions */
DLL int __stdcall HXPGroupPositionTargetGet (int SocketIndex, char * GroupName, int NbElements, double TargetPosition[]); /* Return target positions */
DLL int __stdcall HXPGroupStatusGet (int SocketIndex, char * GroupName, int * Status); /* Return group status */
DLL int __stdcall HXPGroupStatusStringGet (int SocketIndex, int GroupStatusCode, char * GroupStatusString); /* Return the group status string corresponding to the group status code */
DLL int __stdcall HXPKillAll (int SocketIndex); /* Put all groups in 'Not initialized' state */
DLL int __stdcall HXPRestartApplication (int SocketIndex); /* Restart the Controller */
DLL int __stdcall HXPPositionerBacklashGet (int SocketIndex, char * PositionerName, double * BacklashValue, char * BacklaskStatus); /* Read backlash value and status */
DLL int __stdcall HXPPositionerBacklashSet (int SocketIndex, char * PositionerName, double BacklashValue); /* Set backlash value */
DLL int __stdcall HXPPositionerBacklashEnable (int SocketIndex, char * PositionerName); /* Enable the backlash */
DLL int __stdcall HXPPositionerBacklashDisable (int SocketIndex, char * PositionerName); /* Disable the backlash */
DLL int __stdcall HXPPositionerCorrectorNotchFiltersSet (int SocketIndex, char * PositionerName, double NotchFrequency1, double NotchBandwith1, double NotchGain1, double NotchFrequency2, double NotchBandwith2, double NotchGain2); /* Update filters parameters */
DLL int __stdcall HXPPositionerCorrectorNotchFiltersGet (int SocketIndex, char * PositionerName, double * NotchFrequency1, double * NotchBandwith1, double * NotchGain1, double * NotchFrequency2, double * NotchBandwith2, double * NotchGain2); /* Read filters parameters */
DLL int __stdcall HXPPositionerCorrectorPIDFFAccelerationSet (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 HXPPositionerCorrectorPIDFFAccelerationGet (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 HXPPositionerCorrectorPIDFFVelocitySet (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 HXPPositionerCorrectorPIDFFVelocityGet (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 HXPPositionerCorrectorPIDDualFFVoltageSet (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 HXPPositionerCorrectorPIDDualFFVoltageGet (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 HXPPositionerCorrectorPIPositionSet (int SocketIndex, char * PositionerName, bool ClosedLoopStatus, double KP, double KI, double IntegrationTime); /* Update corrector parameters */
DLL int __stdcall HXPPositionerCorrectorPIPositionGet (int SocketIndex, char * PositionerName, bool * ClosedLoopStatus, double * KP, double * KI, double * IntegrationTime); /* Read corrector parameters */
DLL int __stdcall HXPPositionerCorrectorTypeGet (int SocketIndex, char * PositionerName, char * CorrectorType); /* Read corrector type */
DLL int __stdcall HXPPositionerCurrentVelocityAccelerationFiltersSet (int SocketIndex, char * PositionerName, double CurrentVelocityCutOffFrequency, double CurrentAccelerationCutOffFrequency); /* Set current velocity and acceleration cut off frequencies */
DLL int __stdcall HXPPositionerCurrentVelocityAccelerationFiltersGet (int SocketIndex, char * PositionerName, double * CurrentVelocityCutOffFrequency, double * CurrentAccelerationCutOffFrequency); /* Get current velocity and acceleration cut off frequencies */
DLL int __stdcall HXPPositionerDriverStatusGet (int SocketIndex, char * PositionerName, int * DriverStatus); /* Read positioner driver status */
DLL int __stdcall HXPPositionerDriverStatusStringGet (int SocketIndex, int PositionerDriverStatus, char * PositionerDriverStatusString); /* Return the positioner driver status string corresponding to the positioner error code */
DLL int __stdcall HXPPositionerEncoderAmplitudeValuesGet (int SocketIndex, char * PositionerName, double * CalibrationSinusAmplitude, double * CurrentSinusAmplitude, double * CalibrationCosinusAmplitude, double * CurrentCosinusAmplitude); /* Read analog interpolated encoder amplitude values */
DLL int __stdcall HXPPositionerEncoderCalibrationParametersGet (int SocketIndex, char * PositionerName, double * SinusOffset, double * CosinusOffset, double * DifferentialGain, double * PhaseCompensation); /* Read analog interpolated encoder calibration parameters */
DLL int __stdcall HXPPositionerErrorGet (int SocketIndex, char * PositionerName, int * ErrorCode); /* Read and clear positioner error code */
DLL int __stdcall HXPPositionerErrorRead (int SocketIndex, char * PositionerName, int * ErrorCode); /* Read only positioner error code without clear it */
DLL int __stdcall HXPPositionerErrorStringGet (int SocketIndex, int PositionerErrorCode, char * PositionerErrorString); /* Return the positioner status string corresponding to the positioner error code */
DLL int __stdcall HXPPositionerHardwareStatusGet (int SocketIndex, char * PositionerName, int * HardwareStatus); /* Read positioner hardware status */
DLL int __stdcall HXPPositionerHardwareStatusStringGet (int SocketIndex, int PositionerHardwareStatus, char * PositionerHardwareStatusString); /* Return the positioner hardware status string corresponding to the positioner error code */
DLL int __stdcall HXPPositionerHardInterpolatorFactorGet (int SocketIndex, char * PositionerName, int * InterpolationFactor); /* Get hard interpolator parameters */
DLL int __stdcall HXPPositionerHardInterpolatorFactorSet (int SocketIndex, char * PositionerName, int InterpolationFactor); /* Set hard interpolator parameters */
DLL int __stdcall HXPPositionerMaximumVelocityAndAccelerationGet (int SocketIndex, char * PositionerName, double * MaximumVelocity, double * MaximumAcceleration); /* Return maximum velocity and acceleration of the positioner */
DLL int __stdcall HXPPositionerMotionDoneGet (int SocketIndex, char * PositionerName, double * PositionWindow, double * VelocityWindow, double * CheckingTime, double * MeanPeriod, double * TimeOut); /* Read motion done parameters */
DLL int __stdcall HXPPositionerMotionDoneSet (int SocketIndex, char * PositionerName, double PositionWindow, double VelocityWindow, double CheckingTime, double MeanPeriod, double TimeOut); /* Update motion done parameters */
DLL int __stdcall HXPPositionerSGammaExactVelocityAjustedDisplacementGet (int SocketIndex, char * PositionerName, double DesiredDisplacement, double * AdjustedDisplacement); /* Return adjusted displacement to get exact velocity */
DLL int __stdcall HXPPositionerSGammaParametersGet (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 HXPPositionerSGammaParametersSet (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 HXPPositionerSGammaPreviousMotionTimesGet (int SocketIndex, char * PositionerName, double * SettingTime, double * SettlingTime); /* Read SettingTime and SettlingTime */
DLL int __stdcall HXPPositionerStageParameterGet (int SocketIndex, char * PositionerName, char * ParameterName, char * ParameterValue); /* Return the stage parameter */
DLL int __stdcall HXPPositionerStageParameterSet (int SocketIndex, char * PositionerName, char * ParameterName, char * ParameterValue); /* Save the stage parameter */
DLL int __stdcall HXPPositionerUserTravelLimitsGet (int SocketIndex, char * PositionerName, double * UserMinimumTarget, double * UserMaximumTarget); /* Read UserMinimumTarget and UserMaximumTarget */
DLL int __stdcall HXPPositionerUserTravelLimitsSet (int SocketIndex, char * PositionerName, double UserMinimumTarget, double UserMaximumTarget); /* Update UserMinimumTarget and UserMaximumTarget */
DLL int __stdcall HXPHexapodMoveAbsolute (int SocketIndex, char * GroupName, char * CoordinateSystem, double X, double Y, double Z, double U, double V, double W); /* Hexapod absolute move in a specific coordinate system */
DLL int __stdcall HXPHexapodMoveIncremental (int SocketIndex, char * GroupName, char * CoordinateSystem, double dX, double dY, double dZ, double dU, double dV, double dW); /* Hexapod incremental move in a specific coordinate system */
DLL int __stdcall HXPHexapodCoordinatesGet (int SocketIndex, char * GroupName, char * CoordinateSystemIn, char * CoordinateSystemOut, double Xin, double Yin, double Zin, double Uin, double Vin, double Win, double * Xout, double * Yout, double * Zout, double * Uout, double * Vout, double * Wout); /* Get coordinates in a specific coordinate system of a point specified in another coordinate system */
DLL int __stdcall HXPHexapodCoordinateSystemSet (int SocketIndex, char * GroupName, char * CoordinateSystem, double X, double Y, double Z, double U, double V, double W); /* Modify the position of a coordinate system */
DLL int __stdcall HXPHexapodCoordinateSystemGet (int SocketIndex, char * GroupName, char * CoordinateSystem, double * X, double * Y, double * Z, double * U, double * V, double * W); /* Get the position of a coordinate system */
DLL int __stdcall HXPOptionalModuleExecute (int SocketIndex, char * ModuleFileName, char * TaskName); /* Execute an optional module */
DLL int __stdcall HXPOptionalModuleKill (int SocketIndex, char * TaskName); /* Kill an optional module */
DLL int __stdcall HXPControllerStatusGet (int SocketIndex, int * ControllerStatus); /* Read controller current status */
DLL int __stdcall HXPControllerStatusStringGet (int SocketIndex, int ControllerStatusCode, char * ControllerStatusString); /* Return the controller status string corresponding to the controller status code */
DLL int __stdcall HXPEEPROMCIESet (int SocketIndex, int CardNumber, char * ReferenceString); /* Set CIE EEPROM reference string */
DLL int __stdcall HXPEEPROMDACOffsetCIESet (int SocketIndex, int PlugNumber, double DAC1Offset, double DAC2Offset); /* Set CIE DAC offsets */
DLL int __stdcall HXPEEPROMDriverSet (int SocketIndex, int PlugNumber, char * ReferenceString); /* Set Driver EEPROM reference string */
DLL int __stdcall HXPEEPROMINTSet (int SocketIndex, int CardNumber, char * ReferenceString); /* Set INT EEPROM reference string */
DLL int __stdcall HXPCPUCoreAndBoardSupplyVoltagesGet (int SocketIndex, double * VoltageCPUCore, double * SupplyVoltage1P5V, double * SupplyVoltage3P3V, double * SupplyVoltage5V, double * SupplyVoltage12V, double * SupplyVoltageM12V, double * SupplyVoltageM5V, double * SupplyVoltage5VSB); /* Get power informations */
DLL int __stdcall HXPCPUTemperatureAndFanSpeedGet (int SocketIndex, double * CPUTemperature, double * CPUFanSpeed); /* Get CPU temperature and fan speed */
DLL int __stdcall HXPActionListGet (int SocketIndex, char * ActionList); /* Action list */
DLL int __stdcall HXPActionExtendedListGet (int SocketIndex, char * ActionList); /* Action extended list */
DLL int __stdcall HXPAPIExtendedListGet (int SocketIndex, char * Method); /* API method list */
DLL int __stdcall HXPAPIListGet (int SocketIndex, char * Method); /* API method list without extended API */
DLL int __stdcall HXPErrorListGet (int SocketIndex, char * ErrorsList); /* Error list */
DLL int __stdcall HXPEventListGet (int SocketIndex, char * EventList); /* General event list */
DLL int __stdcall HXPGatheringListGet (int SocketIndex, char * list); /* Gathering type list */
DLL int __stdcall HXPGatheringExtendedListGet (int SocketIndex, char * list); /* Gathering type extended list */
DLL int __stdcall HXPGatheringExternalListGet (int SocketIndex, char * list); /* External Gathering type list */
DLL int __stdcall HXPGroupStatusListGet (int SocketIndex, char * GroupStatusList); /* Group status list */
DLL int __stdcall HXPHardwareInternalListGet (int SocketIndex, char * InternalHardwareList); /* Internal hardware list */
DLL int __stdcall HXPHardwareDriverAndStageGet (int SocketIndex, int PlugNumber, char * DriverName, char * StageName); /* Smart hardware */
DLL int __stdcall HXPObjectsListGet (int SocketIndex, char * ObjectsList); /* Group name and positioner name */
DLL int __stdcall HXPPositionerErrorListGet (int SocketIndex, char * PositionerErrorList); /* Positioner error list */
DLL int __stdcall HXPPositionerHardwareStatusListGet (int SocketIndex, char * PositionerHardwareStatusList); /* Positioner hardware status list */
DLL int __stdcall HXPPositionerDriverStatusListGet (int SocketIndex, char * PositionerDriverStatusList); /* Positioner driver status list */
DLL int __stdcall HXPReferencingActionListGet (int SocketIndex, char * list); /* Get referencing action list */
DLL int __stdcall HXPReferencingSensorListGet (int SocketIndex, char * list); /* Get referencing sensor list */
DLL int __stdcall HXPGatheringUserDatasGet (int SocketIndex, double * UserData1, double * UserData2, double * UserData3, double * UserData4, double * UserData5, double * UserData6, double * UserData7, double * UserData8); /* Return UserDatas values */
DLL int __stdcall HXPControllerMotionKernelPeriodMinMaxGet (int SocketIndex, double * MinimumCorrectorPeriod, double * MaximumCorrectorPeriod, double * MinimumProfilerPeriod, double * MaximumProfilerPeriod, double * MinimumServitudesPeriod, double * MaximumServitudesPeriod); /* Get controller motion kernel min/max periods */
DLL int __stdcall HXPControllerMotionKernelPeriodMinMaxReset (int SocketIndex); /* Reset controller motion kernel min/max periods */
DLL int __stdcall HXPTestTCP (int SocketIndex, char * InputString, char * ReturnString); /* Test TCP/IP transfert */
DLL int __stdcall HXPPrepareForUpdate (int SocketIndex); /* Kill QNX processes for firmware update */
#ifdef __cplusplus
}
#endif