Introduction

The Code Generator is a built-in tool to create test code for inputs, outputs and CAN bus of a module. With the generated code, users can read and control inputs and outputs via CAN Bus. It can be used once a project has been opened.

The test code and the accompanying CAN database will be created automatically based on the selected module. The test software generated by the code generator has many use cases. For example it can be used at the beginning of development to get to know the module and user API or for debug purposes to check the inputs and outputs of the module.


Code Generator

Code Generation

Code Generation

The Generate Test Code button triggers the generation of C code, the CAN database and the Build of the application. The C code is placed in user_code.c, the CAN data is inserted in CAN DB Editor and a .sym is created in the root directory of the Applics project. At the end of the build the .s19 can be flashed onto the controller.


Control Inputs and Outputs

Module Test

Loading the symbol file in Module Test allows control of the inputs and outputs by sending datapoints over CAN Bus.

PCAN-Explorer

If PCAN-Explorer Software is available, the symbol file can be imported. The CAN data is then displayed in the Receive section of Receive/Transmit window. To control inputs and outputs the datapoints can be selected and send in the Transmit section of the Receive/Transmit window. Other tools like those from Vector can be used in a similar way.

PCAN