Home > HMS NETWORKS > HMS NETWORKS CANbridge NT Lua ADK Bridge Router User Guide
HMS NETWORKS CANbridge NT Lua ADK Bridge Router User Guide
How to Debug the Lua File?
CAN@net NT/CANbridge NT Lua ADK
5. Note that the Lua script depends on the conguraon on the target. For example, MQTT broker setngs
must be congured on the target to be able to use the callbacks in the Lua script.
6. Start the Lua script on the host PC.
• LuaADK.exe reinializes the device (connect device, test connecon and load script).
7. Note that the target device only starts to operate, if the Lua script is started on the host PC.
8. Congure the target device from the Lua inialize uncon and start normal operaon.
9. If ZeroBrane stops at uncon initialize(), use Project — Connue to run the Lua script or Project —
Step over to single step the script line by line.
3.4. How to Debug the Lua File?
Lua is not able to detect set breakpoints, because uncons like loop, initialize, and on_canare called
from the C environment.
•
To be able to detect set breakpoints, add the following line to each uncon:
function loop(ticks, elapsed)
require('mobdebug').on() -- <== Add this line at the beginning of
the function
-- my code
...
end
If this line is added, breakpoints can be set and single step debugging is possible.
NOTE
Remove the line when using the code in target mode.
4.02.0332.20002 Version 1.5
Page 7 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.













