📄 vardef.h
字号:
typedef enum
{
RLL_Stopped = 0,
RLL_TestNext,
RLL_WaitNextCycle
} T_RLL_Status;
typedef enum
{
ACK_OK = 0x00,
/* ACK. positive */
ACK_UE = 0x01,
/* ACK. negative: remote-USER/FDL interface error */
ACK_RR = 0x02,
/* ACK. negative: no remote resource available */
ACK_RS = 0x03,
/* ACK. negative: service or rem_add at remote-lsap not activated */
ACK_DL = 0x08,
/* response-data (l_sdu) low available */
ACK_NR = 0x09,
/* ACK. negative: no response-data at remote-FDL available */
ACK_DH = 0x0a,
/* response-data (l_sdu) high available */
ACK_RDL = 0x0c,
/* response-data (l_sdu) low available, but negative-ACK for send-data */
ACK_RDH = 0x0d,
/* response-data (l_sdu) high available, but negative-ACK for send-data */
ACK_LS = 0x10,
/* service not activated at local sap */
ACK_NA = 0x11,
/* no reaction (ACK/RES) from remote-station */
ACK_DS = 0x12,
/* local FDL/PHY not in token-ring */
ACK_NO = 0x13,
/* ACK. negative: not ok (different meanings dependant on service) */
ACK_LR = 0x14,
/* resource of local FDL not available */
ACK_IV = 0x15,
/* invalid parameter in request */
ACK_LO = 0x20,
/* LOw-prior response-data are sent at this srd */
ACK_HI = 0x21,
/* HIgh-prior response-data are sent at this srd */
ACK_NO_DATA = 0x22 /* NO-DATA are sent at this srd */
} TACK;
/*
typedef enum {
br9600,
br19200
} TBaudRate;
*/
typedef enum
{
No,
Local,
Remote
} TServiceType;
//**********************************************************************************
//**********************************************************************************
//**********************************************************************************
//
// Standratni struktury pro FDL
//
/* ------------------- */
/* definitions for FLC */
/* ------------------- */
#define FLC_Subsys 0x22
#define DEFAULT_SAP 0xff
#define EVENT_SAP 64
#define NO_SEGMENT 0xff
#define BROADCAST 127 /* broadcast-addr.: rem_add.station, dsap = 63 */
#define MULTICAST 127 /* multicast-addr.: rem_add.station, dsap != 63 */
#define LEN_MAX_RECEIVE_BUFFER 255 /* max. buffer-length for a receive telegram */
#define LEN_MIN_RECEIVE_BUFFER 32 /* min. receive_l_sdu.length */
#define ALL 0x7f
#define SEGMENT_VALID 0x80
#define SEGMENT_INVALID 0x00
#define SEGMENT_TYP 0x40
/* example */
/* access_sap = ALL or sap_number; */
/* access_station = (ALL or station_number) + (SEGMENT_VALID or SEGMENT_INVALID); */
/* if SEGMENT_VALID: access_segment = SEGMENT_TYP + segment_number (0 ... 63); */
/* SERVICE */
#define SDA_RESERVED 0x00
#define SDN_RESERVED 0x01
#define SRD_RESERVED 0x03
#define CSRD_RESERVED 0x05
/* ROLE */
#define INITIATOR 0x00 /* only possible by "sap_activate" */
#define RESPONDER 0x10 /* possible by "sap_activate" and mandatory by "rsap_activate" */
#define BOTH_ROLES 0x20 /* only possible by "sap_activate" */
#define SERVICE_NOT_ACTIVATED 0x30 /* service not activated */
#define STATION_PASSIVE 0x00
#define STATION_NON_EXISTANT 0x10
#define STATION_NON_EXISTENT 0x10
#define STATION_ACTIVE_READY 0x20
#define STATION_ACTIVE 0x30
#define LEN_SAP_ACTIVATE sizeof(struct fdl_sap)
#define LEN_EVENT_INDICATION sizeof(struct event_indication)
typedef enum
{
flc_false,
flc_true
} flc_boolean;
enum com_class
{
request = 0x00,
confirm = 0x01,
indication = 0x02
};
enum service_code
{
sda = 0x00,
// Send Data with Acknowledge
sdn = 0x01,
// Send Data with no Acknowledge
sdn_broadcast = 0x7f,
// only for FDL-indication !!! (signs received broadcast-telegram)
srd = 0x03,
// Send and Request Data
csrd = 0x05,
// Cyclic Send and Request Data
reply_update_single = 0x06,
// Reply Update Single Mode
reply_update_multiple = 0x07,
// Reply Update Multiple Mode
fdl_read_value = 0x0b,
// read busparameter
fdl_set_value = 0x0c,
// set busparameter
sap_activate = 0x0e,
// activate local SAP
rsap_activate = 0x11,
// activate local Responder-SAP
sap_deactivate = 0x12,
// deactivate local (R)SAP
fdl_reset = 0x13,
// reset PHY and FDL; all FDL-information is lost, exc. last busparam.
mac_reset = 0x15,
// reset for MAC; a part of last valid busparameter will be updated
fdl_event = 0x18,
// only for indication, list of events
lsap_status = 0x19,
// requests information of remote-SAP or local-SAP
fdl_life_list_create_remote = 0x1a,
// requests list of intact stations
fdl_life_list_create_local = 0x1b,
// requests quick-list of intact stations (LAS and GAP will be actual)
fdl_ident = 0x1c,
// requests data of software- and hardware-release
fdl_read_statistic_ctr = 0x1d,
// NOT SUPPORTED! reads counter values of statistic and resets counter
fdl_read_las_statistic_ctr = 0x1e,
// NOT SUPPORTED! reads LAS and las_cycle_ctr and resets las_cycle_ctr
await_indication = 0x1f,
// provides resources for indication (sap-dependent)
withdraw_indication = 0x20,
// returnes indication-resources
load_routing_table = 0x21,
// only for network-connection !!!
deactivate_routing_table = 0x22,
// only for network-connection !!!
get_direct_conn = 0x23,
// gets adress of next station
};
typedef enum
{
low = 0x00,
high = 0x01
} service_class;
enum link_status
{
ok = 0x00,
// ACK. positive
ue = 0x01,
// ACK. negative: remote-USER/FDL interface error
rr = 0x02,
// ACK. negative: no remote resource available
rs = 0x03,
// ACK. negative: service or rem_add at remote-lsap not activated
dl = 0x08,
// response-data (l_sdu) low available
nr = 0x09,
// ACK. negative: no response-data at remote-FDL available
dh = 0x0a,
// response-data (l_sdu) high available
rdl = 0x0c,
// response-data (l_sdu) low available, but negative-ACK for send-data
rdh = 0x0d,
// response-data (l_sdu) high available, but negative-ACK for send-data
ls = 0x10,
// service not activated at local sap
na = 0x11,
// no reaction (ACK/RES) from remote-station
ds = 0x12,
// local FDL/PHY not in token-ring
no = 0x13,
// ACK. negative: not ok (different meanings dependant on service)
lr = 0x14,
// resource of local FDL not available
iv = 0x15,
// invalid parameter in request
lo = 0x20,
// LOw-prior response-data are sent at this srd
hi = 0x21,
// HIgh-prior response-data are sent at this srd
no_data = 0x22
// NO-DATA are sent at this srd
};
enum poll_element_entry
{
unlocked = 0x00,
// polling enabled for this element
locked = 0x01,
// element locked for this poll-cycle
not_changed = 0x02
// the same meaning as "unlocked", but layer 2 doesn't plausible this
// service; use only, if this element has already been sent and no
// parameter changed, but actualize receive_l_sdu.length !!!!!!!!!
};
typedef enum
{
passive = 0x00,
active = 0x01,
active_fast = 0x02,
passive_fast = 0x03,
sm_active = 0x04,
/* possible returned by read_value (PROFIBUS-PA) */
sm_passive = 0x05
} station_type ;
typedef enum
{
kbaud_9_6 = 0x00,
kbaud_19_2 = 0x01,
kbaud_93_75 = 0x02,
kbaud_187_5 = 0x03,
kbaud_500 = 0x04,
kbaud_375 = 0x05,
kbaud_750 = 0x06,
/*CT_CHANGE*/
mbaud_1_5 = 0x07,
mbaud_3 = 0x08,
mbaud_6 = 0x09,
mbaud_12 = 0x0a,
kbaud_45_45 = 0x0c /* 09-06-1997: a new baud rate */
} baud_rate;
enum redundancy
{
no_redundancy = 0x00,
bus_a_highprior = 0x01,
bus_b_highprior = 0x02,
redundancy_on = 0x03
};
enum physical_layer
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -