public class CanOpenDevice extends org.lsst.ccs.framework.Module implements PieceOfHardware, AlertRaiser
| Modifier and Type | Field and Description |
|---|---|
protected String[] |
errorHistory |
protected String |
errorRegister |
protected boolean |
inError |
protected boolean |
initialized |
protected String |
nodeID |
protected String |
serialNB |
protected CanOpenProxy |
tcpProxy |
| Constructor and Description |
|---|
CanOpenDevice(String nodeID,
String serialNB)
Create a new CanOpenDevice with a node ID and a serial number.
|
| Modifier and Type | Method and Description |
|---|---|
String |
configAsHeartbeatConsumer(int nodeID,
int producerNodeID,
int heartbeatTime)
Configure a node as a hearbeat consumer.
|
String |
configAsHeartbeatProducer(int nodeID,
int heartbeatTime)
Command to be used by the end users.
|
String |
configAsHeartbeatProducer(String nodeID,
String heartbeatTime)
Configure a node as a hearbeat producer.
|
StatusDataPublishedByCanOpenDevice |
createStatusDataPublishedByCanOpenDevice()
Creates an object to be published on the STATUS bus by a CanOpenDevice.
|
String |
displayErrorHistory() |
String |
displayErrorRegister() |
String[] |
getErrorHistory()
For the GUI
|
String |
getErrorRegister()
For the GUI
|
String |
getNodeID() |
String |
getSerialNB() |
CanOpenProxy |
getTcpProxy()
Return tcpProxy
|
void |
initializeAndCheckHardware()
This methods has to be overridden if there is some initialization to do
for the device.
|
void |
initModule() |
boolean |
isBooted()
Returns true if this CANopen node is booted.
|
boolean |
isInError()
For the GUI
|
boolean |
isInitialized()
Returns true if this CANopen node is initialized.
|
void |
processUpdate(Observable source,
org.lsst.ccs.framework.Module.ValueUpdate v)
What to do when the Modules we observe send there new values.
|
void |
publishData()
Publish Data on status bus for trending data base and GUIs.
|
String[] |
readErrorHistory()
The error history holds errors that have occurred on the device and have
been signalled via the emergency object.
|
String[] |
readErrorHistoryNames()
For the GUI or to display at the console : return a list of String with
the error code and the error name.
|
String |
readErrorRegister()
At index 1001 there deviceErrorFile an error register for the device.
|
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 |
readSDO(String index,
String subindex)
Sends a readSDO request to the CANopen device.
|
protected void |
resetError() |
void |
saveParameters()
This method saves the parameters in the controller memory.
|
String |
toString() |
void |
writeSDO(String index,
String subindex,
String size,
String newValue)
Sends a writeSDO request to the CANopen device.
|
getNObserverThreads, getObservables, getTickMillis, init, listens, sendSignal, sendSignalWithTimeLimit, setNObserverThreads, setObservables, setTickMillis, shutdownNow, signal, startTicking, tick, updateaddObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcheckBooted, checkInitialized, createStatusDataPublishedByHardware, printStateraiseAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseWarning, raiseWarning, raiseWarning, raiseWarninggetComponentConfigurationEnvironment, getComponentLookup, getName, getSubsystemchange, dropSubmittedChanges, getChildren, getComponentByName, getEnvironment, getParent, getParentObject, getSubmittedChanges, isParameterConfigurable, postStart, printConfigurableParameters, setBulkParameter, start, submitChange, submitChanges, validateBulkChange@ConfigurationParameter(isFinal=true,
description="serial number of this CANOpen device")
protected String serialNB
@ConfigurationParameter(isFinal=true,
description="CANOpen node ID of this CANOpen device")
protected String nodeID
protected CanOpenProxy tcpProxy
protected boolean initialized
protected boolean inError
protected String[] errorHistory
protected String errorRegister
@Command(type=QUERY,
level=1,
description="Returns this CANopen device\'s serial number.")
public String getSerialNB()
getSerialNB in interface PieceOfHardware@Command(type=QUERY,
level=1,
description="Returns this CANopen device\'s node ID.")
public String getNodeID()
getNodeID in interface PieceOfHardware@Command(type=QUERY,
level=1,
description="Returns true if this CANopen node is booted.")
public boolean isBooted()
isBooted in interface PieceOfHardware@Command(type=QUERY,
level=1,
description="Returns true if this CANopen node is initialized.")
public boolean isInitialized()
isInitialized in interface PieceOfHardwarepublic CanOpenProxy getTcpProxy()
public String[] getErrorHistory()
public String getErrorRegister()
public boolean isInError()
public void initModule()
initModule in class org.lsst.ccs.framework.Modulepublic void processUpdate(Observable source, org.lsst.ccs.framework.Module.ValueUpdate v)
processUpdate in class org.lsst.ccs.framework.Modulesource - v - protected void resetError()
public void initializeAndCheckHardware()
initializeAndCheckHardware in interface PieceOfHardware@Command(type=ACTION,
level=3,
description="Write on the Can Open Device with a command wsdo. All the values are in hexadecimal format. To write new data value in decimal format, please use command writeSDO of tcpProxy.")
public void writeSDO(String index,
String subindex,
String size,
String newValue)
index - subindex - size - newValue - FcsHardwareException@Command(type=QUERY,
level=3,
description="Reads the Can Open Device with a command rsdo.")
public String readSDO(String index,
String subindex)
index - subindex - FcsHardwareException@Command(type=QUERY,
level=3,
description="Reads Error Register on the controller - in hexa (index 1001).")
public String readErrorRegister()
SDORequestExceptionShortResponseToSDORequestException@Command(type=QUERY,
level=3,
description="Display Error Register on the controller (index 1001).")
public String displayErrorRegister()
public String[] readErrorHistory()
SDORequestExceptionShortResponseToSDORequestException@Command(type=QUERY,
level=1,
description="Display Error Register on the controller (index 1001).")
public String displayErrorHistory()
@Command(type=QUERY,
level=1,
description="Read and returns the number of errors registred in the Error History.")
public int readNumberOfErrors()
SDORequestExceptionShortResponseToSDORequestExceptionpublic String[] readErrorHistoryNames() throws FcsHardwareException
SDORequestExceptionShortResponseToSDORequestExceptionFcsHardwareException@Command(type=ACTION,
level=3,
description="This method saves the parameters in the controller memory.")
public void saveParameters()
SDORequestException@Command(type=ACTION,
level=3,
description="Configure a CANopen device as a heartbeat producer.")
public String configAsHeartbeatProducer(String nodeID,
String heartbeatTime)
nodeID - node ID in hexaheartbeatTime - FORMAT=hexa UNIT=millisecondsSDORequestExceptionpublic String configAsHeartbeatProducer(int nodeID, int heartbeatTime)
nodeID - FORMAT=decimalheartbeatTime - FORMAT=decimal UNIT=millisecondsFcsHardwareExceptionpublic String configAsHeartbeatConsumer(int nodeID, int producerNodeID, int heartbeatTime)
nodeID - node ID in decimalproducerNodeID - heartbeatTime - FORMAT=decimal UNIT=millisecondsSDORequestException@Command(type=QUERY,
level=1,
description="Print CANopen device.")
public String toString()
public StatusDataPublishedByCanOpenDevice createStatusDataPublishedByCanOpenDevice()
@Command(type=QUERY,
level=1,
alias="refreshGUI",
description="Publish data for the device on the status bus.")
public void publishData()
publishData in interface PieceOfHardwareCopyright © 2017 LSST. All rights reserved.