emergency

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrRegGeneric       = 0x01 // bit 0 - generic error
	ErrRegCurrent       = 0x02 // bit 1 - current
	ErrRegVoltage       = 0x04 // bit 2 - voltage
	ErrRegTemperature   = 0x08 // bit 3 - temperature
	ErrRegCommunication = 0x10 // bit 4 - communication error
	ErrRegDevProfile    = 0x20 // bit 5 - device profile specific
	ErrRegReserved      = 0x40 // bit 6 - reserved (always 0)
	ErrRegManufacturer  = 0x80 // bit 7 - manufacturer specific
)

Error register values

View Source
const (
	ErrNoError          = 0x0000
	ErrGeneric          = 0x1000
	ErrCurrent          = 0x2000
	ErrCurrentInput     = 0x2100
	ErrCurrentInside    = 0x2200
	ErrCurrentOutput    = 0x2300
	ErrVoltage          = 0x3000
	ErrVoltageMains     = 0x3100
	ErrVoltageInside    = 0x3200
	ErrVoltageOutput    = 0x3300
	ErrTemperature      = 0x4000
	ErrTempAmbient      = 0x4100
	ErrTempDevice       = 0x4200
	ErrHardware         = 0x5000
	ErrSoftwareDevice   = 0x6000
	ErrSoftwareInternal = 0x6100
	ErrSoftwareUser     = 0x6200
	ErrDataSet          = 0x6300
	ErrAdditionalModul  = 0x7000
	ErrMonitoring       = 0x8000
	ErrCommunication    = 0x8100
	ErrCanOverrun       = 0x8110
	ErrCanPassive       = 0x8120
	ErrHeartbeat        = 0x8130
	ErrBusOffRecovered  = 0x8140
	ErrCanIdCollision   = 0x8150
	ErrProtocolError    = 0x8200
	ErrPdoLength        = 0x8210
	ErrPdoLengthExc     = 0x8220
	ErrDamMpdo          = 0x8230
	ErrSyncDataLength   = 0x8240
	ErrRpdoTimeout      = 0x8250
	ErrExternalError    = 0x9000
	ErrAdditionalFunc   = 0xF000
	ErrDeviceSpecific   = 0xFF00
	Err401OutCurHi      = 0x2310
	Err401OutShorted    = 0x2320
	Err401OutLoadDump   = 0x2330
	Err401InVoltHi      = 0x3110
	Err401InVoltLow     = 0x3120
	Err401InternVoltHi  = 0x3210
	Err401InternVoltLow = 0x3220
	Err401OutVoltHigh   = 0x3310
	Err401OutVoltLow    = 0x3320
)

Error codes

View Source
const (
	EmNoError                 = 0x00
	EmCanBusWarning           = 0x01
	EmRxMsgWrongLength        = 0x02
	EmRxMsgOverflow           = 0x03
	EmRPDOWrongLength         = 0x04
	EmRPDOOverflow            = 0x05
	EmCanRXBusPassive         = 0x06
	EmCanTXBusPassive         = 0x07
	EmNMTWrongCommand         = 0x08
	EmTimeTimeout             = 0x09
	Em0AUnused                = 0x0A
	Em0BUnused                = 0x0B
	Em0CUnused                = 0x0C
	Em0DUnused                = 0x0D
	Em0EUnused                = 0x0E
	Em0FUnused                = 0x0F
	Em10Unused                = 0x10
	Em11Unused                = 0x11
	EmCanTXBusOff             = 0x12
	EmCanRXBOverflow          = 0x13
	EmCanTXOverflow           = 0x14
	EmTPDOOutsideWindow       = 0x15
	Em16Unused                = 0x16
	EmRPDOTimeOut             = 0x17
	EmSyncTimeOut             = 0x18
	EmSyncLength              = 0x19
	EmPDOWrongMapping         = 0x1A
	EmHeartbeatConsumer       = 0x1B
	EmHBConsumerRemoteReset   = 0x1C
	Em1DUnused                = 0x1D
	Em1EUnused                = 0x1E
	Em1FUnused                = 0x1F
	EmEmergencyBufferFull     = 0x20
	Em21Unused                = 0x21
	EmMicrocontrollerReset    = 0x22
	Em23Unused                = 0x23
	Em24Unused                = 0x24
	Em25Unused                = 0x25
	Em26Unused                = 0x26
	EmNonVolatileAutoSave     = 0x27
	EmWrongErrorReport        = 0x28
	EmISRTimerOverflow        = 0x29
	EmMemoryAllocationError   = 0x2A
	EmGenericError            = 0x2B
	EmGenericSoftwareError    = 0x2C
	EmInconsistentObjectDict  = 0x2D
	EmCalculationOfParameters = 0x2E
	EmNonVolatileMemory       = 0x2F
	EmManufacturerStart       = 0x30
	EmManufacturerEnd         = EmergencyErrorStatusBits - 1
)

Error status bits

View Source
const EmergencyErrorStatusBits = 80
View Source
const ServiceId = 0x80

Variables

This section is empty.

Functions

This section is empty.

Types

type EMCY

type EMCY struct {
	*canopen.BusManager
	// contains filtered or unexported fields
}

Emergency object for receiving & transmitting emergencies

func NewEMCY

func NewEMCY(
	bm *canopen.BusManager,
	nodeId uint8,
	entry1001 *od.Entry,
	entry1014 *od.Entry,
	entry1015 *od.Entry,
	entry1003 *od.Entry,
	entryStatusBits *od.Entry,
) (*EMCY, error)

func (*EMCY) Error

func (emcy *EMCY) Error(setError bool, errorBit byte, errorCode uint16, infoCode uint32)

Set or reset an Error condition Function adds a new Error to the history & Error will be processed by Process function

func (*EMCY) ErrorReport

func (emcy *EMCY) ErrorReport(errorBit byte, errorCode uint16, infoCode uint32)

func (*EMCY) ErrorReset

func (emcy *EMCY) ErrorReset(errorBit byte, infoCode uint32)

func (*EMCY) GetErrorRegister

func (emcy *EMCY) GetErrorRegister() byte

func (*EMCY) Handle

func (emcy *EMCY) Handle(frame canopen.Frame)

Handle EMCY related RX CAN frames

func (*EMCY) IsError

func (emcy *EMCY) IsError(errorBit byte) bool

func (*EMCY) Process

func (emcy *EMCY) Process(nmtIsPreOrOperational bool, timeDifferenceUs uint32, timerNextUs *uint32)

Process EMCY state machine and TX CAN frames This should be called periodically

func (*EMCY) ProducerEnabled

func (emcy *EMCY) ProducerEnabled() bool

func (*EMCY) SetCallback

func (emcy *EMCY) SetCallback(callback EMCYRxCallback)

type EMCYRxCallback

type EMCYRxCallback func(ident uint16, errorCode uint16, errorRegister byte, errorBit byte, infoCode uint32)

Emergency object callback on message reception, including own

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL