<?xml version="1.0"?>
<!-- Test Modbus related information -->
<APC_DDF
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:noNamespaceSchemaLocation="http://localhost/ddf_schema/apc_ddf_1_6.xsd"
	ddfid="generac_generator_gpanel_2_Gens"
	ddfname="Generac Generator (MPS Control Panel) 2 Generators"
	ddfversion="3"
	canremove="yes">
  <schemaVersion>1.6</schemaVersion>

  <device deviceid="generac_generator">
      <oidMustExist ruleid="modbusdevicetest" oid="MODBUS_OID_MUST_EXIST"/>

      <setProductData ruleid="vendordata" field="vendor">Generac</setProductData>
      <setProductData ruleid="modeldata" field="model">MPS Digital Control Panel</setProductData>
      <setProductData ruleid="typedata" field="type">Generator</setProductData>

      <setDefaultLabel ruleid="labeldata"><sysHostname/> - Slave <commSetting field="slaveaddress"/></setDefaultLabel>
      
	    <!-- Generator 1 sensor section -->
	  
		<numSensor ruleid="oiltemp">
			<type>temp</type>
			<sensorId>GEN0_OILTEMP</sensorId>
			<value>
				<getOid>gen0oiltemp</getOid>
			</value>
			<label>Gen 1 Oil Temperature</label>
			<sensorSet>Generator Sensors</sensorSet>
		</numSensor>
		<numSensor ruleid="coolanttemp">
			<type>temp</type>
			<sensorId>GEN0_COOLANTTEMP</sensorId>
			<value>
				<getOid>gen0coolanttemp</getOid>
			</value>
			<label>Gen 1 Coolant Temperature</label>
			<sensorSet>Generator Sensors</sensorSet>
		</numSensor>
		<numSensor ruleid="oilpressure">
			<type>pressure</type>
			<sensorId>GEN0_OILPRESSURE</sensorId>
			<value>
				<getOid>gen0oilpressure</getOid>
			</value>
			<label>Gen 1 Oil Pressure</label>
			<sensorSet>Generator Sensors</sensorSet>
		</numSensor>
		<numSensor ruleid="coolantlevel">
			<type>pctofcapacity</type>
			<sensorId>GEN0_COOLANTLEVEL</sensorId>
			<value>
				<getOid>gen0coolantlevel</getOid>
			</value>
			<label>Gen 1 Coolant Level</label>
			<sensorSet>Generator Sensors</sensorSet>
		</numSensor>
		<numSensor ruleid="fuellevel">
			<type>pctofcapacity</type>
			<sensorId>GEN0_FUELLEVEL</sensorId>
			<value>
				<getOid>gen0fuellevel</getOid>
			</value>
			<label>Gen 1 Fuel Level</label>
			<sensorSet>Generator Sensors</sensorSet>
		</numSensor>

		<numSensor ruleid="battcurrent">
			<type>amperage</type>
			<sensorId>GEN0_BATTCURRENT</sensorId>
			<value>
				<getOid>gen0battcurrent</getOid>
			</value>
			<label>Gen 1 Battery Charge Current</label>
			<sensorSet>Generator Sensors</sensorSet>
		</numSensor>
		<numSensor ruleid="battvoltage">
			<type>voltage</type>
			<sensorId>GEN0_BATTVOLTAGE</sensorId>
			<value>
			   <mult>
				<op>
					<getOid>gen0battvoltage</getOid>
					</op>
                <op>
                    0.1
                </op>     
            </mult>
			</value>
			<label>Gen 1 Battery Voltage</label>
			<sensorSet>Generator Sensors</sensorSet>
		</numSensor>
      
      <numSensor ruleid="gen_0_current_a">
          <type>amperage</type>
          <sensorId>GEN0_CURRENT_1</sensorId>
          <value>
              <getOid>gen0battcurrentcurrenta</getOid>
          </value>
          <label>Gen 1 Current Phase A</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="gen_0_current_b">
          <type>amperage</type>
          <sensorId>GEN0_CURRENT_2</sensorId>
          <value>
              <getOid>gen0currentb</getOid>
          </value>
          <label>Gen 1 Current Phase B</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="gen_0_current_c">
          <type>amperage</type>
          <sensorId>GEN0_CURRENT_3</sensorId>
          <value>
              <getOid>gen0currentc</getOid>
          </value>
          <label>Gen 1 Current Phase C</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="gen_0_current_avg">
          <type>amperage</type>
          <sensorId>GEN0_CURRENT_AVG</sensorId>
          <value>
              <getOid>gen0currentavg</getOid>
          </value>
          <label>Gen 1 Current Average</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="gen_0_voltage_ab">
          <type>voltage</type>
          <sensorId>GEN0_VOLTAGE_LL_1</sensorId>
          <value>
              <getOid>gen0voltageab</getOid>
          </value>
          <label>Gen 1 Voltage Phase A-B</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="gen_0_voltage_bc">
          <type>voltage</type>
          <sensorId>GEN0_VOLTAGE_LL_2</sensorId>
          <value>
              <getOid>gen0voltagebc</getOid>
          </value>
          <label>Gen 1 Voltage Phase B-C</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="gen_0_voltage_ca">
          <type>voltage</type>
          <sensorId>GEN0_VOLTAGE_LL_3</sensorId>
          <value>
              <getOid>gen0voltageca</getOid>
          </value>
          <label>Gen 1 Voltage Phase C-A</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="gen_0_voltage_avg">
          <type>voltage</type>
          <sensorId>GEN0_VOLTAGE_AVG</sensorId>
          <value>
              <getOid>gen0voltageavg</getOid>
          </value>
          <label>Gen 1 Voltage Average</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="bus_current_a">
          <type>amperage</type>
          <sensorId>GEN0_BUS_CURRENT_1</sensorId>
          <value>
              <getOid>gen0buscurrenta</getOid>
          </value>
          <label>Bus Current Phase A</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="bus_current_b">
          <type>amperage</type>
          <sensorId>BUS_CURRENT_2</sensorId>
          <value>
              <getOid>buscurrentb</getOid>
          </value>
          <label>Bus Current Phase B</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="bus_current_c">
          <type>amperage</type>
          <sensorId>BUS_CURRENT_3</sensorId>
          <value>
              <getOid>buscurrentc</getOid>
          </value>
          <label>Bus Current Phase C</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="bus_current_avg">
          <type>amperage</type>
          <sensorId>BUS_CURRENT_AVG</sensorId>
          <value>
              <getOid>buscurrentavg</getOid>
          </value>
          <label>Bus Current Average</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="bus_voltage_ab">
          <type>voltage</type>
          <sensorId>BUS_VOLTAGE_LL_1</sensorId>
          <value>
              <getOid>busvoltageab</getOid>
          </value>
          <label>Bus Voltage Phase A-B</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="bus_voltage_bc">
          <type>voltage</type>
          <sensorId>BUS_VOLTAGE_LL_2</sensorId>
          <value>
              <getOid>busvoltagebc</getOid>
          </value>
          <label>Bus Voltage Phase B-C</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="bus_voltage_ca">
          <type>voltage</type>
          <sensorId>BUS_VOLTAGE_LL_3</sensorId>
          <value>
              <getOid>busvoltageca</getOid>
          </value>
          <label>Bus Voltage Phase C-A</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="bus_voltage_avg">
          <type>voltage</type>
          <sensorId>BUS_VOLTAGE_AVG</sensorId>
          <value>
              <getOid>busvoltageavg</getOid>
          </value>
          <label>Bus Voltage Average</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="gentotalkw">
          <type>num/powerKW</type>
          <sensorId>GEN0_GENTOTALKW</sensorId>
          <value>
              <getOid>gen0gentotalkw</getOid>
          </value>
          <label>Gen 1 Total Real Power</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="bustotalkw">
          <type>num/powerKW</type>
          <sensorId>BUSTOTALKW</sensorId>
          <value>
              <getOid>bustotalkw</getOid>
          </value>
          <label>Bus Total Real Power</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="gentotalpf">
          <type>num/powerfactor</type>
          <sensorId>GEN0_GENTOTALPF</sensorId>
          <value>
              <getOid>gen0gentotalpf</getOid>
          </value>
          <label>Gen 1 Total Power Factor</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="bustotalpf">
          <type>num/powerfactor</type>
          <sensorId>BUSTOTALPF</sensorId>
          <value>
              <getOid>bustotalpf</getOid>
          </value>
          <label>Bus Total Power Factor</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="genfreq">
          <type>frequency</type>
          <sensorId>GEN0_GENFREQ</sensorId>
          <value>
              <getOid>gen0freq</getOid>
          </value>
          <label>Gen 1 Frequency</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="busfreq">
          <type>frequency</type>
          <sensorId>BUSFREQ</sensorId>
          <value>
              <getOid>busfreq</getOid>
          </value>
          <label>Bus Frequency</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="enginerpm">
          <type>num</type>
          <units>rpm</units>
          <sensorId>GEN0_ENGINERPM</sensorId>
          <value>
              <getOid>gen0enginerpm</getOid>
          </value>
          <label>Gen 1 Engine RPM</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>
	  
	  <!-- Generator 2 sensor section -->
	  
	  <numSensor ruleid="oiltemp">
			<type>temp</type>
			<sensorId>GEN1_OILTEMP</sensorId>
			<value>
				<getOid>gen1oiltemp</getOid>
			</value>
			<label>Gen 2 Oil Temperature</label>
			<sensorSet>Generator Sensors</sensorSet>
		</numSensor>
		<numSensor ruleid="coolanttemp">
			<type>temp</type>
			<sensorId>GEN1_COOLANTTEMP</sensorId>
			<value>
				<getOid>gen1coolanttemp</getOid>
			</value>
			<label>Gen 2 Coolant Temperature</label>
			<sensorSet>Generator Sensors</sensorSet>
		</numSensor>
		<numSensor ruleid="oilpressure">
			<type>pressure</type>
			<sensorId>GEN1_OILPRESSURE</sensorId>
			<value>
				<getOid>gen1oilpressure</getOid>
			</value>
			<label>Gen 2 Oil Pressure</label>
			<sensorSet>Generator Sensors</sensorSet>
		</numSensor>
		<numSensor ruleid="coolantlevel">
			<type>pctofcapacity</type>
			<sensorId>GEN1_COOLANTLEVEL</sensorId>
			<value>
				<getOid>gen1coolantlevel</getOid>
			</value>
			<label>Gen 2 Coolant Level</label>
			<sensorSet>Generator Sensors</sensorSet>
		</numSensor>
		<numSensor ruleid="fuellevel">
			<type>pctofcapacity</type>
			<sensorId>GEN1_FUELLEVEL</sensorId>
			<value>
				<getOid>gen1fuellevel</getOid>
			</value>
			<label>Gen 2 Fuel Level</label>
			<sensorSet>Generator Sensors</sensorSet>
		</numSensor>

		<numSensor ruleid="battcurrent">
			<type>amperage</type>
			<sensorId>GEN1_BATTCURRENT</sensorId>
			<value>
				<getOid>gen1battcurrent</getOid>
			</value>
			<label>Gen 2 Battery Charge Current</label>
			<sensorSet>Generator Sensors</sensorSet>
		</numSensor>
		<numSensor ruleid="battvoltage">
			<type>voltage</type>
			<sensorId>GEN1_BATTVOLTAGE</sensorId>
			<value>
			   <mult>
				<op>
					<getOid>gen1battvoltage</getOid>
					</op>
                <op>
                    0.1
                </op>     
            </mult>
			</value>
			<label>Gen 2 Battery Voltage</label>
			<sensorSet>Generator Sensors</sensorSet>
		</numSensor>
      
      <numSensor ruleid="gen_0_current_a">
          <type>amperage</type>
          <sensorId>GEN1_CURRENT_1</sensorId>
          <value>
              <getOid>gen1battcurrentcurrenta</getOid>
          </value>
          <label>Gen 2 Current Phase A</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="gen_0_current_b">
          <type>amperage</type>
          <sensorId>GEN1_CURRENT_2</sensorId>
          <value>
              <getOid>gen1currentb</getOid>
          </value>
          <label>Gen 2 Current Phase B</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="gen_0_current_c">
          <type>amperage</type>
          <sensorId>GEN1_CURRENT_3</sensorId>
          <value>
              <getOid>gen1currentc</getOid>
          </value>
          <label>Gen 2 Current Phase C</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="gen_0_current_avg">
          <type>amperage</type>
          <sensorId>GEN1_CURRENT_AVG</sensorId>
          <value>
              <getOid>gen1currentavg</getOid>
          </value>
          <label>Gen 2 Current Average</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="gen_0_voltage_ab">
          <type>voltage</type>
          <sensorId>GEN1_VOLTAGE_LL_1</sensorId>
          <value>
              <getOid>gen1voltageab</getOid>
          </value>
          <label>Gen 2 Voltage Phase A-B</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="gen_0_voltage_bc">
          <type>voltage</type>
          <sensorId>GEN1_VOLTAGE_LL_2</sensorId>
          <value>
              <getOid>gen1voltagebc</getOid>
          </value>
          <label>Gen 2 Voltage Phase B-C</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="gen_0_voltage_ca">
          <type>voltage</type>
          <sensorId>GEN1_VOLTAGE_LL_3</sensorId>
          <value>
              <getOid>gen1voltageca</getOid>
          </value>
          <label>Gen 2 Voltage Phase C-A</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="gen_0_voltage_avg">
          <type>voltage</type>
          <sensorId>GEN1_VOLTAGE_AVG</sensorId>
          <value>
              <getOid>gen1voltageavg</getOid>
          </value>
          <label>Gen 2 Voltage Average</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="bus_current_a">
          <type>amperage</type>
          <sensorId>GEN1_BUS_CURRENT_1</sensorId>
          <value>
              <getOid>gen1buscurrenta</getOid>
          </value>
          <label>Bus Current Phase A</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="bus_current_b">
          <type>amperage</type>
          <sensorId>BUS_CURRENT_2</sensorId>
          <value>
              <getOid>buscurrentb</getOid>
          </value>
          <label>Bus Current Phase B</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="bus_current_c">
          <type>amperage</type>
          <sensorId>BUS_CURRENT_3</sensorId>
          <value>
              <getOid>buscurrentc</getOid>
          </value>
          <label>Bus Current Phase C</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="bus_current_avg">
          <type>amperage</type>
          <sensorId>BUS_CURRENT_AVG</sensorId>
          <value>
              <getOid>buscurrentavg</getOid>
          </value>
          <label>Bus Current Average</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="bus_voltage_ab">
          <type>voltage</type>
          <sensorId>BUS_VOLTAGE_LL_1</sensorId>
          <value>
              <getOid>busvoltageab</getOid>
          </value>
          <label>Bus Voltage Phase A-B</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="bus_voltage_bc">
          <type>voltage</type>
          <sensorId>BUS_VOLTAGE_LL_2</sensorId>
          <value>
              <getOid>busvoltagebc</getOid>
          </value>
          <label>Bus Voltage Phase B-C</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="bus_voltage_ca">
          <type>voltage</type>
          <sensorId>BUS_VOLTAGE_LL_3</sensorId>
          <value>
              <getOid>busvoltageca</getOid>
          </value>
          <label>Bus Voltage Phase C-A</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="bus_voltage_avg">
          <type>voltage</type>
          <sensorId>BUS_VOLTAGE_AVG</sensorId>
          <value>
              <getOid>busvoltageavg</getOid>
          </value>
          <label>Bus Voltage Average</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="gentotalkw">
          <type>num/powerKW</type>
          <sensorId>GEN1_GENTOTALKW</sensorId>
          <value>
              <getOid>gen1gentotalkw</getOid>
          </value>
          <label>Gen 2 Total Real Power</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="bustotalkw">
          <type>num/powerKW</type>
          <sensorId>BUSTOTALKW</sensorId>
          <value>
              <getOid>bustotalkw</getOid>
          </value>
          <label>Bus Total Real Power</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="gentotalpf">
          <type>num/powerfactor</type>
          <sensorId>GEN1_GENTOTALPF</sensorId>
          <value>
              <getOid>gen1gentotalpf</getOid>
          </value>
          <label>Gen 2 Total Power Factor</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="bustotalpf">
          <type>num/powerfactor</type>
          <sensorId>BUSTOTALPF</sensorId>
          <value>
              <getOid>bustotalpf</getOid>
          </value>
          <label>Bus Total Power Factor</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="genfreq">
          <type>frequency</type>
          <sensorId>GEN1_GENFREQ</sensorId>
          <value>
              <getOid>gen1freq</getOid>
          </value>
          <label>Gen 2 Frequency</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>
      <numSensor ruleid="busfreq">
          <type>frequency</type>
          <sensorId>BUSFREQ</sensorId>
          <value>
              <getOid>busfreq</getOid>
          </value>
          <label>Bus Frequency</label>
          <sensorSet>Bus Sensors</sensorSet>
      </numSensor>

      <numSensor ruleid="enginerpm">
          <type>num</type>
          <units>rpm</units>
          <sensorId>GEN1_ENGINERPM</sensorId>
          <value>
              <getOid>gen1enginerpm</getOid>
          </value>
          <label>Gen 2 Engine RPM</label>
          <sensorSet>Generator Sensors</sensorSet>
      </numSensor>
		<!--
      <stateSensor ruleid="gen_0_oil_press_state">
          <type>state</type>
          <sensorId>GEN0_OIL_PRESS_STATE</sensorId>
          <value>
              <mapValue mapid="oilpressstate_valuemap">
                  <formatNumber>
                      <bitwise_and>
                          <op><getOid>genalarmcond0</getOid></op>
                          <op>12288</op>
                      </bitwise_and>
                  </formatNumber>
              </mapValue>
          </value>
          <label>Generator Oil Pressure State</label>
          <enum>warncritstate_enummap</enum>
          <sensorSet>Generator Sensors</sensorSet>
      </stateSensor>

      <valueMap ruleid="oilpressstate_valuemap">
          <valueIn>4096</valueIn>  <valueOut>2</valueOut>
          <valueIn>8192</valueIn>  <valueOut>1</valueOut>
          <valueIn>*</valueIn>     <valueOut>0</valueOut>
      </valueMap>

      <stateSensor ruleid="gen_0_cool_temp_state">
          <type>state</type>
          <sensorId>GEN0_COOL_TEMP_STATE</sensorId>
          <value>
              <mapValue mapid="cooltempstate_valuemap">
                  <formatNumber>
                      <bitwise_and>
                          <op><getOid>genalarmcond0</getOid></op>
                          <op>3584</op> 
                      </bitwise_and>
                  </formatNumber>
              </mapValue>
          </value>
          <label>Generator Coolant Temperature State</label>
          <enum>lowhighhighstate_enummap</enum>
          <sensorSet>Generator Sensors</sensorSet>
      </stateSensor>

      <valueMap ruleid="cooltempstate_valuemap">
          <valueIn>1024</valueIn>  <valueOut>3</valueOut>
          <valueIn>2048</valueIn>  <valueOut>2</valueOut>
          <valueIn>512</valueIn>   <valueOut>1</valueOut>
          <valueIn>*</valueIn>     <valueOut>0</valueOut>
      </valueMap>

      <stateSensor ruleid="gen_0_oil_temp_state">
          <type>state</type>
          <sensorId>GEN0_OIL_TEMP_STATE</sensorId>
          <value>
              <mapValue mapid="oiltempstate_valuemap">
                  <formatNumber>
                      <bitwise_and>
                          <op><getOid>genalarmcond0</getOid></op>
                          <op>384</op> 
                      </bitwise_and>
                  </formatNumber>
              </mapValue>
          </value>
          <label>Generator Oil Temperature State</label>
          <enum>warncritstate_enummap</enum>
          <sensorSet>Generator Sensors</sensorSet>
      </stateSensor>

      <valueMap ruleid="oiltempstate_valuemap">
          <valueIn>128</valueIn>  <valueOut>2</valueOut>
          <valueIn>256</valueIn>  <valueOut>1</valueOut>
          <valueIn>*</valueIn>     <valueOut>0</valueOut>
      </valueMap>

      <stateSensor ruleid="gen_0_batt_volt_state">
          <type>state</type>
          <sensorId>GEN0_BATT_VOLT_STATE</sensorId>
          <value>
              <mapValue mapid="battvoltstate_valuemap">
                  <formatNumber>
                      <bitwise_and>
                          <op><getOid>genalarmcond0</getOid></op>
                          <op>96</op> 
                      </bitwise_and>
                  </formatNumber>
              </mapValue>
          </value>
          <label>Generator Battery Voltage State</label>
          <enum>lowhighstate_enummap</enum>
          <sensorSet>Generator Sensors</sensorSet>
      </stateSensor>

      <valueMap ruleid="battvoltstate_valuemap">
          <valueIn>32</valueIn>  <valueOut>2</valueOut>
          <valueIn>64</valueIn>  <valueOut>1</valueOut>
          <valueIn>*</valueIn>     <valueOut>0</valueOut>
      </valueMap>

      <stateSensor ruleid="gen_0_fuel_level_state">
          <type>state</type>
          <sensorId>GEN0_FUEL_LEVEL_STATE</sensorId>
          <value>
              <mapValue mapid="fuellevelstate_valuemap">
                  <formatNumber>
                      <bitwise_and>
                          <op><getOid>genalarmcond1</getOid></op>
                          <op>12288</op> 
                      </bitwise_and>
                  </formatNumber>
              </mapValue>
          </value>
          <label>Generator Fuel Level State</label>
          <enum>lowemptystate_enummap</enum>
          <sensorSet>Generator Sensors</sensorSet>
      </stateSensor>

      <valueMap ruleid="fuellevelstate_valuemap">
          <valueIn>4096</valueIn>  <valueOut>2</valueOut>
          <valueIn>8192</valueIn>  <valueOut>1</valueOut>
          <valueIn>*</valueIn>     <valueOut>0</valueOut>
      </valueMap>

      <stateSensor ruleid="gen_0_cool_level_state">
          <type>state</type>
          <sensorId>GEN0_COOL_LEVEL_STATE</sensorId>
          <value>
              <mapValue mapid="coollevelstate_valuemap">
                  <formatNumber>
                      <bitwise_and>
                          <op><getOid>genalarmcond1</getOid></op>
                          <op>1024</op> 
                      </bitwise_and>
                  </formatNumber>
              </mapValue>
          </value>
          <label>Generator Coolant Level State</label>
          <enum>lowstate_enummap</enum>
          <sensorSet>Generator Sensors</sensorSet>
      </stateSensor>

      <valueMap ruleid="coollevelstate_valuemap">
          <valueIn>1024</valueIn>  <valueOut>1</valueOut>
          <valueIn>*</valueIn>     <valueOut>0</valueOut>
      </valueMap>
      
      
      <enumMap ruleid="warncritstate_enummap">
          <label>Ok</label>
          <label>Warning</label>
          <label>Critical</label>
      </enumMap>
      
      <enumMap ruleid="lowhighhighstate_enummap">
          <label>Ok</label>
          <label>Low</label>
          <label>High Warning</label>
          <label>High Alarm</label>
      </enumMap>
      
      <enumMap ruleid="lowhighstate_enummap">
          <label>Ok</label>
          <label>Low</label>
          <label>High</label>
      </enumMap>
      
      <enumMap ruleid="lowemptystate_enummap">
          <label>Ok</label>
          <label>Low</label>
          <label>Empty</label>
      </enumMap>
      
      <enumMap ruleid="lowstate_enummap">
          <label>Ok</label>
          <label>Low</label>
      </enumMap>
		-->


      <alarmFlags ruleid="gen0alarmconds_0">
          <value><getOid>gen0alarmcond0</getOid></value>
          
          <alarmFlagsTest mask="8000" match="8000" log="no">
              <name>
                  <activeText>Common Alarm</activeText>
                  <inactiveText>Common Alarm Cleared</inactiveText>
              </name>
              <severity>critical</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Common Alarm condition.</activeText>
                  <inactiveText>The Common Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="4000" match="4000" log="no">
              <name>
                  <activeText>Common Warning</activeText>
                  <inactiveText>Common Warning Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Common Warning condition.</activeText>
                  <inactiveText>The Common Warning condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          
          <alarmFlagsTest mask="2000" match="2000" log="no">
              <name>
                  <activeText>Low Oil Pressure Warning</activeText>
                  <inactiveText>Low Oil Pressure Warning Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Low Oil Pressure Warning condition.</activeText>
                  <inactiveText>The Low Oil Pressure Warning condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="1000" match="1000" log="no">
              <name>
                  <activeText>Low Oil Pressure Alarm</activeText>
                  <inactiveText>Low Oil Pressure Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Low Oil Pressure Alarm condition.</activeText>
                  <inactiveText>The Low Oil Pressure Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="800" match="800" log="no">
              <name>
                  <activeText>High Coolant Temperature Warning</activeText>
                  <inactiveText>High Coolant Temperature Warning Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a High Coolant Temperature Warning condition.</activeText>
                  <inactiveText>The High Coolant Temperature Warning condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="400" match="400" log="no">
              <name>
                  <activeText>High Coolant Temperature Alarm</activeText>
                  <inactiveText>High Coolant Temperature Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a High Coolant Temperature Alarm condition.</activeText>
                  <inactiveText>The High Coolant Temperature Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          
          <alarmFlagsTest mask="200" match="200" log="no">
              <name>
                  <activeText>Low Coolant Temperature Warning</activeText>
                  <inactiveText>Low Coolant Temperature Warning Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Low Coolant Temperature Warning condition.</activeText>
                  <inactiveText>The Low Coolant Temperature Warning condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
         
          
          <alarmFlagsTest mask="100" match="100" log="no">
              <name>
                  <activeText>High Oil Temperature Warning</activeText>
                  <inactiveText>High Oil Temperature Warning Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a High Oil Temperature Warning condition.</activeText>
                  <inactiveText>The High Oil Temperature Warning condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="80" match="80" log="no">
              <name>
                  <activeText>High Oil Temperature Alarm</activeText>
                  <inactiveText>High Oil Temperature Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a High Oil Temperature Alarm condition.</activeText>
                  <inactiveText>The High Oil Temperature Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="40" match="40" log="no">
              <name>
                  <activeText>Low Battery Voltage Warning</activeText>
                  <inactiveText>Low Battery Voltage Warning Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Low Battery Voltage Warning condition.</activeText>
                  <inactiveText>The Low Battery Voltage Warning condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="20" match="20" log="no">
              <name>
                  <activeText>High Battery Voltage Warning</activeText>
                  <inactiveText>High Battery Voltage Warning Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a High Battery Voltage Warning condition.</activeText>
                  <inactiveText>The High Battery Voltage Warning condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          
          <alarmFlagsTest mask="10" match="10" log="no">
              <name>
                  <activeText>Overspeed Warning</activeText>
                  <inactiveText>Overspeed Warning Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected an Overspeed Warning condition.</activeText>
                  <inactiveText>The Overspeed Warning condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="8" match="8" log="no">
              <name>
                  <activeText>Underspeed Warning</activeText>
                  <inactiveText>Underspeed Warning Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected an Underspeed Warning condition.</activeText>
                  <inactiveText>The Underspeed Warning condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
  t
          <alarmFlagsTest mask="4" match="4" log="no">
              <name>
                  <activeText>Over Voltage Alarm</activeText>
                  <inactiveText>Over Voltage Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected an Over Voltage Alarm condition.</activeText>
                  <inactiveText>The Over Voltage Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="2" match="2" log="no">
              <name>
                  <activeText>Under Voltage Alarm</activeText>
                  <inactiveText>Under Voltage Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected an Under Voltage Alarm condition.</activeText>
                  <inactiveText>The Under Voltage Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="1" match="1" log="no">
              <name>
                  <activeText>Over Frequency Alarm</activeText>
                  <inactiveText>Over Frequency Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected an Over Frequency Alarm condition.</activeText>
                  <inactiveText>The Over Frequency Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
   
      </alarmFlags>

      <alarmFlags ruleid="gen0alarmconds_1">
          <value><getOid>gen0alarmcond1</getOid></value>
          <alarmFlagsTest mask="8000" match="8000" log="no">
              <name>
                  <activeText>Under Frequency Alarm</activeText>
                  <inactiveText>Under Frequency Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected an Under Frequency Alarm condition.</activeText>
                  <inactiveText>The Under Frequency Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="4000" match="4000" log="no">
              <name>
                  <activeText>High Fuel Alarm</activeText>
                  <inactiveText>High Fuel Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a High Fuel Alarm condition.</activeText>
                  <inactiveText>The High Fuel Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
   
          <alarmFlagsTest mask="2000" match="2000" log="no">
              <name>
                  <activeText>Low Fuel Warning</activeText>
                  <inactiveText>Low Fuel Warning Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Low Fuel Warning condition.</activeText>
                  <inactiveText>The Low Fuel Warning condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="1000" match="1000" log="no">
              <name>
                  <activeText>Low Fuel Alarm</activeText>
                  <inactiveText>Low Fuel Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Low Fuel Alarm condition.</activeText>
                  <inactiveText>The Low Fuel Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="800" match="800" log="no">
              <name>
                  <activeText>Fail To Start Alarm</activeText>
                  <inactiveText>Fail To Start Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Fail To Start Alarm condition.</activeText>
                  <inactiveText>The Fail To Start Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="400" match="400" log="no">
              <name>
                  <activeText>Coolant Level Alarm</activeText>
                  <inactiveText>Coolant Level Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Coolant Level Alarm condition.</activeText>
                  <inactiveText>The Coolant Level Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="200" match="200" log="no">
              <name>
                  <activeText>RPM Sensor Loss</activeText>
                  <inactiveText>RPM Sensor Loss Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a RPM Sensor Loss condition.</activeText>
                  <inactiveText>The RPM Sensor Loss condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
 
          <alarmFlagsTest mask="100" match="100" log="no">
              <name>
                  <activeText>Start Inhibit Alarm</activeText>
                  <inactiveText>Start Inhibit Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Start Inhibit Alarm condition.</activeText>
                  <inactiveText>The Start Inhibit Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>

          <alarmFlagsTest mask="80" match="80" log="no">
              <name>
                  <activeText>Emergency Stop Alarm</activeText>
                  <inactiveText>Emergency Stop Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected an Emergency Stop Alarm condition.</activeText>
                  <inactiveText>The Emergency Stop Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <!-- Customer did not specify bits 6..0 - omit -->
      </alarmFlags>

      <alarmFlags ruleid="gen0alarmconds_2">
          <value><getOid>gen0alarmcond2</getOid></value>
          <!-- Customer did not specify bits 15..2 - omit -->
                    
          <!-- bit 1 - alarm when not set -->
          <alarmFlagsTest mask="2" match="2" log="no">
              <name>
                  <activeText>Generator In Auto Alarm</activeText>
                  <inactiveText>Generator In Auto Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Generator In Auto Alarm condition.</activeText>
                  <inactiveText>The Generator In Auto Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="1" match="1" log="no">
              <name>
                  <activeText>Generator In Manual Alarm</activeText>
                  <inactiveText>Generator In Manual Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Generator In Manual Alarm condition.</activeText>
                  <inactiveText>The Generator In Manual Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
      </alarmFlags>

      <alarmFlags ruleid="gen0alarmconds_3">
          <value><getOid>gen0alarmcond3</getOid></value>
          <alarmFlagsTest mask="8000" match="8000" log="no">
              <name>
                  <activeText>Generator In Off Alarm</activeText>
                  <inactiveText>Generator In Off Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Generator In Off Alarm condition.</activeText>
                  <inactiveText>The Generator In Off Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
                    
          <alarmFlagsTest mask="800" match="800" log="no">
              <name>
                  <activeText>Generator Running Alarm</activeText>
                  <inactiveText>Generator Running Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Generator Running Alarm condition.</activeText>
                  <inactiveText>The Generator Running Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <!-- Customer did not specify bit 0 - omit -->
      </alarmFlags>

      <alarmFlags ruleid="gen0alarmconds_4">
          <value><getOid>gen0alarmcond4</getOid></value>
          <!-- Customer did not specify bits 15..14 - omit -->
                    
          <alarmFlagsTest mask="4000" match="2000" log="no">
              <name>
                  <activeText>Need Service</activeText>
                  <inactiveText>Need Service Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system needs to be serviced.</activeText>
                  <inactiveText>The Need Service condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="2000" match="2000" log="no">
              <name>
                  <activeText>Battery Charger AC failure</activeText>
                  <inactiveText>Battery Charger AC failure Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Battery Charger AC failure condition.</activeText>
                  <inactiveText>The Battery Charger AC failure condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <!-- Customer did not specify bit 12 - omit -->
          <alarmFlagsTest mask="800" match="800" log="no">
              <name>
                  <activeText>Generator Power Alarm</activeText>
                  <inactiveText>Generator Power Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Generator Power Alarm condition.</activeText>
                  <inactiveText>The Generator Power Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <!-- Customer did not specify bits 10..0 - omit -->
      </alarmFlags>
	  <!-- Generator 2 alarms -->
	  
		<alarmFlags ruleid="gen1alarmconds_0">
          <value><getOid>gen1alarmcond0</getOid></value>
          
          <alarmFlagsTest mask="8000" match="8000" log="no">
              <name>
                  <activeText>Common Alarm</activeText>
                  <inactiveText>Common Alarm Cleared</inactiveText>
              </name>
              <severity>critical</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Common Alarm condition.</activeText>
                  <inactiveText>The Common Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="4000" match="4000" log="no">
              <name>
                  <activeText>Common Warning</activeText>
                  <inactiveText>Common Warning Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Common Warning condition.</activeText>
                  <inactiveText>The Common Warning condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          
          <alarmFlagsTest mask="2000" match="2000" log="no">
              <name>
                  <activeText>Low Oil Pressure Warning</activeText>
                  <inactiveText>Low Oil Pressure Warning Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Low Oil Pressure Warning condition.</activeText>
                  <inactiveText>The Low Oil Pressure Warning condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="1000" match="1000" log="no">
              <name>
                  <activeText>Low Oil Pressure Alarm</activeText>
                  <inactiveText>Low Oil Pressure Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Low Oil Pressure Alarm condition.</activeText>
                  <inactiveText>The Low Oil Pressure Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="800" match="800" log="no">
              <name>
                  <activeText>High Coolant Temperature Warning</activeText>
                  <inactiveText>High Coolant Temperature Warning Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a High Coolant Temperature Warning condition.</activeText>
                  <inactiveText>The High Coolant Temperature Warning condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="400" match="400" log="no">
              <name>
                  <activeText>High Coolant Temperature Alarm</activeText>
                  <inactiveText>High Coolant Temperature Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a High Coolant Temperature Alarm condition.</activeText>
                  <inactiveText>The High Coolant Temperature Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          
          <alarmFlagsTest mask="200" match="200" log="no">
              <name>
                  <activeText>Low Coolant Temperature Warning</activeText>
                  <inactiveText>Low Coolant Temperature Warning Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Low Coolant Temperature Warning condition.</activeText>
                  <inactiveText>The Low Coolant Temperature Warning condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
         
          
          <alarmFlagsTest mask="100" match="100" log="no">
              <name>
                  <activeText>High Oil Temperature Warning</activeText>
                  <inactiveText>High Oil Temperature Warning Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a High Oil Temperature Warning condition.</activeText>
                  <inactiveText>The High Oil Temperature Warning condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="80" match="80" log="no">
              <name>
                  <activeText>High Oil Temperature Alarm</activeText>
                  <inactiveText>High Oil Temperature Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a High Oil Temperature Alarm condition.</activeText>
                  <inactiveText>The High Oil Temperature Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="40" match="40" log="no">
              <name>
                  <activeText>Low Battery Voltage Warning</activeText>
                  <inactiveText>Low Battery Voltage Warning Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Low Battery Voltage Warning condition.</activeText>
                  <inactiveText>The Low Battery Voltage Warning condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="20" match="20" log="no">
              <name>
                  <activeText>High Battery Voltage Warning</activeText>
                  <inactiveText>High Battery Voltage Warning Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a High Battery Voltage Warning condition.</activeText>
                  <inactiveText>The High Battery Voltage Warning condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          
          <alarmFlagsTest mask="10" match="10" log="no">
              <name>
                  <activeText>Overspeed Warning</activeText>
                  <inactiveText>Overspeed Warning Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected an Overspeed Warning condition.</activeText>
                  <inactiveText>The Overspeed Warning condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="8" match="8" log="no">
              <name>
                  <activeText>Underspeed Warning</activeText>
                  <inactiveText>Underspeed Warning Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected an Underspeed Warning condition.</activeText>
                  <inactiveText>The Underspeed Warning condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
  t
          <alarmFlagsTest mask="4" match="4" log="no">
              <name>
                  <activeText>Over Voltage Alarm</activeText>
                  <inactiveText>Over Voltage Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected an Over Voltage Alarm condition.</activeText>
                  <inactiveText>The Over Voltage Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="2" match="2" log="no">
              <name>
                  <activeText>Under Voltage Alarm</activeText>
                  <inactiveText>Under Voltage Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected an Under Voltage Alarm condition.</activeText>
                  <inactiveText>The Under Voltage Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="1" match="1" log="no">
              <name>
                  <activeText>Over Frequency Alarm</activeText>
                  <inactiveText>Over Frequency Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected an Over Frequency Alarm condition.</activeText>
                  <inactiveText>The Over Frequency Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
   
      </alarmFlags>

      <alarmFlags ruleid="gen1alarmconds_1">
          <value><getOid>gen1alarmcond1</getOid></value>
          <alarmFlagsTest mask="8000" match="8000" log="no">
              <name>
                  <activeText>Under Frequency Alarm</activeText>
                  <inactiveText>Under Frequency Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected an Under Frequency Alarm condition.</activeText>
                  <inactiveText>The Under Frequency Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="4000" match="4000" log="no">
              <name>
                  <activeText>High Fuel Alarm</activeText>
                  <inactiveText>High Fuel Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a High Fuel Alarm condition.</activeText>
                  <inactiveText>The High Fuel Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
   
          <alarmFlagsTest mask="2000" match="2000" log="no">
              <name>
                  <activeText>Low Fuel Warning</activeText>
                  <inactiveText>Low Fuel Warning Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Low Fuel Warning condition.</activeText>
                  <inactiveText>The Low Fuel Warning condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="1000" match="1000" log="no">
              <name>
                  <activeText>Low Fuel Alarm</activeText>
                  <inactiveText>Low Fuel Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Low Fuel Alarm condition.</activeText>
                  <inactiveText>The Low Fuel Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="800" match="800" log="no">
              <name>
                  <activeText>Fail To Start Alarm</activeText>
                  <inactiveText>Fail To Start Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Fail To Start Alarm condition.</activeText>
                  <inactiveText>The Fail To Start Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="400" match="400" log="no">
              <name>
                  <activeText>Coolant Level Alarm</activeText>
                  <inactiveText>Coolant Level Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Coolant Level Alarm condition.</activeText>
                  <inactiveText>The Coolant Level Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="200" match="200" log="no">
              <name>
                  <activeText>RPM Sensor Loss</activeText>
                  <inactiveText>RPM Sensor Loss Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a RPM Sensor Loss condition.</activeText>
                  <inactiveText>The RPM Sensor Loss condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
  
          <alarmFlagsTest mask="100" match="100" log="no">
              <name>
                  <activeText>Start Inhibit Alarm</activeText>
                  <inactiveText>Start Inhibit Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Start Inhibit Alarm condition.</activeText>
                  <inactiveText>The Start Inhibit Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>

          <alarmFlagsTest mask="80" match="80" log="no">
              <name>
                  <activeText>Emergency Stop Alarm</activeText>
                  <inactiveText>Emergency Stop Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected an Emergency Stop Alarm condition.</activeText>
                  <inactiveText>The Emergency Stop Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <!-- Customer did not specify bits 6..0 - omit -->
      </alarmFlags>

      <alarmFlags ruleid="gen1alarmconds_2">
          <value><getOid>gen1alarmcond2</getOid></value>
          <!-- Customer did not specify bits 15..2 - omit -->
                    
          <!-- bit 1 - alarm when not set -->
          <alarmFlagsTest mask="2" match="2" log="no">
              <name>
                  <activeText>Generator In Auto Alarm</activeText>
                  <inactiveText>Generator In Auto Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Generator In Auto Alarm condition.</activeText>
                  <inactiveText>The Generator In Auto Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <alarmFlagsTest mask="1" match="1" log="no">
              <name>
                  <activeText>Generator In Manual Alarm</activeText>
                  <inactiveText>Generator In Manual Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Generator In Manual Alarm condition.</activeText>
                  <inactiveText>The Generator In Manual Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
      </alarmFlags>

      <alarmFlags ruleid="gen1alarmconds_3">
          <value><getOid>gen1alarmcond3</getOid></value>
          <alarmFlagsTest mask="8000" match="8000" log="no">
              <name>
                  <activeText>Generator In Off Alarm</activeText>
                  <inactiveText>Generator In Off Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Generator In Off Alarm condition.</activeText>
                  <inactiveText>The Generator In Off Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
                    
          <alarmFlagsTest mask="800" match="800" log="no">
              <name>
                  <activeText>Generator Running Alarm</activeText>
                  <inactiveText>Generator Running Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Generator Running Alarm condition.</activeText>
                  <inactiveText>The Generator Running Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <!-- Customer did not specify bit 0 - omit -->
      </alarmFlags>

      <alarmFlags ruleid="gen1alarmconds_4">
          <value><getOid>gen1alarmcond4</getOid></value>
          <!-- Customer did not specify bits 15..14 - omit -->
          <!--          
          <alarmFlagsTest mask="4000" match="2000" log="no">
              <name>
                  <activeText>Need Service</activeText>
                  <inactiveText>Need Service Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system needs to be serviced.</activeText>
                  <inactiveText>The Need Service condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
		  -->
          <alarmFlagsTest mask="400" match="400" log="no">
              <name>
                  <activeText>Battery Charger failure</activeText>
                  <inactiveText>Battery Charger failure Cleared</inactiveText>
              </name>
              <severity>warning</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Battery Charger failure condition.</activeText>
                  <inactiveText>The Battery Charger failure condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
          <!-- Customer did not specify bit 12 - omit
          <alarmFlagsTest mask="800" match="800" log="no">
              <name>
                  <activeText>Generator Power Alarm</activeText>
                  <inactiveText>Generator Power Alarm Cleared</inactiveText>
              </name>
              <severity>error</severity>
              <category>Output</category>
              <description>
                  <activeText>The system has detected a Generator Power Alarm condition.</activeText>
                  <inactiveText>The Generator Power Alarm condition has been cleared.</inactiveText>
              </description>
          </alarmFlagsTest>
		  -->
          <!-- Customer did not specify bits 10..0 - omit -->
      </alarmFlags>
  </device>
		<!-- Generator 1 modbus registers -->
  <protocol>
    <modbus>    
		<value_ref_id valid="gen0oiltemp">
            <function>3</function>
            <start_addr>4236</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
		<value_ref_id valid="gen0coolanttemp">
            <function>3</function>
            <start_addr>4238</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
		<value_ref_id valid="gen0oilpressure">
            <function>3</function>
            <start_addr>4240</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
		<value_ref_id valid="gen0coolantlevel">
            <function>3</function>
            <start_addr>4254</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
		<value_ref_id valid="gen0fuellevel">
            <function>3</function>
            <start_addr>4256</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>

		<value_ref_id valid="gen0battcurrent">
            <function>3</function>
            <start_addr>4264</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
		<value_ref_id valid="gen0battvoltage">
            <function>3</function>
            <start_addr>4270</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>

        <value_ref_id valid="gen0currenta">
            <function>3</function>
            <start_addr>4280</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id> 
        <value_ref_id valid="gen0currentb">
            <function>3</function>
            <start_addr>4282</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id> 
        <value_ref_id valid="gen0currentc">
            <function>3</function>
            <start_addr>4284</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id> 
		<value_ref_id valid="gen0currentavg">
            <function>3</function>
            <start_addr>4286</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>

        <value_ref_id valid="gen0voltageab">
            <function>3</function>
            <start_addr>4296</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id> 
        <value_ref_id valid="gen0voltagebc">
            <function>3</function>
            <start_addr>4298</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id> 
        <value_ref_id valid="gen0voltageca">
            <function>3</function>
            <start_addr>4300</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
		<value_ref_id valid="gen0voltageavg">
            <function>3</function>
            <start_addr>4302</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>

        <value_ref_id valid="buscurrenta">
            <function>3</function>
            <start_addr>175</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id> 
        <value_ref_id valid="buscurrentb">
            <function>3</function>
            <start_addr>177</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id> 
        <value_ref_id valid="buscurrentc">
            <function>3</function>
            <start_addr>179</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id> 
		<value_ref_id valid="buscurrentavg">
            <function>3</function>
            <start_addr>181</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>

        <value_ref_id valid="busvoltageab">
            <function>3</function>
            <start_addr>191</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id> 
        <value_ref_id valid="busvoltagebc">
            <function>3</function>
            <start_addr>193</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id> 
        <value_ref_id valid="busvoltageca">
            <function>3</function>
            <start_addr>195</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
		<value_ref_id valid="busvoltageavg">
            <function>3</function>
            <start_addr>197</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>

		<value_ref_id valid="gen0totalkw">
            <function>3</function>
            <start_addr>4304</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
		<value_ref_id valid="bustotalkw">
            <function>3</function>
            <start_addr>209</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
		<value_ref_id valid="gen0totalpf">
            <function>3</function>
            <start_addr>4308</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
		<value_ref_id valid="bustotalpf">
            <function>3</function>
            <start_addr>213</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
		<value_ref_id valid="gen0freq">
            <function>3</function>
            <start_addr>4312</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
		<value_ref_id valid="busfreq">
            <function>3</function>
            <start_addr>217</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
		<value_ref_id valid="enginerpm">
            <function>3</function>
            <start_addr>4316</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
        
        <value_ref_id valid="gen0alarmcond0">
            <function>3</function>
            <start_addr>4227</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
        <value_ref_id valid="gen0alarmcond1">
            <function>3</function>
            <start_addr>4228</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
        <value_ref_id valid="gen0alarmcond2">
            <function>3</function>
            <start_addr>4229</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
        <value_ref_id valid="gen0alarmcond3">
            <function>3</function>
            <start_addr>4230</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
        <value_ref_id valid="gen0alarmcond4">
            <function>3</function>
            <start_addr>4225</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>

		 

		<!-- Generator 2 modbus registers -->
		
		<value_ref_id valid="gen1oiltemp">
            <function>3</function>
            <start_addr>8332</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
		<value_ref_id valid="gen1coolanttemp">
            <function>3</function>
            <start_addr>8334</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
		<value_ref_id valid="gen1oilpressure">
            <function>3</function>
            <start_addr>8336</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
		<value_ref_id valid="gen1coolantlevel">
            <function>3</function>
            <start_addr>8350</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
		<value_ref_id valid="gen1fuellevel">
            <function>3</function>
            <start_addr>8352</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>

		<value_ref_id valid="gen1battcurrent">
            <function>3</function>
            <start_addr>8360</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
		<value_ref_id valid="gen1battvoltage">
            <function>3</function>
            <start_addr>8366</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>

        <value_ref_id valid="gen1currenta">
            <function>3</function>
            <start_addr>8376</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id> 
        <value_ref_id valid="gen1currentb">
            <function>3</function>
            <start_addr>8378</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id> 
        <value_ref_id valid="gen1currentc">
            <function>3</function>
            <start_addr>8380</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id> 
		<value_ref_id valid="gen1currentavg">
            <function>3</function>
            <start_addr>8382</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>

        <value_ref_id valid="gen1voltageab">
            <function>3</function>
            <start_addr>8392</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id> 
        <value_ref_id valid="gen1voltagebc">
            <function>3</function>
            <start_addr>8394</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id> 
        <value_ref_id valid="gen1voltageca">
            <function>3</function>
            <start_addr>8396</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
		<value_ref_id valid="gen1voltageavg">
            <function>3</function>
            <start_addr>8398</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>

		<value_ref_id valid="gen1totalkw">
            <function>3</function>
            <start_addr>8400</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>

		<value_ref_id valid="gen1totalpf">
            <function>3</function>
            <start_addr>8404</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>

		<value_ref_id valid="gen1freq">
            <function>3</function>
            <start_addr>8408</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>

		<value_ref_id valid="enginerpm">
            <function>3</function>
            <start_addr>8412</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
        
        <value_ref_id valid="gen1alarmcond0">
            <function>3</function>
            <start_addr>8323</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
        <value_ref_id valid="gen1alarmcond1">
            <function>3</function>
            <start_addr>8324</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
        <value_ref_id valid="gen1alarmcond2">
            <function>3</function>
            <start_addr>8325</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
        <value_ref_id valid="gen1alarmcond3">
            <function>3</function>
            <start_addr>8326</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
        <value_ref_id valid="gen1alarmcond4">
            <function>3</function>
            <start_addr>8321</start_addr>
            <quantity>1</quantity>
            <type>uint_16</type>
        </value_ref_id>
	

		
        <!-- Bulk read for performance. -->
         <packet>
            <function>3</function>
            <start_addr>4225</start_addr>
            <quantity>5</quantity>
        </packet>
		<packet>
            <function>3</function>
            <start_addr>8321</start_addr>
            <quantity>5</quantity>
        </packet>
    </modbus>
  </protocol>
</APC_DDF>    
