
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 org.lsst.ccs.Subsystem |
s |
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()
Read error history on the device and return its String representation.
|
String |
displayErrorRegister()
Read Error Register on the controller (index 1001), retrieve error name and return
a String representation of the error register.
|
org.lsst.ccs.AlertService |
getAlertService()
return alertService
|
int[] |
getErrorHistory()
For the GUI
|
String |
getErrorRegister()
For the GUI
|
String |
getName()
Return name.
|
int |
getNodeID() |
String |
getSerialNB() |
org.lsst.ccs.Subsystem |
getSubsystem() |
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()
read error history on the device and return a list of device error code.
|
int |
readErrorRegister()
Read Error Register on the controller (index 1001).
|
int |
readNumberOfErrors()
Read and return the number of errors registred in the Error History of the device.
|
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()
End of methods to read errors on the device
/***********************************************************************************
/**
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, checkId, checkInitialized, createStatusDataPublishedByHardware, printState, raiseAlarmIfMissingonFault, onFaultResetclearAlarm, raiseAlarm, 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
@LookupField(strategy=TOP) protected org.lsst.ccs.Subsystem s
public CanOpenDevice(int nodeID,
String serialNB)
nodeID - serialNB - public org.lsst.ccs.AlertService getAlertService()
AlertRaisergetAlertService in interface AlertRaiserpublic String getName()
getName in interface AlertRaisergetName in interface PieceOfHardwarepublic org.lsst.ccs.Subsystem getSubsystem()
getSubsystem in interface AlertRaiser@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 (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.