astime.h 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. /* Automation Studio generated header file */
  2. /* Do not edit ! */
  3. #ifndef _ASTIME_
  4. #define _ASTIME_
  5. #ifdef __cplusplus
  6. extern "C"
  7. {
  8. #endif
  9. #include <bur/plctypes.h>
  10. #include <runtime.h>
  11. #ifndef _BUR_PUBLIC
  12. #define _BUR_PUBLIC
  13. #endif
  14. /* Constants */
  15. #ifdef _REPLACE_CONST
  16. #define timERR_AR 33213U
  17. #define timERR_INVALID_DTSTRUCTURE 33212U
  18. #define timERR_INVALID_LEN 33211U
  19. #define timERR_INVALID_PARAMETER 33210U
  20. #define timREDUND_INTERFACE 3U
  21. #define timTIME_SERVER 2U
  22. #define timREAL_TIME_CLOCK 1U
  23. #define timNO_DST 3U
  24. #define timDAYLIGHT_SAVING_TIME 2U
  25. #define timNORMAL_TIME 1U
  26. #define TIME_MAX 2073600000
  27. #define TIME_MIN (-2073600000)
  28. #define DATE_AND_TIME_MAX 4102444799U
  29. #define timEXSETTIME_NO_OPTION 0U
  30. #define timEXSETTIME_NO_LOGENTRY 1U
  31. #else
  32. #ifndef _GLOBAL_CONST
  33. #define _GLOBAL_CONST _WEAK const
  34. #endif
  35. _GLOBAL_CONST unsigned short timERR_AR;
  36. _GLOBAL_CONST unsigned short timERR_INVALID_DTSTRUCTURE;
  37. _GLOBAL_CONST unsigned short timERR_INVALID_LEN;
  38. _GLOBAL_CONST unsigned short timERR_INVALID_PARAMETER;
  39. _GLOBAL_CONST unsigned char timREDUND_INTERFACE;
  40. _GLOBAL_CONST unsigned char timTIME_SERVER;
  41. _GLOBAL_CONST unsigned char timREAL_TIME_CLOCK;
  42. _GLOBAL_CONST unsigned char timNO_DST;
  43. _GLOBAL_CONST unsigned char timDAYLIGHT_SAVING_TIME;
  44. _GLOBAL_CONST unsigned char timNORMAL_TIME;
  45. _GLOBAL_CONST signed long TIME_MAX;
  46. _GLOBAL_CONST signed long TIME_MIN;
  47. _GLOBAL_CONST unsigned long DATE_AND_TIME_MAX;
  48. _GLOBAL_CONST unsigned char timEXSETTIME_NO_OPTION;
  49. _GLOBAL_CONST unsigned char timEXSETTIME_NO_LOGENTRY;
  50. #endif
  51. /* Datatypes and datatypes of function blocks */
  52. typedef struct TIMEStructure
  53. { signed char day;
  54. unsigned char hour;
  55. unsigned char minute;
  56. unsigned char second;
  57. unsigned short millisec;
  58. unsigned short microsec;
  59. } TIMEStructure;
  60. typedef struct DTStructure
  61. { unsigned short year;
  62. unsigned char month;
  63. unsigned char day;
  64. unsigned char wday;
  65. unsigned char hour;
  66. unsigned char minute;
  67. unsigned char second;
  68. unsigned short millisec;
  69. unsigned short microsec;
  70. } DTStructure;
  71. typedef struct DTExSetTime
  72. {
  73. /* VAR_INPUT (analog) */
  74. plcdt DT1;
  75. unsigned char Option;
  76. /* VAR_OUTPUT (analog) */
  77. unsigned short status;
  78. /* VAR_INPUT (digital) */
  79. plcbit enable;
  80. } DTExSetTime_typ;
  81. typedef struct DTSetTime
  82. {
  83. /* VAR_INPUT (analog) */
  84. plcdt DT1;
  85. /* VAR_OUTPUT (analog) */
  86. unsigned short status;
  87. /* VAR_INPUT (digital) */
  88. plcbit enable;
  89. } DTSetTime_typ;
  90. typedef struct DTGetTime
  91. {
  92. /* VAR_OUTPUT (analog) */
  93. unsigned short status;
  94. plcdt DT1;
  95. /* VAR_INPUT (digital) */
  96. plcbit enable;
  97. } DTGetTime_typ;
  98. typedef struct UtcDTGetTime
  99. {
  100. /* VAR_OUTPUT (analog) */
  101. unsigned short status;
  102. plcdt DT1;
  103. /* VAR_INPUT (digital) */
  104. plcbit enable;
  105. } UtcDTGetTime_typ;
  106. typedef struct UtcDTSetTime
  107. {
  108. /* VAR_INPUT (analog) */
  109. plcdt DT1;
  110. /* VAR_OUTPUT (analog) */
  111. unsigned short status;
  112. /* VAR (analog) */
  113. unsigned short i_state;
  114. unsigned short i_result;
  115. unsigned long i_tmp;
  116. /* VAR_INPUT (digital) */
  117. plcbit enable;
  118. } UtcDTSetTime_typ;
  119. typedef struct UtcDTExSetTime
  120. {
  121. /* VAR_INPUT (analog) */
  122. plcdt DT1;
  123. unsigned char Option;
  124. /* VAR_OUTPUT (analog) */
  125. unsigned short status;
  126. /* VAR (analog) */
  127. unsigned short i_state;
  128. unsigned short i_result;
  129. unsigned long i_tmp;
  130. /* VAR_INPUT (digital) */
  131. plcbit enable;
  132. } UtcDTExSetTime_typ;
  133. typedef struct DTStructureGetTime
  134. {
  135. /* VAR_INPUT (analog) */
  136. unsigned long pDTStructure;
  137. /* VAR_OUTPUT (analog) */
  138. unsigned short status;
  139. /* VAR_INPUT (digital) */
  140. plcbit enable;
  141. } DTStructureGetTime_typ;
  142. typedef struct DTStructureSetTime
  143. {
  144. /* VAR_INPUT (analog) */
  145. unsigned long pDTStructure;
  146. /* VAR_OUTPUT (analog) */
  147. unsigned short status;
  148. /* VAR_INPUT (digital) */
  149. plcbit enable;
  150. } DTStructureSetTime_typ;
  151. typedef struct DTStructureExSetTime
  152. {
  153. /* VAR_INPUT (analog) */
  154. unsigned long pDTStructure;
  155. unsigned char Option;
  156. /* VAR_OUTPUT (analog) */
  157. unsigned short status;
  158. /* VAR_INPUT (digital) */
  159. plcbit enable;
  160. } DTStructureExSetTime_typ;
  161. typedef struct UtcDTStructureGetTime
  162. {
  163. /* VAR_INPUT (analog) */
  164. unsigned long pDTStructure;
  165. /* VAR_OUTPUT (analog) */
  166. unsigned short status;
  167. /* VAR_INPUT (digital) */
  168. plcbit enable;
  169. } UtcDTStructureGetTime_typ;
  170. typedef struct UtcDTStructureSetTime
  171. {
  172. /* VAR_INPUT (analog) */
  173. unsigned long pDTStructure;
  174. /* VAR_OUTPUT (analog) */
  175. unsigned short status;
  176. /* VAR (analog) */
  177. unsigned short i_state;
  178. unsigned short i_result;
  179. unsigned long i_tmp;
  180. /* VAR_INPUT (digital) */
  181. plcbit enable;
  182. } UtcDTStructureSetTime_typ;
  183. typedef struct UtcDTStructureExSetTime
  184. {
  185. /* VAR_INPUT (analog) */
  186. unsigned long pDTStructure;
  187. unsigned char Option;
  188. /* VAR_OUTPUT (analog) */
  189. unsigned short status;
  190. /* VAR (analog) */
  191. unsigned short i_state;
  192. unsigned short i_result;
  193. unsigned long i_tmp;
  194. /* VAR_INPUT (digital) */
  195. plcbit enable;
  196. } UtcDTStructureExSetTime_typ;
  197. typedef struct UtcDT_TO_LocalDTStructure
  198. {
  199. /* VAR_INPUT (analog) */
  200. plcdt DT1;
  201. unsigned long pDTStructure;
  202. /* VAR_OUTPUT (analog) */
  203. unsigned short status;
  204. /* VAR (analog) */
  205. unsigned short i_state;
  206. unsigned short i_result;
  207. unsigned long i_tmp;
  208. /* VAR_INPUT (digital) */
  209. plcbit enable;
  210. } UtcDT_TO_LocalDTStructure_typ;
  211. typedef struct LocalDT_TO_UtcDTStructure
  212. {
  213. /* VAR_INPUT (analog) */
  214. plcdt DT1;
  215. unsigned long pDTStructure;
  216. /* VAR_OUTPUT (analog) */
  217. unsigned short status;
  218. /* VAR (analog) */
  219. unsigned short i_state;
  220. unsigned short i_result;
  221. unsigned long i_tmp;
  222. /* VAR_INPUT (digital) */
  223. plcbit enable;
  224. } LocalDT_TO_UtcDTStructure_typ;
  225. typedef struct UtcDTStructure_TO_LocalDT
  226. {
  227. /* VAR_INPUT (analog) */
  228. unsigned long pDTStructure;
  229. /* VAR_OUTPUT (analog) */
  230. plcdt DT1;
  231. unsigned short status;
  232. /* VAR (analog) */
  233. unsigned short i_state;
  234. unsigned short i_result;
  235. unsigned long i_tmp;
  236. /* VAR_INPUT (digital) */
  237. plcbit enable;
  238. } UtcDTStructure_TO_LocalDT_typ;
  239. typedef struct LocalDTStructure_TO_UtcDT
  240. {
  241. /* VAR_INPUT (analog) */
  242. unsigned long pDTStructure;
  243. /* VAR_OUTPUT (analog) */
  244. plcdt DT1;
  245. unsigned short status;
  246. /* VAR (analog) */
  247. unsigned short i_state;
  248. unsigned short i_result;
  249. unsigned long i_tmp;
  250. /* VAR_INPUT (digital) */
  251. plcbit enable;
  252. } LocalDTStructure_TO_UtcDT_typ;
  253. typedef struct TimeDeviceGetInfo
  254. {
  255. /* VAR_INPUT (analog) */
  256. unsigned long pServer;
  257. unsigned char len;
  258. /* VAR_OUTPUT (analog) */
  259. unsigned char timeDevice;
  260. float avgDeviation;
  261. unsigned short status;
  262. /* VAR (analog) */
  263. unsigned short i_state;
  264. unsigned short i_result;
  265. unsigned long i_tmp;
  266. /* VAR_INPUT (digital) */
  267. plcbit enable;
  268. } TimeDeviceGetInfo_typ;
  269. typedef struct DstGetInfo
  270. {
  271. /* VAR_INPUT (analog) */
  272. unsigned long pDTStructure;
  273. /* VAR_OUTPUT (analog) */
  274. unsigned char dstState;
  275. unsigned short status;
  276. /* VAR (analog) */
  277. unsigned short i_state;
  278. unsigned short i_result;
  279. unsigned long i_tmp;
  280. /* VAR_INPUT (digital) */
  281. plcbit enable;
  282. } DstGetInfo_typ;
  283. typedef struct DstGetInfoDT
  284. {
  285. /* VAR_INPUT (analog) */
  286. plcdt DT1;
  287. /* VAR_OUTPUT (analog) */
  288. unsigned char dstState;
  289. unsigned short status;
  290. /* VAR (analog) */
  291. unsigned short i_state;
  292. unsigned short i_result;
  293. unsigned long i_tmp;
  294. /* VAR_INPUT (digital) */
  295. plcbit enable;
  296. } DstGetInfoDT_typ;
  297. /* Prototyping of functions and function blocks */
  298. _BUR_PUBLIC void DTExSetTime(struct DTExSetTime* inst);
  299. _BUR_PUBLIC void DTSetTime(struct DTSetTime* inst);
  300. _BUR_PUBLIC void DTGetTime(struct DTGetTime* inst);
  301. _BUR_PUBLIC void UtcDTGetTime(struct UtcDTGetTime* inst);
  302. _BUR_PUBLIC void UtcDTSetTime(struct UtcDTSetTime* inst);
  303. _BUR_PUBLIC void UtcDTExSetTime(struct UtcDTExSetTime* inst);
  304. _BUR_PUBLIC void DTStructureGetTime(struct DTStructureGetTime* inst);
  305. _BUR_PUBLIC void DTStructureSetTime(struct DTStructureSetTime* inst);
  306. _BUR_PUBLIC void DTStructureExSetTime(struct DTStructureExSetTime* inst);
  307. _BUR_PUBLIC void UtcDTStructureGetTime(struct UtcDTStructureGetTime* inst);
  308. _BUR_PUBLIC void UtcDTStructureSetTime(struct UtcDTStructureSetTime* inst);
  309. _BUR_PUBLIC void UtcDTStructureExSetTime(struct UtcDTStructureExSetTime* inst);
  310. _BUR_PUBLIC void UtcDT_TO_LocalDTStructure(struct UtcDT_TO_LocalDTStructure* inst);
  311. _BUR_PUBLIC void LocalDT_TO_UtcDTStructure(struct LocalDT_TO_UtcDTStructure* inst);
  312. _BUR_PUBLIC void UtcDTStructure_TO_LocalDT(struct UtcDTStructure_TO_LocalDT* inst);
  313. _BUR_PUBLIC void LocalDTStructure_TO_UtcDT(struct LocalDTStructure_TO_UtcDT* inst);
  314. _BUR_PUBLIC void TimeDeviceGetInfo(struct TimeDeviceGetInfo* inst);
  315. _BUR_PUBLIC void DstGetInfo(struct DstGetInfo* inst);
  316. _BUR_PUBLIC void DstGetInfoDT(struct DstGetInfoDT* inst);
  317. _BUR_PUBLIC plctime clock_ms(void);
  318. _BUR_PUBLIC unsigned long ascTIMEStructure(unsigned long pTIMEStructure, unsigned long pStr, unsigned long len);
  319. _BUR_PUBLIC unsigned long ascDTStructure(unsigned long pDTStructure, unsigned long pStr, unsigned long len);
  320. _BUR_PUBLIC unsigned long ascTIME(plctime TIME1, unsigned long pStr, unsigned long len);
  321. _BUR_PUBLIC unsigned long ascDT(plcdt DT1, unsigned long pStr, unsigned long len);
  322. _BUR_PUBLIC plctime TIMEStructure_TO_TIME(unsigned long pTIMEStructure);
  323. _BUR_PUBLIC unsigned long TIME_TO_TIMEStructure(plctime TIME1, unsigned long pTIMEStructure);
  324. _BUR_PUBLIC plcdt DTStructure_TO_DT(unsigned long pDTStructure);
  325. _BUR_PUBLIC unsigned long DT_TO_DTStructure(plcdt DT1, unsigned long pDTStructure);
  326. _BUR_PUBLIC unsigned long DiffT(plctime TIME2, plctime TIME1);
  327. _BUR_PUBLIC unsigned long DiffDT(plcdt DT2, plcdt DT1);
  328. #ifdef __cplusplus
  329. };
  330. #endif
  331. #endif /* _ASTIME_ */