AsIOLink.fun 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ioLinkWrite (*write data to an object of the IO-Link device*)
  2. VAR_INPUT
  3. enable : BOOL; (*enables execution*)
  4. pDeviceName : UDINT; (*device name given as a pointer to string*)
  5. index : UINT; (*index to be written*)
  6. subIndex : USINT; (*subIndex to be written*)
  7. datatype : USINT; (*datatype to be written*)
  8. pData : UDINT; (*pointer to the write data*)
  9. dataLen : UDINT; (*length of the write access*)
  10. END_VAR
  11. VAR_OUTPUT
  12. errorCode : UINT; (*error code generated by the IO-Link device*)
  13. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  14. END_VAR
  15. VAR
  16. _internal : ioLinkInternalAccess_t; (*internal variable*)
  17. END_VAR
  18. END_FUNCTION_BLOCK
  19. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ioLinkRead (*read data from an object of the IO-Link device*)
  20. VAR_INPUT
  21. enable : BOOL; (*enables execution*)
  22. pDeviceName : UDINT; (*device name given as a pointer to string*)
  23. index : UINT; (*index to be read*)
  24. subIndex : USINT; (*subIndex to be read*)
  25. datatype : USINT; (*datatype to be read*)
  26. pData : UDINT; (*pointer for the read data*)
  27. dataLen : UDINT; (*length of the read data buffer*)
  28. END_VAR
  29. VAR_OUTPUT
  30. errorCode : UINT; (*error code generated by the IO-Link device*)
  31. readLen : UDINT; (*read data size in buffer*)
  32. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  33. END_VAR
  34. VAR
  35. _internal : ioLinkInternalAccess_t; (*internal variable*)
  36. END_VAR
  37. END_FUNCTION_BLOCK
  38. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ioLinkGetEvent (*read event data from event queue*)
  39. VAR_INPUT
  40. enable : BOOL; (*enables execution*)
  41. pDeviceName : UDINT; (*device name given as a pointer to string*)
  42. END_VAR
  43. VAR_OUTPUT
  44. eventQualifier : USINT; (*eventQualifier*)
  45. eventData : UINT; (*eventData*)
  46. eventLost : BOOL; (*is set if some events are overwritten*)
  47. eventPending : BOOL; (*indicates if there are more events in the event buffer*)
  48. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  49. END_VAR
  50. VAR
  51. _internal : ioLinkInternalEvent_t; (*internal variable*)
  52. END_VAR
  53. END_FUNCTION_BLOCK
  54. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ioLinkSetMode (*change the mode of an IO-Link device*)
  55. VAR_INPUT
  56. enable : BOOL; (*enables execution*)
  57. pDeviceName : UDINT; (*device name given as a pointer to string*)
  58. mode : USINT; (*desired mode: ioLinkMODE_INACTIVE, ioLinkMODE_DIGINPUT, ioLinkMODE_DIGOUTPUT, ioLinkMODE_FASTOPERATE, ioLinkMODE_OPERATE*)
  59. END_VAR
  60. VAR_OUTPUT
  61. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  62. END_VAR
  63. VAR
  64. _internal : ioLinkInternalSetMode_t; (*internal variable*)
  65. END_VAR
  66. END_FUNCTION_BLOCK
  67. {REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK ioLinkParameterDownload (*download the offline configuration to an IO-Link Device*)
  68. VAR_INPUT
  69. enable : BOOL; (*enables execution*)
  70. pDeviceName : UDINT; (*device name given as a pointer to string*)
  71. END_VAR
  72. VAR_OUTPUT
  73. status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
  74. END_VAR
  75. VAR
  76. _internal : ioLinkInternalParDownload_t; (*internal variable*)
  77. END_VAR
  78. END_FUNCTION_BLOCK