Home
Categories
Dictionary
Glossary
Download
Project Details
Changes Log
What Links Here
FAQ
License

Usage of endianness in the ExternalComm Communication module



This article explains the usage of the endianness property in the ExternalComm Communication module.

By default the External Communication module will not swap the datas which it sends or receives. It assumes that their endianness is Big Endian (the Endianness of the Java platform).

However there are three properties which specify how the Endianness is taken into account:
  • endianness: the endianness to use for the communication. By default it is Big Endian, which is the endianness of the Java platform. See endianness property for more information
  • swapMAGIC: true if the MAGIC number of the communication protocol will be swapped (regardless of the value of the endianness property), false if it will be not swapped (regardless of the value of the endianness property). By default it will follow the behavior specified by the endianness property
  • swapServiceID: true if the serviceID in the communication protocol will be swapped (regardless of the value of the endianness property), false if it will be not swapped (regardless of the value of the endianness property). By default it will follow the behavior specified by the endianness property

endianness property

The endianness property allows to set the endianness of the communication for the module. This property can have 3 values:
  • "bigEndian" (the default): the data values, MAGIC number, service ID, and time stamps are not swapped and are considered to be Big Endian (the Endianness of the Java platform). It is considered that the external application is using Big Endian too
  • "littleEndian": the data values, MAGIC number, service ID, and time stamps are swapped from/to Little Endian. It is considered that the external application is using Little Endian
  • "midLittleEndian": the MAGIC number, service ID, and time stamps are swapped from/to Little Endian. The data values are swapped from/to mid-little endian (CDAB)
  • "platform": iIt is considered that the external application use the default Endianness of the platform (for example, on PC, this is Little Endian; on Linux, it depends on the processor)
Note that the swapMAGIC and swapServiceID properties allows to override the conversion for the MAGIC bnumber and the service ID. The scadacore.com/tools/programming-calculators/online-hex-converter we site propose a useful online converter for hex values.

Examples

Default behavior

With the following properties, no content send or received by the module is swapped:
      <properties>
         <application name="externalComm" >
            <moduleProperty key="network" value="network.xml" />      					 
         </application>
      </properties>

Swaping everything

With the following properties, all content send or received by the module is swapped:
      <properties>
         <application name="externalComm" >
            <moduleProperty key="network" value="network.xml" />      
            <moduleProperty key="endianness" value="littleEndian" />						 
         </application>
      </properties>

Swaping everything except the MAGIC number and the service ID

With the following properties, all content send or received by the module is swapped:
      <properties>
         <application name="externalComm" >
            <moduleProperty key="network" value="network.xml" />      
            <moduleProperty key="endianness" value="littleEndian" />		
            <moduleProperty key="swapMAGIC" value="false" />	
            <moduleProperty key="swapServiceID" value="false" />					 
         </application>
      </properties>

See also


Categories: builtin-applis

Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence