Home > HMS NETWORKS > HMS NETWORKS CANbridge NT Lua ADK Bridge Router User Guide

HMS NETWORKS CANbridge NT Lua ADK Bridge Router User Guide

Limiaons of the Ixxat Lua ADK  
CAN@net NT/CANbridge NT Lua ADK  
2.3. Limiaons of the Ixxat Lua ADK  
The Ixxat Lua ADK has hardware resource limiaons because code is loaded from the Flash le system into  
o-chip RAM and executed there. This RAM area is shared between Lua and other tasks on the target. The overall  
size is approximately 900 Kbyte. Therefore, Lua can use up to approximately 600 Kbyte RAM for code and data.  
The total amount of memory in use by Lua (in Kbytes) can be determined and wrien to the terminal window of  
the CAN-Gateway Conguraor with the following command:  
print(collectgarbage("count"))  
Keep in mind:  
• Lua scripts need much more CPU me than compiled code wrien in C.  
• Do as less as possible compuaon in Lua.  
• Do the compuaon with the lowest possible frequency.  
To reduce the eorfor Lua:  
• If possible use mapping tables and other features.  
• Use the max_frequencyfeature for registered can messages to reduce the on_cancall frequency.  
• Use the array.repackuncon to reassemble CAN message payload.  
The needed CPU power can be monitored via the output in the status bar of the CAN-Gateway Conguraor. The  
Lua uncon sys.get_us_time()allows to measure execuon mes more precisely.  
A typical value for the execuon me of a short Lua uncon is 150 to 200 μs. About 5000–8000 messages can be  
processed per second.  
2.4. Specifcs in Coding for the Ixxat Lua ADK  
2.4.1. Bit Model 32 Bit Version  
The Ixxat Lua ADK is compiled for the 32 bit model. Therefore integer and oang points values are stored as 32  
bit values instead of 64 bit values as with a standard desktop Lua insallaon.  
2.4.2. Errors and Debugging  
The Ixxat CAN@net/CANbridge NT runs the Lua ADK over the nave hardware. There is an underlying kernel  
system to capture errors and to provide graceful failure modes. To avoid aecng the standard rmware, error  
handling is kept simple. If an error occurs when calling a Lua uncon, an error message is wrien to the log le  
and Lua is stopped. Runme errors in Lua uncons are wrien to the terminal and Lua is stopped. The rest of  
the rmware is running without resricons. To reacvae the Lua script the system has to be restarted.  
There is currently no target debugging support. The print statement diagnoscs through the terminal interface of  
the system must be used. The Ixxat Lua ADK provides a remote debugging feature to run the Lua script on the PC  
while communicang with the target device via an USB connecon.  
2.4.3. Declaring Variables  
Two types of data can be assigned to Lua variables:  
• values such as numbers, booleans, and strings  
• references such as uncons, tables, and user data  
For example, if the contents of variable aare assigned to variable b, there is a dierence between values and  
references. In case of a value, the content of ais copied into b. In case of a reference, both aand bnow refer to  
the same object. No content is copied. The Ixxat Lua ADK provides the uncon table.copy()which returns a  
deep copy of the provided table parameters.  
4.02.0332.20002 Version 1.5  
Page 3 of 20  
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 *

1 + one =

HMS NETWORKS CANbridge NT Lua ADK Bridge Router User Guide