config

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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Identity

type Identity struct {
	VendorId       uint32
	ProductCode    uint32
	RevisionNumber uint32
	SerialNumber   uint32
}

type ManufacturerInformation

type ManufacturerInformation struct {
	ManufacturerDeviceName      string
	ManufacturerHardwareVersion string
	ManufacturerSoftwareVersion string
}

type NodeConfigurator

type NodeConfigurator struct {
	// contains filtered or unexported fields
}

NodeConfigurator provides helper methods for reading / updating CANopen reserved configuration objects i.e. objects between 0x1000 and 0x2000. No EDS files need to be loaded for configuring these parameters This uses an SDO client to access the different objects

func NewNodeConfigurator

func NewNodeConfigurator(nodeId uint8, client *sdo.SDOClient) *NodeConfigurator

Create a new NodeConfigurator for given ID and SDOClient

func (*NodeConfigurator) ClearMappings

func (config *NodeConfigurator) ClearMappings(pdoNb uint16) error

Clear all the PDO mappings Technically clearing the actual map entries is not necessary but I find it cleaner

func (*NodeConfigurator) ConsumerDisableTIME

func (config *NodeConfigurator) ConsumerDisableTIME() error

func (*NodeConfigurator) ConsumerEnableTIME

func (config *NodeConfigurator) ConsumerEnableTIME() error

func (*NodeConfigurator) DisablePDO

func (config *NodeConfigurator) DisablePDO(pdoNb uint16) error

Disable PDO

func (*NodeConfigurator) EnablePDO

func (config *NodeConfigurator) EnablePDO(pdoNb uint16) error

Enable PDO

func (*NodeConfigurator) ProducerDisableSYNC

func (config *NodeConfigurator) ProducerDisableSYNC() error

func (*NodeConfigurator) ProducerDisableTIME

func (config *NodeConfigurator) ProducerDisableTIME() error

func (*NodeConfigurator) ProducerEnableSYNC

func (config *NodeConfigurator) ProducerEnableSYNC() error

func (*NodeConfigurator) ProducerEnableTIME

func (config *NodeConfigurator) ProducerEnableTIME() error

func (*NodeConfigurator) ReadCobIdPDO

func (config *NodeConfigurator) ReadCobIdPDO(pdoNb uint16) (uint32, error)

func (*NodeConfigurator) ReadCobIdSYNC

func (config *NodeConfigurator) ReadCobIdSYNC() (cobId uint32, err error)

func (*NodeConfigurator) ReadCobIdTIME

func (config *NodeConfigurator) ReadCobIdTIME() (cobId uint32, err error)

func (*NodeConfigurator) ReadCommunicationPeriod

func (config *NodeConfigurator) ReadCommunicationPeriod() (uint32, error)

func (*NodeConfigurator) ReadConfigurationAllPDO

func (config *NodeConfigurator) ReadConfigurationAllPDO() (
	rpdos []PDOConfigurationParameter, tpdos []PDOConfigurationParameter, err error,
)

Reads complete PDO configuration (RPDO, TPDO) Returns RPDOs and TPDOs configurations in two seperate lists

func (*NodeConfigurator) ReadConfigurationPDO

func (config *NodeConfigurator) ReadConfigurationPDO(pdoNb uint16) (PDOConfigurationParameter, error)

Reads configuration of a single PDO

func (*NodeConfigurator) ReadConfigurationRangePDO

func (config *NodeConfigurator) ReadConfigurationRangePDO(
	pdoStartNb uint16, pdoEndNb uint16,
) ([]PDOConfigurationParameter, error)

Reads configuration of a range of PDOs

func (*NodeConfigurator) ReadCounterOverflow

func (config *NodeConfigurator) ReadCounterOverflow() (uint8, error)

func (*NodeConfigurator) ReadEnabledPDO

func (config *NodeConfigurator) ReadEnabledPDO(pdoNb uint16) (bool, error)

func (*NodeConfigurator) ReadEventTimer

func (config *NodeConfigurator) ReadEventTimer(pdoNb uint16) (uint16, error)

func (*NodeConfigurator) ReadHeartbeatPeriod

func (config *NodeConfigurator) ReadHeartbeatPeriod() (uint16, error)

Read a nodes heartbeat period and returns it in milliseconds

func (*NodeConfigurator) ReadIdentity

func (config *NodeConfigurator) ReadIdentity() (*Identity, error)

Read identity object (od.EntryIdentityObject, mandatory)

func (*NodeConfigurator) ReadInhibitTime

func (config *NodeConfigurator) ReadInhibitTime(pdoNb uint16) (uint16, error)

func (*NodeConfigurator) ReadManufacturerDeviceName

func (config *NodeConfigurator) ReadManufacturerDeviceName() (string, error)

Read manufacturer device name

func (*NodeConfigurator) ReadManufacturerHardwareVersion

func (config *NodeConfigurator) ReadManufacturerHardwareVersion() (string, error)

Read Manufacturer hardware version

func (*NodeConfigurator) ReadManufacturerInformation

func (config *NodeConfigurator) ReadManufacturerInformation() ManufacturerInformation

Read manufacturer objects (od.EntryManufacturerDeviceName,od.EntryManufacturerHardwareVersion,od.EntryManufacturerSoftwareVersion, these are all optional)

func (*NodeConfigurator) ReadManufacturerSoftwareVersion

func (config *NodeConfigurator) ReadManufacturerSoftwareVersion() (string, error)

Read manufacturer software version

func (*NodeConfigurator) ReadMappings

func (config *NodeConfigurator) ReadMappings(pdoNb uint16) ([]PDOMappingParameter, error)

func (*NodeConfigurator) ReadMaxMonitorableNodes

func (config *NodeConfigurator) ReadMaxMonitorableNodes() (uint8, error)

Read max available entries for monitoring

func (*NodeConfigurator) ReadMonitoredNodes

func (config *NodeConfigurator) ReadMonitoredNodes() ([][]uint16, error)

Read current monitored nodes Returns a list of all the entries composed as the id of the monitored node And the expected heartbeat period in ms

func (*NodeConfigurator) ReadNbMappings

func (config *NodeConfigurator) ReadNbMappings(pdoNb uint16) (uint8, error)

func (*NodeConfigurator) ReadTransmissionType

func (config *NodeConfigurator) ReadTransmissionType(pdoNb uint16) (uint8, error)

func (*NodeConfigurator) ReadWindowLengthPdos

func (config *NodeConfigurator) ReadWindowLengthPdos() (uint32, error)

func (*NodeConfigurator) WriteCanIdPDO

func (config *NodeConfigurator) WriteCanIdPDO(pdoNb uint16, canId uint16) error

func (*NodeConfigurator) WriteCanIdSYNC

func (config *NodeConfigurator) WriteCanIdSYNC(canId uint16) error

Change sync can id, sync should be disabled before changing this

func (*NodeConfigurator) WriteCommunicationPeriod

func (config *NodeConfigurator) WriteCommunicationPeriod(periodUs uint32) error

func (*NodeConfigurator) WriteConfigurationPDO

func (config *NodeConfigurator) WriteConfigurationPDO(pdoNb uint16, conf PDOConfigurationParameter) error

Update hole configuration

func (*NodeConfigurator) WriteCounterOverflow

func (config *NodeConfigurator) WriteCounterOverflow(counter uint8) error

Sync should have communication period of 0 before changing this

func (*NodeConfigurator) WriteEventTimer

func (config *NodeConfigurator) WriteEventTimer(pdoNb uint16, eventTimer uint16) error

func (*NodeConfigurator) WriteHeartbeatPeriod

func (config *NodeConfigurator) WriteHeartbeatPeriod(periodMs uint16) error

Update a nodes heartbeat period in milliseconds

func (*NodeConfigurator) WriteInhibitTime

func (config *NodeConfigurator) WriteInhibitTime(pdoNb uint16, inhibitTime uint16) error

func (*NodeConfigurator) WriteMappings

func (config *NodeConfigurator) WriteMappings(pdoNb uint16, mappings []PDOMappingParameter) error

Write new PDO mapping Takes a list of objects to map and will fill them up in the given order This will first clear the current mapping

func (*NodeConfigurator) WriteMonitoredNode

func (config *NodeConfigurator) WriteMonitoredNode(index uint8, nodeId uint8, periodMs uint16) error

Add or update a node to monitor with the expected heartbeat period Index needs to be between 1 & the max nodes that can be monitored

func (*NodeConfigurator) WriteTransmissionType

func (config *NodeConfigurator) WriteTransmissionType(pdoNb uint16, transType uint8) error

func (*NodeConfigurator) WriteWindowLengthPdos

func (config *NodeConfigurator) WriteWindowLengthPdos(windowPeriodUs uint32) error

type PDOConfigurationParameter

type PDOConfigurationParameter struct {
	CanId            uint16
	TransmissionType uint8
	InhibitTime      uint16
	EventTimer       uint16
	Mappings         []PDOMappingParameter
}

Holds a PDO configuration

type PDOMappingParameter

type PDOMappingParameter struct {
	Index      uint16
	Subindex   uint8
	LengthBits uint8
}

Jump to

Keyboard shortcuts

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