Skip to main content

Automatically Change Response Data Using a Pattern File

Overview

Pattern file image

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 set for each frame in the 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..

Master pattern edit

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 the Select file button for Source File in Pattern Setting to open the file dialog, then select the pattern file to load.

Load master pattern

Click the Load button to load the pattern data and display it in the pattern data list.

Master pattern list

3. Configure Pattern Change Trigger
In Pattern Change Trigger, configure the trigger used to switch pattern data. In this example, Log Trigger is configured.

Master pattern change trigger

4. Configure pattern repetition
Click the OK button in the LIN Frame Setting dialog to complete the pattern file settings and close the dialog.

Master pattern repeat setting

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..

Slave pattern edit

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 the Select file button for Source File in Pattern Setting to open the file dialog, then select the pattern file to load.

Load slave pattern

Click the Load button to load the pattern data and display it in the pattern data list.

Slave pattern list

3. Configure Pattern Change Trigger
In Pattern Change Trigger, configure the trigger used to switch pattern data. In this example, Log Trigger is configured.

Slave pattern change trigger

4. Configure pattern repetition
Click the OK button in the LIN Response Setting dialog to complete the pattern file settings and close the dialog.

Slave pattern repeat setting

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 extensionDescription
ptnYou can write it easily as comma-separated values. Note that loading fails if there are spaces before or after commas.
csvIt 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 one frame command, ID, and data item per line.
Lines are transmitted in order starting from the first line. A pattern file can contain up to 10,000 lines.

Frame Structure

Column 1Column 2Column 3Column 4Column 5Column 6Column 7Column 8Column 9Column 10
CommandIDD1D2D3D4D5D6D7D8

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)

For one frame in the master schedule, change the response data including command changes.

Tx,10,00,11
Rx,10
Tx,10,44,55
Sleep
Tx,10,88,89
Wakeup
Tx,10,CC,DD

Pattern Setting Screen Description

Pattern Setting
ItemDescriptionNotes
Source FileDisplays the full path of the pattern file selected with the Select button.You can also set it by entering the full path directly.
Select buttonOpens the file dialog and selects the pattern file to load.The selected file is not loaded until the Load button is clicked.
ID FilterSets whether to extract pattern data from the loaded pattern file. When the check box is ON, data other than the following conditions is treated as invalid.
- The ID matches the value set in ID Filter
- The type is Wakeup or Sleep
Default DataSets the default data in hexadecimal to use when the data length configured in Device Setting - ID Definition differs from the pattern data length.
Missmatch DLSets 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
Load buttonLoads the pattern file shown in Source File and displays it in Pattern Data List.
Clear buttonClears everything in Pattern Data List.
Save buttonSaves Pattern Data List with any file name.
Pattern Data List (Area 1)Displays the pattern data contained in the loaded pattern file.
Pattern Change TriggerSets the occurrence conditions for pattern change events.
OK buttonSaves the settings and closes the dialog.
Cancel buttonDiscards the settings 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.