<Schema name="FDTSERCOSParameterSchema" xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes" xmlns:fdt="x-schema:FDTDataTypesSchema.xml" xmlns:fdtpar="x-schema:DTMParameterSchema.xml">

	<!--Definition of Attributes-->

  <!--  Attribute for IDN Entry -->
  
  <!-- Element 1 of IDN Data block, 32 bits IDN, e.g. "66836" (0x00010514, S-0-1300.0.1) -->
  <AttributeType name="idn" dt:type="ui4"/>
  <AttributeType name="idnList" dt:type="bin.hex"/>
  
  <!-- IDN notation, Text format for Element 1 of IDN Data block. e.g. "S-0-1300.0.1" -->
  <AttributeType name="idnNotation" dt:type="ui4"/>
  
  <!-- Element 2 of IDN Data block, max length is 60 bytes -->
  <AttributeType name="idnName" dt:type="string"/>
    
  <!-- Element 3 of IDN Data block -->
  <AttributeType name="idnAttribute" dt:type="ui4"/>
  
  <!-- Element 4 of IDN Data block, max length is 12 bytes -->
  <AttributeType name="idnUnit" dt:type="ui4"/>
  
  <!-- Element 5 - 7 of IDN Data block, the data type and display format is defined by idnAttribute -->
  <AttributeType name="idnMinValue" dt:type="bin.hex"/>
  <AttributeType name="idnMaxValue" dt:type="bin.hex"/>
  <AttributeType name="idnData" dt:type="bin.hex"/>
  
  <AttributeType name="idnLength" dt:type="ui2"/>
  
  <!-- actionType for Parameter, WRITE, READ and CoMPare, EXECute a procedure command  -->
  <AttributeType name="actionType" dt:type="enumeration" dt:values="WR RDCMP EXEC"/>

  <AttributeType name="dbElement" dt:type="ui1"/>
  <AttributeType name="dataMask" dt:type="bin.hex"/>
  <AttributeType name="abortIfError" dt:type="boolean" default="1"/>
  <AttributeType name="gotoIfError" dt:type="i4"/>

  <!--Range of slaveAddress: 1 - 511 -->
  <AttributeType name="slaveAddress" dt:type="ui2"/>	
	
	<AttributeType name="vendorCode" dt:type="ui2"/>
	<AttributeType name="deviceID" dt:type="string"/>	
	
	<AttributeType name="vendorName" dt:type="string"/>
	<AttributeType name="deviceName" dt:type="string"/>
	<AttributeType name="revision" dt:type="ui2"/>
	<AttributeType name="hardwareRevision" dt:type="string"/>
	<AttributeType name="softwareRevision" dt:type="string"/>
	<AttributeType name="firmwareLoaderRevision" dt:type="string"/>
	<AttributeType name="OrderNumber" dt:type="string"/>
	<AttributeType name="serialNumber" dt:type="string"/>
	
	
	<AttributeType name="connectionNumber" dt:type="ui2"/>		
	<AttributeType name="connectionInstance" dt:type="ui1"/>	
	<AttributeType name="connectionSetup" dt:type="ui2"/>		
	<AttributeType name="actualLength" dt:type="ui2"/>		
	<AttributeType name="cycleTimeFactor" dt:type="ui4"/>
	<AttributeType name="allowedDataLosses" dt:type="ui2"/>		

	<AttributeType name="slot" dt:type="ui1"/>
	<AttributeType name="moduleTypeCode" dt:type="string"/>
	
	<AttributeType name="index" dt:type="ui2"/>
	
	
	<!-- ************************************************** -->
	<!--        Attributes for IO Function Group            -->
	<!-- ************************************************** -->
	
	<!-- FGIdn, the IDN bit0-15 for Function Group -->
	<AttributeType name="FGIdn" dt:type="ui2"/>
	
  <!-- notation for Function Group, e.g. "S-0-1500", "S-0-1502" -->
	<AttributeType name="FGNotation" dt:type="string"/>
	
	<!-- IOFGType, type of IO Function Group, e.g. "IO Bus Head", "Digital Output"  -->
	<!-- For each IOFGType, it has a predefined FGIdn.  E.g. "IO Bus Head" => "S-0-1500" -->
	<AttributeType name="IOFGType" dt:type="string"/>
	
	<AttributeType name="IOFGConfig" dt:type="boolean"/>
  
  <!-- IO_FG.x.20 Parameter Channel Transmit -->
  <AttributeType name="parameterChannelTransmit" dt:type="bin.hex"/>
  	
	<!-- IO_FG.x.22 Fall Back Value -->
  <AttributeType name="fallbackOutput" dt:type="bin.hex"/>
  
  <!-- IO_FG.x.23 Min. Delay Time -->
  <AttributeType name="minDelayTime" dt:type="ui4"/>
  
  <!-- IO_FG.x.24 Max. Delay Time -->
  <AttributeType name="maxDelayTime" dt:type="ui4"/>
  
  <!-- IO_FG.x.25 Slave Index -->
  <AttributeType name="slaveIndex" dt:type="ui2"/>

  <!-- IO_FG.x.26 Available Slaves -->
  <AttributeType name="availableSlaves" dt:type="bin.hex"/>

  <!-- IO_FG.x.27 UNID -->
  <AttributeType name="unid" dt:type="bin.hex"/>  

  
  <!-- Common attributes for PDOUT PDIN DIAGOUT DIAGIN ( IO_FG.x.3 - IO_FG.x.18 ) -->
  
  <AttributeType name="channelType" dt:type="enumeration" dt:values="PDOUT PDIN DIAGOUT DIAGIN"/>
  <AttributeType name="quantity" dt:type="ui2"/>
  <AttributeType name="width" dt:type="ui2"/>
 
  <!-- ToDo -->
  <AttributeType name="operationMode" dt:type="enumeration" dt:values="Op1 Op2 Op3 Op4 etc"/>
 
   <!--  0:  This slave is not optional -->
  <AttributeType name="optional" dt:type="boolean" default="0"/>
  
   <!--  0:  This slave is not pluggable -->
  <AttributeType name="hotPluggable" dt:type="boolean" default="0"/>
  
  <!--  0:  This slave does not support nrt -->
  <AttributeType name="nrtSupport" dt:type="boolean" default="0"/>

	<ElementType name="ElectronicLabel" content="empty" model="closed">
		<attribute type="fdt:nodeId" required="no"/>
		<attribute type="vendorCode" required="yes"/> 
		<attribute type="deviceID" required="yes"/>
		
		<attribute type="vendorName" required="no"/>
		<attribute type="deviceName" required="no"/>
		<attribute type="revision" required="no"/> 
		<attribute type="hardwareRevision" required="no"/> 
		<attribute type="softwareRevision" required="no"/>
		<attribute type="firmwareLoaderRevision" required="no"/>
		<attribute type="OrderNumber" required="no"/> 
		<attribute type="serialNumber" required="no"/> 	
	</ElementType>
	
	<ElementType name="IdnSignal" content="empty" model="closed">
	  <attribute type="fdt:nodeId" required="no"/>	
	  <attribute type="idn" required="yes"/> 
		<attribute type="idnLength" required="yes"/>	
			
	</ElementType>
	
	<ElementType name="IdnSignalList" content="eltOnly" model="closed">
		<element type="IdnSignal" minOccurs="1" maxOccurs="*"/>
	</ElementType>
	
	<ElementType name="Producer" content="mixed" model="closed">		
		<attribute type="connectionInstance" required="yes"/>
		<attribute type="connectionSetup" required="yes"/>
		<attribute type="actualLength" required="yes"/>
		<attribute type="cycleTimeFactor" required="yes"/>
		<element type="IdnSignalList" minOccurs="0" maxOccurs="1"/>
	</ElementType>
	
	<ElementType name="Consumer" content="mixed" model="closed">		
		<attribute type="connectionInstance" required="yes"/>
		<attribute type="connectionSetup" required="yes"/>		
		<attribute type="actualLength" required="yes"/>
		<attribute type="allowedDataLosses" required="yes"/>	
		<element type="IdnSignalList" minOccurs="0" maxOccurs="1"/>
	</ElementType>
	
	<ElementType name="Connection" content="eltOnly" model="closed">	 
    <attribute type="connectionNumber" required="no"/>	
	  <group order="one">
			<element type="Producer"/>
			<element type="Consumer"/>
		</group>
	</ElementType>	
	
	<ElementType name="Connections" content="eltOnly" model="closed">
		<element type="Connection" minOccurs="0" maxOccurs="*"/>
	</ElementType>
			
	<ElementType name="Parameter" content="empty" model="closed">
	  <attribute type="fdt:nodeId" required="no"/>	
	  
	  <attribute type="idn" required="yes"/> 	  
	  <attribute type="dbElement" required="yes"/>
	  <attribute type="actionType" required="yes"/> 	
	  
	   <!--  fdt:byteLength:  byteSize (defined in SIIICfg.xsd) -->	  
	  <attribute type="fdt:byteLength" required="no"/>
	  
	  <!--  fdt:binData:  data (defined in SIIICfg.xsd) -->	  
	  <attribute type="fdt:binData" required="no"/>
	  <attribute type="dataMask" required="no"/>
	  
	  <attribute type="abortIfError" required="no"/>
	  <attribute type="gotoIfError" required="no"/>
	  
	  <!--  fdt:descriptor:  comment (defined in SIIICfg.xsd) -->
	  <attribute type="fdt:descriptor" required="no"/>
	  
	  <!--  fdt:languageId:  LcId (defined in SIIICfg.xsd) -->
	  <attribute type="fdt:languageId" required="no"/>
			
	</ElementType>
	
	<ElementType name="Signal" content="empty" model="closed">
	  <attribute type="fdt:nodeId" required="no"/>
	  <attribute type="index" required="yes"/>
	  <attribute type="fdt:name" required="yes"/>
	</ElementType>
	
	<ElementType name="DataObject" content="eltOnly" model="closed">
	  <attribute type="fdt:nodeId" required="no"/>
	  <attribute type="channelType" required="yes"/>
	  <attribute type="quantity" required="yes"/> 
	  <attribute type="width" required="yes"/>
		<element type="Signal" minOccurs="0" maxOccurs="*"/>
	</ElementType>
	
  <!-- Use FGIdn to specify the type of IOFG. --> 	
  <!-- Together with the slot defined in parent element IOModule, IDN can be encoded--> 	
  
  <!-- Another proposal is to use IDN, e.g. "S-0-1502.1.20--> 	
  
	<ElementType name="IOFG" content="mixed" model="closed">
		<attribute type="fdt:nodeId" required="no"/>
		<attribute type="fdt:name" required="yes"/>
		<attribute type="FGNotation" required="yes"/>
	  <!-- or 	
        <attribute type="FGIdn" required="yes"/>
           or 
		<attribute type="IOFGType" required="no"/> -->
		
	   <attribute type="IOFGConfig" required="yes"/> 
		
		<attribute type="parameterChannelTransmit" required="no"/>
		<attribute type="fallbackOutput" required="no"/>
		<attribute type="minDelayTime" required="no"/> 
		<attribute type="maxDelayTime" required="no"/>
		<attribute type="slaveIndex" required="no"/>
		<attribute type="availableSlaves" required="no"/>
		<attribute type="unid" required="no"/>
				
		<element type="DataObject" minOccurs="0" maxOccurs="*"/>
		
	</ElementType>	
		
	<!-- IOModule must have at least one IOFG ??? -->
	<ElementType name="IO_Module" content="mixed" model="closed">
		<attribute type="fdt:nodeId" required="no"/>
		<attribute type="slot" required="yes"/>
		<attribute type="moduleTypeCode" required="yes"/> 
		<attribute type="fdt:name" required="no"/> 
		<element   type="IOFG" minOccurs="1" maxOccurs="*"/>		
	</ElementType>

  <ElementType name="IO_Cyclic" content="mixed" model="closed">	
	  <attribute type="fdt:nodeId" required="no"/>	
		<element   type="IO_Module" minOccurs="0" maxOccurs="*"/>
	</ElementType>
	

	<!-- IO_Safety is not defined yet -->
	<ElementType name="IO_Safety" content="mixed" model="open">     
  </ElementType>
  
  <ElementType name="CP2Parameters" content="eltOnly" model="open">   
    <element   type="Parameter" minOccurs="0" maxOccurs="*"/>	  
  </ElementType>
    	
  <ElementType name="CP3Parameters" content="eltOnly" model="open">   
    <element   type="Parameter" minOccurs="0" maxOccurs="*"/>	  
  </ElementType>
			
  <ElementType name="CP4Parameters" content="eltOnly" model="open">   
    <element   type="Parameter" minOccurs="0" maxOccurs="*"/>	  
  </ElementType>
  
  <!-- FSP_Drive is not defined yet -->
  <ElementType name="Parameters" content="eltOnly" model="open">   
     <element   type="CP2Parameters" minOccurs="0" maxOccurs="1"/>	 
     <element   type="CP3Parameters" minOccurs="0" maxOccurs="1"/>	 
     <element   type="CP4Parameters" minOccurs="0" maxOccurs="1"/>	 
  </ElementType>
  
	<ElementType name="FSP_IO" content="eltOnly" model="closed">	
	  <attribute type="fdt:nodeId" required="no"/>		  
		<group order="one" minOccurs="0" maxOccurs="1">
			<element type="IO_Safety"/>
			<element type="IO_Cyclic"/>
		</group>
	</ElementType>  
	    
  <!-- FSP_Drive is not defined yet -->
  <ElementType name="FSP_Drive" content="eltOnly" model="open">   
 	 <attribute type="operationMode" required="yes"/>
    
	<!-- TODO: drive dtm defines connections strait forward (should it do this, or masterDTM should? ... 
          how to transfer drive connections to masterDTM-->
  </ElementType>
	     
	<ElementType name="FSP" content="mixed" model="closed">	
	  <attribute type="fdt:nodeId" required="no"/> 
	  <element   type="FSP_IO" minOccurs="0" maxOccurs="1"/>
	  <element   type="FSP_Drive" minOccurs="0" maxOccurs="1"/>
	</ElementType>
		

	<ElementType name="SercosIIINode" content="eltOnly" model="closed">
	  <attribute type="fdt:nodeId" required="no"/>
	  <attribute type="fdt:readAccess" required="no"/>
   	<attribute type="fdt:writeAccess" required="no"/>
   	
   	<attribute type="slaveAddress" required="yes"/>
   	
   	<attribute type="optional" required="no"/>
   	<attribute type="hotPluggable" required="no"/>
   	<attribute type="nrtSupport" required="no"/>
   	
		<element   type="ElectronicLabel" minOccurs="1" maxOccurs="1"/>	
    <element   type="Connections" minOccurs="0" maxOccurs="1"/>		
		<element   type="FSP" minOccurs="0" maxOccurs="1"/>		
		<element   type="Parameters" minOccurs="0" maxOccurs="1"/>
  </ElementType>
  	    		
</Schema>