
public class CanOpenEPOS extends CanOpenDevice implements EPOSController
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
enabledToPublish
Used to publish on the status bus for the GUI*
|
protected EPOSEnumerations.EposMode |
mode |
protected boolean |
parametersOK
used in checkParameters and initializeAndCheckHardware methods
|
protected boolean |
turnedOff |
errorHistory, errorRegister, inError, initialized, nodeID, serialNB, tcpProxy| Constructor and Description |
|---|
CanOpenEPOS(String nodeID,
String serialNB,
Map<String,Integer> paramsForCurrent,
Map<String,Integer> paramsForProfilePosition,
Map<String,Integer> paramsForHoming)
Construction of a CanOpenEPOS.
|
| Modifier and Type | Method and Description |
|---|---|
void |
activateCurrentMode() |
void |
activateHomingMode() |
void |
activateProfilePositionMode() |
void |
changeEPOSParameter(String key,
int value)
Changes an EPOS parameter for this controller.
|
void |
changeMode(EPOSEnumerations.EposMode newMode)
This methods changes the mode to the new mode given as an argument.
|
protected void |
checkCurrentValue(int aValue)
Checks a current value typed by a user at the console.
|
void |
checkFault()
Check if the Controller is in fault.
|
void |
checkParameters(EPOSEnumerations.EposMode aMode)
For every parameter to be defined for this mode this method compares the
values in configuration with the value stored in controller CPU and
throws a HardwareException if these values are not equal.
|
void |
checkParameters(Map<String,Integer> paramsMap)
Compare values of parameters in the map with the values of parameters in
the controller CPU.
|
void |
checkTargetReached(long timeout)
check if target is reached in HOMING or PROFILE_POSITION commands and
throws an Exception if not.
|
void |
defineAbsolutePosition(int position)
Defines the actual position as the absolute position which value is given
as an argument.
|
void |
disable()
shutdowns controller
|
void |
enable()
This methods enables the controller : i.e.
|
void |
enableAndWriteCurrent(int aValue)
Enables controller and sent current value to controller.
|
void |
faultReset()
Clear faults on the controller.
|
EPOSEnumerations.EposMode |
getMode()
Return Epos mode for GUI.
|
void |
initializeAndCheckHardware()
Check if the parameters in the cPU of the controller have the right values.
|
boolean |
isEnabled()
Returns true if the controller is enabled.
|
boolean |
isEnabledToPublish()
For GUI.
|
boolean |
isInMode(EPOSEnumerations.EposMode aMode)
return true if this controller is in the mode given as argument.
|
boolean |
isParametersOK()
This methods returns true if the values of parameters stored in CPU are
the same than those stored in the configuration system.
|
boolean |
isTargetReached()
In HOMING mode and PROFILE_POSITION mode this indicates that the position
is reached.
|
boolean |
isTurnedOff()
Return true if the controller is turned OFF;
|
void |
off()
Turn off controller.
|
void |
publishData()
Publish Data on status bus for trending data base and GUIs.
|
void |
quickStop()
Send a quickStop command to the controller.
|
String |
readControlWord()
Read the control world (index=6040, subindex=0,size=2)
|
int |
readCurrent()
In Current Mode this methods returns the current actualy received by the motor.
|
int |
readCurrentAverageValue()
In Current Mode this methods returns the average of the current received
by the motor.
|
EPOSEnumerations.EposMode |
readMode()
Reads the EPOS mode in the CPU of the EPOS device, updates the field mode
and returns the mode as a String.
|
int |
readParameter(EPOSEnumerations.Parameter param)
Reads in the EPOS CPU the value of the Parameter.
|
int |
readParameter(String parameterName)
Reads in the EPOS CPU the value of the Parameter which parameter name is
given as argument.
|
protected String |
readParameterInHexa(EPOSEnumerations.Parameter param)
Reads in the EPOS CPU the value of the Parameter.
|
protected String |
readParameterInHexa(String parameterName)
Reads in the EPOS CPU the hexadecimal value of the Parameter.
|
String |
readParameters() |
String |
readParameters(EPOSEnumerations.EposMode aMode)
Read all the value of parameters for a given EPOS mode and return a printed list of this values.
|
String |
readParameters(String modeInString)
This methods reads in the CPU of the EPOS the values of the parameters
for a given mode.
|
int |
readPosition()
Reads in the CPU the value of the parameter PositionActualValue and
returns it in a decimal format.
|
int |
readProfileVelocity()
In PROFILE_POSITION returns the value of the parameter ProfileVelocity.
|
int |
readSSIPosition()
Read the position returned by the absolute encoder (single serial data).
|
String |
readStatusWord()
Read the status world (index=6041, subindex=0,size=2)
|
void |
restoreParameters()
Restore default parameters.
|
void |
shutdownEPOS()
Shutdown the controller.
|
void |
stopCurrent()
In current mode this methods set to zero the value of the current sent to
the motor.
|
void |
switchOnEnableOperation()
SwitchOn and enable controller.
|
void |
writeControlWord(String value)
Write a value in hexa in the control world (index=6040,
subindex=0,size=2)
|
void |
writeCurrent(int aValue)
In current mode this methods send a current to the motor.
|
void |
writeParameter(EPOSEnumerations.Parameter param,
int value)
Set the parameter given as argument with the decimal value given as
argument and write it in the controller CPU.
|
String |
writeParameter(String parameterName,
int value)
This method writes a parameter in the CPU of the EPOS.
|
void |
writeParameterInHexa(EPOSEnumerations.Parameter param,
String hexaValue)
Set the parameter given as argument with the hexadecimal value given as
argument and write it in the controller CPU.
|
void |
writeParameterInHexa(String parameterName,
String hexaValue)
This method writes a parameter in the CPU of the EPOS.
|
void |
writeParameters() |
void |
writeParameters(EPOSEnumerations.EposMode mode)
This methods writes in the CPU of the EPOS devis the values of the
parameters set for the mode.
|
void |
writeParameters(Map<String,Integer> paramMap)
Write to the CPU of the EPOS a map of parameters.
|
void |
writeTargetPosition(int aValue)
In PROFILE_POSITION mode this methods set the target position.
|
configAsHeartbeatConsumer, configAsHeartbeatProducer, configAsHeartbeatProducer, createStatusDataPublishedByCanOpenDevice, displayErrorHistory, displayErrorRegister, getErrorHistory, getErrorRegister, getNodeID, getSerialNB, getTcpProxy, initModule, isBooted, isInError, isInitialized, processUpdate, readErrorHistory, readErrorHistoryNames, readErrorRegister, readNumberOfErrors, readSDO, resetError, saveParameters, toString, writeSDOgetNObserverThreads, getObservables, getTickMillis, init, listens, setNObserverThreads, setObservables, setTickMillis, shutdownNow, startTicking, tick, updateaddObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateStatusDataPublishedByEPOSController, displayErrorHistory, enableAndWriteAbsolutePosition, enableAndWriteRelativePosition, getErrorHistory, getErrorRegister, isInError, readNumberOfErrorscheckBooted, checkInitialized, createStatusDataPublishedByHardware, getNodeID, getSerialNB, isBooted, isInitialized, printStategetComponentConfigurationEnvironment, getComponentLookup, getName, getSubsystemraiseAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseWarning, raiseWarning, raiseWarning, raiseWarningchange, dropSubmittedChanges, getChildren, getComponentByName, getEnvironment, getParent, getParentObject, getSubmittedChanges, isParameterConfigurable, printConfigurableParameters, setBulkParameter, submitChange, submitChanges, validateBulkChangesetParameterBulkprotected boolean turnedOff
protected boolean parametersOK
protected EPOSEnumerations.EposMode mode
protected boolean enabledToPublish
public CanOpenEPOS(String nodeID, String serialNB, Map<String,Integer> paramsForCurrent, Map<String,Integer> paramsForProfilePosition, Map<String,Integer> paramsForHoming)
nodeID - serialNB - paramsForCurrent - paramsForProfilePosition - paramsForHoming - public boolean isEnabledToPublish()
EPOSControllerisEnabledToPublish in interface EPOSControllerpublic boolean isTurnedOff()
EPOSControllerisTurnedOff in interface EPOSControllerpublic boolean isParametersOK()
EPOSControllerisParametersOK in interface EPOSControllerpublic EPOSEnumerations.EposMode getMode()
getMode in interface EPOSController@Command(type=QUERY, description="return true if this controller is in the mode given as argument.") public boolean isInMode(EPOSEnumerations.EposMode aMode)
isInMode in interface EPOSControlleraMode - @Command(type=QUERY, level=1, description="Changes an EPOS parameter for this controller. Writes the new value on the CPU of the controller.Changes the new value in the configuration. But doesn\'t save the new parameter in the CPU. To save in CPU controller, use command saveParameters and saveAllChanges.To save configuration, use command saveAllChanges.") public void changeEPOSParameter(String key, int value)
key - value - @Command(type=QUERY, level=1, description="Reads the EPOS mode in the CPU of the EPOS device and updates the field mode.") public EPOSEnumerations.EposMode readMode()
readMode in interface EPOSControllerSDORequestExceptionShortResponseToSDORequestException@Command(type=ACTION, level=1, description="Changes EPOS mode in the CPU of the EPOS device and updates the field mode.") public void changeMode(EPOSEnumerations.EposMode newMode)
changeMode in interface EPOSControllernewMode - SDORequestException@Command(type=QUERY, level=1, description="This methods reads in the CPU of the EPOS the values of the parameters for a given mode.") public String readParameters(String modeInString)
modeInString - SDORequestExceptionShortResponseToSDORequestExceptionpublic String readParameters(EPOSEnumerations.EposMode aMode)
EPOSControllerreadParameters in interface EPOSController@Command(type=QUERY, level=1, description="Read the parameters for the actual mode.") public String readParameters()
@Command(type=ACTION, level=3, description="This methods writes in the CPU of the EPOS device the values of the parameters set for the mode.") public void writeParameters()
@Command(type=ACTION, level=3, description="This methods writes in the CPU of the EPOS device the values of the parameters set for the mode given as argument") public void writeParameters(EPOSEnumerations.EposMode mode)
writeParameters in interface EPOSControllermode - SDORequestExceptionpublic void writeParameters(Map<String,Integer> paramMap)
writeParameters in interface EPOSControllerparamMap - SDORequestException@Command(type=ACTION, level=3, description="Set EPOS parameter with the value given as argument.") public String writeParameter(String parameterName, int value)
parameterName - the name of the parametervalue - in decimalSDORequestExceptionpublic void writeParameter(EPOSEnumerations.Parameter param, int value)
writeParameter in interface EPOSControllerparam - parameter to be setvalue - decimal valueSDORequestException@Command(type=ACTION, level=3, description="Set EPOS parameter with the hexadecimal value given as argument.") public void writeParameterInHexa(String parameterName, String hexaValue)
parameterName - the name of the parameterhexaValue - value of the parameter given in hexaSDORequestExceptionpublic void writeParameterInHexa(EPOSEnumerations.Parameter param, String hexaValue)
writeParameterInHexa in interface EPOSControllerparam - hexaValue - SDORequestException@Command(type=QUERY, level=1, description="Reads in the EPOS CPU the decimal value of the Parameter which parameter name is given as argument.") public int readParameter(String parameterName)
parameterName - name of the parameter to readSDORequestExceptionShortResponseToSDORequestExceptionpublic int readParameter(EPOSEnumerations.Parameter param)
param - FcsHardwareException@Command(type=QUERY, level=1, description="Reads in the EPOS CPU the hexadecimal value of the Parameter which parameter name is given as argument.") protected String readParameterInHexa(String parameterName)
parameterName - FcsHardwareExceptionprotected String readParameterInHexa(EPOSEnumerations.Parameter param)
param - FcsHardwareException@Command(type=QUERY, level=1, description="Read controller\'s parameter in the CPU for each mode and warn if a parameter has not the same value as in the configuration.Then publish data.") public void initializeAndCheckHardware()
initializeAndCheckHardware in interface PieceOfHardwareinitializeAndCheckHardware in class CanOpenDeviceFcsHardwareException@Command(type=QUERY, level=1, description="Returns true if the controller is enabled.") public boolean isEnabled()
isEnabled in interface EPOSController@Command(type=ACTION, level=1, description="This methods enables the controller : i.e. this makes it able to receive commands.") public void enable()
enable in interface EPOSControllerSDORequestExceptionpublic void checkTargetReached(long timeout)
EPOSControllercheckTargetReached in interface EPOSController@Command(type=ACTION, level=1, description="Shutdown the controller.") public void shutdownEPOS()
shutdownEPOS in interface EPOSControllerSDORequestException@Command(type=ACTION, level=1, description="writeControlWord(\"F\")") public void switchOnEnableOperation()
EPOSControllerswitchOnEnableOperation in interface EPOSController@Command(type=ACTION, level=3, description="Restore default parameters. AT YOUR OWN RISK.") public void restoreParameters()
SDORequestException@Command(type=ACTION, level=1, description="Write a value in hexa in the control world (index=6040, subindex=0,size=2)") public void writeControlWord(String value)
writeControlWord in interface EPOSControllervalue - in hexaSDORequestException@Command(type=QUERY, level=1, description="Read the control world (index=6040, subindex=0,size=2)") public String readControlWord()
SDORequestExceptionShortResponseToSDORequestException@Command(type=QUERY, level=1, description="Read the status world (index=6041, subindex=0,size=2)") public String readStatusWord()
readStatusWord in interface EPOSControllerSDORequestExceptionShortResponseToSDORequestException@Command(type=ACTION, level=1, description="QuickStop.") public void quickStop()
EPOSControllerquickStop in interface EPOSController@Command(type=ACTION, level=1, description="Turn OFF controller (in mode CURRENT, stop CURRENT) and shutdown.") public void off()
EPOSControlleroff in interface EPOSController@Command(type=ACTION, level=3, description="Sent current to controller the EPOS CPU. UNIT=mA / FORMAT=decimal") public void writeCurrent(int aValue)
writeCurrent in interface EPOSControlleraValue - UNIT=mA / FORMAT=decimal the value of the current to be
sent.FcsHardwareException@Command(type=ACTION, level=3, description="Enables controller and sets the current value in the EPOS CPU.") public void enableAndWriteCurrent(int aValue)
enableAndWriteCurrent in interface EPOSControlleraValue - protected void checkCurrentValue(int aValue)
aValue - @Command(type=QUERY, level=1, alias="readCurrentActualValue", description="In Current Mode this methods returns the current actualy received by the motor.") public int readCurrent()
readCurrent in interface EPOSControllerSDORequestExceptionShortResponseToSDORequestException@Command(type=QUERY, level=1, alias="readCurrentAverage", description="In Current Mode this methods returns the average of the current received by the motor.") public int readCurrentAverageValue()
SDORequestExceptionShortResponseToSDORequestExceptionpublic void stopCurrent()
SDORequestException@Command(type=QUERY, level=1, alias="readPositionActualValue", description="In PROFILE_POSITION Mode this methods returns the actual position.") public int readPosition()
readPosition in interface EPOSControllerSDORequestExceptionShortResponseToSDORequestException@Command(type=QUERY, level=1, description="Read the position returned by the absolute encoder (single serial data).") public int readSSIPosition()
readSSIPosition in interface EPOSControllerSDORequestExceptionShortResponseToSDORequestException@Command(type=QUERY, level=1, description="In PROFILE_POSITION returns the value of the parameter ProfileVelocity.") public int readProfileVelocity()
readProfileVelocity in interface EPOSControllerSDORequestExceptionShortResponseToSDORequestException@Command(type=ACTION, level=3, description="Define the actual position as position given as argument.") public void defineAbsolutePosition(int position)
defineAbsolutePosition in interface EPOSControllerSDORequestExceptionRejectedCommandException@Command(type=ACTION, level=1, description="In PROFILE_POSITION mode this methods set the target position. Target position has to be given in microns.") public void writeTargetPosition(int aValue)
writeTargetPosition in interface EPOSControlleraValue - UNIT=mA / FORMAT=decimal the value of the current to be
sent.RejectedCommandExceptionSDORequestException@Command(type=QUERY, level=1, description="In HOMING mode and PROFILE_POSITION mode this indicates that the position is reached.") public boolean isTargetReached()
isTargetReached in interface EPOSControllerSDORequestExceptionShortResponseToSDORequestException@Command(type=QUERY, level=1, description="Check if the Controller is in fault.") public void checkFault()
checkFault in interface EPOSControllerFcsHardwareException@Command(type=ACTION, level=1, description="Clear faults on the controller.", alias="resetFault") public void faultReset()
faultReset in interface EPOSController@Command(type=QUERY, level=1, description="For every parameter to be defined for this mode this method compares the values in configuration with the value stored in controller CPUand throws a HardwareException if these values are not equal.") public void checkParameters(EPOSEnumerations.EposMode aMode)
checkParameters in interface EPOSControllerSDORequestExceptionShortResponseToSDORequestExceptionpublic void checkParameters(Map<String,Integer> paramsMap)
paramsMap - SDORequestExceptionShortResponseToSDORequestException@Command(type=ACTION, level=3, description="Change mode to CURRENT mode and initialize theCURRENT mode parameters from configuration values.") public void activateCurrentMode()
@Command(type=ACTION, level=3, description="Change mode to HOMING mode and initialize theHOMING mode parameters from configuration values.") public void activateHomingMode()
@Command(type=ACTION, level=3, description="Change mode to PROFILE_POSITION mode and initialize thePROFILE_POSITION mode parameters from configuration values.") public void activateProfilePositionMode()
@Command(type=ACTION, level=1, description="Shutdowns the controller.") public void disable()
disable in interface EPOSController@Command(type=QUERY, level=1, alias="refreshGUI", description="Publish data for the controller on the status bus.") public void publishData()
publishData in interface PieceOfHardwarepublishData in class CanOpenDeviceCopyright © 2017 LSST. All rights reserved.