Moved the polling from HXPAxis::poll to HXPController::poll to allow HXP support to work with newer firmware.
Issue 124 description:
Older versions of the HXP firmware (v2.1.0 and earlier) are able to query the positions of the virtual axes independently using the virtual group names. Newer versions of the firmware (confirmed with v3.1.0) return an error (-19: GroupName doesn't exist or unknown command). Querying the positions of all six virtual axes simultaneously works on both v2.1.0 and v3.1.0.
Fixes#124
This is from Matthew Pearson, pearsonmr@ornl.gov
A number of users and staff have requested that the motor record have a
setpoint deadband field (eg. SPDB), which prevents any motion from
happening if the readback position is within SPDB.
Without a SPDB we have issues with motors moving unnecessarily.
For example, if the RBV is 0.001 and we set VAL to 0.0, if we have a
non-zero backlash correction then the motor will move unnecessarily
to take out backlash.
Even without backlash correction we often enable and disable the
drive amplifier for no good reason.
Currently the effective setpoint deadband is equal to MRES,
but this is often too small to be an effective setpoint deadband.
The new SPDB field would default to 0.0
The new code hooks into do_work():
When the new setpoint is within DPDB, set too_small and don't move.
The new code does not use snipptes like "abs(npos - rpos)", these
already produce warnings on 64 bit sytems.
abs() is declared to work on int, but we feed long values.
Simply compare the coordinates in engineering units.
1. Changed init function arguments in model-1 drivers to int
2. Simplified the init function logic related to "after"
3. Cast the pointer to the init function as DEVSUPFUN in the motor_dset structure
The asyn module make the constructor
asynPortDriver::asynPortDriver(const char *portNameIn, int maxAddrIn,
int paramTableSize, int interfaceMask, int interruptMask,
int asynFlags, int autoConnect, int priority, int stackSize)
obsolete in R4.32.0, the more modern version should be used, which does
not have the parameter paramTableSize.
Using a modern version of asyn for the motor gives a compiler warning.
As I don't like compiler warnings, add a #ifdef construct to suppress it
for asyn > R4.32, and still allow to compile agains asyn >= R4.32
like this:
../devOmsPC68.cc:74:1: error: invalid conversion from ‘long int
(*)(int)’ to ‘DEVSUPFUN {aka long int (*)(void*)}’ [-fpermissive]
};
and this:
./devPmac.cc:66: error: invalid conversion from 'long int (*)(int)' to
'long int (*)(void*)'
Refactor the changes for the deprecated RECSUP in later EPICS base
version, which need a typedef for struct rset.
Unite all common code and put it into a single include file.
Add motor_epics_inc.h.
Remove more compiler warnings when compiling against the base 7.0 branch.
Note:
Some of the model1/2 drivers still give a warning. As I can not test the
code, leave those files untouched.
- It was using the value of mr->[link]->value.constantStr and mr->[link]->value.pv_link.pvname without checking the link types.
This was incorrect, and led to errors because constantStr no longer has a defined value if the link type is not CONSTANT.
Changed so that it only accesses these union fields if the link is the correct type.
- It did not check if pv_link.pvname was NULL before calling CA functions, though now that we check the link type perhaps this cannot occur.
- It did not lock the motor record before accessing the fields.
- Added Debug calls to show the link types and values.
Don't set "stop" field true if driver returns RA_PROBLEM true
Partially reverts commit 303a9208e3
Fixes issue #100:
> There have been multiple problems caused by the motor record sending a stop when the problem bit is set.
>
> One problem is discussed here:
> https://epics.anl.gov/tech-talk/2018/msg01338.php
>
> The commit that introduced the stop is 303a920. I vaguely recall the change being a workaround for less-than-idea behavior of a motor controller, but neither @rsluiter nor I remember which controller that was.
>
> Motor drivers should be modified to send the stop command when the condition that triggers the setting of the problem bit is detected, if needed.
the driver's responsiblity to stop a motor if the condition that results
in the RA_PROBLEM bit being set doesn't result in the motor
automatically stopping.
This partially reverts commit 303a9208e3