Midas Data Types: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
(Created page with "MIDAS defines its own <b> data types </b> 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 ...")
 
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{Pagelinks}}
MIDAS defines its own <b> data types </b> for OS compatibility.  These can be found in ''midas.h'' in the MIDAS package.
MIDAS defines its own <b> data types </b> for OS compatibility.  These can be found in ''midas.h'' in the MIDAS package.


Line 5: Line 6:




<span style="color: brown; font-weight: bold"> float</span>  and <span style="color: brown;font-weight: bold">double</span> retain OS definition.
<span style="color: saddlebrown; font-weight: bold"> float</span>  and <span style="color: saddlebrown;font-weight: bold">double</span> retain OS definition.


* <span style="color: brown;">BYTE</span>      unsigned char
* <span style="color: saddlebrown;">BYTE</span>      unsigned char
* <span style="color: brown;">WORD</span>      unsigned short int (16-bits word)
* <span style="color: saddlebrown;">WORD</span>      unsigned short int (16-bits word)
* <span style="color: brown;">DWORD</span>    unsigned 32-bits word
* <span style="color: saddlebrown;">DWORD</span>    unsigned 32-bits word
* <span style="color: brown;">INT</span>     signed 32-bits word
* <span style="color: saddlebrown;">INT</span>       signed 32-bits word
* <span style="color: brown;">BOOL</span>      OS dependent.
* <span style="color: saddlebrown;">BOOL</span>      OS dependent
* <span style="color: saddlebrown;">FLOAT</span>    OS dependent
* <span style="color: saddlebrown;">DOUBLE</span>    OS dependent


When defining a data type either in the frontend code for bank definition or in user code
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
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 ''midas.h''
below shows the main Type IDentification to be used (refer to [http://ladd00.triumf.ca/~daqweb/doc/midas-devel/doc/html/group__mdefineh.html] for complete listing):
for complete listing):


* <span style="color: sienna;">TID_BYTE</span>      unsigned byte        0      255  
* <span style="color: sienna;">TID_BYTE</span>      unsigned byte        0      255  
Line 28: Line 30:
* <span style="color: sienna;">TID_FLOAT</span>  four bytes float format     
* <span style="color: sienna;">TID_FLOAT</span>  four bytes float format     
* <span style="color: sienna;">TID_DOUBLE</span>  eight bytes float format
* <span style="color: sienna;">TID_DOUBLE</span>  eight bytes float format
[[Category:Appendices]]

Latest revision as of 15:08, 14 July 2015


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