Added interpose driver from DLS

Added a low-level interpose driver to allow usage of stream devices.
This commit is contained in:
2025-04-17 09:25:42 +02:00
parent 7b904e30db
commit e5a4af14ea
10 changed files with 1147 additions and 1012 deletions

View File

@@ -2,6 +2,7 @@
#include "asynOctetSyncIO.h"
#include "epicsExport.h"
#include "iocsh.h"
#include "pmacAsynIPPort.h"
#include "turboPmacController.h"
#include <cmath>
#include <errlog.h>
@@ -114,7 +115,8 @@ asynStatus turboPmacAxis::init() {
// Local variable declaration
asynStatus status = asynSuccess;
char command[pC_->MAXBUF_], response[pC_->MAXBUF_];
char command[pC_->MAXBUF_] = {0};
char response[pC_->MAXBUF_] = {0};
int nvals = 0;
double motorRecResolution = 0.0;
double motorPos = 0.0;
@@ -229,8 +231,9 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
// Status of parameter library operations
asynStatus pl_status = asynSuccess;
char command[pC_->MAXBUF_], response[pC_->MAXBUF_],
userMessage[pC_->MAXBUF_];
char command[pC_->MAXBUF_] = {0};
char response[pC_->MAXBUF_] = {0};
char userMessage[pC_->MAXBUF_] = {0};
int nvals = 0;
int direction = 0;
@@ -884,7 +887,8 @@ asynStatus turboPmacAxis::doMove(double position, int relative,
// Status of parameter library operations
asynStatus pl_status = asynSuccess;
char command[pC_->MAXBUF_], response[pC_->MAXBUF_];
char command[pC_->MAXBUF_] = {0};
char response[pC_->MAXBUF_] = {0};
double motorCoordinatesPosition = 0.0;
double motorRecResolution = 0.0;
double motorVelocity = 0.0;
@@ -1002,7 +1006,8 @@ asynStatus turboPmacAxis::stop(double acceleration) {
// Status of parameter library operations
asynStatus pl_status = asynSuccess;
char command[pC_->MAXBUF_], response[pC_->MAXBUF_];
char command[pC_->MAXBUF_] = {0};
char response[pC_->MAXBUF_] = {0};
// =========================================================================
@@ -1035,7 +1040,8 @@ asynStatus turboPmacAxis::doReset() {
// Status of parameter library operations
asynStatus pl_status = asynSuccess;
char command[pC_->MAXBUF_], response[pC_->MAXBUF_];
char command[pC_->MAXBUF_] = {0};
char response[pC_->MAXBUF_] = {0};
// =========================================================================
@@ -1072,7 +1078,8 @@ asynStatus turboPmacAxis::doHome(double min_velocity, double max_velocity,
// Status of parameter library operations
asynStatus pl_status = asynSuccess;
char command[pC_->MAXBUF_], response[pC_->MAXBUF_];
char command[pC_->MAXBUF_] = {0};
char response[pC_->MAXBUF_] = {0};
// =========================================================================
@@ -1130,7 +1137,8 @@ asynStatus turboPmacAxis::readEncoderType() {
// Status of parameter library operations
asynStatus pl_status = asynSuccess;
char command[pC_->MAXBUF_], response[pC_->MAXBUF_];
char command[pC_->MAXBUF_] = {0};
char response[pC_->MAXBUF_] = {0};
int nvals = 0;
int encoder_id = 0;
@@ -1274,7 +1282,8 @@ asynStatus turboPmacAxis::rereadEncoder() {
asynStatus turboPmacAxis::enable(bool on) {
int timeout_enable_disable = 2;
char command[pC_->MAXBUF_], response[pC_->MAXBUF_];
char command[pC_->MAXBUF_] = {0};
char response[pC_->MAXBUF_] = {0};
int nvals = 0;
// Status of read-write-operations of ASCII commands to the controller
@@ -1480,8 +1489,11 @@ static const iocshArg CreateAxisArg0 = {"Controller name (e.g. mcu1)",
static const iocshArg CreateAxisArg1 = {"Axis number", iocshArgInt};
static const iocshArg *const CreateAxisArgs[] = {&CreateAxisArg0,
&CreateAxisArg1};
static const iocshFuncDef configTurboPmacCreateAxis = {"turboPmacAxis", 2,
CreateAxisArgs};
static const iocshFuncDef configTurboPmacCreateAxis = {
"turboPmacAxis", 2, CreateAxisArgs,
"Create an instance of a turboPmac axis. The first argument is the "
"controller this axis should be attached to, the second argument is the "
"axis number."};
static void configTurboPmacCreateAxisCallFunc(const iocshArgBuf *args) {
turboPmacCreateAxis(args[0].sval, args[1].ival);
}