Skip to main content

Change Frame Data on Every Transmission (Pattern Files)

Overview

Pattern file overview

Use the pattern file feature in simulation mode when you want to change the response data automatically at transmission time.
It is helpful when you need to swap response data under the same ID or switch commands under specific conditions during a master simulation, such as:

  • Repeated transmissions
  • Elapsed time
  • Custom conditions

This makes it possible to emulate pseudo sensor inputs to an ECU or reproduce specific sequence operations during simulation.

Use Cases

  • Emulate a temperature sensor signal toward the ECU.
  • Gradually change frame data to verify fail-safe behavior.
  • Recreate periodic variations observed on real vehicles to evaluate communication stability.

Setup Steps

Applying to Master Schedules

  • You can assign a pattern file to each frame in the master schedule.
  • The frame ID is overwritten by the ID inside the pattern file.

1. Select the simulation mode
From the main menu open Simulation Window, then set LIN Simulation Mode to Master Sim.

Edit master schedule frame

In the Frame List, choose the frame that should use the pattern file and click the edit button to open the LIN Frame Setting dialog.

2. Load a pattern file
Click Browse pattern file in Pattern Setting → Source File to open the file dialog and select the pattern file to load.

Choose pattern file for master simulation

Click Load to import the pattern data and show it in the pattern data list.

Loaded pattern list for master simulation

3. Configure Pattern Change Trigger
Use Pattern Change Trigger to define when the pattern data should switch.
In this example the trigger is set to Log Trigger.

Pattern Change Trigger for master simulation

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

Pattern repetition setting for master simulation

Frames with an assigned pattern file show a check mark in Ptn. Turn on Rep. to loop the pattern file continuously.

Applying to Slave Simulation Response Frames

  • A pattern file can be assigned for each ID.
  • The ID set in the response definition takes priority over the ID inside the pattern file.

1. Select the simulation mode
From the main menu open Simulation Window, then set LIN Simulation Mode to Slave Sim.

Edit slave simulation frame

In the Response ID List, select the frame that should use the pattern file and click the edit button to open the LIN Response Setting dialog.

2. Load a pattern file
Click Browse pattern file in Pattern Setting → Source File to open the file dialog and choose the pattern file to load.

Choose pattern file for slave simulation

Click Load to import the pattern data and show it in the pattern data list.

Loaded pattern list for slave simulation

3. Configure Pattern Change Trigger
Use Pattern Change Trigger to define when the pattern data should switch.
In this example the trigger is set to Log Trigger.

Pattern Change Trigger for slave simulation

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

Pattern repetition setting for slave simulation

Frames with an assigned pattern file show a check mark in Ptn. Turn on Rep. to loop the pattern file continuously.

Pattern File Format

File extensions

Pattern file formatting differs between the .ptn and .csv extensions.

ExtensionDetails
ptnA simple comma-separated format. Avoid spaces before or after commas, otherwise loading fails.
csvMust be in MicroPeckerX log file format. Useful when you want to reuse transmit/receive patterns captured from logs.

Pattern files with the .ptn extension

Each line describes one frame containing the command, ID, and data.
Lines are transmitted in order. A pattern file can contain up to 10,000 lines.

Frame layout

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

Command types

  • Tx
  • Rx
  • Wakeup
  • Sleep

Pattern file examples (.ptn)

Change payload for the same ID (master/slave)

Changes D0 and D1 in 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 both ID and payload (master)

Updates the response data and command for one frame in the master schedule.

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

Pattern Setting Dialog Reference

Pattern Setting dialog overview
ItemDescriptionNotes
Source FileShows the full path of the pattern file selected with Browse pattern file.You can also enter the full path manually.
Browse pattern file buttonOpens the file dialog to choose the pattern file.The file is not loaded until you click Load pattern file.
ID FilterEnables filtering for the pattern data in the loaded file. When enabled, data that does not meet the following conditions is ignored:
・ID matches the value entered in ID Filter
・Type is Wakeup or Sleep
Default DataSpecify hexadecimal default data used when the pattern data length differs from the length defined under Device Setting → ID Definition.
Missmatch DLConfigure how to handle length mismatches between the pattern data and the ID length defined under Device Setting → ID Definition.
Use Default: Fill missing bytes with the default data
Ignore: Exclude the entry from the list
Use Default example:
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 pattern file buttonLoads the pattern file shown in Source File and displays it in the pattern data list.
Clear pattern data buttonClears the pattern data list.
Save pattern data buttonSaves the pattern data list to a file.
Pattern Data List (outline ①)Displays the pattern data included in the loaded pattern file.
Pattern Change TriggerDefines the conditions under which pattern changes occur.
Confirm pattern settings buttonSaves the settings and closes the dialog.
Cancel pattern settings buttonDiscards the settings and closes the dialog.

FAQ

Q: How can I switch the pattern on every transmission?

Master simulation

Set the Pattern Change Trigger for the preceding frame in the schedule to a Log Trigger that reacts to the frame reception.
Alternatively, match the Timer setting of the Pattern Change Trigger to the transmission interval of the target frame to switch the pattern on every transmission.

Slave simulation

For the target ID, set the Pattern Change Trigger (Log Trigger) to Header reception so the pattern switches on every transmission.