<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../XSLT/decoder.xsl"?>
<!-- Copyright (C) JMRI 2022, 2023, 2024 All rights reserved                      -->
<!--                                                                        -->
<!-- JMRI is free software; you can redistribute it and/or modify it under  -->
<!-- the terms of version 2 of the GNU General Public License as published  -->
<!-- by the Free Software Foundation. See the "COPYING" file for a copy     -->
<!-- of this license.                                                       -->
<!--                                                                        -->
<!-- JMRI is distributed in the hope that it will be useful, but WITHOUT    -->
<!-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or  -->
<!-- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License  -->
<!-- for more details.                                                      -->
<decoder-config xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://jmri.org/xml/schema/decoder-4-15-2.xsd">
    <version author="Ulrich Gerlach" version="1" lastUpdated="2024-04-01"/>
    <!-- Version 1 - Only for Piko SUSI Light Controller KM ML4000 -->
    <version author="Ulrich Gerlach" version="2" lastUpdated="2026-03-26"/>
    <!-- Version 2 - added more LC2 types -->
    <!-- WARNING: output names fully linked to function mapping include file - do not change independently -->
    <decoder>
        <family name="PIKO SUSI Lichtcontroller V2" mfg="PIKO" lowVersionID="0" highVersionID="29" comment="Decoders not sorted (necessarily) in numerical order">
            <!-- to be checked by hardware owner -->
            <model show="yes" model="PIKO SUSI LC2" numOuts="22" numFns="31" maxMotorCurrent="1.0A" formFactor="N" connector="SUSI" productID="LC2" comment="Piko SUSI Lichtcontroller V2">
                <output name="1" label="LC_A1" connection="wire" maxcurrent="50 mA"/>
                <output name="2" label="LC-A2" connection="wire" maxcurrent="50 mA"/>
                <output name="3" label="LC-A3" connection="wire" maxcurrent="50 mA"/>
                <output name="4" label="LC-A4" connection="wire" maxcurrent="50 mA"/>
                <output name="5" label="LC-A5" connection="wire" maxcurrent="50 mA"/>
                <output name="6" label="LC-A6" connection="wire" maxcurrent="50 mA"/>
                <output name="7" label="LC-A7" connection="wire" maxcurrent="50 mA"/>
                <output name="8" label="LC-A8" connection="wire" maxcurrent="50 mA"/>
                <output name="9" label="LC-A9" connection="wire" maxcurrent="50 mA"/>
                <output name="10" label="LC-A10" connection="wire" maxcurrent="50 mA"/>
                <output name="11" label="LC-A11" connection="wire" maxcurrent="50 mA"/>
                <output name="12" label="LC-A12" connection="wire" maxcurrent="50 mA"/>
                <output name="13" label="LC-A13" connection="wire" maxcurrent="50 mA"/>
                <output name="14" label="LC-A14" connection="wire" maxcurrent="50 mA"/>
                <output name="15" label="LC-A15" connection="wire" maxcurrent="50 mA"/>
                <output name="16" label="LC-A16" connection="wire" maxcurrent="50 mA"/>
                <output name="17" label="LC-A17" connection="wire" maxcurrent="50 mA"/>
                <output name="18" label="LC-A18" connection="wire" maxcurrent="50 mA"/>
                <output name="19" label="LC-A19" connection="wire" maxcurrent="50 mA"/>
                <output name="20" label="LC-A20" connection="wire" maxcurrent="50 mA"/>
                <output name="21" label="LC-A21" connection="wire" maxcurrent="50 mA"/>
                <output name="22" label="LC-A22" connection="wire" maxcurrent="50 mA"/>
                <size length="1" width="1" height="1" units="mm"/>
            </model>
            <model show="yes" model="PIKO SUSI LC2 DE 18-H0" numOuts="22" numFns="31" maxMotorCurrent="1.0A" formFactor="N" connector="SUSI" productID="LC2" comment="Piko DE 18 SUSI Lichtcontroller V2">
                <output name="1" label="LC_A1" connection="wire" maxcurrent="50 mA"/>
                <output name="2" label="LC-A2" connection="wire" maxcurrent="50 mA"/>
                <output name="3" label="LC-A3" connection="wire" maxcurrent="50 mA"/>
                <output name="4" label="LC-A4" connection="wire" maxcurrent="50 mA"/>
                <output name="5" label="LC-A5" connection="wire" maxcurrent="50 mA"/>
                <output name="6" label="LC-A6" connection="wire" maxcurrent="50 mA"/>
                <output name="7" label="LC-A7" connection="wire" maxcurrent="50 mA"/>
                <output name="8" label="LC-A8" connection="wire" maxcurrent="50 mA"/>
                <output name="9" label="LC-A9" connection="wire" maxcurrent="50 mA"/>
                <output name="10" label="LC-A10" connection="wire" maxcurrent="50 mA"/>
                <output name="11" label="LC-A11" connection="wire" maxcurrent="50 mA"/>
                <output name="12" label="LC-A12" connection="wire" maxcurrent="50 mA"/>
                <output name="13" label="LC-A13" connection="wire" maxcurrent="50 mA"/>
                <output name="14" label="LC-A14" connection="wire" maxcurrent="50 mA"/>
                <output name="15" label="LC-A15" connection="wire" maxcurrent="50 mA"/>
                <output name="16" label="LC-A16" connection="wire" maxcurrent="50 mA"/>
                <output name="17" label="LC-A17" connection="wire" maxcurrent="50 mA"/>
                <output name="18" label="LC-A18" connection="wire" maxcurrent="50 mA"/>
                <output name="19" label="LC-A19" connection="wire" maxcurrent="50 mA"/>
                <output name="20" label="LC-A20" connection="wire" maxcurrent="50 mA"/>
                <output name="21" label="LC-A21" connection="wire" maxcurrent="50 mA"/>
                <output name="22" label="LC-A22" connection="wire" maxcurrent="50 mA"/>
                <size length="1" width="1" height="1" units="mm"/>
            </model>
            <model show="yes" model="PIKO SUSI LC2 BR 249-H0" numOuts="22" numFns="31" maxMotorCurrent="1.0A" formFactor="N" connector="SUSI" productID="LC2" comment="Piko BR 249 SUSI Lichtcontroller V2">
                <output name="1" label="LC_A1" connection="wire" maxcurrent="50 mA"/>
                <output name="2" label="LC-A2" connection="wire" maxcurrent="50 mA"/>
                <output name="3" label="LC-A3" connection="wire" maxcurrent="50 mA"/>
                <output name="4" label="LC-A4" connection="wire" maxcurrent="50 mA"/>
                <output name="5" label="LC-A5" connection="wire" maxcurrent="50 mA"/>
                <output name="6" label="LC-A6" connection="wire" maxcurrent="50 mA"/>
                <output name="7" label="LC-A7" connection="wire" maxcurrent="50 mA"/>
                <output name="8" label="LC-A8" connection="wire" maxcurrent="50 mA"/>
                <output name="9" label="LC-A9" connection="wire" maxcurrent="50 mA"/>
                <output name="10" label="LC-A10" connection="wire" maxcurrent="50 mA"/>
                <output name="11" label="LC-A11" connection="wire" maxcurrent="50 mA"/>
                <output name="12" label="LC-A12" connection="wire" maxcurrent="50 mA"/>
                <output name="13" label="LC-A13" connection="wire" maxcurrent="50 mA"/>
                <output name="14" label="LC-A14" connection="wire" maxcurrent="50 mA"/>
                <output name="15" label="LC-A15" connection="wire" maxcurrent="50 mA"/>
                <output name="16" label="LC-A16" connection="wire" maxcurrent="50 mA"/>
                <output name="17" label="LC-A17" connection="wire" maxcurrent="50 mA"/>
                <output name="18" label="LC-A18" connection="wire" maxcurrent="50 mA"/>
                <output name="19" label="LC-A19" connection="wire" maxcurrent="50 mA"/>
                <output name="20" label="LC-A20" connection="wire" maxcurrent="50 mA"/>
                <output name="21" label="LC-A21" connection="wire" maxcurrent="50 mA"/>
                <output name="22" label="LC-A22" connection="wire" maxcurrent="50 mA"/>
                <size length="1" width="1" height="1" units="mm"/>
            </model>
            <model show="yes" model="PIKO SUSI LC2 D.445-H0" numOuts="22" numFns="31" maxMotorCurrent="1.0A" formFactor="N" connector="SUSI" productID="LC2" comment="Piko D.445 SUSI Lichtcontroller V2">
                <output name="1" label="LC_A1" connection="wire" maxcurrent="50 mA"/>
                <output name="2" label="LC-A2" connection="wire" maxcurrent="50 mA"/>
                <output name="3" label="LC-A3" connection="wire" maxcurrent="50 mA"/>
                <output name="4" label="LC-A4" connection="wire" maxcurrent="50 mA"/>
                <output name="5" label="LC-A5" connection="wire" maxcurrent="50 mA"/>
                <output name="6" label="LC-A6" connection="wire" maxcurrent="50 mA"/>
                <output name="7" label="LC-A7" connection="wire" maxcurrent="50 mA"/>
                <output name="8" label="LC-A8" connection="wire" maxcurrent="50 mA"/>
                <output name="9" label="LC-A9" connection="wire" maxcurrent="50 mA"/>
                <output name="10" label="LC-A10" connection="wire" maxcurrent="50 mA"/>
                <output name="11" label="LC-A11" connection="wire" maxcurrent="50 mA"/>
                <output name="12" label="LC-A12" connection="wire" maxcurrent="50 mA"/>
                <output name="13" label="LC-A13" connection="wire" maxcurrent="50 mA"/>
                <output name="14" label="LC-A14" connection="wire" maxcurrent="50 mA"/>
                <output name="15" label="LC-A15" connection="wire" maxcurrent="50 mA"/>
                <output name="16" label="LC-A16" connection="wire" maxcurrent="50 mA"/>
                <output name="17" label="LC-A17" connection="wire" maxcurrent="50 mA"/>
                <output name="18" label="LC-A18" connection="wire" maxcurrent="50 mA"/>
                <output name="19" label="LC-A19" connection="wire" maxcurrent="50 mA"/>
                <output name="20" label="LC-A20" connection="wire" maxcurrent="50 mA"/>
                <output name="21" label="LC-A21" connection="wire" maxcurrent="50 mA"/>
                <output name="22" label="LC-A22" connection="wire" maxcurrent="50 mA"/>
                <size length="1" width="1" height="1" units="mm"/>
            </model>
            <model show="no" model="PIKO ML4000 SUSI LC2" numOuts="22" numFns="31" maxMotorCurrent="1.0A" formFactor="N" connector="SUSI" productID="PIKO_ML4000_SUSI_LC2" comment="Piko ML 4000 SUSI Lichtcontroller V2" replacementModel="PIKO SUSI LC2 ML 4000-H0" replacementFamily="query:PIKO SUSI Lichtcontroller V2">
                <output name="1" label="LC_A1" connection="wire" maxcurrent="50 mA"/>
                <output name="2" label="LC-A2" connection="wire" maxcurrent="50 mA"/>
                <output name="3" label="LC-A3" connection="wire" maxcurrent="50 mA"/>
                <output name="4" label="LC-A4" connection="wire" maxcurrent="50 mA"/>
                <output name="5" label="LC-A5" connection="wire" maxcurrent="50 mA"/>
                <output name="6" label="LC-A6" connection="wire" maxcurrent="50 mA"/>
                <output name="7" label="LC-A7" connection="wire" maxcurrent="50 mA"/>
                <output name="8" label="LC-A8" connection="wire" maxcurrent="50 mA"/>
                <output name="9" label="LC-A9" connection="wire" maxcurrent="50 mA"/>
                <output name="10" label="LC-A10" connection="wire" maxcurrent="50 mA"/>
                <output name="11" label="LC-A11" connection="wire" maxcurrent="50 mA"/>
                <output name="12" label="LC-A12" connection="wire" maxcurrent="50 mA"/>
                <output name="13" label="LC-A13" connection="wire" maxcurrent="50 mA"/>
                <output name="14" label="LC-A14" connection="wire" maxcurrent="50 mA"/>
                <output name="15" label="LC-A15" connection="wire" maxcurrent="50 mA"/>
                <output name="16" label="LC-A16" connection="wire" maxcurrent="50 mA"/>
                <output name="17" label="LC-A17" connection="wire" maxcurrent="50 mA"/>
                <output name="18" label="LC-A18" connection="wire" maxcurrent="50 mA"/>
                <output name="19" label="LC-A19" connection="wire" maxcurrent="50 mA"/>
                <output name="20" label="LC-A20" connection="wire" maxcurrent="50 mA"/>
                <output name="21" label="LC-A21" connection="wire" maxcurrent="50 mA"/>
                <output name="22" label="LC-A22" connection="wire" maxcurrent="50 mA"/>
                <size length="1" width="1" height="1" units="mm"/>
                <functionlabels>
                    <functionlabel num="0" lockable="true">
                        <text>Headlights</text>
                        <text xml:lang="de">Spitzenlicht</text>
                    </functionlabel>
                    <functionlabel num="1" lockable="true"> </functionlabel>
                    <functionlabel num="2" lockable="true"> </functionlabel>
                    <functionlabel num="3" lockable="false"> </functionlabel>
                    <functionlabel num="4" lockable="false"> </functionlabel>
                    <functionlabel num="5" lockable="false"> </functionlabel>
                    <functionlabel num="6" lockable="false"> </functionlabel>
                    <functionlabel num="7" lockable="true">Headlight Dimmer</functionlabel>
                    <functionlabel num="8" lockable="false"> </functionlabel>
                    <functionlabel num="9" lockable="false">Indicators + Markers Lights (multi steps)</functionlabel>
                    <functionlabel num="10" lockable="true">Dual White Gyralite</functionlabel>
                    <functionlabel num="11" lockable="true">Red Gyralite</functionlabel>
                    <functionlabel num="12" lockable="true"> </functionlabel>
                    <functionlabel num="13" lockable="true">Cab Interior Light</functionlabel>
                    <functionlabel num="14" lockable="true">Engine Room Light</functionlabel>
                    <functionlabel num="15" lockable="false">Lighting Double Traction (multi steps)</functionlabel>
                    <functionlabel num="16" lockable="false"> </functionlabel>
                    <functionlabel num="17" lockable="true"> </functionlabel>
                    <functionlabel num="18" lockable="true"> </functionlabel>
                    <functionlabel num="19" lockable="true"> </functionlabel>
                    <functionlabel num="20" lockable="true"> </functionlabel>
                    <functionlabel num="21" lockable="false"> </functionlabel>
                    <functionlabel num="22" lockable="false"> </functionlabel>
                    <functionlabel num="23" lockable="false"> </functionlabel>
                    <functionlabel num="24" lockable="true"> </functionlabel>
                    <functionlabel num="25" lockable="true">Control Stand Light</functionlabel>
                    <functionlabel num="26" lockable="false"> </functionlabel>
                    <functionlabel num="27" lockable="true"> </functionlabel>
                    <functionlabel num="28" lockable="true"> m </functionlabel>
                </functionlabels>
            </model>
            <model show="yes" model="PIKO SUSI LC2 ML 4000-H0" numOuts="22" numFns="31" maxMotorCurrent="1.0A" formFactor="N" connector="SUSI" productID="LC2_ML4000-H0" comment="Piko ML 4000 SUSI Lichtcontroller V2 (XP5.1)">
                <output name="1" label="LC_A1" connection="wire" maxcurrent="50 mA"/>
                <output name="2" label="LC-A2" connection="wire" maxcurrent="50 mA"/>
                <output name="3" label="LC-A3" connection="wire" maxcurrent="50 mA"/>
                <output name="4" label="LC-A4" connection="wire" maxcurrent="50 mA"/>
                <output name="5" label="LC-A5" connection="wire" maxcurrent="50 mA"/>
                <output name="6" label="LC-A6" connection="wire" maxcurrent="50 mA"/>
                <output name="7" label="LC-A7" connection="wire" maxcurrent="50 mA"/>
                <output name="8" label="LC-A8" connection="wire" maxcurrent="50 mA"/>
                <output name="9" label="LC-A9" connection="wire" maxcurrent="50 mA"/>
                <output name="10" label="LC-A10" connection="wire" maxcurrent="50 mA"/>
                <output name="11" label="LC-A11" connection="wire" maxcurrent="50 mA"/>
                <output name="12" label="LC-A12" connection="wire" maxcurrent="50 mA"/>
                <output name="13" label="LC-A13" connection="wire" maxcurrent="50 mA"/>
                <output name="14" label="LC-A14" connection="wire" maxcurrent="50 mA"/>
                <output name="15" label="LC-A15" connection="wire" maxcurrent="50 mA"/>
                <output name="16" label="LC-A16" connection="wire" maxcurrent="50 mA"/>
                <output name="17" label="LC-A17" connection="wire" maxcurrent="50 mA"/>
                <output name="18" label="LC-A18" connection="wire" maxcurrent="50 mA"/>
                <output name="19" label="LC-A19" connection="wire" maxcurrent="50 mA"/>
                <output name="20" label="LC-A20" connection="wire" maxcurrent="50 mA"/>
                <output name="21" label="LC-A21" connection="wire" maxcurrent="50 mA"/>
                <output name="22" label="LC-A22" connection="wire" maxcurrent="50 mA"/>
                <size length="1" width="1" height="1" units="mm"/>
                <functionlabels>
                    <functionlabel num="0" lockable="true">
                        <text>Headlights</text>
                        <text xml:lang="de">Spitzenlicht</text>
                    </functionlabel>
                    <functionlabel num="1" lockable="true"> </functionlabel>
                    <functionlabel num="2" lockable="true"> </functionlabel>
                    <functionlabel num="3" lockable="false"> </functionlabel>
                    <functionlabel num="4" lockable="false"> </functionlabel>
                    <functionlabel num="5" lockable="false"> </functionlabel>
                    <functionlabel num="6" lockable="false"> </functionlabel>
                    <functionlabel num="7" lockable="true">Headlight Dimmer</functionlabel>
                    <functionlabel num="8" lockable="false"> </functionlabel>
                    <functionlabel num="9" lockable="false">Indicators + Markers Lights (multi steps)</functionlabel>
                    <functionlabel num="10" lockable="true">Dual White Gyralite</functionlabel>
                    <functionlabel num="11" lockable="true">Red Gyralite</functionlabel>
                    <functionlabel num="12" lockable="true"> </functionlabel>
                    <functionlabel num="13" lockable="true">Cab Interior Light</functionlabel>
                    <functionlabel num="14" lockable="true">Engine Room Light</functionlabel>
                    <functionlabel num="15" lockable="false">Lighting Double Traction (multi steps)</functionlabel>
                    <functionlabel num="16" lockable="false"> </functionlabel>
                    <functionlabel num="17" lockable="true"> </functionlabel>
                    <functionlabel num="18" lockable="true"> </functionlabel>
                    <functionlabel num="19" lockable="true"> </functionlabel>
                    <functionlabel num="20" lockable="true"> </functionlabel>
                    <functionlabel num="21" lockable="false"> </functionlabel>
                    <functionlabel num="22" lockable="false"> </functionlabel>
                    <functionlabel num="23" lockable="false"> </functionlabel>
                    <functionlabel num="24" lockable="true"> </functionlabel>
                    <functionlabel num="25" lockable="true">Control Stand Light</functionlabel>
                    <functionlabel num="26" lockable="false"> </functionlabel>
                    <functionlabel num="27" lockable="true"> </functionlabel>
                    <functionlabel num="28" lockable="true"> m </functionlabel>
                </functionlabels>
            </model>
        </family>
        <programming direct="yes" paged="no" register="no" ops="yes">
            <capability>
                <name>Indexed CV access</name>
                <parameter name="PI">1021</parameter>
                <parameter name="cvFirst">true</parameter>
            </capability>
            <capability>
                <name>Ops Mode Delayed Programming</name>
                <parameter name="Delay">1000</parameter>
            </capability>
        </programming>
        <variables>
            <!-- CV 1, 17, 29 bit 5 -->
            <xi:include href="http://jmri.org/xml/decoders/nmra/shortAndLongAddress.xml"/>
            <variable item="Manufacturer" CV="980.1021=0" readOnly="yes" default="162">
                <decVal/>
                <label>"Manufacturer ID:" </label>
                <label xml:lang="it">ID Costruttore: </label>
                <label xml:lang="fr">ID constructeur: </label>
                <label xml:lang="de">Hersteller ID: </label>
                <label xml:lang="nl">Fabrikant-ID: </label>
                <label xml:lang="cs">ID výrobce: </label>
            </variable>
            <variable item="Decoder Version" CV="981.1021=0" readOnly="yes" default="2">
                <decVal/>
                <label>Manufacturer Version No: </label>
                <label xml:lang="it">Versione Decoder: </label>
                <label xml:lang="fr">Version décodeur: </label>
                <label xml:lang="de">Decoder Version: </label>
                <label xml:lang="nl">Versie van decoder: </label>
                <label xml:lang="cs">Verze dekodéru: </label>
            </variable>
            <!-- Interner Lichtdecoder CV897 - 1024 -->
            <xi:include href="http://jmri.org/xml/decoders/piko/cv897-1024_LC2_v5.1.xml"/>
        </variables>
        <resets>
            <factReset label="Reset Default SUSI Light Controller" CV="1019.1021=0" default="255">
                <label xml:lang="de">Reset Werkseinstellungen SUSI Lichtdecoder (CV1019 = 255)</label>
                <label xml:lang="cs">Reset</label>
            </factReset>
            <factReset label="Outputs Test Mode" CV="1018.1021=0" default="128">
                <label xml:lang="de">Test Modus: Alle Ausgänge ein- und ausschalten (CV1018 = 128)</label>
                <label xml:lang="cs">Test</label>
            </factReset>
        </resets>
    </decoder>
    <!-- special panes -->
    <xi:include href="http://jmri.org/xml/decoders/piko/PanePikoLichtDecoder_LC2_v5.1.xml"/>
</decoder-config>

