Added error string PV to hexapod support

This commit is contained in:
kmpeters
2013-06-12 22:01:32 +00:00
parent 6d2f14176c
commit 78a7178740
5 changed files with 190 additions and 95 deletions
+10 -4
View File
@@ -1,4 +1,4 @@
grecord(mbbo,"$(P)$(R)CS") {
record(mbbo,"$(P)$(R)CS") {
field(DESC,"Coordinate System")
field(DTYP, "asynInt32")
field(OUT,"@asynMask($(PORT) 0 0xFFFF)HXP_MOVE_COORD_SYS")
@@ -10,7 +10,7 @@ grecord(mbbo,"$(P)$(R)CS") {
field(PINI, "YES")
}
grecord(ai,"$(P)$(R)STATUS") {
record(ai,"$(P)$(R)STATUS") {
field(DESC,"HXP Group Status")
field(DTYP, "asynInt32")
field(PINI, "1")
@@ -19,11 +19,17 @@ grecord(ai,"$(P)$(R)STATUS") {
field(INP,"@asyn($(PORT),0)HXP_STATUS")
}
grecord(ai,"$(P)$(R)ERROR") {
record(ai,"$(P)$(R)ERROR") {
field(DESC,"HXP Group Error")
field(DTYP, "asynInt32")
field(PINI, "1")
field(PREC,"0")
field(SCAN, "I/O Intr")
field(INP,"@asyn($(PORT),0)HXP_ERROR")
}
record(stringin, "$(P)$(R)ERR_DESC") {
field(DESC, "Error Description")
field(DTYP, "asynOctetRead")
field(SCAN, "I/O Intr")
field(INP, "@asyn($(PORT),0)HXP_ERROR_DESC")
}
+15
View File
@@ -57,6 +57,7 @@ HXPController::HXPController(const char *portName, const char *IPAddress, int IP
createParam(HXPMoveCoordSysString, asynParamInt32, &HXPMoveCoordSys_);
createParam(HXPStatusString, asynParamInt32, &HXPStatus_);
createParam(HXPErrorString, asynParamInt32, &HXPError_);
createParam(HXPErrorDescString, asynParamOctet, &HXPErrorDesc_);
// This socket is used for polling by the controller and all axes
pollSocket_ = HXPTCP_ConnectToServer((char *)IPAddress, IPPort, HXP_POLL_TIMEOUT);
@@ -256,11 +257,23 @@ asynStatus HXPAxis::move(double position, int relative, double baseVelocity, dou
{
/* Set the error */
pC_->setIntegerParam(pC_->HXPError_, status);
/* Get the error string */
HXPErrorStringGet(moveSocket_, status, errorDescFull_);
/* Trim the error string */
strncpy(errorDesc_, errorDescFull_, 39);
errorDesc_[39] = 0;
/* */
pC_->setStringParam(pC_->HXPErrorDesc_, errorDesc_);
}
else
{
/* Clear the error */
pC_->setIntegerParam(pC_->HXPError_, 0);
pC_->setStringParam(pC_->HXPErrorDesc_, "");
}
callParamCallbacks();
@@ -351,6 +364,8 @@ asynStatus HXPAxis::poll(bool *moving)
"%s:%s: [%s,%d]: %s axisStatus=%d\n",
driverName, functionName, pC_->portName, axisNo_, positionerName_, axisStatus_);
/* Set the status */
/* Note: there is only one status PV for the controller. Currently it reflects the status of axis 0.
It might be better to call pC_->setIntegerParam(pC_->HXPStatus_, axisStatus_); */
setIntegerParam(pC_->HXPStatus_, axisStatus_);
/* If the group is not moving then the axis is not moving */
+5 -1
View File
@@ -15,6 +15,7 @@ USAGE... Motor driver support for the Newport Hexapod controller.
#define HXPMoveCoordSysString "HXP_MOVE_COORD_SYS"
#define HXPStatusString "HXP_STATUS"
#define HXPErrorString "HXP_ERROR"
#define HXPErrorDescString "HXP_ERROR_DESC"
class HXPAxis : public asynMotorAxis
{
@@ -35,6 +36,8 @@ private:
int pollSocket_;
char axisName_;
char positionerName_[12];
char errorDesc_[40];
char errorDescFull_[1024];
double encoderPosition_;
double setpointPosition_;
int axisStatus_;
@@ -56,7 +59,8 @@ protected:
int HXPMoveCoordSys_;
int HXPStatus_;
int HXPError_;
#define LAST_HXP_PARAM HXPError_
int HXPErrorDesc_;
#define LAST_HXP_PARAM HXPErrorDesc_
#define NUM_HXP_PARAMS ((int) (&LAST_HXP_PARAM - &FIRST_HXP_PARAM + 1))
+112 -65
View File
@@ -1,14 +1,14 @@
file {
name="/home/oxygen/KPETERSN/epics/ioc/synApps_5_6/kmp/kmpApp/op/adl/HXP_extra.adl"
name="/home/oxygen21/KPETERSN/epics/ioc/synApps_5_6/kmp/kmpApp/op/adl/HXP_extra.adl"
version=030107
}
display {
object {
x=208
y=115
width=250
height=130
width=350
height=250
}
clr=14
bclr=4
@@ -91,7 +91,7 @@ rectangle {
object {
x=0
y=0
width=250
width=350
height=30
}
"basic attribute" {
@@ -102,7 +102,7 @@ text {
object {
x=0
y=0
width=250
width=350
height=30
}
"basic attribute" {
@@ -111,67 +111,114 @@ text {
textix="$(P)$(R)"
align="horiz. centered"
}
composite {
text {
object {
x=12
y=50
width=225
height=67
x=62
y=44
width=110
height=30
}
"composite name"=""
children {
text {
object {
x=12
y=50
width=110
height=30
}
"basic attribute" {
clr=14
}
textix="Coord Sys"
}
menu {
object {
x=127
y=50
width=110
height=36
}
control {
chan="$(P)$(R)CS"
clr=14
bclr=4
}
}
text {
object {
x=12
y=87
width=110
height=30
}
"basic attribute" {
clr=14
}
textix="Status"
}
"text update" {
object {
x=127
y=87
width=110
height=30
}
monitor {
chan="$(P)$(R)STATUS"
clr=14
bclr=4
}
align="horiz. centered"
limits {
}
}
"basic attribute" {
clr=14
}
textix="Coord Sys"
}
menu {
object {
x=177
y=44
width=110
height=36
}
control {
chan="$(P)$(R)CS"
clr=14
bclr=4
}
}
text {
object {
x=62
y=81
width=110
height=30
}
"basic attribute" {
clr=14
}
textix="Status"
}
"text update" {
object {
x=177
y=81
width=110
height=30
}
monitor {
chan="$(P)$(R)STATUS"
clr=14
bclr=4
}
align="horiz. centered"
limits {
}
}
"text update" {
object {
x=179
y=129
width=110
height=30
}
monitor {
chan="$(P)$(R)ERROR"
clr=14
bclr=4
}
align="horiz. centered"
limits {
}
}
text {
object {
x=64
y=129
width=110
height=30
}
"basic attribute" {
clr=14
}
textix="Error"
}
text {
object {
x=62
y=165
width=225
height=30
}
"basic attribute" {
clr=14
}
textix="Error Description"
align="horiz. centered"
}
"text update" {
object {
x=6
y=204
width=335
height=22
}
monitor {
chan="$(P)$(R)ERR_DESC"
clr=14
bclr=4
}
align="horiz. centered"
format="string"
limits {
}
}
+48 -25
View File
@@ -1,6 +1,6 @@
file {
name="/home/oxygen/KPETERSN/epics/ioc/synApps_5_6/kmp/kmpApp/op/adl/HXP_motors.adl"
name="/home/oxygen21/KPETERSN/epics/ioc/synApps_5_6/kmp/kmpApp/op/adl/HXP_motors.adl"
version=030107
}
display {
@@ -2469,9 +2469,9 @@ composite {
text {
object {
x=4
y=164
width=115
height=30
y=169
width=95
height=20
}
"basic attribute" {
clr=14
@@ -2480,7 +2480,7 @@ text {
}
menu {
object {
x=125
x=105
y=164
width=105
height=30
@@ -2493,10 +2493,10 @@ menu {
}
text {
object {
x=487
y=164
width=100
height=30
x=570
y=169
width=70
height=20
}
"basic attribute" {
clr=14
@@ -2506,10 +2506,10 @@ text {
}
"text update" {
object {
x=610
y=164
width=97
height=30
x=647
y=169
width=60
height=20
}
monitor {
chan="$(P)$(R)STATUS"
@@ -2692,18 +2692,6 @@ rectangle {
chan="$(P)$(R)CS"
}
}
rectangle {
object {
x=371
y=156
width=98
height=25
}
"basic attribute" {
clr=3
width=2
}
}
rectangle {
object {
x=129
@@ -2789,3 +2777,38 @@ rectangle {
chan="$(P)$(R)CS"
}
}
rectangle {
object {
x=220
y=165
width=345
height=30
}
"basic attribute" {
clr=20
fill="outline"
width=2
}
"dynamic attribute" {
vis="calc"
calc="A<0"
chan="$(P)$(R)ERROR"
}
}
"text update" {
object {
x=225
y=171
width=335
height=20
}
monitor {
chan="$(P)$(R)ERR_DESC"
clr=20
bclr=3
}
align="horiz. centered"
format="string"
limits {
}
}