Home > HMS NETWORKS > HMS NETWORKS CANbridge NT Lua ADK Bridge Router User Guide
HMS NETWORKS CANbridge NT Lua ADK Bridge Router User Guide
C Funcons Called from Lua
CAN@net NT/CANbridge NT Lua ADK
Funcon 'table.copy'
table.copy(tbl)
Returns a deep copy of tbl.
5.2.2. Module can
The module canis loaded by default and can is directly available.
Funcon 'can.dump_data'
can.dump_data(data)
Formats dataas byte hex dump, like:
can.dump_data({1, 2, 3, 4}) --> [01, 02, 03, 04]
Funcon 'can.register_msg'
can.register_msg({
handle = 1,
port = 1,
format = "std",
ident = 0x100,
data_as = "array",
max_frequency = 500,
})
Registers a CAN/CAN-FD message for recepon via on_can.
• handle: user dened reference to the registered message, to be used inside on_can
• port: CAN port number (1.. 4), depending on the available CAN ports of the target device
• formatis stdfor 11-bit, or extfor 29-bit ideners
• ident: message idener
• data_aspossible values:
– "array": received message payload (data bytes) is provided as byte array (userdata)
– "table": received message payload (data bytes) is provided as Lua table
• max_frequency: value in msec for the "message load reducon ler" to reduce the CPU load. CAN
messages is forwarded to Lua with the given maximum frequency. This parameter is oponal. Default value is
0(no ler is used).
Type "array"has beer performance and is therefore the preferred type. Type "table"is more generic and
provides more possibilies to work with the received data.
Funcon 'can.send'
can.send(port, format, ident, payload)
Sends a CAN message.
4.02.0332.20002 Version 1.5
Page 11 of 20
| General | Details |
|---|---|
| Name | HMS NETWORKS CANbridge NT Lua ADK Bridge Router User Guide |
| Make | HMS NETWORKS |
| Language | English |
| Filetype | PDF (Download) |
| File size | MB |
If you have any questions regarding HMS NETWORKS CANbridge NT Lua ADK Bridge Router User Guide, please ask here and describe the problem in detail.













