Midas Data Types

From MidasWiki
Revision as of 14:07, 14 July 2015 by Suz (talk | contribs)
Jump to navigation Jump to search

MIDAS defines its own data types for OS compatibility. These can be found in midas.h in the MIDAS package.

It is suggested that you use them in order to ensure correct compilation when moving code from one OS to another.


float and double retain OS definition.

  • BYTE unsigned char
  • WORD unsigned short int (16-bits word)
  • DWORD unsigned 32-bits word
  • INT signed 32-bits word
  • BOOL OS dependent
  • FLOAT OS dependent
  • DOUBLE OS dependent

When defining a data type either in the frontend code for bank definition or in user code to define ODB variables, MIDAS requires the use of its own data type declaration. The list below shows the main Type IDentification to be used (refer to [1] for complete listing):

  • TID_BYTE unsigned byte 0 255
  • TID_SBYTE signed BYTE -128 127
  • TID_CHAR single character 0 255
  • TID_WORD two BYTE 0 65535
  • TID_SHORT signed WORD -32768 32767
  • TID_DWORD four bytes 0 2**32-1
  • TID_INT signed DWORD -2**31 2**31-1
  • TID_BOOL four bytes bool 0 1
  • TID_FLOAT four bytes float format
  • TID_DOUBLE eight bytes float format