Automatically Change Response Data Using a Pattern File
When replacing existing responses from Catalog, see Importing Responses for the initial data used and the effects on Error and Pattern settings. This page describes Pattern settings themselves and the file specifications.
Overview
In simulation mode, use the pattern file function when you want to change response data automatically at transmission time.
This is useful when you want to change response data for the same ID or change commands under specific conditions in master simulation.
- During repeat transmission
- After time elapses
- Under specific conditions
This makes it possible to simulate pseudo sensor inputs to the ECU and reproduce specific sequence behavior.
Application Examples
- Emulate a temperature sensor signal for the ECU.
- Gradually change frame data to verify fail-safe behavior.
- Reproduce periodic changes that occur in an actual vehicle and evaluate communication stability.
Setup Procedure
When Applying to a Master Schedule
- A pattern file can be assigned to each individual frame in a master schedule.
- The frame ID is set with the pattern file ID taking priority.
1. Select the simulation mode
Open Simulation Window from the main menu. For LIN Simulation Mode, select Master Sim..
Select the frame to which you want to apply the pattern file from Frame List, then click the edit button to open the LIN Frame Setting dialog.
2. Load the pattern file
Click Pattern File to open LIN Pattern File. Click the
button for Source File and select the pattern file to load.
The following figures for file selection, data lists, and trigger settings show screens from the previous version.
Click the Load button to load the pattern data and display it in the pattern data list.
3. Configure Pattern Change Trigger
In LIN Pattern File, use Pattern Change Trigger to set the trigger for switching pattern data.
In this example, Log Trigger is configured.
4. Configure pattern repetition
Click OK in LIN Pattern File to apply the settings to the parent screen. Click OK in the parent LIN Frame Setting screen to finalize the pattern file settings.
Frames with a configured pattern file have a check mark in Ptn. If Rep. is checked, the pattern file is executed repeatedly.
When Applying to a Slave Simulation Response Frame
- A pattern file can be set for each ID.
- The configured ID takes priority over the pattern file ID.
1. Select the simulation mode
Open Simulation Window from the main menu. For LIN Simulation Mode, select Slave Sim..
Select the frame to which you want to apply the pattern file from Response ID List, then click the edit button to open the LIN Response Setting dialog.
2. Load the pattern file
Click Pattern File to open LIN Pattern File. Click the
button for Source File and select the pattern file to load.
The following figures for file selection, data lists, and trigger settings show screens from the previous version.
Click the Load button to load the pattern data and display it in the pattern data list.
3. Configure Pattern Change Trigger
In LIN Pattern File, use Pattern Change Trigger to set the trigger for switching pattern data.
In this example, Log Trigger is configured.
4. Configure pattern repetition
Click OK in LIN Pattern File to apply the settings to the parent screen. Click OK in the parent LIN Response Setting screen to finalize the pattern file settings.
Frames with a configured pattern file have a check mark in Ptn. If Rep. is checked, the pattern file is executed repeatedly.
Pattern File Specifications
File Extension
The format of the pattern file depends on the extension, ptn or csv.
| File extension | Description |
|---|---|
| ptn | You can write it easily as comma-separated values. Note that loading fails if there are spaces before or after commas. |
| csv | It must be in MicroPeckerX log file format. This is convenient when you want to use transmission and reception patterns from a captured log. |
Pattern File with a .ptn Extension
Write the command, ID, and data for one frame on each line. Lines are transmitted in order from the first line. A pattern file can contain up to 10,000 lines.
Frame Structure
| Column 1 | Column 2 | Column 3 | Column 4 | Column 5 | Column 6 | Column 7 | Column 8 | Column 9 | Column 10 |
|---|---|---|---|---|---|---|---|---|---|
| Command | ID | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 |
Command Types
- Tx
- Rx
- Wakeup
- Sleep
Pattern File Sample (ptn)
Change Transmission Data for the Same ID (Target: Master/Slave)
Transmit while changing D0 and D1 of the response data.
Tx,10,E8,03
Tx,10,D0,07
Tx,10,D0,08
Tx,10,D0,10
Tx,10,B8,0B
Tx,10,B8,0C
Tx,10,B8,11
Change Transmission Data Including the ID (Target: Master)
Change the response data, including the command, for a single frame in a master schedule.
Tx,10,00,11
Rx,10
Tx,10,44,55
Sleep
Tx,10,88,89
Wakeup
Tx,10,CC,DD
Pattern Setting Screen Description
In the current version, configure the following items in LIN Pattern File, opened with the Pattern File button. The figure below shows the previous version's screen.
| Item | Description | Notes |
|---|---|---|
| Source File | Displays the full path of the pattern file selected with the button. | You can also set it by entering the full path directly. |
button | Opens the file dialog and selects the pattern file to load. | The selected file is not loaded until the button is clicked. |
| ID Filter | When ON, extracts data matching the specified ID. For PTN files, Master loads Wakeup and Sleep, and Slave loads Wakeup regardless of the ID condition. Slave does not load Sleep. For CSV files, the ID condition is applied to the corresponding records. | |
| Default Data | Sets hexadecimal default data used when the data length set in Device Setting → ID Definition differs from the pattern data length. | |
| Missmatch DL | Sets the handling when the data length configured in Device Setting - ID Definition differs from the pattern data length.- Use Default: Use default data for missing bytes- Ignore: Treat it as invalid and do not display it in the list | Example when Use Default is set:ID definition length: 4 bytes Pattern: 08,4C (2 bytes) Default: 11,22,33,44,55,66,77,88 -> Result: 08,4C,33,44 |
button | Loads the pattern file shown in Source File and displays it in Pattern Data List. | |
button | Clears everything in Pattern Data List. | |
button | Saves Pattern Data List with any file name. | |
| Pattern data list (area ①) | Displays the pattern data contained in the loaded pattern file. | |
| Pattern Change Trigger | Sets the occurrence conditions for pattern change events. | |
button | Applies the child screen settings to the parent screen and closes the child. Finalize the settings with OK in the parent screen. | |
button | Discards changes in the child screen and closes the dialog. |
Troubleshooting
Q: I want to switch patterns every time data is transmitted
In Master Simulation
If you set Pattern Change Trigger to Log Trigger for the reception of the schedule frame immediately before the target frame, you can switch the pattern when the target frame is transmitted. Alternatively, if you set the Timer in Pattern Change Trigger to the same cycle as the transmission cycle of the target frame, you can switch the pattern on each transmission.
In Slave Simulation
If you set Pattern Change Trigger to Header reception of the target ID in Log Trigger settings, you can switch the pattern on each transmission.
button is clicked.
button
button
button
button