Home > HMS NETWORKS > HMS NETWORKS CANbridge NT Lua ADK Bridge Router User Guide
HMS NETWORKS CANbridge NT Lua ADK Bridge Router User Guide
CAN@net NT/CANbridge NT Lua ADK
C Funcons Called from Lua
Funcon 'cyc.update_msg'
cyc.update_msg(row, format, ident, payload)
The uncon cyc.update_msgis used to start the transmission of messages and/or to update the message
idener or data for transmission.
• row: The row number in the "CAN-Gateway Conguraor" grid (0 to 127)
• format: Combinaon of three characters to specify the message format, e. g.:
– "csr"means: "classic CAN", "standard idener (11 bit)", "remote frame"
– "fed"means: "CAN-FD", "extended idener (29 bit), "data frame"
• ident: message idener
• payload: data bytes of the message as arrayor table(see Funcon 'can.register_msg', p. 11)
5.2.6. Module json
The module jsonis oponal and has to be loaded via json= sys.dofile('json.lua').
Funcon 'json.encode'
json.encode(val)
Serializes the provided value as JSON string. The result is returned. Allowed data types for valueare boolean,
number, string, and table.
Funcon 'json.decode'
json.decode(st)
De-serializes the provided JSON string. The result is returned.
5.2.7. Module array
The module arrayis loaded by default and directly available.
Provides the data type arraywhich is a userdata byte array with up to 64 bytes, used for CAN messages
payload.
The module provides uncons to generate and modify byte arrays in C which is more ecien than doing this in
Lua, like:
• extractdata bytes from an array
• insertdata bytes into an array
• repackdata from one array into another
Funcon 'array.new'
a = array.new(64, 0)
-- OR
a = array.new({1, 2, 3, 4, 5 ,6 ,7 ,8})
Creates a new instance of type array. The rs parameter is used as size (number of bytes) , the second
parameter as inializaon value for the array.
A provided table is used as list of inializaon values.
Page 16 of 20
4.02.0332.20002 Version 1.5
| 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.












