
public class CanOpenDevice extends Object implements PieceOfHardware, AlertRaiser
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
booted |
protected int[] |
errorHistory |
protected String |
errorRegister |
protected boolean |
inError |
protected boolean |
initialized |
protected String |
name |
protected int |
nodeID |
protected String |
serialNB |
protected CanOpenProxy |
tcpProxy |
alertSeparater| Constructor and Description |
|---|
CanOpenDevice(int 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)
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() |
int[] |
getErrorHistory()
For the GUI
|
String |
getErrorRegister()
For the GUI
|
String |
getName()
Return name.
|
int |
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.
|
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 |
onEmergencyMessage(EmergencyMessage emcyMsg)
This method is to be used when receiving an EmergencyMessage from the
CANbus.
|
void |
publishData()
Publish Data on status bus for trending data base and GUIs.
|
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.
|
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.
|
int |
readSDO(int index,
int subindex)
Sends a readSDO request to the CANopen device.
|
String |
readStringSerialNumber()
return a Hexadecimal String representation of serial number.
|
void |
resetError()
Reset fields which contains error messages.
|
void |
saveParameters()
This method saves the parameters in the controller memory.
|
void |
setBooted(boolean isBooted)
set boolean isBooted in INITIALIZATION phase.
|
String |
toString() |
void |
writeSDO(int index,
int subindex,
int size,
int newValue)
Sends a writeSDO request to the CANopen device.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcheckBooted, checkInitialized, createStatusDataPublishedByHardware, printState, raiseAlarmIfMissingonFault, onFaultResetraiseAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseAlarm, raiseWarning, raiseWarning, raiseWarning, raiseWarning, raiseWarning@ConfigurationParameter(isFinal=true,
description="CANOpen node ID of this CANOpen device")
protected int nodeID
@ConfigurationParameter(description="serial number of this CANOpen device") protected String serialNB
@LookupField(strategy=ANCESTORS) protected CanOpenProxy tcpProxy
protected boolean initialized
protected boolean booted
protected boolean inError
protected int[] errorHistory
protected String errorRegister
@LookupName protected String name
public CanOpenDevice(int nodeID,
String serialNB)
nodeID - serialNB - public String getName()
getName in interface org.lsst.ccs.UsesSubsystem@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 and print it in decimal format.") public int 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 PieceOfHardwarepublic void setBooted(boolean isBooted)
PieceOfHardwaresetBooted 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 int[] getErrorHistory()
public String getErrorRegister()
public boolean isInError()
public void onEmergencyMessage(EmergencyMessage emcyMsg)
onEmergencyMessage in interface EmergencyMessageListeneremcyMsg - the emergency message to be processed.public void resetError()
@Command(type=ACTION, level=1, description="Initialize the device.") 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(int index, int subindex, int size, int newValue)
index - subindex - size - newValue - FcsHardwareException@Command(type=QUERY, level=3, description="Reads the Can Open Device with a command rsdo.") public int readSDO(int index, int subindex)
index - subindex - FcsHardwareException@Command(type=QUERY, level=3, description="Reads serial number on the Can Open Device with a command rsdo.") public String readStringSerialNumber()
@Command(type=QUERY, level=3, description="Reads Error Register on the controller - in hexa (index 1001).") public int readErrorRegister()
SDORequestExceptionShortResponseToSDORequestException@Command(type=QUERY, level=3, description="Display Error Register on the controller (index 1001).") public String displayErrorRegister()
public int[] readErrorHistory()
@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()
SDORequestExceptionShortResponseToSDORequestException@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(int nodeID, int heartbeatTime)
nodeID - node IDheartbeatTime - heartbeat in millisecondsSDORequestExceptionpublic 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.