AsIOLink.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. /* Automation Studio generated header file */
  2. /* Do not edit ! */
  3. #ifndef _ASIOLINK_
  4. #define _ASIOLINK_
  5. #ifdef __cplusplus
  6. extern "C"
  7. {
  8. #endif
  9. #include <bur/plctypes.h>
  10. #include <AsIOAcc.h>
  11. #ifndef _BUR_PUBLIC
  12. #define _BUR_PUBLIC
  13. #endif
  14. /* Constants */
  15. #ifdef _REPLACE_CONST
  16. #define ioLinkMODE_OPERATE 10U
  17. #define ioLinkMODE_DIGOUTPUT 2U
  18. #define ioLinkMODE_DIGINPUT 1U
  19. #define ioLinkMODE_INACTIVE 0U
  20. #define ioLinkTYPE_RECORD 254U
  21. #define ioLinkTYPE_STRING 9U
  22. #define ioLinkTYPE_LREAL 14U
  23. #define ioLinkTYPE_REAL 8U
  24. #define ioLinkTYPE_ULINT 10U
  25. #define ioLinkTYPE_UDINT 7U
  26. #define ioLinkTYPE_UINT 6U
  27. #define ioLinkTYPE_USINT 5U
  28. #define ioLinkTYPE_LINT 23U
  29. #define ioLinkTYPE_DINT 4U
  30. #define ioLinkTYPE_INT 3U
  31. #define ioLinkTYPE_SINT 2U
  32. #define ioLinkERR_DEVICE_ERROR 37971U
  33. #define ioLinkERR_NO_EVENT 37970U
  34. #define ioLinkERR_EVENT_RECEIVED 37969U
  35. #define ioLinkERR_DATATYPE_MISMATCH 37968U
  36. #define ioLinkERR_DEVICE_DRIVER 37967U
  37. #define ioLinkERR_BUFFER_TO_SMALL 37966U
  38. #define ioLinkERR_REQUEST_TO_LONG 37965U
  39. #define ioLinkERR_REQUESTQUEUE_FULL 37964U
  40. #define ioLinkERR_MAX_OPEN_COUNT 37963U
  41. #define ioLinkERR_COMMUNICATION_DEVICE 37962U
  42. #define ioLinkERR_INVALID_MASTER 37961U
  43. #define ioLinkERR_INVALID_PARAMETER 37960U
  44. #else
  45. #ifndef _GLOBAL_CONST
  46. #define _GLOBAL_CONST _WEAK const
  47. #endif
  48. _GLOBAL_CONST unsigned char ioLinkMODE_OPERATE;
  49. _GLOBAL_CONST unsigned char ioLinkMODE_DIGOUTPUT;
  50. _GLOBAL_CONST unsigned char ioLinkMODE_DIGINPUT;
  51. _GLOBAL_CONST unsigned char ioLinkMODE_INACTIVE;
  52. _GLOBAL_CONST unsigned char ioLinkTYPE_RECORD;
  53. _GLOBAL_CONST unsigned char ioLinkTYPE_STRING;
  54. _GLOBAL_CONST unsigned char ioLinkTYPE_LREAL;
  55. _GLOBAL_CONST unsigned char ioLinkTYPE_REAL;
  56. _GLOBAL_CONST unsigned char ioLinkTYPE_ULINT;
  57. _GLOBAL_CONST unsigned char ioLinkTYPE_UDINT;
  58. _GLOBAL_CONST unsigned char ioLinkTYPE_UINT;
  59. _GLOBAL_CONST unsigned char ioLinkTYPE_USINT;
  60. _GLOBAL_CONST unsigned char ioLinkTYPE_LINT;
  61. _GLOBAL_CONST unsigned char ioLinkTYPE_DINT;
  62. _GLOBAL_CONST unsigned char ioLinkTYPE_INT;
  63. _GLOBAL_CONST unsigned char ioLinkTYPE_SINT;
  64. _GLOBAL_CONST unsigned short ioLinkERR_DEVICE_ERROR;
  65. _GLOBAL_CONST unsigned short ioLinkERR_NO_EVENT;
  66. _GLOBAL_CONST unsigned short ioLinkERR_EVENT_RECEIVED;
  67. _GLOBAL_CONST unsigned short ioLinkERR_DATATYPE_MISMATCH;
  68. _GLOBAL_CONST unsigned short ioLinkERR_DEVICE_DRIVER;
  69. _GLOBAL_CONST unsigned short ioLinkERR_BUFFER_TO_SMALL;
  70. _GLOBAL_CONST unsigned short ioLinkERR_REQUEST_TO_LONG;
  71. _GLOBAL_CONST unsigned short ioLinkERR_REQUESTQUEUE_FULL;
  72. _GLOBAL_CONST unsigned short ioLinkERR_MAX_OPEN_COUNT;
  73. _GLOBAL_CONST unsigned short ioLinkERR_COMMUNICATION_DEVICE;
  74. _GLOBAL_CONST unsigned short ioLinkERR_INVALID_MASTER;
  75. _GLOBAL_CONST unsigned short ioLinkERR_INVALID_PARAMETER;
  76. #endif
  77. /* Datatypes and datatypes of function blocks */
  78. typedef enum ioLinkState_t
  79. { READY,
  80. WORK,
  81. DONE
  82. } ioLinkState_t;
  83. typedef struct ioLinkInternalAccess_t
  84. { enum ioLinkState_t state;
  85. unsigned long idCount;
  86. unsigned long drvInstHandle;
  87. unsigned short error;
  88. unsigned long done;
  89. unsigned long serviceResponse;
  90. unsigned char datatype;
  91. unsigned long buffer;
  92. unsigned long bufferSize;
  93. unsigned char bufferFeatures[16];
  94. } ioLinkInternalAccess_t;
  95. typedef struct ioLinkInternalEvent_t
  96. { enum ioLinkState_t state;
  97. unsigned long drvInstHandle;
  98. unsigned char eventQualifier;
  99. unsigned short eventData;
  100. plcbit eventLost;
  101. plcbit eventPending;
  102. unsigned short error;
  103. unsigned char bufferFeatures[8];
  104. } ioLinkInternalEvent_t;
  105. typedef struct ioLinkInternalSetMode_t
  106. { enum ioLinkState_t state;
  107. unsigned short error;
  108. plcstring deviceName[129];
  109. plcstring channelName[33];
  110. struct AsIOAccWrite accWrite;
  111. unsigned char bufferFeatures[8];
  112. } ioLinkInternalSetMode_t;
  113. typedef struct ioLinkInternalParDownload_t
  114. { enum ioLinkState_t state;
  115. unsigned long drvInstHandle;
  116. unsigned short error;
  117. unsigned char bufferFeatures[8];
  118. } ioLinkInternalParDownload_t;
  119. typedef struct ioLinkWrite
  120. {
  121. /* VAR_INPUT (analog) */
  122. unsigned long pDeviceName;
  123. unsigned short index;
  124. unsigned char subIndex;
  125. unsigned char datatype;
  126. unsigned long pData;
  127. unsigned long dataLen;
  128. /* VAR_OUTPUT (analog) */
  129. unsigned short errorCode;
  130. unsigned short status;
  131. /* VAR (analog) */
  132. struct ioLinkInternalAccess_t _internal;
  133. /* VAR_INPUT (digital) */
  134. plcbit enable;
  135. } ioLinkWrite_typ;
  136. typedef struct ioLinkRead
  137. {
  138. /* VAR_INPUT (analog) */
  139. unsigned long pDeviceName;
  140. unsigned short index;
  141. unsigned char subIndex;
  142. unsigned char datatype;
  143. unsigned long pData;
  144. unsigned long dataLen;
  145. /* VAR_OUTPUT (analog) */
  146. unsigned short errorCode;
  147. unsigned long readLen;
  148. unsigned short status;
  149. /* VAR (analog) */
  150. struct ioLinkInternalAccess_t _internal;
  151. /* VAR_INPUT (digital) */
  152. plcbit enable;
  153. } ioLinkRead_typ;
  154. typedef struct ioLinkGetEvent
  155. {
  156. /* VAR_INPUT (analog) */
  157. unsigned long pDeviceName;
  158. /* VAR_OUTPUT (analog) */
  159. unsigned char eventQualifier;
  160. unsigned short eventData;
  161. unsigned short status;
  162. /* VAR (analog) */
  163. struct ioLinkInternalEvent_t _internal;
  164. /* VAR_INPUT (digital) */
  165. plcbit enable;
  166. /* VAR_OUTPUT (digital) */
  167. plcbit eventLost;
  168. plcbit eventPending;
  169. } ioLinkGetEvent_typ;
  170. typedef struct ioLinkSetMode
  171. {
  172. /* VAR_INPUT (analog) */
  173. unsigned long pDeviceName;
  174. unsigned char mode;
  175. /* VAR_OUTPUT (analog) */
  176. unsigned short status;
  177. /* VAR (analog) */
  178. struct ioLinkInternalSetMode_t _internal;
  179. /* VAR_INPUT (digital) */
  180. plcbit enable;
  181. } ioLinkSetMode_typ;
  182. typedef struct ioLinkParameterDownload
  183. {
  184. /* VAR_INPUT (analog) */
  185. unsigned long pDeviceName;
  186. /* VAR_OUTPUT (analog) */
  187. unsigned short status;
  188. /* VAR (analog) */
  189. struct ioLinkInternalParDownload_t _internal;
  190. /* VAR_INPUT (digital) */
  191. plcbit enable;
  192. } ioLinkParameterDownload_typ;
  193. /* Prototyping of functions and function blocks */
  194. _BUR_PUBLIC void ioLinkWrite(struct ioLinkWrite* inst);
  195. _BUR_PUBLIC void ioLinkRead(struct ioLinkRead* inst);
  196. _BUR_PUBLIC void ioLinkGetEvent(struct ioLinkGetEvent* inst);
  197. _BUR_PUBLIC void ioLinkSetMode(struct ioLinkSetMode* inst);
  198. _BUR_PUBLIC void ioLinkParameterDownload(struct ioLinkParameterDownload* inst);
  199. #ifdef __cplusplus
  200. };
  201. #endif
  202. #endif /* _ASIOLINK_ */