[ag-automation] configuration concept for fieldbus stack
Dieter Hess
d.hess at 3s-software.com
Tue Jul 10 17:22:05 CEST 2007
Hello,
the xml-file is just an external representation of the parameters in the fddi-interface. The "Name"-Attribute is optional and just for better readability. The "Id" is the only possibility to identify the meaning of the parameter for the driver. The order is not enough, because it is possible to ommit parameter, to have different types of parameters and it is possible to extend the parameters in the future. The "Type" attribute is only necessary for the external xml-representation, to make it possible to write a driver independent import (in the parameter structure the value of the parameter is just a 32bit value). The driver itself knows how to interpret the value (as int, bool, string, etc.).
Regards
Dieter Hess
----------------------------------------------------
We software Automation.
3S-Smart Software Solutions GmbH
Dieter Hess
Geschäftsführer
Memminger Str. 151, DE-87439 Kempten
Fon +49-831-54031-0, Fax +49-831-54031-50
Email: d.hess at 3s-software.com
Web: http://www.3s-software.com
Besuchen Sie das CoDeSys Internet-Forum unter http://forum.3s-software.com/
3S-Smart Software Solutions GmbH
Geschäftsführer: Dipl.Inf.Dieter Hess, Dipl.Inf. Manfred Werner
Handelsregister: Kempten HRB 6186
USt-IDNr. DE 167014915
-----Ursprüngliche Nachricht-----
Von: Robert Schwebel [mailto:rsc at pengutronix.de] Im Auftrag von Robert Schwebel
Gesendet: Dienstag, 10. Juli 2007 17:11
An: ag-automation at www.osadl.org
Cc: Dieter Hess
Betreff: Re: [ag-automation] configuration concept for fieldbus stack
On Tue, Jul 10, 2007 at 10:45:51AM +0200, Dieter Hess wrote:
> here are a general XML-schema for a configuration of a fddi driver, a
> example for modbus and a description of the modbus profile.
Great, thanks a lot! :-) However, in order to make it readable, here's the result of running pretty.xsl over the file:
----------8<----------8<----------8<----------8<----------8<----------8<----------
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--Sample XML file generated by XMLSPY v2004 rel. 4 U (http://www.xmlspy.com)-->
<FddiDevice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="C:\Dokumente und Einstellungen\d.hess\Desktop\fddi\fddiconfig.xsd">
<Id>0</Id>
<Name>ModbusMaster</Name>
<FddiDevice>
<Id>1</Id>
<Name>ModbusSlave1</Name>
<FddiParam Id="1" Name="ParamAddress" Type="int">14</FddiParam>
<FddiParam Id="2" Name="ParamValue" Type="int">0</FddiParam>
<FddiParam Id="11" Name="ParamAddress" Type="int">22</FddiParam>
<FddiParam Id="12" Name="ParamValue" Type="int">17</FddiParam>
<FddiParam Id="1001" Name="TpuAdress" Type="int">64</FddiParam>
<FddiParam Id="1002" Name="TpuSize" Type="int">8</FddiParam>
<FddiParam Id="1003" Name="TpuGranularity" Type="int">1</FddiParam>
<FddiParam Id="1004" Name="TpuUpdateRate" Type="int">100</FddiParam>
<FddiParam Id="1004" Name="TpuDirectionWrite" Type="bool">false</FddiParam>
<FddiParam Id="1011" Name="TpuAdress" Type="int">72</FddiParam>
<FddiParam Id="1012" Name="TpuSize" Type="int">12</FddiParam>
<FddiParam Id="1013" Name="TpuGranularity" Type="int">2</FddiParam>
<FddiParam Id="1014" Name="TpuUpdateRate" Type="int">100</FddiParam>
<FddiParam Id="1014" Name="TpuDirectionWrite" Type="bool">true</FddiParam>
</FddiDevice>
<FddiDevice>
<Id>2</Id>
<Name>ModbusSlave2</Name>
<FddiParam Id="1" Name="ParamAddress" Type="int">4</FddiParam>
<FddiParam Id="2" Name="ParamValue" Type="int">11</FddiParam>
<FddiParam Id="1011" Name="TpuAdress" Type="int">20</FddiParam>
<FddiParam Id="1012" Name="TpuSize" Type="int">4</FddiParam>
<FddiParam Id="1013" Name="TpuGranularity" Type="int">1</FddiParam>
<FddiParam Id="1014" Name="TpuUpdateRate" Type="int">50</FddiParam>
<FddiParam Id="1014" Name="TpuDirectionWrite" Type="bool">true</FddiParam>
</FddiDevice>
<FddiParam Id="1" Name="TCPIP-Port" Type="int">1010</FddiParam>
</FddiDevice>
----------8<----------8<----------8<----------8<----------8<----------8<----------
Why are these "Id" attributes necessary? For the initialization params, the order in the xml file should be enough to specify the order the params have to be written into the bus.
Regarding the types, I'd suggest to directly map to the stdint types, also in order to avoid 32/64 bit interpretation problems.
Regards,
Robert Schwebel
--
Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de Pengutronix - Linux Solutions for Science and Industry
Handelsregister: Amtsgericht Hildesheim, HRA 2686
Hannoversche Str. 2, 31134 Hildesheim, Germany
Phone: +49-5121-206917-0 | Fax: +49-5121-206917-9
More information about the ag-automation
mailing list