brsystem.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. /* Automation Studio generated header file */
  2. /* Do not edit ! */
  3. #ifndef _BRSYSTEM_
  4. #define _BRSYSTEM_
  5. #ifdef __cplusplus
  6. extern "C"
  7. {
  8. #endif
  9. #include <bur/plctypes.h>
  10. #include <runtime.h>
  11. #ifndef _IEC_CONST
  12. #define _IEC_CONST _WEAK const
  13. #endif
  14. /* Constants */
  15. #ifdef _REPLACE_CONST
  16. #define brX2X 10U
  17. #define brPP 255U
  18. #define brCPU 1U
  19. #define brKEY 8U
  20. #define brDRAM 0U
  21. #define br2003 2U
  22. #define br2005 1U
  23. #define br2010 0U
  24. #define brC200 9U
  25. #define brC300 8U
  26. #define brADDON 7U
  27. #define brPANEL 6U
  28. #define brGLOBAL_REMANENT_PV 5U
  29. #define brLOCAL_REMANENT_PV 4U
  30. #define brUSRROM 3U
  31. #define brSYSROM 2U
  32. #define brUSRRAM 1U
  33. #define brACOPOS 7U
  34. #define brCAN_IO 5U
  35. #define brBASE_IO 3U
  36. #define brPRODUCT 0U
  37. #define brETHER_IO 6U
  38. #define brNO_FAMILY 255U
  39. #define brREMOTE_IO 4U
  40. #define brBATTERY_OK 1U
  41. #define brPOWERPANEL 5U
  42. #define brBATTERY_LOW 0U
  43. #define brLOGICSCANNER 3U
  44. #define brPLUGIN_MODULE 10U
  45. #define brSYSTEM_MODULE 2U
  46. #define brBATTERY_NOTEST 2U
  47. #define TARGET_BIG_ENDIAN 2U
  48. #define brBATTERY_MISSING 3U
  49. #define INIT_REASON_UNKNOWN (-1)
  50. #define INIT_REASON_DOWNLOAD 3
  51. #define TARGET_LITTLE_ENDIAN 1U
  52. #define brAUTOMATION_RUNTIME 4U
  53. #define brERR_INVALID_DEVICE 27250U
  54. #define INIT_REASON_COLDSTART 2
  55. #define INIT_REASON_WARMSTART 1
  56. #define brSYSCONF_SET_VOLATILE 0
  57. #define brERR_INVALID_PARAMETER 27251U
  58. #define brSYSCONF_SET_NON_VOLATILE 1
  59. #else
  60. _IEC_CONST unsigned char brX2X = 10U;
  61. _IEC_CONST unsigned char brPP = 255U;
  62. _IEC_CONST unsigned char brCPU = 1U;
  63. _IEC_CONST unsigned char brKEY = 8U;
  64. _IEC_CONST unsigned long brDRAM = 0U;
  65. _IEC_CONST unsigned char br2003 = 2U;
  66. _IEC_CONST unsigned char br2005 = 1U;
  67. _IEC_CONST unsigned char br2010 = 0U;
  68. _IEC_CONST unsigned char brC200 = 9U;
  69. _IEC_CONST unsigned char brC300 = 8U;
  70. _IEC_CONST unsigned char brADDON = 7U;
  71. _IEC_CONST unsigned char brPANEL = 6U;
  72. _IEC_CONST unsigned long brGLOBAL_REMANENT_PV = 5U;
  73. _IEC_CONST unsigned long brLOCAL_REMANENT_PV = 4U;
  74. _IEC_CONST unsigned long brUSRROM = 3U;
  75. _IEC_CONST unsigned long brSYSROM = 2U;
  76. _IEC_CONST unsigned long brUSRRAM = 1U;
  77. _IEC_CONST unsigned char brACOPOS = 7U;
  78. _IEC_CONST unsigned char brCAN_IO = 5U;
  79. _IEC_CONST unsigned char brBASE_IO = 3U;
  80. _IEC_CONST unsigned char brPRODUCT = 0U;
  81. _IEC_CONST unsigned char brETHER_IO = 6U;
  82. _IEC_CONST unsigned char brNO_FAMILY = 255U;
  83. _IEC_CONST unsigned char brREMOTE_IO = 4U;
  84. _IEC_CONST unsigned char brBATTERY_OK = 1U;
  85. _IEC_CONST unsigned char brPOWERPANEL = 5U;
  86. _IEC_CONST unsigned char brBATTERY_LOW = 0U;
  87. _IEC_CONST unsigned char brLOGICSCANNER = 3U;
  88. _IEC_CONST unsigned char brPLUGIN_MODULE = 10U;
  89. _IEC_CONST unsigned char brSYSTEM_MODULE = 2U;
  90. _IEC_CONST unsigned char brBATTERY_NOTEST = 2U;
  91. _IEC_CONST unsigned char TARGET_BIG_ENDIAN = 2U;
  92. _IEC_CONST unsigned char brBATTERY_MISSING = 3U;
  93. _IEC_CONST signed char INIT_REASON_UNKNOWN = -1;
  94. _IEC_CONST signed char INIT_REASON_DOWNLOAD = 3;
  95. _IEC_CONST unsigned char TARGET_LITTLE_ENDIAN = 1U;
  96. _IEC_CONST unsigned char brAUTOMATION_RUNTIME = 4U;
  97. _IEC_CONST unsigned short brERR_INVALID_DEVICE = 27250U;
  98. _IEC_CONST signed char INIT_REASON_COLDSTART = 2;
  99. _IEC_CONST signed char INIT_REASON_WARMSTART = 1;
  100. _IEC_CONST plcbit brSYSCONF_SET_VOLATILE = 0;
  101. _IEC_CONST unsigned short brERR_INVALID_PARAMETER = 27251U;
  102. _IEC_CONST plcbit brSYSCONF_SET_NON_VOLATILE = 1;
  103. #endif
  104. /* Datatypes and datatypes of function blocks */
  105. typedef struct MEMInfo
  106. {
  107. /* VAR_OUTPUT (analog) */
  108. unsigned short status;
  109. unsigned long FreeUSR_Ram;
  110. unsigned long FreeSYSTEM;
  111. unsigned long FreeUSR_Prom;
  112. unsigned long FreeSYS_Prom;
  113. unsigned long FreeFIX_Ram;
  114. unsigned long FreeTMP_Ram;
  115. unsigned long FreeMEMCARD;
  116. /* VAR_INPUT (digital) */
  117. plcbit enable;
  118. } MEMInfo_typ;
  119. typedef struct SysInfo
  120. {
  121. /* VAR_OUTPUT (analog) */
  122. unsigned char init_reason;
  123. unsigned char init_count;
  124. unsigned long tick_count;
  125. unsigned long version;
  126. /* VAR_INPUT (digital) */
  127. plcbit enable;
  128. } SysInfo_typ;
  129. typedef struct RTInfo
  130. {
  131. /* VAR_OUTPUT (analog) */
  132. unsigned short status;
  133. unsigned long cycle_time;
  134. signed char init_reason;
  135. signed char task_class;
  136. /* VAR_INPUT (digital) */
  137. plcbit enable;
  138. } RTInfo_typ;
  139. typedef struct TARGETInfo
  140. {
  141. /* VAR_INPUT (analog) */
  142. unsigned long pOSVersion;
  143. /* VAR_OUTPUT (analog) */
  144. unsigned short status;
  145. unsigned char DataFormat;
  146. /* VAR_INPUT (digital) */
  147. plcbit enable;
  148. } TARGETInfo_typ;
  149. typedef struct HWInfo
  150. {
  151. /* VAR_INPUT (analog) */
  152. unsigned long pName;
  153. /* VAR_OUTPUT (analog) */
  154. unsigned short status;
  155. unsigned char family;
  156. unsigned char usetype;
  157. unsigned long module_typ;
  158. unsigned char master_no;
  159. unsigned char slave_no;
  160. unsigned char module_adr;
  161. unsigned char slot_no;
  162. /* VAR (analog) */
  163. unsigned long next_vw_p;
  164. unsigned long last_modul_p;
  165. unsigned long next_entry_p;
  166. unsigned char next_entry_ix;
  167. unsigned char next_slot_ix;
  168. unsigned char last_rio_master;
  169. /* VAR_INPUT (digital) */
  170. plcbit enable;
  171. plcbit first;
  172. } HWInfo_typ;
  173. typedef struct BatteryInfo
  174. {
  175. /* VAR_INPUT (analog) */
  176. unsigned long pDevice;
  177. /* VAR_OUTPUT (analog) */
  178. unsigned short status;
  179. unsigned char state;
  180. /* VAR_INPUT (digital) */
  181. plcbit enable;
  182. } BatteryInfo_typ;
  183. typedef struct EXCInfo
  184. {
  185. /* VAR_OUTPUT (analog) */
  186. unsigned short status;
  187. unsigned long task_class;
  188. unsigned long task_ident;
  189. /* VAR_INPUT (digital) */
  190. plcbit enable;
  191. } EXCInfo_typ;
  192. typedef struct ZYKVLenable
  193. {
  194. /* VAR_OUTPUT (analog) */
  195. unsigned short status;
  196. /* VAR_INPUT (digital) */
  197. plcbit enable;
  198. plcbit mode;
  199. } ZYKVLenable_typ;
  200. typedef struct PMemGet
  201. {
  202. /* VAR_INPUT (analog) */
  203. unsigned long offset;
  204. unsigned long len;
  205. unsigned long adress;
  206. /* VAR_OUTPUT (analog) */
  207. unsigned short status;
  208. /* VAR_INPUT (digital) */
  209. plcbit enable;
  210. } PMemGet_typ;
  211. typedef struct PMemPut
  212. {
  213. /* VAR_INPUT (analog) */
  214. unsigned long offset;
  215. unsigned long len;
  216. unsigned long adress;
  217. /* VAR_OUTPUT (analog) */
  218. unsigned short status;
  219. /* VAR_INPUT (digital) */
  220. plcbit enable;
  221. } PMemPut_typ;
  222. typedef struct PMemSize
  223. {
  224. /* VAR_OUTPUT (analog) */
  225. unsigned short status;
  226. unsigned long size;
  227. /* VAR_INPUT (digital) */
  228. plcbit enable;
  229. } PMemSize_typ;
  230. /* Prototyping of functions and function blocks */
  231. void MEMInfo(struct MEMInfo* inst);
  232. void SysInfo(struct SysInfo* inst);
  233. void RTInfo(struct RTInfo* inst);
  234. void TARGETInfo(struct TARGETInfo* inst);
  235. void HWInfo(struct HWInfo* inst);
  236. void BatteryInfo(struct BatteryInfo* inst);
  237. void EXCInfo(struct EXCInfo* inst);
  238. void ZYKVLenable(struct ZYKVLenable* inst);
  239. void PMemGet(struct PMemGet* inst);
  240. void PMemPut(struct PMemPut* inst);
  241. void PMemSize(struct PMemSize* inst);
  242. #ifdef __cplusplus
  243. };
  244. #endif
  245. #endif /* _BRSYSTEM_ */