Constructor
new Device(args)
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
args |
object | arguments. Properties
|
Members
dataObjects :object
- Description:
Accessor for version 5 Eds DataObjects. Do not use.
- Source:
- Deprecated:
- Use Eds#entries instead.
Accessor for version 5 Eds DataObjects. Do not use.
Type:
- object
emcy :Emcy
The Emcy module.
Type:
id :number
The device id.
Type:
- number
lss :Lss
The Lss module.
Type:
nmt :Nmt
The Nmt module.
Type:
pdo :Pdo
The Pdo module.
Type:
sdo :SdoClient
The Sdo (client) module.
Type:
sdoServer :SdoClient
The Sdo (server) module.
Type:
state :NmtState
The Nmt state.
Type:
sync :Sync
The Sync module.
Type:
time :Time
The Time module.
Type:
Methods
getRaw(index) → {Buffer}
Parameters:
Name | Type | Description |
---|---|---|
index |
number | string | index or name of the entry. |
Returns:
entry data.
- Type
- Buffer
getRawArray(index, subIndex) → {Buffer}
Parameters:
Name | Type | Description |
---|---|---|
index |
number | string | index or name of the entry. |
subIndex |
number | sub-object index. |
Returns:
entry data.
- Type
- Buffer
getScale(index) → {number|bigint|string|Date}
Parameters:
Name | Type | Description |
---|---|---|
index |
number | string | index or name of the entry. |
Returns:
entry value.
- Type
- number | bigint | string | Date
getScaleArray(index, subIndex) → {number|bigint|string|Date}
Parameters:
Name | Type | Description |
---|---|---|
index |
number | string | index or name of the entry. |
subIndex |
number | sub-object index. |
Returns:
entry value.
- Type
- number | bigint | string | Date
getValue(index) → {number|bigint|string|Date}
Parameters:
Name | Type | Description |
---|---|---|
index |
number | string | index or name of the entry. |
Returns:
entry value.
- Type
- number | bigint | string | Date
getValueArray(index, subIndex) → {number|bigint|string|Date}
Parameters:
Name | Type | Description |
---|---|---|
index |
number | string | index or name of the entry. |
subIndex |
number | sub-object index. |
Returns:
entry value.
- Type
- number | bigint | string | Date
init()
- Description:
Initialize the device and audit the object dictionary. Additionally this method will enable deprecated Device level events.
- Source:
- Deprecated:
- Use Device#start instead.
mapRemoteNode(args)
- Description:
Map a remote node's EDS file on to this Device.
This method provides an easy way to set up communication with another device. Most EDS transmit/producer entries will be mapped to their local receive/consumer analogues. Note that this method will heavily modify the Device's internal EDS file.
This may be called multiple times to map more than one EDS.
- Source:
- Since:
- 6.0.0
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
args |
object | method arguments. Properties
|
receive(message)
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
message |
object | CAN frame. Properties
|
setRaw(index, raw)
Parameters:
Name | Type | Description |
---|---|---|
index |
number | string | index or name of the entry. |
raw |
Buffer | raw Buffer to set. |
setRawArray(index, subIndex, raw)
Parameters:
Name | Type | Description |
---|---|---|
index |
number | string | index or name of the entry. |
subIndex |
number | sub-object index. |
raw |
Buffer | raw Buffer to set. |
setScale(index, scaleFactor)
Parameters:
Name | Type | Description |
---|---|---|
index |
number | string | index or name of the entry. |
scaleFactor |
number | value to set. |
setScaleArray(index, subIndex, scaleFactor)
Parameters:
Name | Type | Description |
---|---|---|
index |
number | string | index or name of the entry. |
subIndex |
number | array sub-index to set; |
scaleFactor |
number | value to set. |
setTransmitFunction(send)
- Description:
Set the send function.
This method has been deprecated. Add a listener for the 'message' event instead.
- Source:
- Deprecated:
- Use Device.on('message') instead.
Parameters:
Name | Type | Description |
---|---|---|
send |
function | send function. |
setValue(index, value)
Parameters:
Name | Type | Description |
---|---|---|
index |
number | string | index or name of the entry. |
value |
number | bigint | string | Date | value to set. |
setValueArray(index, subIndex, value)
Parameters:
Name | Type | Description |
---|---|---|
index |
number | string | index or name of the entry. |
subIndex |
number | array sub-index to set; |
value |
number | bigint | string | Date | value to set. |
start()
- Description:
Initialize the device and audit the object dictionary.
- Source:
- Since:
- 6.0.0
stop()
Events
emergency
- Description:
Emcy object consumed (deprecated).
This event needs to be enabled by calling Device#init before it will fire.
- Source:
- Deprecated:
- Use Emcy#event:emergency instead.
lssChangeDeviceId
- Description:
Change of device id (deprecated).
This event needs to be enabled by calling Device#init before it will fire.
- Source:
- Deprecated:
- Use Lss#event:changeDeviceId instead.
lssChangeMode
- Description:
Change of LSS mode (deprecated).
This event needs to be enabled by calling Device#init before it will fire.
- Source:
- Deprecated:
- Use Lss#event:changeMode instead.
nmtChangeState
- Description:
NMT state changed (deprecated).
This event needs to be enabled by calling Device#init before it will fire.
- Source:
- Deprecated:
- Use Nmt#event:changeState or Nmt#event:heartbeat instead.
nmtChangeState
- Description:
NMT consumer timeout (deprecated).
This event needs to be enabled by calling Device#init before it will fire.
- Source:
- Deprecated:
- Use Nmt#event:timeout instead.
nmtResetCommunication
- Description:
NMT reset communication (deprecated).
This event needs to be enabled by calling Device#init before it will fire.
- Source:
- Deprecated:
- Use Nmt#event:reset instead.
nmtResetNode
- Description:
NMT reset node (deprecated).
This event needs to be enabled by calling Device#init before it will fire.
- Source:
- Deprecated:
- Use Nmt#event:reset instead.
pdo
- Description:
PDO received (deprecated).
This event needs to be enabled by calling Device#init before it will fire.
- Source:
- Deprecated:
- Use Pdo#event:pdo instead.
sync
- Description:
Sync object consumed (deprecated).
This event needs to be enabled by calling Device#init before it will fire.
- Source:
- Deprecated:
- Use Sync#event:sync instead.
time
- Description:
Time object consumed (deprecated).
This event needs to be enabled by calling Device#init before it will fire.
- Source:
- Deprecated:
- Use Time#event:time instead.