<?xml version="1.0" encoding="utf-8"?>
<HWClassInfo>
  <HWDevice ModuleID="1029" SubModuleID="0x0" ModType="M_SDIAS" Desc="SDIAS Input/Output Module (8x digital in/out)" OrderNr="20-008-161">
    <Types>
      <Device Name="DM161" ClassName="DM161" DisplayGroup="Digital" Default="true" PowerLoss="2500">
        <Power Voltage="5000" Supply="0" Drain="50"/>
        <Power Voltage="24000" Supply="0" Drain="0"/> 
      </Device>
    </Types>
    <VisualData>
      <VisualView TypeId="0" Size="10,120">
        <VisualModule ImgPath=".\S-Dias\S-DIAS Grundmodul.xaml" Position="0,0" Width="12.5" Height="101.8">
          <!-- Texte -->
          <VisualTexts>
            <VisualText Text="DM 161" FontFamily="ARIAL" Italic="true" FontSize="12" ClrForeground="4294967295" FontWeight="1" LineHeight="10" Width="7.94" Height="5.82" Left="4.76" Top="10.05" />
            <VisualText Text="S" FontFamily="ARIAL" ClrForeground="4294967295" Width="1.59" Height="2.65" Left="0.26" Top="9" />
            <VisualText Text="U" FontFamily="ARIAL" ClrForeground="4294967295" Width="1.59" Height="2.65" Left="0.26" Top="11.64" />
            <VisualText Text="X1" FontFamily="ARIAL" ClrForeground="4291330563" ClrBackground="4294967295" Width="3.17" Height="2.38" Left="0.26" Top="15.61" />
            <VisualText Text="I1" FontFamily="ARIAL" ClrForeground="4294967295" Width="1.85" Height="2.65" Left="0.26" Top="17.99" />
            <VisualText Text="I2" FontFamily="ARIAL" ClrForeground="4294967295" Width="1.85" Height="2.65" Left="0.26" Top="21.17" />
            <VisualText Text="I3" FontFamily="ARIAL" ClrForeground="4294967295" Width="1.85" Height="2.65" Left="0.26" Top="24.34" />
            <VisualText Text="I4" FontFamily="ARIAL" ClrForeground="4294967295" Width="1.85" Height="2.65" Left="0.26" Top="27.52" />
            <VisualText Text="X2" FontFamily="ARIAL" ClrForeground="4291330563" ClrBackground="4294967295" Width="3.17" Height="2.38" Left="0.26" Top="30.96" />
            <VisualText Text="I5" FontFamily="ARIAL" ClrForeground="4294967295" Width="1.85" Height="2.65" Left="0.26" Top="33.34" />
            <VisualText Text="I6" FontFamily="ARIAL" ClrForeground="4294967295" Width="1.85" Height="2.65" Left="0.26" Top="36.51" />
            <VisualText Text="I7" FontFamily="ARIAL" ClrForeground="4294967295" Width="1.85" Height="2.65" Left="0.26" Top="39.69" />
            <VisualText Text="I8" FontFamily="ARIAL" ClrForeground="4294967295" Width="1.85" Height="2.65" Left="0.26" Top="42.86" />
            <VisualText Text="X3" FontFamily="ARIAL" ClrForeground="4291330563" ClrBackground="4294967295" Width="3.17" Height="2.38" Left="0.26" Top="46.3" />
            <VisualText Text="O1" FontFamily="ARIAL" ClrForeground="4294967295" Width="2.91" Height="2.65" Left="0.26" Top="48.68" />
            <VisualText Text="O2" FontFamily="ARIAL" ClrForeground="4294967295" Width="2.91" Height="2.65" Left="0.26" Top="51.86" />
            <VisualText Text="O3" FontFamily="ARIAL" ClrForeground="4294967295" Width="2.91" Height="2.65" Left="0.26" Top="55.03" />
            <VisualText Text="O4" FontFamily="ARIAL" ClrForeground="4294967295" Width="2.91" Height="2.65" Left="0.26" Top="58.21" />
            <VisualText Text="X4" FontFamily="ARIAL" ClrForeground="4291330563" ClrBackground="4294967295" Width="3.17" Height="2.38" Left="0.26" Top="61.65" />
            <VisualText Text="O5" FontFamily="ARIAL" ClrForeground="4294967295" Width="2.91" Height="2.65" Left="0.26" Top="64.03" />
            <VisualText Text="O6" FontFamily="ARIAL" ClrForeground="4294967295" Width="2.91" Height="2.65" Left="0.26" Top="67.2" />
            <VisualText Text="O7" FontFamily="ARIAL" ClrForeground="4294967295" Width="2.91" Height="2.65" Left="0.26" Top="70.38" />
            <VisualText Text="O8" FontFamily="ARIAL" ClrForeground="4294967295" Width="2.91" Height="2.65" Left="0.26" Top="73.55" />
            <VisualText Text="X5" FontFamily="ARIAL" ClrForeground="4291330563" ClrBackground="4294967295" Width="3.17" Height="2.38" Left="0.26" Top="76.99" />
            <VisualText Text="24" FontFamily="ARIAL" ClrForeground="4294967295" Width="2.38" Height="2.65" Left="0.26" Top="79.38" />
            <VisualText Text="0V" FontFamily="ARIAL" ClrForeground="4294967295" Width="2.65" Height="2.65" Left="0.26" Top="88.9" />
          </VisualTexts>
          <!-- Leds -->
          <VisualLeds>
            <VisualLed Description="Module state" ImgPath=".\S-Dias\S-DIAS LED.xaml" ClrForeground="1342242560" Width="1.32" Height="1.32" Left="2.12" Top="10.32">
              <Behaviour ClrForeground="4278255360">
                <Activator TypeId="4">
                  <Activator TypeId="1" Value="1" />
                  <Activator TypeId="3" DataString="DM161.ClassState" Value="0" />
                </Activator>
              </Behaviour>
              <Behaviour ClrForeground="4278255360" Interval="200">
                <Activator TypeId="4">
                  <Activator TypeId="1" Value="1" />
                  <Activator TypeId="3" Negate="true" DataString="DM161.ClassState" Value="0" />
                </Activator>
              </Behaviour>
            </VisualLed>
            <VisualLed DataString="DM161.LedControl" Description="User" ImgPath=".\S-Dias\S-DIAS LED.xaml" ClrForeground="1342216703" Width="1.32" Height="1.32" Left="2.12" Top="12.96">
              <Behaviour ClrForeground="4278229503">
                <Activator TypeId="3" DataString="DM161.LedControl" Value="1" />
              </Behaviour>
              <Behaviour ClrForeground="4278229503" Interval="500">
                <Activator TypeId="3" DataString="DM161.LedControl" Value="2" />
              </Behaviour>
              <Behaviour ClrForeground="4278229503" Interval="250">
                <Activator TypeId="3" DataString="DM161.LedControl" Value="3" />
              </Behaviour>
            </VisualLed>
            <!-- X1-->
            <VisualLed Description="Digital input 1" ImgPath=".\S-Dias\S-DIAS LED.xaml" ClrForeground="1342242560" Width="1.32" Height="1.32" Left="2.12" Top="19.31">
              <Behaviour ClrForeground="4278255360">
                <Activator TypeId="3" DataString="DM161.Input1" Value="1" />
              </Behaviour>
            </VisualLed>
            <VisualLed Description="Digital input 2" ImgPath=".\S-Dias\S-DIAS LED.xaml" ClrForeground="1342242560" Width="1.32" Height="1.32" Left="2.12" Top="22.49">
              <Behaviour ClrForeground="4278255360">
                <Activator TypeId="3" DataString="DM161.Input2" Value="1" />
              </Behaviour>
            </VisualLed>
            <VisualLed Description="Digital input 3" ImgPath=".\S-Dias\S-DIAS LED.xaml" ClrForeground="1342242560" Width="1.32" Height="1.32" Left="2.12" Top="25.66">
              <Behaviour ClrForeground="4278255360">
                <Activator TypeId="3" DataString="DM161.Input3" Value="1" />
              </Behaviour>
            </VisualLed>
            <VisualLed Description="Digital input 4" ImgPath=".\S-Dias\S-DIAS LED.xaml" ClrForeground="1342242560" Width="1.32" Height="1.32" Left="2.12" Top="28.84">
              <Behaviour ClrForeground="4278255360">
                <Activator TypeId="3" DataString="DM161.Input4" Value="1" />
              </Behaviour>
            </VisualLed>
            <!-- X2-->
            <VisualLed Description="Digital input 5" ImgPath=".\S-Dias\S-DIAS LED.xaml" ClrForeground="1342242560" Width="1.32" Height="1.32" Left="2.12" Top="34.66">
              <Behaviour ClrForeground="4278255360">
                <Activator TypeId="3" DataString="DM161.Input5" Value="1" />
              </Behaviour>
            </VisualLed>
            <VisualLed Description="Digital input 6" ImgPath=".\S-Dias\S-DIAS LED.xaml" ClrForeground="1342242560" Width="1.32" Height="1.32" Left="2.12" Top="37.84">
              <Behaviour ClrForeground="4278255360">
                <Activator TypeId="3" DataString="DM161.Input6" Value="1" />
              </Behaviour>
            </VisualLed>
            <VisualLed Description="Digital input 7" ImgPath=".\S-Dias\S-DIAS LED.xaml" ClrForeground="1342242560" Width="1.32" Height="1.32" Left="2.12" Top="41.01">
              <Behaviour ClrForeground="4278255360">
                <Activator TypeId="3" DataString="DM161.Input7" Value="1" />
              </Behaviour>
            </VisualLed>
            <VisualLed Description="Digital input 8" ImgPath=".\S-Dias\S-DIAS LED.xaml" ClrForeground="1342242560" Width="1.32" Height="1.32" Left="2.12" Top="44.19">
              <Behaviour ClrForeground="4278255360">
                <Activator TypeId="3" DataString="DM161.Input8" Value="1" />
              </Behaviour>
            </VisualLed>
            <!-- X3-->
            <VisualLed Description="Digital output 1" ImgPath=".\S-Dias\S-DIAS LED.xaml" ClrForeground="1342216703" Width="1.32" Height="1.32" Left="2.12" Top="50.01">
              <Behaviour ClrForeground="4278229503">
                <Activator TypeId="3" DataString="DM161.Output1" Value="1" />
              </Behaviour>
            </VisualLed>
            <VisualLed Description="Digital output 2" ImgPath=".\S-Dias\S-DIAS LED.xaml" ClrForeground="1342216703" Width="1.32" Height="1.32" Left="2.12" Top="53.18">
              <Behaviour ClrForeground="4278229503">
                <Activator TypeId="3" DataString="DM161.Output2" Value="1" />
              </Behaviour>
            </VisualLed>
            <VisualLed Description="Digital output 3" ImgPath=".\S-Dias\S-DIAS LED.xaml" ClrForeground="1342216703" Width="1.32" Height="1.32" Left="2.12" Top="56.36">
              <Behaviour ClrForeground="4278229503">
                <Activator TypeId="3" DataString="DM161.Output3" Value="1" />
              </Behaviour>
            </VisualLed>
            <VisualLed Description="Digital output 4" ImgPath=".\S-Dias\S-DIAS LED.xaml" ClrForeground="1342216703" Width="1.32" Height="1.32" Left="2.12" Top="59.53">
              <Behaviour ClrForeground="4278229503">
                <Activator TypeId="3" DataString="DM161.Output4" Value="1" />
              </Behaviour>
            </VisualLed>
            <!-- X4-->
            <VisualLed Description="Digital output 5" ImgPath=".\S-Dias\S-DIAS LED.xaml" ClrForeground="1342216703" Width="1.32" Height="1.32" Left="2.12" Top="65.35">
              <Behaviour ClrForeground="4278229503">
                <Activator TypeId="3" DataString="DM161.Output5" Value="1" />
              </Behaviour>
            </VisualLed>
            <VisualLed Description="Digital output 6" ImgPath=".\S-Dias\S-DIAS LED.xaml" ClrForeground="1342216703" Width="1.32" Height="1.32" Left="2.12" Top="68.53">
              <Behaviour ClrForeground="4278229503">
                <Activator TypeId="3" DataString="DM161.Output6" Value="1" />
              </Behaviour>
            </VisualLed>
            <VisualLed Description="Digital output 7" ImgPath=".\S-Dias\S-DIAS LED.xaml" ClrForeground="1342216703" Width="1.32" Height="1.32" Left="2.12" Top="71.7">
              <Behaviour ClrForeground="4278229503">
                <Activator TypeId="3" DataString="DM161.Output7" Value="1" />
              </Behaviour>
            </VisualLed>
            <VisualLed Description="Digital output 8" ImgPath=".\S-Dias\S-DIAS LED.xaml" ClrForeground="1342216703" Width="1.32" Height="1.32" Left="2.12" Top="74.88">
              <Behaviour ClrForeground="4278229503">
                <Activator TypeId="3" DataString="DM161.Output8" Value="1" />
              </Behaviour>
            </VisualLed>
            <!-- X5-->
            <VisualLed Description="Voltage Supply Ok" ImgPath=".\S-Dias\S-DIAS LED.xaml" ClrForeground="1342242560" Width="1.32" Height="1.32"  Left="2.12" Top="80.7">
              <Behaviour ClrForeground="4278255360">
                <Activator TypeId="3" DataString="DM161.VoltageOk" Value="1" />
              </Behaviour>
            </VisualLed>
          </VisualLeds>
          <!-- Stecker -->
          <VisualConnectors>
            <VisualConnector Description="X1" ImgPath=".\S-Dias\S-DIAS Phoenix 4-polig.xaml" Width="7.86" Height="15" Left="3.7" Top="16.93">
              <ConnectorPin DataString="DM161.Input1" Description="Digital Input 1" TypeId="1" />
              <ConnectorPin DataString="DM161.Input2" Description="Digital Input 2" TypeId="1" />
              <ConnectorPin DataString="DM161.Input3" Description="Digital Input 3" TypeId="1" />
              <ConnectorPin DataString="DM161.Input4" Description="Digital Input 4" TypeId="1" />
            </VisualConnector>
            <VisualConnector Description="X2" ImgPath=".\S-Dias\S-DIAS Phoenix 4-polig.xaml" Width="7.86" Height="15" Left="3.7" Top="32.28">
              <ConnectorPin DataString="DM161.Input5" Description="Digital Input 5" TypeId="1" />
              <ConnectorPin DataString="DM161.Input6" Description="Digital Input 6" TypeId="1" />
              <ConnectorPin DataString="DM161.Input7" Description="Digital Input 7" TypeId="1" />
              <ConnectorPin DataString="DM161.Input8" Description="Digital Input 8" TypeId="1" />
            </VisualConnector>
            <VisualConnector Description="X3" ImgPath=".\S-Dias\S-DIAS Phoenix 4-polig.xaml" Width="7.86" Height="15" Left="3.7" Top="47.62">
              <ConnectorPin DataString="DM161.Output1" Description="Digital Output 1" TypeId="1" />
              <ConnectorPin DataString="DM161.Output2" Description="Digital Output 2" TypeId="1" />
              <ConnectorPin DataString="DM161.Output3" Description="Digital Output 3" TypeId="1" />
              <ConnectorPin DataString="DM161.Output4" Description="Digital Output 4" TypeId="1" />
            </VisualConnector>
            <VisualConnector Description="X4" ImgPath=".\S-Dias\S-DIAS Phoenix 4-polig.xaml" Width="7.86" Height="15" Left="3.7" Top="62.97">
              <ConnectorPin DataString="DM161.Output5" Description="Digital Output 5" TypeId="1" />
              <ConnectorPin DataString="DM161.Output6" Description="Digital Output 6" TypeId="1" />
              <ConnectorPin DataString="DM161.Output7" Description="Digital Output 7" TypeId="1" />
              <ConnectorPin DataString="DM161.Output8" Description="Digital Output 8" TypeId="1" />
            </VisualConnector>
            <VisualConnector Description="X5" ImgPath=".\S-Dias\S-DIAS Phoenix 4-polig.xaml" Width="7.86" Height="15" Left="3.7" Top="78.32">
              <ConnectorPin Description="not connected" TypeId="0" />
              <ConnectorPin DataString="DM161.VoltageOk" Description="+24V" TypeId="1" />
              <ConnectorPin Description="not connected" TypeId="0" />
              <ConnectorPin DataString="DM161.VoltageOk" Description="GND" TypeId="1" />
            </VisualConnector>
          </VisualConnectors>
        </VisualModule>
      </VisualView>
    </VisualData>
  </HWDevice>
  <Class Name="DM161">
    <Uplink Name="SdiasIn" BusType="SDIAS" PlaceName="Place" />
	<Downlink Name="ClassState" Port="0" BusType="Hardwarealarme" Desc="Hardwarealarme" />
    <!-- General -->
    <Property Name="Required" Channel="Required" Editor="Combo:1=Module is required;0=Module is not required" Desc="0=module is not required 1=module is required (CPU will crash if module is missing)" />
    <IOState Name="Class State" Channel="ClassState" Desc="This server shows the status of the hardware class. If the state is not equal than _ClassOK, an error has occurred " Type="" />
    <IOState Name="Device ID" Channel="DeviceID" IsInfo="true" Type="" Desc="This server shows the device ID  of the hardware module" />
    <IOState Name="FPGA Version" Channel="FPGAVersion" Format="V{5-8}.{1-4}" IsInfo="true" Desc="Shows the actual FPGA version of the module in the format x.y (e.g. 16#10 means v1.0)" />
    <IOState Name="Hardware Version" Channel="HwVersion" IsInfo="true" Format="V{9-16}.{5-8}{1-4}" Type="" Desc="Shows the hardware version of the module" /> 
    <IOState Name="Serial Number" Channel="SerialNo" IsInfo="true" Type="" Desc="This server shows the Serial Number of the hardware module" />
    <IOState Name="Retry Counter" Channel="RetryCounter" Desc="Is incremented in case of incorrect data transfer." />
    <Output Name="LED Control" Channel="LEDControl" Type="Digital" Desc="Sets a LED on hardware, to detect module. (0=LED off; 1=LED on; 2=blinking slowly; 3=blinking fast)" />
    <!-- Digital Inputs -->
    <IOComment Name="---------------------- Digital Inputs ----------------------" IsInfo="true" Desc=""/>
    <Input Name="Digital Input 1" Channel="Input1" Type="Digital" Desc="Input 1 value" />
    <Input Name="Digital Input 2" Channel="Input2" Type="Digital" Desc="Input 2 value" />
    <Input Name="Digital Input 3" Channel="Input3" Type="Digital" Desc="Input 3 value" />
    <Input Name="Digital Input 4" Channel="Input4" Type="Digital" Desc="Input 4 value" />
    <Input Name="Digital Input 5" Channel="Input5" Type="Digital" Desc="Input 5 value" />
    <Input Name="Digital Input 6" Channel="Input6" Type="Digital" Desc="Input 6 value" />
    <Input Name="Digital Input 7" Channel="Input7" Type="Digital" Desc="Input 7 value" />
    <Input Name="Digital Input 8" Channel="Input8" Type="Digital" Desc="Input 8 value" />
    <Input Name="Input Byte" Channel="InputByte" Type="Analog" Desc="Bit 0 to 7 ... Input 1 to 8" />
    <!-- Digital Outputs -->
    <IOComment Name="--------------------- Digital Outputs ----------------------" IsInfo="true" Desc=""/>
    <Output Name="Digital Out 1" Channel="Output1" Type="Digital" Desc="Digital Output 1" />
    <Output Name="Digital Out 2" Channel="Output2" Type="Digital" Desc="Digital Output 2" />
    <Output Name="Digital Out 3" Channel="Output3" Type="Digital" Desc="Digital Output 3" />
    <Output Name="Digital Out 4" Channel="Output4" Type="Digital" Desc="Digital Output 4" />
    <Output Name="Digital Out 5" Channel="Output5" Type="Digital" Desc="Digital Output 5" />
    <Output Name="Digital Out 6" Channel="Output6" Type="Digital" Desc="Digital Output 6" />
    <Output Name="Digital Out 7" Channel="Output7" Type="Digital" Desc="Digital Output 7" />
    <Output Name="Digital Out 8" Channel="Output8" Type="Digital" Desc="Digital Output 8" />
    <Output Name="Output Byte" Channel="OutputByte" Type="Analog" Desc="Bit 0 to 7 ... Output 1 to 8" />
    <IOState Name="Voltage OK Output 1-8" Channel="VoltageOk" Desc="Supply voltage ok (+24V Digital Out 1-8)" />

    <Script Name="DM161">
<Code>
def compPost_DM161(element, parameters):
  
  if parameters['varanBridge']:
    parameters['AddToSDiasTime'] = True
    element['result']['optional'] =  {'PDO': {'Wr':[], 'Rd':[], 'WrDyn':[], 'RdDyn':[]}}    
    SDIASPDORdAdd(0x2,element)
    SDIASPDOWrAdd(0x1,element)

</Code>
    </Script>  
  </Class>
</HWClassInfo>