public class SimuEPOSControllerModule extends CanOpenEPOS implements org.lsst.ccs.framework.HasLifecycle
| Modifier and Type | Field and Description |
|---|---|
protected int |
actualCurrent |
protected int |
position |
protected int |
ssiPosition |
protected int |
targetCurrent |
protected int |
targetPosition |
enabledToPublish, mode, parametersOKbooted, errorHistory, errorRegister, inError, initialized, name, nodeID, serialNB, tcpProxyalertSeparater| Constructor and Description |
|---|
SimuEPOSControllerModule(int nodeID,
String serialNB,
Map<String,Integer> paramsForCurrent,
Map<String,Integer> paramsForProfilePosition,
Map<String,Integer> paramsForHoming)
Build a new SimuEPOSControllerModule
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkCurrent(int aValue) |
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 FcsHardwareException if these values are not equal.
|
void |
defineAbsolutePosition(int position)
Defines the actual position as the absolute position which value is given
as an argument.
|
void |
disable()
shutdowns controller
|
String |
displayErrorHistory()
Return a printed list of errors that occured on this controller.
|
void |
enable()
This methods enables the controller : i.e.
|
void |
enableAndWriteRelativePosition(int pos)
Enable controller and go to relative position.
|
boolean |
isBooted()
Returns true if this CANopen node is booted.
|
boolean |
isEnabled()
Returns true if the controller is enabled.
|
boolean |
isParametersOK()
We assum that simulated hardware's controller has always correct parameters.
|
boolean |
isTargetReached()
overriden for simulation
|
void |
quickStop()
Send a quickStop command to the controller.
|
int |
readCurrent()
In Current Mode this methods returns the current actualy received by the motor.
|
int[] |
readErrorHistory()
The error history holds errors that have occurred on the device and have
been signalled via the emergency object.
|
int |
readErrorRegister()
At index 1001 there deviceErrorFile an error register for the device.
|
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 |
readNumberOfErrors()
Extract from the Maxon Motor firmware specification : Contains the number
of actual errors that are recorded in the array starting at subindex 1.
|
String |
readParameters(EPOSEnumerations.EposMode mode)
Read all the value of parameters for a given EPOS mode and return a printed list of this values.
|
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).
|
void |
setPosition(int actualPosition) |
void |
stopAction()
Stop action and disable(shutdown) controller.
|
void |
writeControlWord(int f)
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)
This method writes a parameter in the CPU of the EPOS.
|
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 position)
In PROFILE_POSITION mode this methods set the target position.
|
changeEPOSParameter, changeMode, checkParameters, getMode, initializeAndCheckHardware, isEnabledToPublish, publishData, readControlWord, readCurrentAverageValue, readParameter, readParameterInHexa, readParameterInHexa, readStatusWord, restoreParameters, setEnabledToPublish, writeTargetVelocityconfigAsHeartbeatConsumer, configAsHeartbeatProducer, createStatusDataPublishedByCanOpenDevice, displayErrorRegister, getErrorHistory, getErrorRegister, getName, getNodeID, getSerialNB, getTcpProxy, isInError, isInitialized, onEmergencyMessage, readSDO, readStringSerialNumber, resetError, saveParameters, setBooted, toString, writeSDOclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitinit, postInit, postShutdown, postStart, shutdownNow, startcheckEnabled, checkTargetReached, createStatusDataPublishedByEPOSController, enableAndWriteAbsolutePosition, enableAndWriteCurrent, faultReset, getErrorHistory, getErrorRegister, isInError, isInMode, readParameter, readParameters, readParameters, readPositionSensorType, resetError, startVelocity, stopPosition, stopVelocity, switchOnEnableOperation, writeParameterscheckBooted, checkInitialized, createStatusDataPublishedByHardware, getNodeID, getSerialNB, isInitialized, printState, raiseAlarmIfMissing, setBootedonEmergencyMessage, onFault, onFaultResetraiseAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseWarning, raiseWarning, raiseWarning, raiseWarning, raiseWarningprotected int targetPosition
protected int position
protected int ssiPosition
protected int targetCurrent
protected int actualCurrent
public SimuEPOSControllerModule(int nodeID,
String serialNB,
Map<String,Integer> paramsForCurrent,
Map<String,Integer> paramsForProfilePosition,
Map<String,Integer> paramsForHoming)
nodeID - serialNB - paramsForCurrent - paramsForProfilePosition - paramsForHoming - @Command(type=ACTION,
level=1,
description="For simulator only : Update position with a position given as argument.")
public void setPosition(int actualPosition)
public boolean isTargetReached()
isTargetReached in interface EPOSControllerpublic boolean isParametersOK()
isParametersOK in interface EPOSControllerisParametersOK in class CanOpenEPOSpublic void defineAbsolutePosition(int position)
EPOSControllerdefineAbsolutePosition in interface EPOSControllerpublic void disable()
EPOSControllerdisable in interface EPOSControllerpublic void writeParameters(EPOSEnumerations.EposMode mode)
CanOpenEPOSwriteParameters in interface EPOSControllerwriteParameters in class CanOpenEPOSpublic void writeParameter(EPOSEnumerations.Parameter param, int value)
CanOpenEPOSwriteParameter in interface EPOSControllerwriteParameter in class CanOpenEPOSvalue - in decimalpublic void writeTargetPosition(int position)
CanOpenEPOSwriteTargetPosition in interface EPOSControllerwriteTargetPosition in class CanOpenEPOSposition - UNIT=mA / FORMAT=decimal the value of the current to be
sent.public void writeParameters(Map<String,Integer> paramMap)
EPOSControllerwriteParameters in interface EPOSControllerpublic void writeCurrent(int aValue)
CanOpenEPOSwriteCurrent in interface EPOSControllerwriteCurrent in class CanOpenEPOSaValue - UNIT=mA / FORMAT=decimal the value of the current to be
sent.public void stopAction()
EPOSControllerstopAction in interface EPOSControllerpublic int readPosition()
EPOSControllerreadPosition in interface EPOSControllerpublic int readSSIPosition()
readSSIPosition in interface EPOSControllerSDORequestExceptionShortResponseToSDORequestExceptionpublic void enable()
EPOSControllerenable in interface EPOSControllerpublic int readCurrent()
CanOpenEPOSreadCurrent in interface EPOSControllerreadCurrent in class CanOpenEPOSpublic EPOSEnumerations.EposMode readMode()
CanOpenEPOSreadMode in interface EPOSControllerreadMode in class CanOpenEPOSpublic void quickStop()
EPOSControllerquickStop in interface EPOSControllerpublic int readNumberOfErrors()
CanOpenDevicereadNumberOfErrors in interface EPOSControllerreadNumberOfErrors in class CanOpenDevicepublic int readErrorRegister()
CanOpenDevicereadErrorRegister in class CanOpenDevicepublic int[] readErrorHistory()
CanOpenDevicereadErrorHistory in class CanOpenDevicepublic String displayErrorHistory()
EPOSControllerdisplayErrorHistory in interface EPOSControllerdisplayErrorHistory in class CanOpenDevice@Command(type=QUERY,
level=1,
description="Check if the Controller is in fault.")
public void checkFault()
CanOpenEPOScheckFault in interface EPOSControllercheckFault in class CanOpenEPOS@Command(type=QUERY,
level=1,
description="Returns always true in simulation.")
public boolean isBooted()
isBooted in interface PieceOfHardwareisBooted in class CanOpenDevicepublic int readProfileVelocity()
EPOSControllerreadProfileVelocity in interface EPOSControllerpublic String readParameters(EPOSEnumerations.EposMode mode)
EPOSControllerreadParameters in interface EPOSControllerpublic void checkParameters(EPOSEnumerations.EposMode aMode)
CanOpenEPOScheckParameters in interface EPOSControllercheckParameters in class CanOpenEPOSpublic void writeControlWord(int f)
CanOpenEPOSwriteControlWord in interface EPOSControllerwriteControlWord in class CanOpenEPOSf - in hexapublic boolean isEnabled()
EPOSControllerisEnabled in interface EPOSController@Command(type=ACTION,
level=3,
description="Enable controller and go to relative position. Doesn\'t check condition. DANGER !!!! ")
public void enableAndWriteRelativePosition(int pos)
EPOSControllerenableAndWriteRelativePosition in interface EPOSControllerpublic void checkCurrent(int aValue)
checkCurrent in interface EPOSControllerCopyright © 2017 LSST. All rights reserved.