The OOBD Book
- Web UI
- Setup your Developer Environment
The OOBD Book
When going through Make your own OOBD Scripts you might find that writing Lua Scripts for OOBD is not so easy. You need to install the build environment, understand how its all works, understand Lua as such, write you first scripts, compile it and debug it to finally have your first script in hands.
To make this easier, OOBD QuickScript was invented.
With the mouse you select the elements you want to have, drag and drop your program flow, fill in the parameters and finally download the compiled script ready to run.
All this runs in all modern browsers (except the Internet Explorer, as it seems ), so you only need to go to OOBD QuickScript to have your first script ready in about five minutes.
When opening the page, you'll find a menu bar and a initial template. When clicking onto the items in the menu bar, another menu opens where you can select the functionality you need. While all the other menu items only contain standard lua function, we'll concentrate on the OOBD menu with its related functions here.
In the upper right corner you find some buttons. These are
This is the starting point for your program. The program execution starts here, so here you can put the initialisation stuff in here (like setting the bus- and module parameters). Here you also need to place your main menu (in case you want to have one) with its menu items.
Whenever you want to have a visible menu where the user can select some item from, you'll put these items into this menu structure. The menu title is that what is placed as header into the OOBD UI and helps the user to identify where he is.
Inside the above mentioned menu you can have as many menu items as you like. Its parameters are
As said above, when a user selects a menu item, its related function is called. Such functions are defined here as an item procedure. When called, the variable
id contains the ID parameter which is given in the menu item.
The return value of this function is shown as the result of the menu item call. So whatever you want to show as result, assign that value inside your program flow to the variable
result as its content will be returned and shown as result.
This command you'll need at least once at the beginning to initialize the OOBD dongle hardware. The parameters and their meanings are:
This tells which module address to be used and how much time in milliseconds we'll give for a module answer.
After so much configuration stuff we come to the first real data communication. With the request service you can send your own service request or, in case of the RDT protocol, fill the listening tables.
If the program receives a positive answer from the module, means a service + 0x40 reply, the “success” branch is executed, where you place your own processing code. The variable
udsLen contains the number of received bytes, the byte array
udsBuffer the received bytes itself (don't forget: Lua arrays starts with 1 , not 0)
Any failure is handled by the routine itself and the actual running code is left with a return. As return value a error code is returned 1)
And here now finally the probably most exiting routine: Requesting a value and get the clear text result in a single call. These are the parameters to make it work: