Use Ignition to Interact with a Light Tower

The module uses XML to declare structured datatypes and define communication parameters. I usually help customers do this for specific I/O modules, as it can be somewhat complicated. Like this one:

<Controller>
  <DataTypes>
    <DataType Name="IFM_AL1x2x_Cfg1_t" Handle="1364">
      <Member Name="AccessRights" DataType="SINT" Dimension="0" />
      <Member Name="ProcDataLen" DataType="SINT" Dimension="0" />
    </DataType>
    <DataType Name="IFM_AL1x2x_Cfg2_t" Handle="40ae">
      <Member Name="PortMode" DataType="SINT" Dimension="0" />
      <Member Name="CycleTime" DataType="SINT" Dimension="0" />
      <Member Name="ByteSwap" DataType="SINT" Dimension="0" />
      <Member Name="Validation" DataType="SINT" Dimension="0" />
      <Member Name="VendorA" DataType="SINT" Dimension="0" />
      <Member Name="VendorB" DataType="SINT" Dimension="0" />
      <Member Name="DeviceA" DataType="SINT" Dimension="0" />
      <Member Name="DeviceB" DataType="SINT" Dimension="0" />
      <Member Name="DeviceC" DataType="SINT" Dimension="0" />
      <Member Name="Reserved" DataType="SINT" Dimension="0" />
      <Member Name="FailSafeMode" DataType="SINT" Dimension="0" />
      <Member Name="FailSafeValue" DataType="SINT" Dimension="0" />
    </DataType>
    <DataType Name="IFM_AL1x2x_In1_t" Handle="178b">
      <Member Name="DigitalIn" DataType="INT" Dimension="0" />
      <Member Name="X1pin4" DataType="BIT" Target="DigitalIn" BitNumber="0" />
      <Member Name="X2pin4" DataType="BIT" Target="DigitalIn" BitNumber="1" />
      <Member Name="X3pin4" DataType="BIT" Target="DigitalIn" BitNumber="2" />
      <Member Name="X4pin4" DataType="BIT" Target="DigitalIn" BitNumber="3" />
      <Member Name="X5pin4" DataType="BIT" Target="DigitalIn" BitNumber="4" />
      <Member Name="X6pin4" DataType="BIT" Target="DigitalIn" BitNumber="5" />
      <Member Name="X7pin4" DataType="BIT" Target="DigitalIn" BitNumber="6" />
      <Member Name="X8pin4" DataType="BIT" Target="DigitalIn" BitNumber="7" />
      <Member Name="X1pin2" DataType="BIT" Target="DigitalIn" BitNumber="8" />
      <Member Name="X2pin2" DataType="BIT" Target="DigitalIn" BitNumber="9" />
      <Member Name="X3pin2" DataType="BIT" Target="DigitalIn" BitNumber="10" />
      <Member Name="X4pin2" DataType="BIT" Target="DigitalIn" BitNumber="11" />
      <Member Name="X5pin2" DataType="BIT" Target="DigitalIn" BitNumber="12" />
      <Member Name="X6pin2" DataType="BIT" Target="DigitalIn" BitNumber="13" />
      <Member Name="X7pin2" DataType="BIT" Target="DigitalIn" BitNumber="14" />
      <Member Name="X8pin2" DataType="BIT" Target="DigitalIn" BitNumber="15" />
      <Member Name="Status" DataType="INT" Dimension="0" />
      <Member Name="X1short" DataType="BIT" Target="Status" BitNumber="0" />
      <Member Name="X2short" DataType="BIT" Target="Status" BitNumber="1" />
      <Member Name="X3short" DataType="BIT" Target="Status" BitNumber="2" />
      <Member Name="X4short" DataType="BIT" Target="Status" BitNumber="3" />
      <Member Name="X5short" DataType="BIT" Target="Status" BitNumber="4" />
      <Member Name="X6short" DataType="BIT" Target="Status" BitNumber="5" />
      <Member Name="X7short" DataType="BIT" Target="Status" BitNumber="6" />
      <Member Name="X8short" DataType="BIT" Target="Status" BitNumber="7" />
      <Member Name="AuxPwr" DataType="BIT" Target="Status" BitNumber="8" />
      <Member Name="SensorPwr" DataType="BIT" Target="Status" BitNumber="9" />
    </DataType>
    <DataType Name="IFM_AL1x2x_In_Acyclic_t" Handle="b241">
      <Member Name="Port" DataType="INT" Dimension="0" />
      <Member Name="Index" DataType="INT" Dimension="0" />
      <Member Name="SubIndex" DataType="INT" Dimension="0" />
      <Member Name="Command" DataType="SINT" Dimension="0" />
      <Member Name="Handshake" DataType="BIT" Target="Command" BitNumber="7" />
      <Member Name="Result" DataType="SINT" Dimension="0" />
      <Member Name="LenAndData" DataType="SINT" Dimension="33" />
    </DataType>
    <DataType Name="IFM_AL1x2x_In_PQI_Diag_t" Handle="a9f9">
      <Member Name="PQI" DataType="INT" Dimension="0" />
      <Member Name="IOLMode" DataType="BIT" Target="PQI" BitNumber="0" />
      <Member Name="NotCnx" DataType="BIT" Target="PQI" BitNumber="1" />
      <Member Name="Invalid" DataType="BIT" Target="PQI" BitNumber="2" />
      <Member Name="WrongID" DataType="BIT" Target="PQI" BitNumber="3" />
      <Member Name="WrongTime" DataType="BIT" Target="PQI" BitNumber="4" />
      <Member Name="WrongInLen" DataType="BIT" Target="PQI" BitNumber="5" />
      <Member Name="WrongOutLen" DataType="BIT" Target="PQI" BitNumber="6" />
      <Member Name="DiagPresent" DataType="BIT" Target="PQI" BitNumber="7" />
      <Member Name="VendorA" DataType="SINT" Dimension="0" />
      <Member Name="VendorB" DataType="SINT" Dimension="0" />
      <Member Name="DeviceA" DataType="SINT" Dimension="0" />
      <Member Name="DeviceB" DataType="SINT" Dimension="0" />
      <Member Name="DeviceC" DataType="SINT" Dimension="0" />
      <Member Name="Reserved1" DataType="SINT" Dimension="0" />
      <Member Name="Event1Bits" DataType="SINT" Dimension="0" />
      <Member Name="Event1A" DataType="SINT" Dimension="0" />
      <Member Name="Event1B" DataType="SINT" Dimension="0" />
      <Member Name="Event2Bits" DataType="SINT" Dimension="0" />
      <Member Name="Event2A" DataType="SINT" Dimension="0" />
      <Member Name="Event2B" DataType="SINT" Dimension="0" />
      <Member Name="Event3Bits" DataType="SINT" Dimension="0" />
      <Member Name="Event3A" DataType="SINT" Dimension="0" />
      <Member Name="Event3B" DataType="SINT" Dimension="0" />
      <Member Name="Reserved2" DataType="SINT" Dimension="0" />
    </DataType>
    <DataType Name="IFM_AL1x2x_Out1_t" Handle="955d">
      <Member Name="DigitalOut" DataType="INT" Dimension="0" />
      <Member Name="X1pin4" DataType="BIT" Target="DigitalOut" BitNumber="0" />
      <Member Name="X2pin4" DataType="BIT" Target="DigitalOut" BitNumber="1" />
      <Member Name="X3pin4" DataType="BIT" Target="DigitalOut" BitNumber="2" />
      <Member Name="X4pin4" DataType="BIT" Target="DigitalOut" BitNumber="3" />
      <Member Name="X5pin4" DataType="BIT" Target="DigitalOut" BitNumber="4" />
      <Member Name="X6pin4" DataType="BIT" Target="DigitalOut" BitNumber="5" />
      <Member Name="X7pin4" DataType="BIT" Target="DigitalOut" BitNumber="6" />
      <Member Name="X8pin4" DataType="BIT" Target="DigitalOut" BitNumber="7" />
    </DataType>
    <DataType Name="IFM_AL1x2x_Out_Acyclic_t" Handle="de47">
      <Member Name="Port" DataType="INT" Dimension="0" />
      <Member Name="Index" DataType="INT" Dimension="0" />
      <Member Name="SubIndex" DataType="INT" Dimension="0" />
      <Member Name="Command" DataType="SINT" Dimension="0" />
      <Member Name="Trigger" DataType="BIT" Target="Command" BitNumber="7" />
      <Member Name="DataLen" DataType="SINT" Dimension="0" />
      <Member Name="Data" DataType="SINT" Dimension="32" />
      <Member Name="Reserved" DataType="INT" Dimension="0" />
    </DataType>
  </DataTypes>
  <Tags>
    <Tag Name="IFM_AL1x2x_Cfg1" DataType="IFM_AL1x2x_Cfg1_t" Dimensions="0">
      <Data>
        00 04 00 00
      </Data>
    </Tag>
    <Tag Name="IFM_AL1x2x_Cfg2" DataType="IFM_AL1x2x_Cfg2_t" Dimensions="8">
      <Data>
        03 00 01 00 00 00 00 00 00 00 00 00 03 00
        01 00 00 00 00 00 00 00 00 00 03 00 01 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00
      </Data>
    </Tag>
    <Tag Name="IFM_AL1x2x_In1" DataType="IFM_AL1x2x_In1_t" Dimensions="0">
      <Data>
        00 00 00 00
      </Data>
    </Tag>
    <Tag Name="IFM_AL1x2x_In2" DataType="IFM_AL1x2x_In_Acyclic_t" Dimensions="0">
      <Data>
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00
      </Data>
    </Tag>
    <Tag Name="IFM_AL1x2x_In3" DataType="IFM_AL1x2x_In_PQI_Diag_t" Dimensions="8">
      <Data>
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      </Data>
    </Tag>
    <Tag Name="IFM_AL1x2x_In4" DataType="SINT" Dimensions="8 32">
      <Data>
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      </Data>
    </Tag>
    <Tag Name="IFM_AL1x2x_Out1" DataType="IFM_AL1x2x_Out1_t" Dimensions="0">
      <Data>
        00 00 00 00
      </Data>
    </Tag>
    <Tag Name="IFM_AL1x2x_Out2" DataType="IFM_AL1x2x_Out_Acyclic_t" Dimensions="0">
      <Data>
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00
      </Data>
    </Tag>
    <Tag Name="IFM_AL1x2x_Out3" DataType="SINT" Dimensions="8 32">
      <Data>
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      </Data>
    </Tag>
  </Tags>
  <Assemblies>
    <Assembly Name="IFM_AL1x2x_In" CxPt="100100">
      <Member Bits="32" Target="IFM_AL1x2x_In1" />
      <Member Bits="336" Target="IFM_AL1x2x_In2" />
      <Member Bits="144" Target="IFM_AL1x2x_In3[0]" />
      <Member Bits="144" Target="IFM_AL1x2x_In3[1]" />
      <Member Bits="144" Target="IFM_AL1x2x_In3[2]" />
      <Member Bits="144" Target="IFM_AL1x2x_In3[3]" />
      <Member Bits="144" Target="IFM_AL1x2x_In3[4]" />
      <Member Bits="144" Target="IFM_AL1x2x_In3[5]" />
      <Member Bits="144" Target="IFM_AL1x2x_In3[6]" />
      <Member Bits="144" Target="IFM_AL1x2x_In3[7]" />
      <Member Bits="2048" Target="IFM_AL1x2x_In4" />
    </Assembly>
    <Assembly Name="IFM_AL1x2x_Out" CxPt="100150">
      <Member Bits="32" Target="IFM_AL1x2x_Out1" />
      <Member Bits="336" Target="IFM_AL1x2x_Out2" />
      <Member Bits="2048" Target="IFM_AL1x2x_Out3" />
    </Assembly>
    <Assembly Name="IFM_AL1x2x_Cfg" CxPt="100199">
      <Member Bits="16" Target="IFM_AL1x2x_Cfg1" />
      <Member Bits="768" Target="IFM_AL1x2x_Cfg2" />
    </Assembly>
  </Assemblies>
  <Modules>
    <Module Name="G3_IO_Link_1" CatalogNumber="ETHERNET-MODULE" Inhibited="false" Direction="Client"
    Vendor="322" ProductType="12" ProductCode="1322" Major="1" Minor="1"
    InRPI="200000" UnicastIn="true" InRTMF="1" OutRPI="200000" UnicastOut="true" OutRTMF="4">
      <Route>port 2 162.117.93.132</Route>
      <Application>2004 24c7 2c96 2c64</Application>
      <InputTag>(assembly 100100)</InputTag>
      <OutputTag>(assembly 100150)</OutputTag>
      <ConfigTag>(assembly 100199)</ConfigTag>
    </Module>
  </Modules>
  <Code># Default Event Handler Code Placeholder
from system.cip import *
logger = system.util.getLogger(&quot;dummyCipHandler&quot;)

def dummyHandler(event):
	logger.debug(str(event))</Code>
</Controller>
4 Likes