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  
idener 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 idener (11 bit)", "remote frame"  
"fed"means: "CAN-FD", "extended idener (29 bit), "data frame"  
ident: message idener  
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 ecienthan 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 rsparameter 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  
GeneralDetails
NameHMS NETWORKS CANbridge NT Lua ADK Bridge Router User Guide
MakeHMS NETWORKS
LanguageEnglish
FiletypePDF (Download)
File size MB
Download PDF
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading...

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

twenty − 16 =

HMS NETWORKS CANbridge NT Lua ADK Bridge Router User Guide