13 |
13 |
14 #include "types.h" |
14 #include "types.h" |
15 |
15 |
16 /*****************************************************************************/ |
16 /*****************************************************************************/ |
17 |
17 |
18 /** |
18 // ec_slave_t ist in EtherCAT_rt.h ... |
19 EtherCAT-Slave |
|
20 |
|
21 Achtung: Bei Änderungen dieser Struktur immer das Define |
|
22 ECAT_INIT_SLAVE anpassen! |
|
23 */ |
|
24 |
|
25 typedef struct |
|
26 { |
|
27 // Base data |
|
28 unsigned char type; /**< Slave-Typ */ |
|
29 unsigned char revision; /**< Revision */ |
|
30 unsigned short build; /**< Build-Nummer */ |
|
31 |
|
32 // Addresses |
|
33 short ring_position; /**< (Negative) Position des Slaves im Bus */ |
|
34 unsigned short station_address; /**< Konfigurierte Slave-Adresse */ |
|
35 |
|
36 // Slave information interface |
|
37 unsigned int vendor_id; /**< Identifikationsnummer des Herstellers */ |
|
38 unsigned int product_code; /**< Herstellerspezifischer Produktcode */ |
|
39 unsigned int revision_number; /**< Revisionsnummer */ |
|
40 unsigned int serial_number; /**< Seriennummer der Klemme */ |
|
41 |
|
42 const ec_slave_desc_t *desc; /**< Zeiger auf die Beschreibung |
|
43 des Slave-Typs */ |
|
44 |
|
45 unsigned int logical_address; /**< Konfigurierte, logische adresse */ |
|
46 |
|
47 ec_slave_state_t current_state; /**< Aktueller Zustand */ |
|
48 ec_slave_state_t requested_state; /**< Angeforderter Zustand */ |
|
49 |
|
50 unsigned char *process_data; /**< Zeiger auf den Speicherbereich |
|
51 innerhalb eines Prozessdatenobjekts */ |
|
52 unsigned int domain; /**< Prozessdatendomäne */ |
|
53 int error_reported; /**< Ein Zugriffsfehler wurde bereits gemeldet */ |
|
54 } |
|
55 ec_slave_t; |
|
56 |
|
57 #define EC_INIT_SLAVE(TYPE, DOMAIN) {0, 0, 0, 0, 0, 0, 0, 0, 0, \ |
|
58 TYPE, 0, ECAT_STATE_UNKNOWN, \ |
|
59 EC_STATE_UNKNOWN, NULL, DOMAIN, 0} |
|
60 |
19 |
61 /*****************************************************************************/ |
20 /*****************************************************************************/ |
62 |
21 |
63 // Slave construction and deletion |
22 // Slave construction and deletion |
64 void ec_slave_init(ec_slave_t *); |
23 void ec_slave_init(ec_slave_t *); |
65 |
|
66 #if 0 |
|
67 int EtherCAT_read_value(EtherCAT_slave_t *, unsigned int); |
|
68 void EtherCAT_write_value(EtherCAT_slave_t *, unsigned int, int); |
|
69 #endif |
|
70 |
24 |
71 /*****************************************************************************/ |
25 /*****************************************************************************/ |
72 |
26 |
73 #endif |
27 #endif |
74 |
28 |