From 021872872e91232a7e67f1c1aa8f808019e0a722 Mon Sep 17 00:00:00 2001 From: Alexander Schwinn <al.schwinn@gsi.de> Date: Mon, 17 Jul 2017 15:20:58 +0200 Subject: [PATCH] Bug 1441 - Restructurization of silecsdeploy - fixed xsd --- silecs-codegen/src/xml/xmltemplate.py | 17 +- silecs-model/src/xml/DeploySchema.xsd | 931 +++++++++++++++----------- 2 files changed, 539 insertions(+), 409 deletions(-) diff --git a/silecs-codegen/src/xml/xmltemplate.py b/silecs-codegen/src/xml/xmltemplate.py index b09e09f..bb2c1b8 100644 --- a/silecs-codegen/src/xml/xmltemplate.py +++ b/silecs-codegen/src/xml/xmltemplate.py @@ -47,7 +47,7 @@ silecsHeader = """<?xml version="1.0" encoding="UTF-8"?> def getSilecsHeader(silecsVersion): date = time.strftime("%x") owner = getpass.getuser() - return silecsHeader%(silecsVersion,date,date,owner,owner) + return silecsHeader % (silecsVersion, date, date, owner, owner) #========================================================= # DESIGN TEMPLATE @@ -69,10 +69,10 @@ designTemplate = """<?xml version="1.0" encoding="UTF-8"?> </SILECS-Class> </SILECS-Design> """ -def getDesignTemplate(designName,schemaPath,silecsVersion): +def getDesignTemplate(designName, schemaPath, silecsVersion): date = time.strftime("%x") owner = getpass.getuser() - return designTemplate%(silecsVersion,date,date,schemaPath,owner,owner,designName) + return designTemplate % (silecsVersion, date, date, schemaPath, owner, owner, designName) #========================================================= @@ -87,11 +87,12 @@ deployTemplate = """<?xml version="1.0" encoding="UTF-8"?> <Editor user-login="%s"/> </Information> <Deploy-Unit name="%s" version="0.1.0"/> + <SilecsDesign silecs-design-name="" silecs-design-version=""/> + <Controller host-name=""> - <Siemens-PLC system="TIA-PORTAL" model="SIMATIC_S7-300" protocol="DEVICE_MODE" base-DB-number="1"/> - <SilecsDesign silecs-design-version="" silecs-design-name=""> - <Device device-name="" /> - </SilecsDesign> + <Siemens-PLC system="TIA-PORTAL" model="SIMATIC_S7-300" protocol="DEVICE_MODE" base-DB-number="1"> + <Device silecs-device-label="dev0" silecs-design-ref="" fesa-device-name="" fesa-fec-name=""/> + </Siemens-PLC> </Controller> </SILECS-Deploy> """ @@ -99,4 +100,4 @@ deployTemplate = """<?xml version="1.0" encoding="UTF-8"?> def getDeployTemplate(deployName, schemaPath, silecsVersion): date = time.strftime("%x") owner = getpass.getuser() - return deployTemplate%(silecsVersion,date,date,schemaPath,owner,owner,deployName) + return deployTemplate % (silecsVersion, date, date, schemaPath, owner, owner, deployName) diff --git a/silecs-model/src/xml/DeploySchema.xsd b/silecs-model/src/xml/DeploySchema.xsd index ffc6ec6..350dab9 100644 --- a/silecs-model/src/xml/DeploySchema.xsd +++ b/silecs-model/src/xml/DeploySchema.xsd @@ -1,33 +1,33 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright 2016 CERN and GSI -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see http://www.gnu.org/licenses/.--> +<!-- Copyright 2016 CERN and GSI This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. --> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:include schemaLocation="shared.xsd" /> - + <xs:element name="SILECS-Deploy"> <xs:annotation> - <xs:documentation>A SILECS configuration contains the class designs, the memory mapping and the hardware distribution for a given set of PLCs.</xs:documentation> + <xs:documentation>A SILECS configuration contains the class designs, + the memory mapping and the hardware distribution for a given set of + PLCs. + </xs:documentation> <xs:appinfo> <doc> - The SILECS configuration defines the data structure and the communication parameters required for the interconnection of the PLCs and the Front-End clients. It consists of 3 parts: - <ol> - <li> Design: to define the structure of the exchanged data - <li> Mapping: to define the PLC memory mapping and the protocol parameters - <li> Generation: to define the hardware on which we will deployed the different Mapping - </ol> - Generally under the responsability of a unique expert entity, an SILECS configuration is done for a set of classes and PLCs in the scope of a particular project or set of equipment. + The SILECS configuration defines the data structure and the + communication parameters required for the interconnection of the + PLCs and the Front-End clients. It consists of 3 parts: + <ol> + <li> Design: to define the structure of the exchanged data + <li> Mapping: to define the PLC memory mapping and the + protocol + parameters + <li> Generation: to define the hardware on + which we will deployed the + different Mapping + </ol> + Generally + under the responsability of a unique expert entity, an SILECS + configuration is done for a set of classes and PLCs in the scope of + a particular project or set of equipment. </doc> </xs:appinfo> </xs:annotation> @@ -38,12 +38,12 @@ along with this program. If not, see http://www.gnu.org/licenses/.--> <xs:sequence> <xs:element name="Owner"> <xs:complexType> - <xs:attribute name="user-login" type="xs:string" use="required"/> + <xs:attribute name="user-login" type="xs:string" use="required" /> </xs:complexType> </xs:element> <xs:element name="Editor" maxOccurs="unbounded"> <xs:complexType> - <xs:attribute name="user-login" type="xs:string" use="required"/> + <xs:attribute name="user-login" type="xs:string" use="required" /> </xs:complexType> </xs:element> </xs:sequence> @@ -51,19 +51,21 @@ along with this program. If not, see http://www.gnu.org/licenses/.--> </xs:element> <xs:element name="Deploy-Unit"> <xs:complexType> - <xs:attribute name="name" type="DeployNameType" use="required"/> - <xs:attribute name="version" type="VersionType" use="required"/> + <xs:attribute name="name" type="DeployNameType" use="required" /> + <xs:attribute name="version" type="VersionType" use="required" /> </xs:complexType> </xs:element> + <xs:element name="SilecsDesign" type="SilecsDesignType" maxOccurs="unbounded" minOccurs="1"> + <xs:unique name="Design-name-uniquer"> + <xs:selector xpath="." /> + <xs:field xpath="@silecs-design-name" /> + </xs:unique> + </xs:element> <xs:element name="Controller" type="ControllerType" maxOccurs="unbounded" minOccurs="1"> - <xs:unique name="Device-name-unique-per-controller"> - <xs:selector xpath="SilecsDesign/Device"/> - <xs:field xpath="@device-name"/> - </xs:unique> - <xs:unique name="Class-name-unique-per-controller"> - <xs:selector xpath="SilecsDesign"/> - <xs:field xpath="@silecs-design-name"/> - </xs:unique> + <xs:unique name="silecs-device-label-unique-per-controller"> + <xs:selector xpath="*/Device" /> + <xs:field xpath="@silecs-device-label" /> + </xs:unique> </xs:element> </xs:sequence> <xs:attribute name="silecs-version" type="xs:string" use="required"> @@ -88,431 +90,558 @@ along with this program. If not, see http://www.gnu.org/licenses/.--> </xs:annotation> </xs:attribute> </xs:complexType> - <xs:unique name="Host-name-unique-per-silecsdeploy"> - <xs:selector xpath="Controller"/> - <xs:field xpath="@host-name"/> - </xs:unique> + <xs:unique name="Host-name-unique-per-silecsdeploy"> + <xs:selector xpath="Controller" /> + <xs:field xpath="@host-name" /> + </xs:unique> + <xs:unique name="fesa-device-name-unique"> + <xs:selector xpath="Controller/*/Device" /> + <xs:field xpath="@fesa-device-name" /> + </xs:unique> </xs:element> - + <xs:complexType name="ControllerType"> <xs:sequence> - <xs:choice> - <xs:element name="Siemens-PLC" type="SiemensPLCType"> - <xs:annotation> - <xs:documentation>A Siemens-Mapping defines a particular Mapping of classes intended to SIMATIC PLCs</xs:documentation> - </xs:annotation> - </xs:element> - <xs:element name="Schneider-PLC" type="SchneiderPLCType"> - <xs:annotation> - <xs:documentation>A Schneider-Mapping defines a particular Mapping of classes intended to PL7/UNITY PLCs</xs:documentation> - </xs:annotation> - </xs:element> - <xs:element name="Beckhoff-PLC" type="BeckhoffPLCType"> - <xs:annotation> - <xs:documentation>A Beckhoff-Mapping defines a particular Mapping of classes intended to TwinCat PLCs</xs:documentation> - </xs:annotation> - </xs:element> - <!-- No support for this type in CERN codegen so far<xs:element name="Beckhoff-RIO" type="BeckhoffRIOType"> - <xs:annotation> - <xs:documentation>A Beckhoff-RIO deployment defines the physical Mapping of TwinCAT Remote IO modules.</xs:documentation> - </xs:annotation> - </xs:element>--> - <xs:element name="Rabbit-uC" type="RabbituCType"> - <xs:annotation> - <xs:documentation>A Rabbit-Mapping defines a particular Mapping of classes intended for Rabbit microcontrollers</xs:documentation> - </xs:annotation> - </xs:element> - <xs:element name="Virtual-Controller" type="VirtualControllerType"> - <xs:annotation> - <xs:documentation>Defines a particular C++ code mapping of classes intended for Software controller</xs:documentation> - </xs:annotation> - </xs:element> - <xs:element name="NI-Controller" type="NIControllerType"> - <xs:annotation> - <xs:documentation>A NI-Mapping defines a particular Mapping of classes intended to National Instrument Controllers</xs:documentation> - </xs:annotation> - </xs:element> - </xs:choice> - <xs:element name="SilecsDesign" type="SilecsDesignType" maxOccurs="unbounded"/> + <xs:choice> + <xs:element name="Siemens-PLC" type="SiemensPLCType"> + <xs:annotation> + <xs:documentation>A Siemens-Mapping defines a particular Mapping + of classes intended to SIMATIC PLCs + </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="Schneider-PLC" type="SchneiderPLCType"> + <xs:annotation> + <xs:documentation>A Schneider-Mapping defines a particular Mapping + of classes intended to PL7/UNITY PLCs + </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="Beckhoff-PLC" type="BeckhoffPLCType"> + <xs:annotation> + <xs:documentation>A Beckhoff-Mapping defines a particular Mapping + of classes intended to TwinCat PLCs + </xs:documentation> + </xs:annotation> + </xs:element> + <!-- No support for this type in CERN codegen so far<xs:element name="Beckhoff-RIO" type="BeckhoffRIOType"> <xs:annotation> <xs:documentation>A Beckhoff-RIO deployment defines the physical Mapping of TwinCAT Remote IO modules.</xs:documentation> </xs:annotation> </xs:element> --> + <xs:element name="Rabbit-uC" type="RabbituCType"> + <xs:annotation> + <xs:documentation>A Rabbit-Mapping defines a particular Mapping of + classes intended for Rabbit microcontrollers + </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="Virtual-Controller" type="VirtualControllerType"> + <xs:annotation> + <xs:documentation>Defines a particular C++ code mapping of classes + intended for Software controller + </xs:documentation> + </xs:annotation> + </xs:element> + <xs:element name="NI-Controller" type="NIControllerType"> + <xs:annotation> + <xs:documentation>A NI-Mapping defines a particular Mapping of + classes intended to National Instrument Controllers + </xs:documentation> + </xs:annotation> + </xs:element> + </xs:choice> </xs:sequence> - <xs:attribute name="host-name" type="HostNameType" use="required"/> + <xs:attribute name="host-name" type="HostNameType" use="required" /> </xs:complexType> - + <xs:complexType name="SilecsDesignType"> - <xs:sequence> - <xs:element name="Device" type="DeviceType" maxOccurs="unbounded"/> - </xs:sequence> - <xs:attribute name="silecs-design-name" type="SilecsClassNameType" use="required"/> - <xs:attribute name="silecs-design-version" type="VersionType" use="required"/> - </xs:complexType> - - <xs:complexType name="DeviceType"> - <xs:sequence> - <xs:annotation> - <xs:documentation>The device is an instance of the related silecs-design.</xs:documentation> - <xs:appinfo> - <doc> - The device is an instance of the related SILECS design class. - The label is dedicated to the PLC process and the SILECS client software to identify the device in the scope of that class in that particular Mapping. - It does not identify a unique device instance of the control system at the supervision level. - The device sequence will occupy contiguous segment of PLC memory respecting their exact ordering. - The SILECS tool assists the expert in ordering devices as required. - </doc> - </xs:appinfo> - </xs:annotation> - </xs:sequence> - <xs:attribute name="device-name" type="DeviceNameType" use="required"/> - </xs:complexType> + <xs:attribute name="silecs-design-name" type="SilecsClassNameType" use="required" /> + <xs:attribute name="silecs-design-version" type="VersionType" use="required" /> + </xs:complexType> + + <xs:complexType name="DeviceType"> + <xs:sequence> + <xs:annotation> + <xs:documentation>The device is an instance of the related + silecs-design. + </xs:documentation> + <xs:appinfo> + <doc> + The device is an instance of the related SILECS design class. + The label is dedicated to the PLC process and the SILECS client + software to identify the device in the scope of that class in that + particular Mapping. + It does not identify a unique device instance + of the control system + at the supervision level. + The device sequence + will occupy contiguous segment of PLC memory + respecting their exact + ordering. + The SILECS tool assists the expert in ordering devices as + required. + </doc> + </xs:appinfo> + </xs:annotation> + </xs:sequence> + <xs:attribute name="silecs-device-label" type="DeviceNameType" use="required" /> + <xs:attribute name="silecs-design-ref" type="SilecsClassNameType" use="required" /> + <xs:attribute name="fesa-device-name" type="DeviceNameType" use="optional" /> + <xs:attribute name="fesa-fec-name" type="HostNameType" use="optional" /> + </xs:complexType> <xs:simpleType name="HostNameType"> <xs:restriction base="xs:string"> - <xs:minLength value="1"/> - <xs:pattern value="[_A-Za-z0-9]*"/> + <xs:minLength value="1" /> + <xs:pattern value="[_A-Za-z0-9]*" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="DeployNameType"> <xs:restriction base="xs:string"> - <xs:minLength value="1"/> - <xs:maxLength value="20"/> - <xs:pattern value="[_A-Za-z]+[_A-Za-z0-9]*"/> + <xs:minLength value="1" /> + <xs:maxLength value="20" /> + <xs:pattern value="[_A-Za-z]+[_A-Za-z0-9]*" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="DeviceNameType"> <xs:restriction base="xs:string"> - <xs:minLength value="1"/> - <xs:maxLength value="30"/> - <!-- In FESA the deviceName is restricted to max. 30 characters --> - <xs:pattern value="[_A-Za-z][_A-Za-z0-9]*"/> + <xs:minLength value="1" /> + <xs:maxLength value="30" /> + <!-- In FESA the deviceName is restricted to max. 30 characters --> + <xs:pattern value="[_A-Za-z][_A-Za-z0-9]*" /> </xs:restriction> </xs:simpleType> - + <xs:simpleType name="SiemensSystemType"> <xs:restriction base="xs:string"> - <xs:enumeration value="STEP-7"/> - <xs:enumeration value="TIA-PORTAL"/> + <xs:enumeration value="STEP-7" /> + <xs:enumeration value="TIA-PORTAL" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="SchneiderSystemType"> <xs:restriction base="xs:string"> - <xs:enumeration value="UNITY Pro"/> + <xs:enumeration value="UNITY Pro" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="BeckhoffSystemType"> <xs:restriction base="xs:string"> - <xs:enumeration value="TWINCat"/> + <xs:enumeration value="TWINCat" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="RabbitSystemType"> <xs:restriction base="xs:string"> - <xs:enumeration value="Standard-C"/> + <xs:enumeration value="Standard-C" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="NISystemType"> <xs:restriction base="xs:string"> - <xs:enumeration value="Labview"/> + <xs:enumeration value="Labview" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="BothProtocolType"> <xs:restriction base="xs:string"> - <xs:enumeration value="DEVICE_MODE"/> - <xs:enumeration value="BLOCK_MODE"/> + <xs:enumeration value="DEVICE_MODE" /> + <xs:enumeration value="BLOCK_MODE" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="DeviceProtocolType"> <xs:restriction base="xs:string"> - <xs:enumeration value="DEVICE_MODE"/> + <xs:enumeration value="DEVICE_MODE" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="BlockProtocolType"> <xs:restriction base="xs:string"> - <xs:enumeration value="BLOCK_MODE"/> + <xs:enumeration value="BLOCK_MODE" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="PCSystemType"> - <xs:restriction base="xs:string"> - <xs:enumeration value="SNAP7 linux32"/> - <xs:enumeration value="SNAP7 linux64"/> - </xs:restriction> - </xs:simpleType> - + <xs:restriction base="xs:string"> + <xs:enumeration value="SNAP7 linux32" /> + <xs:enumeration value="SNAP7 linux64" /> + </xs:restriction> + </xs:simpleType> + + <xs:complexType name="PLCBaseType"> + <xs:sequence> + <xs:element name="Device" type="DeviceType" maxOccurs="unbounded" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="SiemensPLCType"> - <xs:attribute name="system" type="SiemensSystemType" use="required"> - <xs:annotation> - <xs:documentation>System infrastructure used to develop and/or configure the controller software.</xs:documentation> - <xs:appinfo> - <doc> - System infrastructure used to develop and/or configure the controller software. - </doc> - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="model" use="required"> - <xs:simpleType> - <xs:restriction base="xs:string"> - <xs:enumeration value="SIMATIC_S7-300"/> - <xs:enumeration value="SIMATIC_S7-400"/> - <xs:enumeration value="SIMATIC_S7-1200"/> - <xs:enumeration value="SIMATIC_S7-1500"/> - <xs:enumeration value="SIMATIC_ET-200S"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute name="protocol" type="BothProtocolType" use="required"> - <xs:annotation> - <xs:documentation>Data access mode is defined at PLC level for all the classes</xs:documentation> - <xs:appinfo> - <doc> - DEVICE_MODE: One S7-DB per class/device ([class-name]_[device-label|id]), <br>containing the corresponding ordered list of Blocks - <br>BLOCK_MODE: One S7-DB per class/block ([class-name]_[block-name]), <br>containing array of corresponding Block, one element per device - </doc> - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="base-DB-number" type="xs:unsignedInt" use="required"> - <xs:annotation> - <xs:documentation>Number of the diagnostic DB that is the first one of the global configuration (corresponds to the common SilecsHeader data-block).</xs:documentation> - <xs:appinfo> - <doc> - Number of the diagnostic DB that is the first one of the global configuration ( >=1) - </doc> - </xs:appinfo> - </xs:annotation> - </xs:attribute> + <xs:complexContent> + <xs:extension base="PLCBaseType"> + <xs:attribute name="system" type="SiemensSystemType" use="required"> + <xs:annotation> + <xs:documentation>System infrastructure used to develop and/or + configure the controller software. + </xs:documentation> + <xs:appinfo> + <doc> + System infrastructure used to develop and/or configure the + controller + software. + </doc> + </xs:appinfo> + </xs:annotation> + </xs:attribute> + <xs:attribute name="model" use="required"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value="SIMATIC_S7-300" /> + <xs:enumeration value="SIMATIC_S7-400" /> + <xs:enumeration value="SIMATIC_S7-1200" /> + <xs:enumeration value="SIMATIC_S7-1500" /> + <xs:enumeration value="SIMATIC_ET-200S" /> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="protocol" type="BothProtocolType" use="required"> + <xs:annotation> + <xs:documentation>Data access mode is defined at PLC level for all + the classes + </xs:documentation> + <xs:appinfo> + <doc> + DEVICE_MODE: One S7-DB per class/device + ([class-name]_[device-label|id]), + <br>containing the + corresponding ordered list of Blocks + <br>BLOCK_MODE: One + S7-DB per class/block + ([class-name]_[block-name]), + <br>containing array of + corresponding Block, one element + per device + </doc> + </xs:appinfo> + </xs:annotation> + </xs:attribute> + <xs:attribute name="base-DB-number" type="xs:unsignedInt" use="required"> + <xs:annotation> + <xs:documentation>Number of the diagnostic DB that is the first + one of the global configuration (corresponds to the common + SilecsHeader data-block). + </xs:documentation> + <xs:appinfo> + <doc> + Number of the diagnostic DB that is the first one of the + global + configuration ( >=1) + </doc> + </xs:appinfo> + </xs:annotation> + </xs:attribute> + </xs:extension> + </xs:complexContent> </xs:complexType> + <xs:complexType name="SchneiderPLCType"> - <xs:attribute name="system" type="SchneiderSystemType" use="required"> - <xs:annotation> - <xs:documentation>System infrastructure used to develop and/or configure the controller software.</xs:documentation> - <xs:appinfo> - <doc> - System infrastructure used to develop and/or configure the controller software. - </doc> - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="model" use="required"> - <xs:simpleType> - <xs:restriction base="xs:string"> - <xs:enumeration value="Premium"/> - <xs:enumeration value="Quantum"/> - <xs:enumeration value="M340"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute name="protocol" type="BlockProtocolType" use="required"> - <xs:annotation> - <xs:documentation>Data access mode is defined at PLC level for all the classes</xs:documentation> - <xs:appinfo> - <doc> - BLOCK_MODE: One data-segment per class/block ([class-name]_[block-name]), <br>containing array of corresponding Block, one element per device - </doc> - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="base-address" type="xs:unsignedInt" use="required"> - <xs:annotation> - <xs:documentation>Start address of the SILECS configuration (corresponds to the common SilecsHeader block address). Attention: 16bit address value is expected independently from the HW model (16 or 32 bit).</xs:documentation> - <xs:appinfo> - <doc> - Start address of the SILECS configuration (corresponds to the common SilecsHeader block address). - <br>Attention: 16bit address value is expected independently from the HW model (16 or 32 bit) - </doc> - </xs:appinfo> - </xs:annotation> - </xs:attribute> -</xs:complexType> + <xs:complexContent> + <xs:extension base="PLCBaseType"> + <xs:attribute name="system" type="SchneiderSystemType" use="required"> + <xs:annotation> + <xs:documentation>System infrastructure used to develop and/or + configure the controller software. + </xs:documentation> + <xs:appinfo> + <doc> + System infrastructure used to develop and/or configure the + controller + software. + </doc> + </xs:appinfo> + </xs:annotation> + </xs:attribute> + <xs:attribute name="model" use="required"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value="Premium" /> + <xs:enumeration value="Quantum" /> + <xs:enumeration value="M340" /> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="protocol" type="BlockProtocolType" use="required"> + <xs:annotation> + <xs:documentation>Data access mode is defined at PLC level for all + the classes + </xs:documentation> + <xs:appinfo> + <doc> + BLOCK_MODE: One data-segment per class/block + ([class-name]_[block-name]), + <br>containing array of + corresponding Block, one element per + device + </doc> + </xs:appinfo> + </xs:annotation> + </xs:attribute> + <xs:attribute name="base-address" type="xs:unsignedInt" use="required"> + <xs:annotation> + <xs:documentation>Start address of the SILECS configuration + (corresponds to the common SilecsHeader block address). Attention: + 16bit address value is expected independently from the HW model (16 + or 32 bit). + </xs:documentation> + <xs:appinfo> + <doc> + Start address of the SILECS configuration (corresponds to the + common + SilecsHeader block address). + <br>Attention: 16bit + address value is expected independently from the HW model + (16 or 32 + bit) + </doc> + </xs:appinfo> + </xs:annotation> + </xs:attribute> + </xs:extension> + </xs:complexContent> + </xs:complexType> -<xs:complexType name="BeckhoffPLCType"> - <xs:attribute name="system" type="BeckhoffSystemType" use="required"> - <xs:annotation> - <xs:documentation>System infrastructure used to develop and/or configure the controller software.</xs:documentation> - <xs:appinfo> - <doc> - System infrastructure used to develop and/or configure the Controller software. - </doc> - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="model" use="required"> - <xs:simpleType> - <xs:restriction base="xs:string"> - <xs:enumeration value="BC9020"/> - <xs:enumeration value="CX9020"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute name="protocol" type="BlockProtocolType" use="required"> - <xs:annotation> - <xs:documentation>Data access mode is defined at PLC level for all the classes</xs:documentation> - <xs:appinfo> - <doc> - BLOCK_MODE: One data-segment per class/block ([class-name]_[block-name]), <br>containing array of corresponding Block, one element per device - </doc> - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="base-address" type="xs:unsignedInt" use="required"> - <xs:annotation> - <xs:documentation>Start address of the SILECS configuration (corresponds to the common SilecsHeader block address). Attention: 16bit address value is expected independently from the HW model (16 or 32 bit).</xs:documentation> - <xs:appinfo> - <doc> - Start address of the SILECS configuration (corresponds to the common SilecsHeader block address). - <br>Attention: 16bit address value is expected independently from the HW model (16 or 32 bit) - </doc> - </xs:appinfo> - </xs:annotation> - </xs:attribute> -</xs:complexType> + <xs:complexType name="BeckhoffPLCType"> + <xs:complexContent> + <xs:extension base="PLCBaseType"> + <xs:attribute name="system" type="BeckhoffSystemType" use="required"> + <xs:annotation> + <xs:documentation>System infrastructure used to develop and/or + configure the controller software. + </xs:documentation> + <xs:appinfo> + <doc> + System infrastructure used to develop and/or configure the + Controller + software. + </doc> + </xs:appinfo> + </xs:annotation> + </xs:attribute> + <xs:attribute name="model" use="required"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value="BC9020" /> + <xs:enumeration value="CX9020" /> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="protocol" type="BlockProtocolType" use="required"> + <xs:annotation> + <xs:documentation>Data access mode is defined at PLC level for all + the classes + </xs:documentation> + <xs:appinfo> + <doc> + BLOCK_MODE: One data-segment per class/block + ([class-name]_[block-name]), + <br>containing array of + corresponding Block, one element per + device + </doc> + </xs:appinfo> + </xs:annotation> + </xs:attribute> + <xs:attribute name="base-address" type="xs:unsignedInt" use="required"> + <xs:annotation> + <xs:documentation>Start address of the SILECS configuration + (corresponds to the common SilecsHeader block address). Attention: + 16bit address value is expected independently from the HW model (16 + or 32 bit). + </xs:documentation> + <xs:appinfo> + <doc> + Start address of the SILECS configuration (corresponds to the + common + SilecsHeader block address). + <br>Attention: 16bit + address value is expected independently from the HW model + (16 or 32 + bit) + </doc> + </xs:appinfo> + </xs:annotation> + </xs:attribute> + </xs:extension> + </xs:complexContent> + </xs:complexType> -<!-- No support for this type in CERN codegen so far <xs:complexType name="BeckhoffRIOType"> - <xs:attribute name="system" type="BeckhoffSystemType" use="required"> - <xs:annotation> - <xs:documentation>System infrastructure used to develop and/or configure the controller software.</xs:documentation> - <xs:appinfo> - <doc> - System infrastructure used to develop and/or configure the Controller software. - </doc> - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="model" use="required"> - <xs:simpleType> - <xs:restriction base="xs:string"> - <xs:enumeration value="BK9000"/> - <xs:enumeration value="BK9050"/> - <xs:enumeration value="BK9100"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute name="io-base-address" type="xs:unsignedInt" use="required"> - <xs:annotation> - <xs:documentation>Start address of the Remote IO modules (can be 0 if not required). Attention: 16bit address value is expected independently from the HW model (16 or 32 bit).</xs:documentation> - <xs:appinfo> - <doc> - Start address of the Remote IO modules (can be 0 if not required). - <br>Attention: 16bit address value is expected independently from the HW model (16 or 32 bit). - </doc> - </xs:appinfo> - </xs:annotation> - </xs:attribute> -</xs:complexType>--> - -<xs:complexType name="RabbituCType"> - <xs:attribute name="system" type="RabbitSystemType" use="required"> - <xs:annotation> - <xs:documentation>System infrastructure used to develop and/or configure the controller software.</xs:documentation> - <xs:appinfo> - <doc> - System infrastructure used to develop and/or configure the Controller software. - </doc> - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="model" use="required"> - <xs:simpleType> - <xs:restriction base="xs:string"> - <xs:enumeration value="Rabbit_RCM_4010"/> - <xs:enumeration value="Rabbit_RCM_2000"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute name="protocol" type="BothProtocolType" use="required"> - <xs:annotation> - <xs:documentation>Data access mode is defined at PLC level for all the classes</xs:documentation> - <xs:appinfo> - <doc> - DEVICE_MODE: One C struct field per class/device ([class-name]_[device-label|id]), <br>containing the corresponding ordered list of Blocks - <br>BLOCK_MODE: One C struct field per class/block ([class-name]_[block-name]), <br>containing array of corresponding Block, one element per device - </doc> - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="base-address" type="xs:unsignedInt" use="required"> - <xs:annotation> - <xs:documentation>Start address of the entire SILECS configuration interpreted as 16bit address.</xs:documentation> - <xs:appinfo> - <doc> - Start address of the entire SILECS configuration interpreted as 16bit address. - </doc> - </xs:appinfo> - </xs:annotation> - </xs:attribute> -</xs:complexType> + <!-- No support for this type in CERN codegen so far <xs:complexType name="BeckhoffRIOType"> <xs:attribute name="system" type="BeckhoffSystemType" use="required"> <xs:annotation> <xs:documentation>System infrastructure used to develop and/or configure the controller software.</xs:documentation> <xs:appinfo> <doc> System infrastructure used to develop and/or configure the Controller software. </doc> </xs:appinfo> </xs:annotation> </xs:attribute> <xs:attribute name="model" use="required"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="BK9000"/> <xs:enumeration value="BK9050"/> <xs:enumeration value="BK9100"/> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:attribute name="io-base-address" type="xs:unsignedInt" use="required"> <xs:annotation> <xs:documentation>Start address of the Remote IO modules (can be 0 if not required). Attention: 16bit address value is expected independently from the HW model (16 or 32 bit).</xs:documentation> <xs:appinfo> <doc> Start + address of the Remote IO modules (can be 0 if not required). <br>Attention: 16bit address value is expected independently from the HW model (16 or 32 bit). </doc> </xs:appinfo> </xs:annotation> </xs:attribute> </xs:complexType> --> -<xs:complexType name="VirtualControllerType"> - <xs:attribute name="system" type="PCSystemType" use="required"> - <xs:annotation> - <xs:documentation>System infrastructure used to develop and/or configure the controller software.</xs:documentation> - <xs:appinfo> - <doc> - System infrastructure used to develop and/or configure the Controller software. - </doc> - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="model" use="required"> - <xs:simpleType> - <xs:restriction base="xs:string"> - <xs:enumeration value="SIMATIC_S7-VIRTUAL"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute name="protocol" type="BothProtocolType" use="required"> - <xs:annotation> - <xs:documentation>Data access mode is defined at PLC level for all the classes</xs:documentation> - <xs:appinfo> - <doc> - DEVICE_MODE: One C struct field per class/device ([class-name]_[device-label|id]), <br>containing the corresponding ordered list of Blocks - <br>BLOCK_MODE: One C struct field per class/block ([class-name]_[block-name]), <br>containing array of corresponding Block, one element per device - </doc> - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="base-DB-number" type="xs:unsignedInt" use="required"> - <xs:annotation> - <xs:documentation>Number of the diagnostic DB that is the first one of the global configuration (corresponds to the common SilecsHeader data-block).</xs:documentation> - <xs:appinfo> - <doc> - Number of the diagnostic DB that is the first one of the global configuration ( >=1) - </doc> - </xs:appinfo> - </xs:annotation> - </xs:attribute> -</xs:complexType> - -<xs:complexType name="NIControllerType"> - <xs:attribute name="model" use="required"> - <xs:simpleType> - <xs:restriction base="xs:string"> - <xs:enumeration value="Compact_RIO"/> - <xs:enumeration value="PXI_RT"/> - <xs:enumeration value="PXI_Windows"/> - <xs:enumeration value="PC_Windows"/> - <xs:enumeration value="Other_Support_CNV"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute name="system" type="NISystemType" use="required"> - <xs:annotation> - <xs:documentation>System infrastructure used to develop and/or configure the controller software.</xs:documentation> - <xs:appinfo> - <doc> - System infrastructure used to develop and/or configure the Controller software. - </doc> - </xs:appinfo> - </xs:annotation> - </xs:attribute> - <xs:attribute name="protocol" type="DeviceProtocolType" use="required"> - <xs:annotation> - <xs:documentation>Data access mode is defined at PLC level for all the classes</xs:documentation> - <xs:appinfo> - <doc> - DEVICE_MODE: One shared variable per class/device (//class-name//controllerName//device-label), <br>containing the corresponding ordered list of Blocks. - </doc> - </xs:appinfo> - </xs:annotation> - </xs:attribute> -</xs:complexType> + <xs:complexType name="RabbituCType"> + <xs:complexContent> + <xs:extension base="PLCBaseType"> + <xs:attribute name="system" type="RabbitSystemType" use="required"> + <xs:annotation> + <xs:documentation>System infrastructure used to develop and/or + configure the controller software. + </xs:documentation> + <xs:appinfo> + <doc> + System infrastructure used to develop and/or configure the + Controller + software. + </doc> + </xs:appinfo> + </xs:annotation> + </xs:attribute> + <xs:attribute name="model" use="required"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value="Rabbit_RCM_4010" /> + <xs:enumeration value="Rabbit_RCM_2000" /> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="protocol" type="BothProtocolType" use="required"> + <xs:annotation> + <xs:documentation>Data access mode is defined at PLC level for all + the classes + </xs:documentation> + <xs:appinfo> + <doc> + DEVICE_MODE: One C struct field per class/device + ([class-name]_[device-label|id]), <br>containing the + corresponding ordered list of Blocks + <br>BLOCK_MODE: One C + struct field per class/block ([class-name]_[block-name]), + <br>containing array of corresponding Block, one element per + device + </doc> + </xs:appinfo> + </xs:annotation> + </xs:attribute> + <xs:attribute name="base-address" type="xs:unsignedInt" use="required"> + <xs:annotation> + <xs:documentation>Start address of the entire SILECS configuration + interpreted as 16bit address. + </xs:documentation> + <xs:appinfo> + <doc> + Start address of the entire SILECS configuration interpreted + as 16bit + address. + </doc> + </xs:appinfo> + </xs:annotation> + </xs:attribute> + </xs:extension> + </xs:complexContent> + </xs:complexType> + + <xs:complexType name="VirtualControllerType"> + <xs:complexContent> + <xs:extension base="PLCBaseType"> + <xs:attribute name="system" type="PCSystemType" use="required"> + <xs:annotation> + <xs:documentation>System infrastructure used to develop and/or + configure the controller software. + </xs:documentation> + <xs:appinfo> + <doc> + System infrastructure used to develop and/or configure the + Controller + software. + </doc> + </xs:appinfo> + </xs:annotation> + </xs:attribute> + <xs:attribute name="model" use="required"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value="SIMATIC_S7-VIRTUAL" /> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="protocol" type="BothProtocolType" use="required"> + <xs:annotation> + <xs:documentation>Data access mode is defined at PLC level for all + the classes + </xs:documentation> + <xs:appinfo> + <doc> + DEVICE_MODE: One C struct field per class/device + ([class-name]_[device-label|id]), <br>containing the + corresponding ordered list of Blocks + <br>BLOCK_MODE: One C + struct field per class/block ([class-name]_[block-name]), + <br>containing array of corresponding Block, one element per + device + </doc> + </xs:appinfo> + </xs:annotation> + </xs:attribute> + <xs:attribute name="base-DB-number" type="xs:unsignedInt" use="required"> + <xs:annotation> + <xs:documentation>Number of the diagnostic DB that is the first one + of the global configuration (corresponds to the common SilecsHeader + data-block). + </xs:documentation> + <xs:appinfo> + <doc> + Number of the diagnostic DB that is the first one of the + global + configuration ( >=1) + </doc> + </xs:appinfo> + </xs:annotation> + </xs:attribute> + </xs:extension> + </xs:complexContent> + </xs:complexType> + + <xs:complexType name="NIControllerType"> + <xs:complexContent> + <xs:extension base="PLCBaseType"> + <xs:attribute name="model" use="required"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value="Compact_RIO" /> + <xs:enumeration value="PXI_RT" /> + <xs:enumeration value="PXI_Windows" /> + <xs:enumeration value="PC_Windows" /> + <xs:enumeration value="Other_Support_CNV" /> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="system" type="NISystemType" use="required"> + <xs:annotation> + <xs:documentation>System infrastructure used to develop and/or + configure the controller software. + </xs:documentation> + <xs:appinfo> + <doc> + System infrastructure used to develop and/or configure the + Controller + software. + </doc> + </xs:appinfo> + </xs:annotation> + </xs:attribute> + <xs:attribute name="protocol" type="DeviceProtocolType" use="required"> + <xs:annotation> + <xs:documentation>Data access mode is defined at PLC level for all + the classes + </xs:documentation> + <xs:appinfo> + <doc> + DEVICE_MODE: One shared variable per class/device + (//class-name//controllerName//device-label), <br>containing + the corresponding ordered list of Blocks. + </doc> + </xs:appinfo> + </xs:annotation> + </xs:attribute> + </xs:extension> + </xs:complexContent> + </xs:complexType> + + <xs:keyref name="SilecsDesignRef" refer="SilecsDesign"> + <xs:selector xpath="Controller/*/Device" /> + <xs:field xpath="@silecs-design-ref" /> + </xs:keyref> + <xs:key name="SilecsDesign"> + <xs:selector xpath="SilecsDesign" /> + <xs:field xpath="@silecs-design-name" /> + </xs:key> </xs:schema> -- GitLab