123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323 |
- #ifndef POWERLNK_H_
- #define POWERLNK_H_ 0x1105
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include <bur/plctypes.h>
- #define ERR_PLMGR_VERS_CONFLICT 20900
- #define ERR_PLMGR_NOMEM 20901
- #define ERR_PLMGR_WRONG_DEVICE 20903
- #define ERR_PLMGR_CONFIG_NOT_FOUND 20904
- #define ERR_PLMGR_ALREADY_CONFIGURATED 20905
- #define ERR_PLMGR_NOT_IMPLEMENTED 20906
- #define ERR_PLMGR_ILLEGAL_PARAMETER 20908
- #define ERR_PLMGR_WRONG_IDENT 20911
- #define ERR_PLMGR_ERROR_ALLOC_STATION 20913
- #define ERR_PLMGR_ERROR_ALLOC_CHANNEL 20914
- #define ERR_PLMGR_ERROR_ALLOC_BUFFER 20915
- #define ERR_PLMGR_CHANNEL_ALREADY_OPEN 20916
- #define ERR_PLMGR_NO_FRAME_RECEIVED 20917
- #define ERR_PLMGR_FRAME_TOO_LONG 20918
- #define ERR_PLMGR_WRITE_ACTIVE 20919
- #define ERR_PLMGR_OFFSET_TO_HIGH 20920
- #define ERR_PLMGR_NIL_POINTER 20921
- #define ERR_PLMGR_OVERFLOW 20922
- #define ERR_PLMGR_UNAVAILABLE_DATAPOINT 20923
- #define ERR_PLMGR_WRONG_TASKCLASS 20924
- #define ERR_PLMGR_STATION_NOT_ACTIVE 20925
- #define ERR_PLMGR_TOO_MANY_INTERFACES 20926
- #define ERR_PLMGR_BUS_CONFIGURED_TWICE 20927
- #define ERR_PLMGR_SYNC_BY_SYSTEM 20928
- #define ERR_PLMGR_SYNC_FAILED 20929
- #define ERR_PLMGR_CONFIG_CONFLICT 20930
- #define ERR_PLMGR_NOT_IN_PRES 20931
- #define ERR_PLMGR_UNKNOWN_TYPE 20932
- #define ERR_PLMGR_NO_PDO_MAPPING_DEFINED 20933
- #define ERR_PLMGR_PARSE_ERROR 20950
- #define ERR_PLMGR_PARSE_END_EXPECTED 20951
- #define ERR_PLMGR_PARSE_NO_PERCENT 20952
- #define ERR_PLMGR_PARSE_NOT_IN_OR_OUT 20953
- #define ERR_PLMGR_PARSE_INTERFACE 20954
- #define ERR_PLMGR_PARSE_STATION 20955
- #define ERR_PLMGR_PARSE_MODUL 20956
- #define ERR_PLMGR_PARSE_SUBMODUL 20957
- #define ERR_PLMGR_PARSE_CHANNEL 20958
- #define ERR_PLMGR_PARSE_BIT 20959
- #define ERR_PLMGR_PARSE_TO_MANY_NUMBERS 20960
- #define ERR_PLMGR_PARSE_NETTIME 20961
- #define ERR_PLMGR_PARSE_SLOT 20962
- #define ERR_PLMGR_PARSE_SUBSLOT 20963
- #define ERR_PLMGR_PARSE_TRAILINGCHARS 20964
- #define ERR_PLMGR_WARNING_FW_UPDATE 20980
- #define ERR_PLMGR_HW_BOOTUP_FAILED 20981
- #define ERR_PLMGR_RECOMMEND_FW_UPDATE 20982
- #define ERR_PLMGR_INTERNAL 20997
- #define ERR_PLMGR_EXCEPTION 20998
- #define ERR_PLMGR_NO_POWERLNK_LIBRARY 20999
- #define plCE_CYCLIC_1 1
- #define plCE_CYCLIC_2 2
- #define plCE_CYCLIC_3 3
- #define plCE_CYCLIC_4 4
- #define plCE_CYCLIC_5 5
- #define plCE_CYCLIC_6 6
- #define plCE_CYCLIC_7 7
- #define plCE_CYCLIC_8 8
- #define plCE_TIMER_1 -1
- #define plCE_TIMER_2 -2
- #define plOPEN_MODE_READ 0
- #define plOPEN_MODE_WRITE 1
- #define plOPEN_MODE_RW 2
- #define plOPEN_MODE_EPLV1 0x10
- #define plOPEN_MODE_EPLV2 0x20
- #define plOPEN_MODE_LENGTH 0x40
- #define plOPEN_PRIORITY_ENABLE 0x8000
- #define plOPEN_PRIORITY_LOWEST 0x0000
- #define plOPEN_PRIORITY_LOWER 0x0100
- #define plOPEN_PRIORITY_LOW 0x0200
- #define plOPEN_PRIORITY_GENERIC 0x0300
- #define plOPEN_PRIORITY_HIGH 0x0400
- #define plOPEN_PRIORITY_HIGHER 0x0500
- #define plOPEN_PRIORITY_HIGHEST 0x0600
- #define plOPEN_PRIORITY_NMT 0x0700
- #define plSTATE_WRONG_IDENT 0xffff
- #define plSTATE_STATION_NONEXISTANT 0x0000
- #define plSTATE_STATION_WAITING 0x0001
- #define plSTATE_STATION_OSDL 0x0002
- #define plSTATE_STATION_CONFIG 0x0003
- #define plSTATE_STATION_ACTIVATEING 0x0004
- #define plSTATE_STATION_ACTIVE 0x0005
- #define plSTATE_STATION_INACTIVE 0x0006
- #define plSTATE_STATION_CHANGED 0x0007
- #define plSTATE_STATION_CFGFAILED 0x0008
- #define plSTATE_STATION_FAILED 0x000f
- #define plSTATE_CE_WAITING 1
- #define plSTATE_CE_ACTIVE 2
- #define plSTATE_CE_INACTIVE 3
- #define plSTATE_CE_ERROR 4
- #define plSTATE_CHANNEL_WRITE_MASK 0x0f00
- #define plSTATE_CHANNEL_WRITE_CLOSED 0x0000
- #define plSTATE_CHANNEL_WRITE_OPEN 0x0100
- #define plSTATE_CHANNEL_WRITE_ACTIVE 0x0200
- #define plSTATE_CHANNEL_WRITE_WRONG 0x0f00
- #define plSTATE_CHANNEL_READ_MASK 0x00f0
- #define plSTATE_CHANNEL_READ_CLOSED 0x0000
- #define plSTATE_CHANNEL_READ_EMPTY 0x0010
- #define plSTATE_CHANNEL_READ_READY 0x0020
- #define plSTATE_CHANNEL_READ_WRONG 0x00f0
- #define plACTION_GET_NET_QUALITY 1
- #define plACTION_GET_IDENT 2
- #define plACTION_START_SYNC_STATISTICS 3
- #define plACTION_STOP_SYNC_STATISTICS 4
- #define plACTION_GET_SYNC_STATISTICS 5
- #define plACTION_GET_FIRMWARE_VERSION 6
- #define plACTION_DEVICE_TO_BUS_NR 7
- #define plACTION_GET_STATION_NUMBER 8
- #define plACTION_GET_IF_PARAMETERS 9
- #define plACTION_GET_LOST_INA_SOURCE 10
- #define plACTION_GET_STATIONFLAG 12
- #define plACTION_GET_STATION_HWVARIANT 13
- #define plACTION_GET_STATION_SHIFT 14
- #define plACTION_GET_IF_CYCLE_TIME 15
- #define plACTION_GET_IF_PRESCALE 16
- #define plACTION_GET_IF_MUXPRESCALE 17
- #define plACTION_GET_IF_RSQUEUELAPCNT 18
- #define plACTION_GET_CROSSLINK_INFO 19
- #define plACTION_GET_PROTOCOL_VERSION 20
- #define plACTION_GET_DP_INFO 21
- #define plACTION_GET_PDO_INFO 22
- #define plDIRECTION_IN 1
- #define plDIRECTION_OUT 2
- #define plDIRECTION_XOUT 3
- #define plMESSAGE_TYPE_PREQ 3
- #define plMESSAGE_TYPE_PRES 4
- #define plSYSCONF_STATIONFLAG_SLOW 0x20
- typedef struct PLSYSCONF_RS_typ
- {
- USINT size_x16;
-
- USINT bus;
- USINT station;
- USINT flags;
- UDINT hwVariant;
- INT insize;
- INT outsize;
- INT RespTimeout;
- USINT MuxNetworkSlot;
- USINT reserve2;
- }PLSYSCONF_RS_typ;
- typedef struct PLSYSCONF_IF_typ
- {
- USINT station;
- USINT slot;
- USINT subslot;
- USINT interface;
- UDINT pl_cycle;
- UDINT pl_prescale;
- UDINT uptimeout;
- USINT bus;
- USINT MuxStationsPerCycle;
- USINT MuxPrescaler;
- USINT reservedbyte2;
- UDINT reservedlong;
- }PLSYSCONF_IF_typ;
- typedef struct PLSYSCONF_typ
- {
- USINT noIF;
- USINT takt_master;
- UINT reserve1;
- UDINT pRemoteCfg;
-
- PLSYSCONF_IF_typ interfaces[15];
- }PLSYSCONF_typ;
- typedef struct PLACTION_NET_QUALITY_typ{
- UDINT nLineQualFreezeCnt;
- UDINT nLineQualFailCnt;
- }PLACTION_NET_QUALITY_typ;
- typedef struct PLACTION_GET_IDENT_typ{
- char *pName;
- UDINT ident;
- }PLACTION_GET_IDENT_typ;
- typedef struct PLACTION_DEVICE_TO_BUS_NR_typ{
- char *pDeviceString;
- USINT busNumber;
- }PLACTION_DEVICE_TO_BUS_NR_typ;
- typedef struct PLACTION_SYNC_STATISTICS_typ{
- UINT act_usec;
- UINT min_usec;
- UINT max_usec;
- UINT act_cycle;
- UINT min_cycle;
- UINT max_cycle;
- }PLACTION_SYNC_STATISTICS_typ;
- typedef struct PLACTION_GET_CROSSLINK_INFO_typ{
- const char *DeviceName;
- const char *ChannelName;
- UINT NodeId;
- UINT Offset;
- UINT Length;
- UINT TypeId;
- }PLACTION_GET_CROSSLINK_INFO_typ;
- typedef struct PLACTION_GET_DP_INFO_typ{
- const char *DeviceName;
- const char *ChannelName;
- USINT DestNode;
- USINT SrcNode;
- USINT MessageType;
- USINT MuxSlot;
- UINT OffsetAbs;
- UINT OffsetRel;
- UINT Length;
- UINT TypeId;
- UINT NodeInSize;
- UINT NodeOutSize;
- USINT Direction;
- USINT Node;
- UINT reserved;
- UDINT ImageIndex;
- UDINT ImageOffset;
- }PLACTION_GET_DP_INFO_typ;
- typedef struct PLACTION_GET_PDO_INFO_typ{
- const char *DeviceName;
- UINT ODIndex;
- USINT ODSubindex;
- USINT align;
- USINT DestNode;
- USINT SrcNode;
- USINT MessageType;
- USINT MuxSlot;
- UINT OffsetAbs;
- UINT OffsetRel;
- UINT Length;
- UINT TypeId;
- UINT NodeInSize;
- UINT NodeOutSize;
- USINT Direction;
- USINT Node;
- UINT reserved;
- UDINT ImageIndex;
- UDINT ImageOffset;
- }PLACTION_GET_PDO_INFO_typ;
- UINT plConfig(PLSYSCONF_typ *pConfigStruct);
- UINT plCECreate(const char* pDatapoint, void* address, SINT taskclass, UDINT *pIdent);
- UINT plCEDelete(UDINT ident);
- UINT plState(UDINT ident);
- UINT plAction(UDINT ident, UDINT actionID, void* pObject, UDINT objectSize);
- UINT plAcycOpen(const char* pName, UDINT flags, UDINT *pIdent);
- UINT plAcycClose(UDINT ident);
- UINT plAcycRead(UDINT ident, void* bufferAdr, UDINT bufferLen, UDINT *pReadLen);
- UINT plAcycInvite(UDINT ident);
- UINT plAcycWrite(UDINT ident, void* bufferAdr, UDINT bufferLen, UDINT *pWrittenLen);
- #ifdef __cplusplus
- };
- #endif
- #endif
|