Manual

Programming Manual
ECUSIMPMB www.obdsol.com 11 of 13
5.0 Examples
5.1 Creating a Basic ECU
In this example, we will create a basic custom ECU. This ECU will use the J1850 PWM protocol and support one PID (RPM).
Notes:
After any reset, the simulator automatically creates default ECUs. Therefore, the first step is to delete the default
ECUs.
The knobs are assigned to the first three ECUs (IDs $0, $1, and $2). We want to set the RPM to a fixed value,
therefore we will use the next available ID ($3).
Here is the complete list of commands:
SP 1 set the simulator’s protocol to PWM
EDA delete all existing (default) ECUs
EA 3 create ECU #3
EN 3, “My ECU” specify ECU name
EAP 3, 10 assign ECU physical address $10
EAF 3, 6A assign ECU functional address $6A
EP 3, 1 set ECU’s protocol preset to PWM
PA 3, 0C, 0FA0 create PID (RPM) and set its value to 1000 r/min
E 3, on turn on the ECU
Send the EL (“list ECUs”) command to verify that the ECU has been created correctly. You should see the following
summary:
3 My ECU 10,6A
We can now request RPM to verify proper operation. Commands below assume that you’re using an STN11xx-based OBD
tester (e.g., OBDLink SX or OBDLink MX):
>ATSP 1 set protocol to PWM
OK
>ATH 1 turn on message headers
OK
>01 0C send a request for RPM
41 6B 10 41 0C 0F A0 DE response from ECUsim
5.2 Adding PIDs
Previous example already demonstrated how to add the PID for RPM ($0C). However, most OBD testers would not be
able to read out the RPM value, or even connect to the ECU, because the ECU will not respond to a PID $00 request. There
are two ways to remedy this problem: either add the PID manually using the PA command, or use the PAUS command to
have the ECU automatically create and update the “supported PIDs” PIDs ($00, $20, $40, etc) on as-needed basis.
We’ll use the PAUS command in this example, as we add PIDs for vehicle speed and fuel level. Assuming you’ve already
set up a basic ECU from the previous example, enter the following commands:
PAUS 3, on enable auto-update of supported PIDs
PA 3, 0D, 64 vehicle speed = 100 km/h
PA 3, 2F, 80 fuel level = 50%
Use an OBD tester to confirm that the ECUsim automatically created and properly encoded PIDs $00 and $020: