<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									StartDiag Forum - Recent Topics				            </title>
            <link>https://www.tomelectronics.it/community/</link>
            <description>The official StartDiag community forum — CAN Bus diagnostics, LUA scripting, troubleshooting and tips.</description>
            <language>en-US</language>
            <lastBuildDate>Fri, 14 Aug 2026 05:57:27 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>5.9 tuner enthusiast intro.</title>
                        <link>https://www.tomelectronics.it/community/introduce-yourself/5-9-tuner-enthusiast-intro/</link>
                        <pubDate>Fri, 24 Jul 2026 04:46:00 +0000</pubDate>
                        <description><![CDATA[Hello all, I have been using the UDCpro software to tune my MM3 5.9 cummins for a few years.  I look forward to learning from this new forum.]]></description>
                        <content:encoded><![CDATA[<p>Hello all, I have been using the UDCpro software to tune my MM3 5.9 cummins for a few years.  I look forward to learning from this new forum.</p>]]></content:encoded>
						                            <category domain="https://www.tomelectronics.it/community/"></category>                        <dc:creator>mhennessy79</dc:creator>
                        <guid isPermaLink="true">https://www.tomelectronics.it/community/introduce-yourself/5-9-tuner-enthusiast-intro/</guid>
                    </item>
				                    <item>
                        <title> How to Create Encrypted &amp; Hardware-Locked Scripts (S/N Protection)</title>
                        <link>https://www.tomelectronics.it/community/tips-tricks-lua-scripting/tutorial-how-to-create-encrypted-hardware-locked-scripts-s-n-protection/</link>
                        <pubDate>Mon, 20 Jul 2026 06:21:48 +0000</pubDate>
                        <description><![CDATA[Hi everyone,
If you are developing custom Lua scripts for StartDiag and want to protect your intellectual property, you can easily encrypt your code and lock it so it only runs on a specifi...]]></description>
                        <content:encoded><![CDATA[<p data-path-to-node="1">Hi everyone,</p>
<p data-path-to-node="2">If you are developing custom Lua scripts for StartDiag and want to protect your intellectual property, you can easily encrypt your code and lock it so it only runs on a specific customer's hardware unit.</p>
<p data-path-to-node="3">Here is the step-by-step workflow to compile and deliver a hardware-locked script:</p>
<h3 data-path-to-node="4">1. Retrieve the Client's Serial Number (S/N)</h3>
<p data-path-to-node="5">First, your customer needs to extract their unique hardware identification. Instruct them to perform the following steps on their device:</p>
<ul data-path-to-node="6">
<li>
<p data-path-to-node="6,0,0">Navigate to: <b data-path-to-node="6,0,0" data-index-in-node="13">Main Menu -&gt; Info -&gt; StartDiag Information -&gt; Export</b>.<a title="StartDiag" href="https://www.tomelectronics.it/downloadfiles/images/sd_device_info.bmp">https://www.tomelectronics.it/downloadfiles/images/sd_device_info.bmp</a></p>
</li>
<li>
<p data-path-to-node="6,1,0">This will generate a file named <b data-path-to-node="6,1,0" data-index-in-node="32"><code data-path-to-node="6,1,0" data-index-in-node="32">SDSystem.txt</code></b> containing their unique controller details. Ask the client to send this file (or the S/N inside it) to you via email.</p>
</li>
</ul>
<h3 data-path-to-node="7">2. Develop Your Lua Script</h3>
<p data-path-to-node="8">Create and test your script using the built-in editor in the <b data-path-to-node="8" data-index-in-node="61">PC Suite</b> or your preferred external Lua IDE.</p>
<ul data-path-to-node="9">
<li>
<p data-path-to-node="9,0,0"><i data-path-to-node="9,0,0" data-index-in-node="0">Pro Tip:</i> For an extra layer of protection, you can hardcode a check inside your Lua script to verify the specific vehicle's <b data-path-to-node="9,0,0" data-index-in-node="124">VIN</b> before executing any critical diagnostic routines.</p>
</li>
</ul>
<h3 data-path-to-node="10">3. Encrypt and Lock via PC Suite Compiler</h3>
<p data-path-to-node="11">Once your code is finalized, it is time to secure it:</p>
<ul data-path-to-node="12">
<li>
<p data-path-to-node="12,0,0">Open the <b data-path-to-node="12,0,0" data-index-in-node="9">"Compiler"</b> workspace within the PC Suite.</p>
</li>
<li>
<p data-path-to-node="12,1,0">Input the customer's hardware <b data-path-to-node="12,1,0" data-index-in-node="30">S/N</b> that you received in Step 1 ("Get from file" button or type it manually).</p>
</li>
<li>
<p data-path-to-node="12,2,0">Select the output format option: <b data-path-to-node="12,2,0" data-index-in-node="33">"Controller S.N. Locked"</b>.</p>
</li>
<li>
<p data-path-to-node="12,3,0">Run the compilation process to generate the protected, encrypted file ("Export" button).<a title="PCSuite" href="https://www.tomelectronics.it/downloadfiles/images/PCSuite.jpg">https://www.tomelectronics.it/downloadfiles/images/PCSuite.jpg</a></p>
</li>
</ul>
<h3 data-path-to-node="13">4. Deliver the Script</h3>
<p data-path-to-node="14">Send the newly generated output file directly to your client.</p>
<p data-path-to-node="14"> </p>
<p data-path-to-node="15">The script is now completely secure. The raw code cannot be read or reverse-engineered, and it will <b data-path-to-node="15" data-index-in-node="100">only execute</b> on the specific StartDiag controller matching that exact Serial Number. If transferred to another device, the script <strong>will strictly refuse to run</strong>.</p>
<p data-path-to-node="15"> </p>
<p data-path-to-node="16">Feel free to reply to this thread if you have any questions about the compilation process or managing secure script deployments!</p>]]></content:encoded>
						                            <category domain="https://www.tomelectronics.it/community/"></category>                        <dc:creator>TomElectronics</dc:creator>
                        <guid isPermaLink="true">https://www.tomelectronics.it/community/tips-tricks-lua-scripting/tutorial-how-to-create-encrypted-hardware-locked-scripts-s-n-protection/</guid>
                    </item>
				                    <item>
                        <title>VIN reader script</title>
                        <link>https://www.tomelectronics.it/community/tips-tricks-lua-scripting/vin-reader-script/</link>
                        <pubDate>Thu, 16 Jul 2026 06:56:47 +0000</pubDate>
                        <description><![CDATA[The following script reads the vehicle&#039;s VIN.
You can find it inside the StartDiag&#039;s microSD card.
-- Script V1 : 26_03_30

-- This table represents the CAN IDs to be tried
local AllIDs...]]></description>
                        <content:encoded><![CDATA[<p>The following script reads the vehicle's VIN.</p>
<p>You can find it inside the StartDiag's microSD card.</p>
<pre contenteditable="false">-- Script V1 : 26_03_30

-- This table represents the CAN IDs to be tried
local AllIDs = {
    {     0x7E0,      0x7E8},
    {0x18DB33F1, 0x18DAF110},
    {0x18DA40F1, 0x18DAF140}
}

-- This table represents the list of SID, DID, begin position, end position for reading VIN
-- Remember that LUA indices start with 1, not 0 like C/C++ !!!
local reqs = {
    {0x09, 0x0002,  1+1,  1+17},
    {0x22, 0xF190,    1,    17},
    {0x22, 0xF1A0, 11+1, 11+17}
}

-- Local variables for info to user
local lastVin = "Not found!"
local remoteCanId = 0
local localCanId = 0
local vinRequest = 0
local canBitRate = 0
local canPacketPadding = true

local rc, currentBR = can.getCurrentBaudrate()
if (currentBR == 0) then
    --Ask the user here, since there is no current CAN baudrate set and validated
    currentBR = ui.inputValue('Set CAN Baudrate', 'u', 1, 500000, 500000)
end

if (currentBR == nil) then 
    error('No CAN Baudrate provided.')
end

rc = can.init(currentBR)
if (rc ~= 0) then
    error("CAN Init failed! Error: " .. rc .. " (Invalid BUS / Invalid CAN baudrate / Key off)")
end

canBitRate = currentBR

-- Loop on the defined CAN IDs
for i = 1, #AllIDs do

    local rID = AllIDs
    local lID = AllIDs

    can.setFilters(lID)
    can.enableFilters()

    -- Loop on the defined requests
    for r = 1, #reqs do
        local start = reqs
        local stop = reqs
        
        rc, data = uds.xmit(rID, reqs, reqs, "", lID, 100*3)
        if (data ~= nil) then
            local vin = string.sub(data, start, stop)
            -- If we have not enough data to read a full vin, mark the condition in the output
            if string.len(vin) &lt; 17 then
                vin = vin .. '(BAD LEN)'
            end
            -- salva le informazioni da mostrare nel messaggio all'utente            
            lastVin = vin
            remoteCanId = rID
            localCanId = lID
            vinRequest = (reqs &lt;&lt; 16) + reqs
            --canBitRate = 500000
            canPacketPadding = true
            goto endVINfind
        else
            lastVin = "Error!"
        end
        --Stop here if we have the VIN
    end
end

::endVINfind::

can.disableFilters()
can.uninit()

-- #####################
-- SHOW RESULTS --
-- #####################
local title = "VEHICLE INFORMATION"
local message = "Connected VIN#: %s\nRemote CAN ID: %08X\nLocal CAN ID: %08X\nVIN Request: %08X\nCAN Baudrate: %d\nCAN Packet Padding: %s"
local btn1Text = "EXPORT"
local btn2Text = "EXIT"
message = string.format(message, lastVin, remoteCanId, localCanId, vinRequest, canBitRate, canPacketPadding)
local result = ui.messageBox(title, message, "i", btn1Text, btn2Text)
-- Manages the possible storage of the information file
if (result == btn1Text) then
    -- Save the file
    local fileName = "Vehicle.txt"
    file = io.open(fileName, 'w')
    if (file ~= nil) then
        if (file:write(message ..'\n') ~= nil) then
            file:close()
        else
            file:close()
            file = nil
        end
    end
    -- File storage outcome management
    title = "EXPORT INFO - System"
    btn1Text = "EXIT"
    local messageType
    if (file ~= nil) then
        message = "Export info successfully.\nData save in file '%s'"
        message = string.format(message, fileName)
        messageType = "i"
    else
        message = "Export info failed!"
        messageType = "e"
    end
    ui.messageBox(title, message, messageType, btn1Text)
end</pre>]]></content:encoded>
						                            <category domain="https://www.tomelectronics.it/community/"></category>                        <dc:creator>TomElectronics</dc:creator>
                        <guid isPermaLink="true">https://www.tomelectronics.it/community/tips-tricks-lua-scripting/vin-reader-script/</guid>
                    </item>
				                    <item>
                        <title>Script to check SAE PIDs availability</title>
                        <link>https://www.tomelectronics.it/community/tips-tricks-lua-scripting/script-to-check-sae-pids-availability/</link>
                        <pubDate>Thu, 16 Jul 2026 06:53:35 +0000</pubDate>
                        <description><![CDATA[The following script gives you the ability to check which SAE PIDs are supported from your ECM.
You can find it inside the StartDiag&#039;s microSD card.
-- Script V1 : 26_03_30

-- Reference...]]></description>
                        <content:encoded><![CDATA[<p>The following script gives you the ability to check which SAE PIDs are supported from your ECM.</p>
<p>You can find it inside the StartDiag's microSD card.</p>
<pre contenteditable="false">-- Script V1 : 26_03_30

-- Reference for PIDs: https://en.wikipedia.org/wiki/OBD-II_PIDs

-- table with description for possible PIDs (makes easier to understand what the codes mean)
idToDesc = {
     = 'PIDs supported 0x01-0x20',
     = 'Monitor status since DTCs clear',
     = 'DTC that caused Freeze Frame',
     = 'Fuel system status',
     = 'Calculated engine load / %',
     = 'Engine coolant Temperature (ECT) /Â°C',
     = 'Short term fuel trim Bank 1 / %',
     = 'Long term fuel trim Bank 1 / %',
     = 'Short term fuel trim Bank 2 / %',
     = 'Long term fuel trim Bank 2 / %',
     = 'Fuel Pressure / kPa',
     = 'Intake manifold absolute pressure / kPa',
     = 'Engine speed / RPM',
     = 'Vehicle speed / km/h',
     = 'Timing advance / Â°',
     = 'Intake air temperature (IAT) / Â°C',
     = 'Air flow rate (MAF) / g/s',
     = 'Throttle position / %',
     = 'Commanded secondary air status',
     = 'Oxygen sensor present (2 banks)',
     = 'Oxygen sensor 1',
     = 'Oxygen sensor 2',
     = 'Oxygen sensor 3',
     = 'Oxygen sensor 4',
     = 'Oxygen sensor 5',
     = 'Oxygen sensor 6',
     = 'Oxygen sensor 7',
     = 'Oxygen sensor 8',
     = 'OBD standard supported',
     = 'Oxygen sensor present (4 banks)',
     = 'Aux input status',
     = 'Runtime since engine start / s',

     = 'PIDs supported 0x21-0x40',
     = 'Distance traveled since MIL on / km',
     = 'Fuel rail pressure / kPa',
     = 'Fuel rail gauge pressure / kPa',
     = 'Oxygen sensor 1',
     = 'Oxygen sensor 2',
     = 'Oxygen sensor 3',
     = 'Oxygen sensor 4',
     = 'Oxygen sensor 5',
     = 'Oxygen sensor 6',
     = 'Oxygen sensor 7',
     = 'Oxygen sensor 8',
     = 'Commanded EGR / %',
     = 'EGR error / %',
     = 'Commanded evaporative purge / %',
     = 'Fuel tank level input / %',
     = 'Warmups since codes clear',
     = 'Distance traveled since codes clear / km',
     = 'Evaporative system pressure / Pa',
     = 'Absolute barometric pressure / kPa',
     = 'Oxygen sensor 1',
     = 'Oxygen sensor 2',
     = 'Oxygen sensor 3',
     = 'Oxygen sensor 4',
     = 'Oxygen sensor 5',
     = 'Oxygen sensor 6',
     = 'Oxygen sensor 7',
     = 'Oxygen sensor 8',
     = 'Catalyst temperature: Bank 1, Sensor 1',
     = 'Catalyst temperature: Bank 2, Sensor 1',
     = 'Catalyst temperature: Bank 1, Sensor 2',
     = 'Catalyst temperature: Bank 2, Sensor 2',

     = 'PID supported 0x41-0x60',
     = 'Monitor status (this drive cycle)',
     = 'Control module voltage / V',
     = 'Absolute load value / %',
     = 'Commanded air fuel eq. ratio / %',
     = 'Relative throttle position / %',
     = 'Ambient air temperature (AAT) / Â°C',
     = 'Absolute throttle position B / %',
     = 'Absolute throttle position C / %',
     = 'Absolute throttle position D / %',
     = 'Absolute throttle position E / %',
     = 'Absolute throttle position F / %',
     = 'Commanded throttle actuator / %',
     = 'Time run with MIL on / min',
     = 'Time since DTC clear / min',
     = 'Max value for Air-fuel ration',
     = 'Maximum value fro air flo from MAF / g/s',
     = 'Fuel type',
     = 'Ethanol fuel %',
     = 'Absolute evap. system pressure / kPa',
     = 'Evap. system pressure / Pa',
     = 'Short term secondary trim',
     = 'Short term secondary trim',
     = 'Short term secondary trim',
     = 'Short term secondary trim',
     = 'Fuel rail abs. pressure / kPa',
     = 'Relative accelerator pedal position / %',
     = 'Hybrid battery pack remaining life / %',
     = 'Engine oil temperature / Â°C',
     = 'Fuel injection timing / Â°',
     = 'Engine fuel rate / L/h',
     = 'Emission requirement to which vehicle is designed',

     = 'PIDs supported 0x61-0x80',
     = 'Drivers demanded engine percentage torque / %',
     = 'Actual engine percentage torque / %',
     = 'Engine reference torque / Nm',
     = 'Engine percent torque data / %',
     = 'Aux input/output supported',
     = 'Mass air flow sensor / g/s',
     = 'Engine coolant temperature (ECT) / Â°C',
     = 'Intake air temperature sensor / Â°C',
     = 'Actual / Commanded / Error EGR',
     = 'Commanded diesel intake air flow control and relative intake air flow position',
     = 'Exhaust gas recirculation temperature',
     = 'Commanded throttle actuator control and relative throttle position',
     = 'Fuel pressure control system',
     = 'Injection pressure control system',
     = 'Turbocharger compressor inlet pressure',
     = 'Boost pressure control',
     = 'VGT control',
     = 'Wastegate control',
     = 'Exhaust pressure',
     = 'Turbocharger RPM / RPM',
     = 'Turbocharger temperature',
     = 'Turbocharger temperature',
     = 'Charge air cooler temperature',
     = 'EGT bank 1',
     = 'EGT bank 2',
     = 'DPF differential pressure',
     = 'Diesel particulate filter (DPF)',
     = 'DPF temperature',
     = 'NOx NTE control status area',
     = 'PM NTE control status area',
     = 'Engine run time',

     = 'PID supported 0x81-0xA0',
     = 'Engine run time for auxiliary emission control device (AECD)',
     = 'Engine run time for auxiliary emission control device (AECD)',
     = 'NOx sensor',
     = 'Manifold surface temperature',
     = 'NOx reagent system',
     = 'PM sensor',
     = 'Intake manifold absolute pressure',
     = 'SCR induce system',
     = 'Runtime for AECD #11-#15',
     = 'Runtime for AECD #16-#20',
     = 'Diesel aftertreatment',
     = 'O2 sensor',
     = 'Throttle position G / %',
     = 'Engine Friction - Percent torque / %',
     = 'PM sensor bank 1&amp;2',
     = 'WWH-OBD Vehicle OBD System info',
     = 'WWH-OBD Vehicle OBD System info',
     = 'Fuel control system',
     = 'WWH-OBD Vehicle OBD counters support',
     = 'NOx warning and inducement system',
     = '',
     = '',
     = '',
     = 'EGT sensor',
     = 'EGT sensor',
     = 'Hybrid/EV vehicle system data/battery/voltage',
     = 'Diesel exhaust fluid sensor data',
     = 'O2 sensor data',
     = 'Engine fuel rate / g/s',
     = 'Exhaust engine fuel rate / kg/h',
     = 'Fuel system percentage use',

     = 'PID supported 0xA1-0xC0',
     = 'NOx sensor corrected data',
     = 'Cylinder fuel rate',
     = 'Evap system vapor pressure',
     = 'Transmission actual gear',
     = 'Commanded diesel exhaust fluid dosing',
     = 'Odometer',
     = 'NOx sensor concentration sensor 3 and 4',
     = 'NOx sensor corrected concentration sensor 3 and 4',
     = 'ABS disable switch state',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',

     = 'PID supported 0xC1-0xE0',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = '',
     = ''
}

-- parameters: buffer to convert
-- return: string representing the given buffer
function hex_dump(buf)
    if buf == nil then return '' end
    local txt = ''
    for byte=1, #buf, 16 do
        local chunk = buf:sub(byte, byte+15)
        chunk:gsub('.', function (c) txt = txt .. string.format('%02X ',string.byte(c)) end)
    end
    return txt
end

-- parameters: input buffer (string of byte), position to start from, length of byte to get the number from
-- returns: number extracted / nil on errors
function readNumber(buf, pos, len)
    local val = nil
    if ((len &gt; 0) and (len &lt;= 4)) then 
        val = 0
        endpos = pos+len-1
        -- Validation of the available data respect to the passed requested length
        if (endpos &gt; #buf) then return nil  end
        for idx = pos, endpos do
            val = (val * 256) + string.byte( string.sub(buf, idx) )
        end 
    end 
    return val
end

-- parameters: U32 value to convert
-- returns: string with the bits representation
function getU32AsBinaryString(val)
  local bits = {}
  for i = 31, 0, -1 do
    local b = (val &amp; (1 &lt;&lt; i)) &gt;&gt; i
    table.insert(bits, b)
  end
  return table.concat(bits)
end

-- parameters: remoteID so send request to, lcoalID to receive the message on, filename to log data into
-- returns: nil (all the relevant work is done inside the function)
function handleSAESupportMap(rid, lid, filename)
    local rc
    local resp
    local done = false
    local DID = 0x0000
    local supCnt = 0

    -- open the log file to write to
    local fw = io.open(filename, "w")
    if (fw == nil) then
        print('We have not been able to open the log file.')
        return
    end
    
    -- it is useful to add the useful information to read the log file later
    fw:write('RemoteID = ' .. string.format('%08X', rid) .. '\n')
    fw:write('LocalID = ' .. string.format('%08X', lid) .. '\n')
    fw:write('\n')
    
    -- SAE 0x01 can be parsed in a loop fashion
    repeat
        fw:write('\nDID: ' .. string.format('%04X', DID) ..'\n')
        
        rc, resp = uds.xmit(rid, 0x01, DID, "", lid, 100)
        
        if (rc ~= 0) then
            print('Error in ECM communication: ' .. string.format('%08X', rc))
            fw:write('Error in ECM communication: ' .. string.format('%08X', rc) .. '\n')
            -- in case of communication error we stop the script altogether
            return
        end
        
        local map = readNumber(resp, 1, 4);
        fw:write( string.format('(Data:%s)  - %s\n', hex_dump(resp), map, getU32AsBinaryString(map)) )

        -- Bit position:         31, 30,  .......  ,  1,  0
        -- SAE map positions:     1,  2,  .......  , 31, 32
        for idx = 1, 32 do
            local bm = (1 &lt;&lt; (32 - idx))
            --fw:write( string.format('map = %08X\n', idx, (map &amp; bm)) )
            if (map &amp; bm) ~= 0 then
                -- bit is 1 / True
                -- NOTE: the bitmap starts with values from 1 , not 0, so the last (bit 31 == 0x20(32d))
                fw:write(string.format('%04X', (DID + idx)) .. ' is supported. ('.. idToDesc  ..') \n' )
                supCnt = supCnt + 1
            else 
                -- last bit is 0 / False -&gt; no more component of the SAE bitmap
                if idx == 32 then done = true end
            end
        end
        
        -- prepare the DID to get the next SAE supported map part
        DID = DID + 0x20
        
        -- safe clean condition: single byte request DID is used by SID 0x01
        if DID &gt; 0xFF then done = true end
        
    until done == true
    
    print('Found ' .. supCnt .. ' SAE PID supported by request at 0x01')
    fw:write('\n\nFound ' .. supCnt .. ' SAE PID supported by request at 0x01\n')
    
    fw:close()
end


print('START...')

print('Turn Key ON for testing..')

ui.sleep(100*5) --sleep 5 secs

local rc, currentBR = can.getCurrentBaudrate()
if (currentBR == 0) then
    --Ask the user here, since there is no current CAN baudrate set and validated
    currentBR = ui.inputValue('Set CAN Baudrate', 'u', 1, 500000, 500000)
end

if (currentBR == nil) then 
    error('No CAN Baudrate provided.')
end

rc = can.init(currentBR)
if (rc ~= 0) then
    error("CAN Init failed! Error: " .. rc .. " (Invalid BUS / Invalid CAN baudrate / Key off)")
end

can.disableFilters()

can.startLog('OBDTLog.log')

ui.sleep(100*5) --sleep 5 secs

print('Testing 7E0-7E8')
handleSAESupportMap(0x7E0, 0x7E8, '7E07E8.txt')

ui.sleep(100*5) --sleep 5 secs

print('Testing 0x18DB33F1-0x18DAF110')
handleSAESupportMap(0x18DB33F1, 0x18DAF110, '18DB33F1.txt')

ui.sleep(100*5) --sleep 5 secs

-- test for FIAT
print('Testing 0x18DA40F1-0x18DAF140')
handleSAESupportMap(0x18DA40F1, 0x18DAF140, '18DA40F1.txt')

print('Turn Key OFF for testing..')

ui.sleep(100*5) --sleep 5 secs

can.stopLog()

can.enableFilters()
can.uninit()

print('DONE.')</pre>]]></content:encoded>
						                            <category domain="https://www.tomelectronics.it/community/"></category>                        <dc:creator>TomElectronics</dc:creator>
                        <guid isPermaLink="true">https://www.tomelectronics.it/community/tips-tricks-lua-scripting/script-to-check-sae-pids-availability/</guid>
                    </item>
				                    <item>
                        <title>BMW x5 50e SoC</title>
                        <link>https://www.tomelectronics.it/community/tips-tricks-lua-scripting/bmw-x5-50e-soc/</link>
                        <pubDate>Mon, 13 Jul 2026 07:28:44 +0000</pubDate>
                        <description><![CDATA[Example on getting precise State of Charge (SoC) data from the Battery Management System (SME) on a BMW X5 50e (G-Series).
Notes:


Addressing: If you get a timeout on 0x792/0x79A, your ...]]></description>
                        <content:encoded><![CDATA[<p>Example on getting precise State of Charge (SoC) data from the Battery Management System (SME) on a BMW X5 50e (G-Series).</p>
<p data-path-to-node="8"><b data-path-to-node="8" data-index-in-node="0">Notes:</b></p>
<ul data-path-to-node="9">
<li>
<p data-path-to-node="9,0,0"><b data-path-to-node="9,0,0" data-index-in-node="0">Addressing:</b> If you get a timeout on <code data-path-to-node="9,0,0" data-index-in-node="36">0x792/0x79A</code>, your specific model/firmware might use different IDs. Try sniffing the bus while the car is active to verify your transmission IDs.</p>
</li>
<li>
<p data-path-to-node="9,1,0"><b data-path-to-node="9,1,0" data-index-in-node="0">Safety:</b> Always ensure the vehicle is in a safe state. Do not run active diagnostic scripts while the vehicle is in motion.</p>
</li>
</ul>
<p>Below is the Lua script:</p>
<pre contenteditable="false">-- CAN Init (Best Practice)
local rc, currentBR = can.getCurrentBaudrate()
if (currentBR == 0) then
    currentBR = ui.inputValue('Set CAN Baudrate', 'u', 1, 1000000, 500000)

    if (currentBR == nil) then error('No baudrate was given, script terminated.') end
end

rc = can.init(currentBR, true) -- forceActive = true for secutiry
if (rc ~= 0) then
    error("CAN Init failed! Error: " .. rc)
end

local RID = 0x792
local LID = 0x79A
local DID = 0x4170
local timeout = 100

-- 1. Extended session request
rc = uds.xmit(RID, 0x10, 0x03, "", LID, 50, true)
if (rc ~= 0) then
    error("Extended session failed! Error: " .. rc)
end

-- 2. Little pause for the ECU to enter state
ui.sleep(10)

-- Tester Present
rc = uds.xmit(RID, 0x3E, 0x00, "", LID, 50, true)
if (rc ~= 0) then
    error("Tester Present failed! Error: " .. rc)
end

-- 3. SoC request
rc, data = uds.xmit(RID, 0x22, DID, "", LID, timeout, true)

if rc == 0 then
    local soc_val = string.byte(data, 1)
    print("SoC: " .. tostring(soc_val) .. "%")
else
    print("SoC failed! Error: " .. tostring(rc))
end

can.uninit()</pre>]]></content:encoded>
						                            <category domain="https://www.tomelectronics.it/community/"></category>                        <dc:creator>TomElectronics</dc:creator>
                        <guid isPermaLink="true">https://www.tomelectronics.it/community/tips-tricks-lua-scripting/bmw-x5-50e-soc/</guid>
                    </item>
				                    <item>
                        <title>RAM Cummins PickUp/CC / 2007.5 - Present / 6.7l Diesel</title>
                        <link>https://www.tomelectronics.it/community/dodge/ram-cummins-pickup-cc-2007-5-present-6-7l-diesel/</link>
                        <pubDate>Thu, 02 Jul 2026 07:10:47 +0000</pubDate>
                        <description><![CDATA[Last Update: 2026-07-02
Brand: DODGE
Model: RAM Cummins PickUp/CC
Year And Engine: 2007.5-Present 6.7l Diesel
&nbsp;
VIN Reading Status
Can we read the VIN: YES

Remote ID: 7E0 / Loc...]]></description>
                        <content:encoded><![CDATA[<p>Last Update: 2026-07-02</p>
<h3><strong>Brand:</strong> <span class="placeholder-brand">DODGE</span></h3>
<h3><strong>Model:</strong> <span class="placeholder-model">RAM Cummins PickUp/CC</span></h3>
<h3><strong>Year And Engine:</strong> <span class="placeholder-model">2007.5-Present 6.7l Diesel</span></h3>
<p>&nbsp;</p>
<h3>VIN Reading Status</h3>
<p>Can we read the VIN: <strong>YES</strong></p>
<ul>
<li>Remote ID: 7E0 / Local ID: 7E8</li>
<li>Service ID: 09</li>
<li>DID: 0002</li>
</ul>
<p>&nbsp;</p>
<h3>SAE PID Reading Status</h3>
<p>Can we read SAE PIDs: <strong>YES</strong></p>
<ul>
<li>Remote ID: 7E0 / Local ID: 7E8</li>
</ul>
<p>&nbsp;</p>
<h3>Other Info</h3>]]></content:encoded>
						                            <category domain="https://www.tomelectronics.it/community/"></category>                        <dc:creator>StartDiag</dc:creator>
                        <guid isPermaLink="true">https://www.tomelectronics.it/community/dodge/ram-cummins-pickup-cc-2007-5-present-6-7l-diesel/</guid>
                    </item>
				                    <item>
                        <title>RAM Cummins PickUp / 2006.0-2007.0 / 5.9l Diesel</title>
                        <link>https://www.tomelectronics.it/community/dodge/ram-cummins-pickup-2006-0-2007-0-5-9l-diesel/</link>
                        <pubDate>Thu, 02 Jul 2026 07:09:40 +0000</pubDate>
                        <description><![CDATA[Last Update: 2026-07-02
Brand: DODGE
Model: RAM Cummins PickUp
Year And Engine: 2006.0-2007.0 5.9l Diesel
&nbsp;
VIN Reading Status
Can we read the VIN: YES

Remote ID: 7E0 / Local I...]]></description>
                        <content:encoded><![CDATA[<p>Last Update: 2026-07-02</p>
<h3><strong>Brand:</strong> <span class="placeholder-brand">DODGE</span></h3>
<h3><strong>Model:</strong> <span class="placeholder-model">RAM Cummins PickUp</span></h3>
<h3><strong>Year And Engine:</strong> <span class="placeholder-model">2006.0-2007.0 5.9l Diesel</span></h3>
<p>&nbsp;</p>
<h3>VIN Reading Status</h3>
<p>Can we read the VIN: <strong>YES</strong></p>
<ul>
<li>Remote ID: 7E0 / Local ID: 7E8</li>
<li>Service ID: 09</li>
<li>DID: 0002</li>
</ul>
<p>&nbsp;</p>
<h3>SAE PID Reading Status</h3>
<p>Can we read SAE PIDs: <strong>YES</strong></p>
<ul>
<li>Remote ID: 7E0 / Local ID: 7E8</li>
</ul>
<p>&nbsp;</p>
<h3>Other Info</h3>]]></content:encoded>
						                            <category domain="https://www.tomelectronics.it/community/"></category>                        <dc:creator>StartDiag</dc:creator>
                        <guid isPermaLink="true">https://www.tomelectronics.it/community/dodge/ram-cummins-pickup-2006-0-2007-0-5-9l-diesel/</guid>
                    </item>
				                    <item>
                        <title>MITO / 2012 / 1.4l Gasoline</title>
                        <link>https://www.tomelectronics.it/community/alfa-romeo/mito-2012-1-4l-gasoline/</link>
                        <pubDate>Thu, 02 Jul 2026 07:08:47 +0000</pubDate>
                        <description><![CDATA[Last Update: 2026-07-02
Brand: ALFA ROMEO
Model: MITO
Year And Engine: 2012 1.4l Gasoline
&nbsp;
VIN Reading Status
Can we read the VIN: YES

Remote ID: 18DA40F1 / Local ID: 18DAF140...]]></description>
                        <content:encoded><![CDATA[<p>Last Update: 2026-07-02</p>
<h3><strong>Brand:</strong> <span class="placeholder-brand">ALFA ROMEO</span></h3>
<h3><strong>Model:</strong> <span class="placeholder-model">MITO</span></h3>
<h3><strong>Year And Engine:</strong> <span class="placeholder-model">2012 1.4l Gasoline</span></h3>
<p>&nbsp;</p>
<h3>VIN Reading Status</h3>
<p>Can we read the VIN: <strong>YES</strong></p>
<ul>
<li>Remote ID: 18DA40F1 / Local ID: 18DAF140</li>
<li>Service ID: 22</li>
<li>DID: F190</li>
</ul>
<p>&nbsp;</p>
<h3>SAE PID Reading Status</h3>
<p>Can we read SAE PIDs: <strong>YES</strong></p>
<ul>
<li>Remote ID: 18DB33F1 / Local ID: 18DAF110</li>
</ul>
<p>&nbsp;</p>
<h3>Other Info</h3>]]></content:encoded>
						                            <category domain="https://www.tomelectronics.it/community/"></category>                        <dc:creator>StartDiag</dc:creator>
                        <guid isPermaLink="true">https://www.tomelectronics.it/community/alfa-romeo/mito-2012-1-4l-gasoline/</guid>
                    </item>
				                    <item>
                        <title>CLIO / 2014 / 1.5l Diesel</title>
                        <link>https://www.tomelectronics.it/community/renault/clio-2014-1-5l-diesle/</link>
                        <pubDate>Wed, 01 Jul 2026 14:07:48 +0000</pubDate>
                        <description><![CDATA[Last Update: 2026-07-01
Brand:RENAULT
Model:CLIO
Year And Engine:2014 1.5l Diesel
&nbsp;
VIN Reading Status
Can we read the VIN: YES

Remote ID: 7E0 / Local ID: 7E8
Service ID: 22
...]]></description>
                        <content:encoded><![CDATA[<p>Last Update: 2026-07-01</p>
<h3><strong>Brand:</strong><span class="placeholder-brand">RENAULT</span></h3>
<h3><strong>Model:</strong><span class="placeholder-model">CLIO</span></h3>
<h3><strong>Year And Engine:</strong><span class="placeholder-model">2014 1.5l Diesel</span></h3>
<p>&nbsp;</p>
<h3>VIN Reading Status</h3>
<p>Can we read the VIN: <strong>YES</strong></p>
<ul>
<li>Remote ID: 7E0 / Local ID: 7E8</li>
<li>Service ID: 22</li>
<li>DID: F190</li>
</ul>
<p>&nbsp;</p>
<h3>SAE PID Reading Status</h3>
<p>Can we read SAE PIDs: <strong>YES</strong></p>
<ul>
<li>Remote ID: 7E0 / Local ID: 7E8</li>
</ul>
<p>&nbsp;</p>
<h3>Other Info</h3>]]></content:encoded>
						                            <category domain="https://www.tomelectronics.it/community/"></category>                        <dc:creator>StartDiag</dc:creator>
                        <guid isPermaLink="true">https://www.tomelectronics.it/community/renault/clio-2014-1-5l-diesle/</guid>
                    </item>
							        </channel>
        </rss>
		