astime.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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 _IEC_CONST
  12. #define _IEC_CONST _WEAK const
  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 timTIME_SERVER 2U
  21. #define timREAL_TIME_CLOCK 1U
  22. #define timNO_DST 3U
  23. #define timDAYLIGHT_SAVING_TIME 2U
  24. #define timNORMAL_TIME 1U
  25. #define TIME_MAX 2073600000
  26. #define TIME_MIN (-2073600000)
  27. #define DATE_AND_TIME_MAX 4102444799U
  28. #define timEXSETTIME_NO_OPTION 0U
  29. #define timEXSETTIME_NO_LOGENTRY 1U
  30. #else
  31. _IEC_CONST unsigned short timERR_AR = 33213U;
  32. _IEC_CONST unsigned short timERR_INVALID_DTSTRUCTURE = 33212U;
  33. _IEC_CONST unsigned short timERR_INVALID_LEN = 33211U;
  34. _IEC_CONST unsigned short timERR_INVALID_PARAMETER = 33210U;
  35. _IEC_CONST unsigned char timTIME_SERVER = 2U;
  36. _IEC_CONST unsigned char timREAL_TIME_CLOCK = 1U;
  37. _IEC_CONST unsigned char timNO_DST = 3U;
  38. _IEC_CONST unsigned char timDAYLIGHT_SAVING_TIME = 2U;
  39. _IEC_CONST unsigned char timNORMAL_TIME = 1U;
  40. _IEC_CONST signed long TIME_MAX = 2073600000;
  41. _IEC_CONST signed long TIME_MIN = -2073600000;
  42. _IEC_CONST unsigned long DATE_AND_TIME_MAX = 4102444799U;
  43. _IEC_CONST unsigned char timEXSETTIME_NO_OPTION = 0U;
  44. _IEC_CONST unsigned char timEXSETTIME_NO_LOGENTRY = 1U;
  45. #endif
  46. /* Datatypes and datatypes of function blocks */
  47. typedef struct TIMEStructure
  48. { signed char day;
  49. unsigned char hour;
  50. unsigned char minute;
  51. unsigned char second;
  52. unsigned short millisec;
  53. unsigned short microsec;
  54. } TIMEStructure;
  55. typedef struct DTStructure
  56. { unsigned short year;
  57. unsigned char month;
  58. unsigned char day;
  59. unsigned char wday;
  60. unsigned char hour;
  61. unsigned char minute;
  62. unsigned char second;
  63. unsigned short millisec;
  64. unsigned short microsec;
  65. } DTStructure;
  66. typedef struct DTExSetTime
  67. {
  68. /* VAR_INPUT (analog) */
  69. plcdt DT1;
  70. unsigned char Option;
  71. /* VAR_OUTPUT (analog) */
  72. unsigned short status;
  73. /* VAR_INPUT (digital) */
  74. plcbit enable;
  75. } DTExSetTime_typ;
  76. typedef struct DTSetTime
  77. {
  78. /* VAR_INPUT (analog) */
  79. plcdt DT1;
  80. /* VAR_OUTPUT (analog) */
  81. unsigned short status;
  82. /* VAR_INPUT (digital) */
  83. plcbit enable;
  84. } DTSetTime_typ;
  85. typedef struct DTGetTime
  86. {
  87. /* VAR_OUTPUT (analog) */
  88. unsigned short status;
  89. plcdt DT1;
  90. /* VAR_INPUT (digital) */
  91. plcbit enable;
  92. } DTGetTime_typ;
  93. /* Prototyping of functions and function blocks */
  94. void DTExSetTime(struct DTExSetTime* inst);
  95. void DTSetTime(struct DTSetTime* inst);
  96. void DTGetTime(struct DTGetTime* inst);
  97. unsigned long ascTIMEStructure(unsigned long pTIMEStructure, unsigned long pStr, unsigned long len);
  98. unsigned long ascDTStructure(unsigned long pDTStructure, unsigned long pStr, unsigned long len);
  99. unsigned long ascTIME(plctime TIME1, unsigned long pStr, unsigned long len);
  100. unsigned long ascDT(plcdt DT1, unsigned long pStr, unsigned long len);
  101. plctime TIMEStructure_TO_TIME(unsigned long pTIMEStructure);
  102. unsigned long TIME_TO_TIMEStructure(plctime TIME1, unsigned long pTIMEStructure);
  103. plcdt DTStructure_TO_DT(unsigned long pDTStructure);
  104. unsigned long DT_TO_DTStructure(plcdt DT1, unsigned long pDTStructure);
  105. unsigned long DiffT(plctime TIME2, plctime TIME1);
  106. unsigned long DiffDT(plcdt DT2, plcdt DT1);
  107. #ifdef __cplusplus
  108. };
  109. #endif
  110. #endif /* _ASTIME_ */