runtime.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. /* Automation Studio generated header file */
  2. /* Do not edit ! */
  3. #ifndef _RUNTIME_
  4. #define _RUNTIME_
  5. #ifdef __cplusplus
  6. extern "C"
  7. {
  8. #endif
  9. #include <bur/plctypes.h>
  10. #ifndef _BUR_PUBLIC
  11. #define _BUR_PUBLIC
  12. #endif
  13. /* Constants */
  14. #ifdef _REPLACE_CONST
  15. #define IEC_DATATYPE_LINT 23U
  16. #define IEC_DATATYPE_WSTRING 21U
  17. #define IEC_DATATYPE_LWORD 20U
  18. #define IEC_DATATYPE_DWORD 19U
  19. #define IEC_DATATYPE_WORD 18U
  20. #define IEC_DATATYPE_BYTE 17U
  21. #define IEC_DATATYPE_TIME_OF_DAY 16U
  22. #define IEC_DATATYPE_LREAL 14U
  23. #define IEC_DATATYPE_DATE 13U
  24. #define IEC_DATATYPE_TIME 12U
  25. #define IEC_DATATYPE_DATE_AND_TIME 11U
  26. #define IEC_DATATYPE_ULINT 10U
  27. #define IEC_DATATYPE_STRING 9U
  28. #define IEC_DATATYPE_REAL 8U
  29. #define IEC_DATATYPE_UDINT 7U
  30. #define IEC_DATATYPE_UINT 6U
  31. #define IEC_DATATYPE_USINT 5U
  32. #define IEC_DATATYPE_DINT 4U
  33. #define IEC_DATATYPE_INT 3U
  34. #define IEC_DATATYPE_SINT 2U
  35. #define IEC_DATATYPE_BOOL 1U
  36. #define ERR_FB_NOT_IMPLEMENTED (-1070585592)
  37. #define ERR_FUB_REDUNDANT 35688U
  38. #define ERR_FUB_BUSY 65535U
  39. #define ERR_FUB_ENABLE_FALSE 65534U
  40. #define ERR_NOTIMPLEMENTED 9999U
  41. #define ERR_OK 0U
  42. #else
  43. #ifndef _GLOBAL_CONST
  44. #define _GLOBAL_CONST _WEAK const
  45. #endif
  46. _GLOBAL_CONST unsigned short IEC_DATATYPE_LINT;
  47. _GLOBAL_CONST unsigned short IEC_DATATYPE_WSTRING;
  48. _GLOBAL_CONST unsigned short IEC_DATATYPE_LWORD;
  49. _GLOBAL_CONST unsigned short IEC_DATATYPE_DWORD;
  50. _GLOBAL_CONST unsigned short IEC_DATATYPE_WORD;
  51. _GLOBAL_CONST unsigned short IEC_DATATYPE_BYTE;
  52. _GLOBAL_CONST unsigned short IEC_DATATYPE_TIME_OF_DAY;
  53. _GLOBAL_CONST unsigned short IEC_DATATYPE_LREAL;
  54. _GLOBAL_CONST unsigned short IEC_DATATYPE_DATE;
  55. _GLOBAL_CONST unsigned short IEC_DATATYPE_TIME;
  56. _GLOBAL_CONST unsigned short IEC_DATATYPE_DATE_AND_TIME;
  57. _GLOBAL_CONST unsigned short IEC_DATATYPE_ULINT;
  58. _GLOBAL_CONST unsigned short IEC_DATATYPE_STRING;
  59. _GLOBAL_CONST unsigned short IEC_DATATYPE_REAL;
  60. _GLOBAL_CONST unsigned short IEC_DATATYPE_UDINT;
  61. _GLOBAL_CONST unsigned short IEC_DATATYPE_UINT;
  62. _GLOBAL_CONST unsigned short IEC_DATATYPE_USINT;
  63. _GLOBAL_CONST unsigned short IEC_DATATYPE_DINT;
  64. _GLOBAL_CONST unsigned short IEC_DATATYPE_INT;
  65. _GLOBAL_CONST unsigned short IEC_DATATYPE_SINT;
  66. _GLOBAL_CONST unsigned short IEC_DATATYPE_BOOL;
  67. _GLOBAL_CONST signed long ERR_FB_NOT_IMPLEMENTED;
  68. _GLOBAL_CONST unsigned short ERR_FUB_REDUNDANT;
  69. _GLOBAL_CONST unsigned short ERR_FUB_BUSY;
  70. _GLOBAL_CONST unsigned short ERR_FUB_ENABLE_FALSE;
  71. _GLOBAL_CONST unsigned short ERR_NOTIMPLEMENTED;
  72. _GLOBAL_CONST unsigned short ERR_OK;
  73. #endif
  74. /* Datatypes and datatypes of function blocks */
  75. typedef struct SFCActionControl
  76. {
  77. /* VAR_INPUT (analog) */
  78. plctime T;
  79. /* VAR (analog) */
  80. unsigned char S_FF_SET;
  81. unsigned char S_FF_R1;
  82. unsigned char S_FF_Q;
  83. unsigned char dummy1;
  84. plctime L_TMR_PT;
  85. plctime L_TMR_ET;
  86. plctime L_TMR_STAR;
  87. unsigned char L_TMR_IN;
  88. unsigned char L_TMR_Q;
  89. unsigned char L_TMR_M;
  90. unsigned char dummy2;
  91. plctime D_TMR_PT;
  92. plctime D_TMR_ET;
  93. plctime D_TMR_STAR;
  94. unsigned char D_TMR_IN;
  95. unsigned char D_TMR_Q;
  96. unsigned char D_TMR_M;
  97. unsigned char dummy3;
  98. unsigned char P_TRIG_CLK;
  99. unsigned char P_TRIG_Q;
  100. unsigned char P_TRIG_M;
  101. unsigned char dummy4;
  102. plctime SD_TMR_PT;
  103. plctime SD_TMR_ET;
  104. plctime SD_TMR_STA;
  105. unsigned char SD_TMR_IN;
  106. unsigned char SD_TMR_Q;
  107. unsigned char SD_TMR_M;
  108. unsigned char dummy5;
  109. unsigned char SD_FF_SET;
  110. unsigned char SD_FF_R1;
  111. unsigned char SD_FF_Q;
  112. unsigned char DS_FF_SET;
  113. unsigned char DS_FF_R1;
  114. unsigned char DS_FF_Q;
  115. plctime DS_TMR_PT;
  116. plctime DS_TMR_ET;
  117. plctime DS_TMR_STA;
  118. unsigned char DS_TMR_IN;
  119. unsigned char DS_TMR_Q;
  120. unsigned char DS_TMR_M;
  121. unsigned char dummy6;
  122. unsigned char SL_FF_SET;
  123. unsigned char SL_FF_R1;
  124. unsigned char SL_FF_Q;
  125. unsigned char dummy7;
  126. plctime SL_TMR_PT;
  127. plctime SL_TMR_ET;
  128. plctime SL_TMR_STA;
  129. unsigned char SL_TMR_IN;
  130. unsigned char SL_TMR_Q;
  131. unsigned char SL_TMR_M;
  132. unsigned char dummy8;
  133. /* VAR_INPUT (digital) */
  134. plcbit N;
  135. plcbit R0;
  136. plcbit S0;
  137. plcbit L;
  138. plcbit D;
  139. plcbit P;
  140. plcbit SD;
  141. plcbit DS;
  142. plcbit SL;
  143. /* VAR_OUTPUT (digital) */
  144. plcbit Q;
  145. } SFCActionControl_typ;
  146. typedef struct SFCActionType
  147. { plcbit x;
  148. plcbit _x;
  149. plctime t;
  150. plctime _t;
  151. struct SFCActionControl AC;
  152. } SFCActionType;
  153. typedef struct SFCAC2
  154. {
  155. /* VAR_INPUT (analog) */
  156. plctime T;
  157. /* VAR (analog) */
  158. unsigned char S_FF_SET;
  159. unsigned char S_FF_R1;
  160. unsigned char S_FF_Q;
  161. plctime L_TMR_PT;
  162. plctime L_TMR_ET;
  163. plctime L_TMR_STAR;
  164. unsigned char L_TMR_IN;
  165. unsigned char L_TMR_Q;
  166. unsigned char L_TMR_M;
  167. plctime D_TMR_PT;
  168. plctime D_TMR_ET;
  169. plctime D_TMR_STAR;
  170. unsigned char D_TMR_IN;
  171. unsigned char D_TMR_Q;
  172. unsigned char D_TMR_M;
  173. plctime SD_TMR_PT;
  174. plctime SD_TMR_ET;
  175. plctime SD_TMR_STA;
  176. unsigned char SD_TMR_IN;
  177. unsigned char SD_TMR_Q;
  178. unsigned char SD_TMR_M;
  179. unsigned char SD_FF_SET;
  180. unsigned char SD_FF_R1;
  181. unsigned char SD_FF_Q1;
  182. unsigned char DS_FF_SET;
  183. unsigned char DS_FF_R1;
  184. unsigned char DS_FF_Q1;
  185. plctime DS_TMR_PT;
  186. plctime DS_TMR_ET;
  187. plctime DS_TMR_STA;
  188. unsigned char DS_TMR_IN;
  189. unsigned char DS_TMR_Q;
  190. unsigned char DS_TMR_M;
  191. unsigned char SL_FF_SET;
  192. unsigned char SL_FF_R1;
  193. unsigned char SL_FF_Q;
  194. plctime SL_TMR_PT;
  195. plctime SL_TMR_ET;
  196. plctime SL_TMR_STA;
  197. unsigned char SL_TMR_IN;
  198. unsigned char SL_TMR_Q;
  199. unsigned char SL_TMR_M;
  200. unsigned char P_TRIG_Q;
  201. unsigned char P_TRIG_M;
  202. unsigned char Q_TRIG_Q;
  203. unsigned char Q_TRIG_M;
  204. unsigned char P1_TRIG_Q;
  205. unsigned char P1_TRIG_M;
  206. unsigned char P0_TRIG_Q;
  207. unsigned char P0_TRIG_M;
  208. /* VAR_INPUT (digital) */
  209. plcbit N;
  210. plcbit R0;
  211. plcbit S0;
  212. plcbit L;
  213. plcbit D;
  214. plcbit P;
  215. plcbit P1;
  216. plcbit P0;
  217. plcbit SD;
  218. plcbit DS;
  219. plcbit SL;
  220. /* VAR_OUTPUT (digital) */
  221. plcbit Q;
  222. plcbit A;
  223. } SFCAC2_typ;
  224. typedef struct SFCActionType2
  225. { plcbit x;
  226. plcbit _x;
  227. struct SFCAC2 AC;
  228. } SFCActionType2;
  229. typedef struct SFCActionCType
  230. { plcbit x;
  231. plcbit _x;
  232. plcbit force;
  233. plcbit _force;
  234. plcbit active;
  235. plcbit _active;
  236. plcbit error;
  237. struct SFCActionControl AC;
  238. } SFCActionCType;
  239. typedef struct SFCActionCType2
  240. { plcbit x;
  241. plcbit _x;
  242. plcbit force;
  243. plcbit _force;
  244. plcbit active;
  245. plcbit _active;
  246. plcbit error;
  247. struct SFCAC2 AC;
  248. } SFCActionCType2;
  249. typedef struct TimerType
  250. { double ptime;
  251. double etime;
  252. double start;
  253. unsigned char in;
  254. unsigned char q;
  255. } TimerType;
  256. typedef struct SFCAC3
  257. {
  258. /* VAR_INPUT (analog) */
  259. double T;
  260. double T_ACT;
  261. /* VAR (analog) */
  262. struct TimerType L_TMR;
  263. struct TimerType D_TMR;
  264. struct TimerType SD_TMR;
  265. struct TimerType DS_TMR;
  266. struct TimerType SL_TMR;
  267. unsigned char S_FF_Q1;
  268. unsigned char SD_FF_Q1;
  269. unsigned char DS_FF_Q1;
  270. unsigned char SL_FF_Q1;
  271. unsigned char P_R_TRIG_Q;
  272. unsigned char P_R_TRIG_M;
  273. unsigned char Q_F_TRIG_Q;
  274. unsigned char Q_F_TRIG_M;
  275. unsigned char P1_R_TRIG_Q;
  276. unsigned char P1_R_TRIG_M;
  277. unsigned char P0_F_TRIG_Q;
  278. unsigned char P0_F_TRIG_M;
  279. /* VAR_INPUT (digital) */
  280. plcbit N;
  281. plcbit R0;
  282. plcbit S0;
  283. plcbit L;
  284. plcbit D;
  285. plcbit P;
  286. plcbit P1;
  287. plcbit P0;
  288. plcbit SD;
  289. plcbit DS;
  290. plcbit SL;
  291. plcbit PAUSE;
  292. /* VAR_OUTPUT (digital) */
  293. plcbit Q;
  294. plcbit A;
  295. } SFCAC3_typ;
  296. typedef struct SFCActionCType3
  297. { double t;
  298. double _t;
  299. double tp;
  300. plcbit x;
  301. plcbit _x;
  302. plcbit force;
  303. plcbit _force;
  304. plcbit active;
  305. plcbit _active;
  306. plcbit error;
  307. struct SFCAC3 AC;
  308. } SFCActionCType3;
  309. typedef struct SFCStepType
  310. { plcbit x;
  311. plctime t;
  312. plcbit _x;
  313. plctime _t;
  314. } SFCStepType;
  315. typedef struct SFCStepCType
  316. { plctime t;
  317. plctime _t;
  318. unsigned long inactive_actions;
  319. unsigned long _inactive_actions;
  320. unsigned long error_actions;
  321. plcbit x;
  322. plcbit _x;
  323. plcbit x_activate;
  324. plcbit force;
  325. plcbit _force;
  326. plcbit active;
  327. plcbit _active;
  328. plcbit error;
  329. plcbit tip;
  330. plcbit tip_disable_duration;
  331. plcbit tip_disable_action;
  332. } SFCStepCType;
  333. typedef struct SFCStepCType3
  334. { double t;
  335. double _t;
  336. double tp;
  337. unsigned long inactive_actions;
  338. unsigned long _inactive_actions;
  339. unsigned long error_actions;
  340. plcbit x;
  341. plcbit _x;
  342. plcbit x_activate;
  343. plcbit force;
  344. plcbit _force;
  345. plcbit active;
  346. plcbit _active;
  347. plcbit error;
  348. plcbit tip;
  349. plcbit tip_disable_duration;
  350. plcbit tip_disable_action;
  351. } SFCStepCType3;
  352. typedef struct SFCSimpleStepCType
  353. { plctime t;
  354. plctime _t;
  355. plcbit x;
  356. plcbit _x;
  357. plcbit x_activate;
  358. plcbit force;
  359. plcbit _force;
  360. plcbit active;
  361. plcbit _active;
  362. plcbit error;
  363. plcbit tip;
  364. plcbit tip_disable_duration;
  365. plcbit tip_disable_action;
  366. } SFCSimpleStepCType;
  367. typedef struct SFCSimpleStepCType3
  368. { double t;
  369. double _t;
  370. double tp;
  371. plcbit x;
  372. plcbit _x;
  373. plcbit x_activate;
  374. plcbit force;
  375. plcbit _force;
  376. plcbit active;
  377. plcbit _active;
  378. plcbit error;
  379. plcbit tip;
  380. plcbit tip_disable_duration;
  381. plcbit tip_disable_action;
  382. } SFCSimpleStepCType3;
  383. typedef struct SFCTransitionCType
  384. { plcbit force;
  385. plcbit _force;
  386. plcbit active;
  387. plcbit _active;
  388. } SFCTransitionCType;
  389. typedef struct ArFBStateInternalType
  390. { unsigned long ExecuteRef;
  391. unsigned long BusyRef;
  392. unsigned long DoneRef;
  393. unsigned long ErrorRef;
  394. unsigned long ActiveRef;
  395. unsigned long StatusRef;
  396. unsigned long FBCyclic;
  397. unsigned long AsyfumaState;
  398. unsigned long FBResetOut;
  399. unsigned long Argument;
  400. unsigned long State;
  401. plcbit ExecutePrev;
  402. } ArFBStateInternalType;
  403. typedef struct ArFBAsyFuMaInternalType
  404. { unsigned short State;
  405. signed long Result;
  406. } ArFBAsyFuMaInternalType;
  407. typedef struct r_trig
  408. {
  409. /* VAR_INPUT (digital) */
  410. plcbit CLK;
  411. /* VAR_OUTPUT (digital) */
  412. plcbit Q;
  413. /* VAR (digital) */
  414. plcbit M;
  415. } r_trig_typ;
  416. typedef struct f_trig
  417. {
  418. /* VAR_INPUT (digital) */
  419. plcbit CLK;
  420. /* VAR_OUTPUT (digital) */
  421. plcbit Q;
  422. /* VAR (digital) */
  423. plcbit M;
  424. } f_trig_typ;
  425. typedef struct rf_trig
  426. {
  427. /* VAR_INPUT (digital) */
  428. plcbit CLK;
  429. /* VAR_OUTPUT (digital) */
  430. plcbit Q;
  431. /* VAR (digital) */
  432. plcbit M;
  433. } rf_trig_typ;
  434. /* Prototyping of functions and function blocks */
  435. _BUR_PUBLIC void r_trig(struct r_trig* inst);
  436. _BUR_PUBLIC void f_trig(struct f_trig* inst);
  437. _BUR_PUBLIC void rf_trig(struct rf_trig* inst);
  438. _BUR_PUBLIC void SFCActionControl(struct SFCActionControl* inst);
  439. _BUR_PUBLIC void SFCAC2(struct SFCAC2* inst);
  440. _BUR_PUBLIC void SFCAC3(struct SFCAC3* inst);
  441. _BUR_PUBLIC plctime GetTime(void);
  442. _BUR_PUBLIC double RealTan(double x);
  443. _BUR_PUBLIC double RealAtan(double x);
  444. _BUR_PUBLIC double RealAsin(double x);
  445. _BUR_PUBLIC double RealAcos(double x);
  446. _BUR_PUBLIC double RealExp(double x);
  447. _BUR_PUBLIC double RealLn(double x);
  448. _BUR_PUBLIC double RealLog(double x);
  449. _BUR_PUBLIC double RealExpt(double x, double y);
  450. _BUR_PUBLIC double RealAbs(double x);
  451. _BUR_PUBLIC double RealSin(double x);
  452. _BUR_PUBLIC double RealCos(double x);
  453. _BUR_PUBLIC double RealSqrt(double x);
  454. #ifdef __cplusplus
  455. };
  456. #endif
  457. #endif /* _RUNTIME_ */