<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alkit.se/wice295/index.php?action=history&amp;feed=atom&amp;title=IDC_sequence_file_commands</id>
	<title>IDC sequence file commands - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alkit.se/wice295/index.php?action=history&amp;feed=atom&amp;title=IDC_sequence_file_commands"/>
	<link rel="alternate" type="text/html" href="https://wiki.alkit.se/wice295/index.php?title=IDC_sequence_file_commands&amp;action=history"/>
	<updated>2026-04-05T18:15:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://wiki.alkit.se/wice295/index.php?title=IDC_sequence_file_commands&amp;diff=2508&amp;oldid=prev</id>
		<title>Mathias: Created page with &quot;IDC can read sequence files with the following general syntax:  [channel specifier-]&lt;ECU id&gt; &lt;Diagnostic request bytes&gt;;[wait];[ECU name and request description];[subnode id];...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.alkit.se/wice295/index.php?title=IDC_sequence_file_commands&amp;diff=2508&amp;oldid=prev"/>
		<updated>2021-04-13T10:01:56Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;IDC can read sequence files with the following general syntax:  [channel specifier-]&amp;lt;ECU id&amp;gt; &amp;lt;Diagnostic request bytes&amp;gt;;[wait];[ECU name and request description];[subnode id];...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;IDC can read sequence files with the following general syntax:&lt;br /&gt;
&lt;br /&gt;
[channel specifier-]&amp;lt;ECU id&amp;gt; &amp;lt;Diagnostic request bytes&amp;gt;;[wait];[ECU name and request description];[subnode id];[PIN=code];[AREA=code]&lt;br /&gt;
&lt;br /&gt;
where &amp;#039;&amp;#039;channel specifier&amp;#039;&amp;#039;, if specified, is an integer specifying a can channel number followed by a hyphen, &amp;#039;&amp;#039;ECU id&amp;#039;&amp;#039; is the ECU identifier of a diagnostic request,&lt;br /&gt;
&amp;#039;&amp;#039;Diagnostic request bytes&amp;#039;&amp;#039; are the hexadecimal codes of the diagnostic request, &amp;#039;&amp;#039;wait&amp;#039;&amp;#039; is the time in milliseconds to wait after a request until the next, &lt;br /&gt;
&amp;#039;&amp;#039;ECU name and request description&amp;#039;&amp;#039; is a textual description of the target ECU and the diagnostic request, &amp;#039;&amp;#039;subnode id&amp;#039;&amp;#039; is the subnode address of the ECU, if used, &lt;br /&gt;
&amp;#039;&amp;#039;PIN code&amp;#039;&amp;#039; is the secret code used for security access, if required, and &amp;#039;&amp;#039;AREA&amp;#039;&amp;#039; is the security access area code. &lt;br /&gt;
&lt;br /&gt;
An example sequence file line would be:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
0-7E0 22 F4 0D;;ECM Bosch EDC16C_Y286 I5D Bosch EDC16C Diesel\Read Data By Identifier\Vehicle speed&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sequence file lines starting with # or // are treated as comments and ignored.&lt;br /&gt;
&lt;br /&gt;
Sequence file lines starting with &amp;lt;nowiki&amp;gt;&amp;gt;&amp;lt;/nowiki&amp;gt; are treated as commands.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
Variables can be assigned values. The only valid data types are integers and diagnostic responses. This sets the variable &amp;#039;foo&amp;#039; to the value 1:&lt;br /&gt;
  &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;gt; set foo 1&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
When referencing a variable, the &amp;#039;$&amp;#039; symbol before the name gives the variable&amp;#039;s value, i.e. to set variable &amp;#039;x&amp;#039; to the value or variable &amp;#039;foo&amp;#039; is done as follows:&lt;br /&gt;
  &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;gt; set x $foo&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
To set a variable to a diagnostic response use the special keyword &amp;#039;$$&amp;#039; as follows:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;gt; set foo $$&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
This will set the variable &amp;#039;foo&amp;#039; to the response to the diagnostic request on the line following immediately after the directive.&lt;br /&gt;
&lt;br /&gt;
Variables containing diagnostic responses can be used in subsequent diagnostic requests, as the following example illustrates.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;gt; set x $$&lt;br /&gt;
 1001 22 20 07&lt;br /&gt;
 1001 2E A2 20 $x[3] $x[4]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how the individual bytes of the variable &amp;#039;x&amp;#039; are referenced in the second request using &amp;#039;$x[n]&amp;#039; where n is the byte offset of the response starting at 0.&lt;br /&gt;
&lt;br /&gt;
Integer variables can be increased or decreased by a value, as follows:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;gt; set x 1&lt;br /&gt;
 &amp;gt; set y 2&lt;br /&gt;
 &amp;gt; incr x 2&lt;br /&gt;
 &amp;gt; decr x $y&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would increase variable &amp;#039;x&amp;#039; from 1 to 3, and then decrease it by 2 (the value of y).&lt;br /&gt;
&lt;br /&gt;
There are a number of built-in special purpose variables, as listed in Table 1.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1: Built-in variables&lt;br /&gt;
|-&lt;br /&gt;
! Name&lt;br /&gt;
! Meaning&lt;br /&gt;
! Type&lt;br /&gt;
|-&lt;br /&gt;
| start&lt;br /&gt;
| Time in milliseconds since start of idc&lt;br /&gt;
| Integer&lt;br /&gt;
|-&lt;br /&gt;
| epoch&lt;br /&gt;
| Time in seconds since the unix epoch&lt;br /&gt;
| Integer&lt;br /&gt;
|-&lt;br /&gt;
| resplen&lt;br /&gt;
| Length in bytes of last diagnostic response&lt;br /&gt;
| Integer&lt;br /&gt;
|-&lt;br /&gt;
| majver&lt;br /&gt;
| Major version number of idc&lt;br /&gt;
| Integer&lt;br /&gt;
|-&lt;br /&gt;
| minver&lt;br /&gt;
| Minor version number of idc&lt;br /&gt;
| Integer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Labels ==&lt;br /&gt;
Lebels define positions in the sequence file that can be jumped to by the &amp;#039;jnz&amp;#039;, &amp;#039;jz&amp;#039; and &amp;#039;goto&amp;#039; commands.&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;gt;label name&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
This defines a label with the name &amp;quot;name&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Control Flow ==&lt;br /&gt;
The control flow of a sequence file can be altered by jumping to a label, using &amp;#039;jnz&amp;#039;, &amp;#039;jz&amp;#039; and &amp;#039;goto&amp;#039; commands. The &amp;#039;jnz&amp;#039; and &amp;#039;jz&amp;#039; takes a variable name as first parameter and a label as the second. If the value of the variable is zero (0), &amp;#039;jz&amp;#039; will jump to the specified label, whereas &amp;#039;jnz&amp;#039; will jump if it is not zero. The &amp;#039;goto&amp;#039; command takes just a label as argument. For example:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;gt; jz foo name&lt;br /&gt;
 &amp;gt; jnz foo name&lt;br /&gt;
 &amp;gt; goto name&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;quit&amp;#039; command finishes execution of the sequence file.&lt;br /&gt;
&lt;br /&gt;
== Timing==&lt;br /&gt;
The execution of the sequence file can be paused for a specified time using the &amp;#039;wait&amp;#039; command. For example:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;gt; wait 100&lt;br /&gt;
 &amp;gt; set foo 1000&lt;br /&gt;
 &amp;gt; wait $foo&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
The first of the above commands waits for 100 milliseconds, and the second waits for one second (the value of integer variable &amp;#039;foo&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
The time in milliseconds to wait for diagnostic responses after a request can be changed by the &amp;#039;timeout&amp;#039; command.&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;gt; timeout 5000&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
This sets the timeout to 5 seconds.&lt;br /&gt;
&lt;br /&gt;
The special variable name &amp;#039;epoch&amp;#039; can be used to get the time in seconds since the unix epoch.&lt;br /&gt;
The special variable name &amp;#039;start&amp;#039; can be used to get the time in milliseconds since the start of the sequence file execution.&lt;br /&gt;
&lt;br /&gt;
== Printing ==&lt;br /&gt;
To print strings, including values of variables, to the output result file, use the &amp;#039;print&amp;#039; command. For instance:&lt;br /&gt;
 &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;gt; print &amp;quot;Time since start is $start milliseconds. Value of foo is $foo&amp;quot;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To print debug output to the logfile, use instead the &amp;#039;debug&amp;#039; command, with a debug level from 1 to 5 as first argument.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;gt; debug 2 &amp;quot;This is a debug message&amp;quot;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mathias</name></author>
	</entry>
</feed>