Motion Master
Loading...
Searching...
No Matches
soem.h
Go to the documentation of this file.
1#pragma once
2
3#include <chrono>
4#include <cstdint>
5#include <functional>
6#include <map>
7#include <memory>
8#include <mutex>
9#include <sstream>
10#include <string>
11#include <type_traits>
12#include <unordered_map>
13#include <utility>
14#include <variant>
15#include <vector>
16
17#include <tl/expected.hpp>
18
19#include "base.h"
20#include "ethercat.h"
21#include "loguru.h"
22
23namespace mm::comm::soem {
24
25// 3-second SDO read/write timeout — long enough for devices with slower mailbox
26// implementations.
27inline constexpr int kSdoTimeoutUs = 3'000'000;
28
29// 10-second FoE write timeout — covers large firmware files over slow links.
30inline constexpr int kFoeTimeoutUs = 10'000'000;
31
32// 2-second FoE read timeout. Reads are small and a healthy device answers each
33// mailbox cycle within milliseconds, so a much shorter timeout than writes is
34// safe. Keeping it short bounds the cost of recovering from a transient/wedged
35// mailbox: a non-responsive read fails quickly and is retried (with a mailbox
36// drain) instead of stalling for the full write timeout on every attempt.
37inline constexpr int kFoeReadTimeoutUs = 2'000'000;
38
39// 10-second timeout for a file removal ("fs-remove=<name>" issued as an FoE
40// read). Removing a file erases flash, which can take several seconds — much
41// longer than reading one back.
42inline constexpr int kFoeRemoveTimeoutUs = 10'000'000;
43
44// 30-second timeout for removing the ESI file. It is large and its erase takes
45// considerably longer than other files (measured at ~17 s on a SOMANET drive).
46inline constexpr int kFoeRemoveEsiTimeoutUs = 30'000'000;
47
67std::recursive_mutex& controlPlaneMutex();
68
89std::string drainMailboxErrors(ecx_contextt* context);
90
116int drainMailbox(ecx_contextt* context, uint16_t slave);
117
129std::map<std::string, std::string> mapMacAddressesToInterfaces();
130
146inline std::string uiConfigWithDefaultPdoMapping = R"(
147{
148 "pdoMapping": {
149 "rx": {
150 "0x1600": [
151 "0x60400010",
152 "0x60600008",
153 "0x60710010",
154 "0x607a0020",
155 "0x60ff0020",
156 "0x60b20010",
157 "0x27010020"
158 ],
159 "0x1601": [
160 "0x60fe0120",
161 "0x60fe0220"
162 ],
163 "0x1602": [
164 "0x27030020",
165 "0x60b10020",
166 "0x20120120"
167 ]
168 },
169 "tx": {
170 "0x1a00": [
171 "0x60410010",
172 "0x60610008",
173 "0x60640020",
174 "0x606c0020",
175 "0x60770010",
176 "0x60f40020",
177 "0x21110220",
178 "0x21130220"
179 ],
180 "0x1a01": [
181 "0x24010010",
182 "0x24020010",
183 "0x24030010",
184 "0x24040010",
185 "0x27020020"
186 ],
187 "0x1a02": [
188 "0x60fd0020"
189 ],
190 "0x1a03": [
191 "0x27040020",
192 "0x20f00020",
193 "0x60fc0020",
194 "0x606b0020",
195 "0x60740010",
196 "0x60790020"
197 ]
198 }
199 }
200})";
201
226int setPdoMappingFromUiConfig(ecx_contextt* context, uint16 slave);
227
245void checkPdoMapping(ecx_contextt* context, uint16 slave);
246
266uint16_t getSlaveState(ecx_contextt* context, uint16_t slave,
267 int timeoutUs = EC_TIMEOUTRET);
268
288std::string convertSlaveStateToString(int state);
289
312void updateMailboxSyncManagersOnNextState(ecx_contextt* context, uint16_t slave,
313 int targetState);
314
329
345void configureDetectedSmmModule(ecx_contextt* context, uint16_t slave);
346
384void transitionSlaves(ecx_contextt* context,
385 const std::vector<uint16_t>& positions,
386 uint16_t requiredState, uint16_t targetState,
387 const char* targetName,
388 std::chrono::steady_clock::duration timeout,
389 std::chrono::steady_clock::duration resendInterval =
390 std::chrono::seconds(2),
391 std::function<void()> tick = nullptr,
392 std::function<bool()> shouldAbort = nullptr);
393
406bool setSlaveState(
407 ecx_contextt* context, uint16_t slave, uint16_t targetState,
408 std::chrono::steady_clock::duration timeout = std::chrono::seconds(5));
409
443std::vector<uint8_t> readSii(ecx_contextt* context, uint16 position);
444
456mm::comm::base::PdoMappings readPdoMappings(ecx_contextt* context,
457 uint16_t slave);
458
474 const std::vector<mm::comm::base::PdoMappingEntry>& entries);
475
487void logIoMap(uint8_t* ioMap, size_t totalBytes);
488
503struct Fieldbus {
504 ecx_contextt context;
505 std::string iface;
506 uint8 group;
508
509 /* Used by the context */
510 uint8 map[4096];
511 ecx_portt port;
512 ec_slavet slavelist[EC_MAXSLAVE];
514 ec_groupt grouplist[EC_MAXGROUP];
515 uint8 esibuf[EC_MAXEEPBUF];
516 uint32 esimap[EC_MAXEEPBITMAP];
517 ec_eringt elist;
518 ec_idxstackT idxstack;
519 boolean ecaterror;
520 int64 DCtime;
521 ec_SMcommtypet SMcommtype[EC_MAX_MAPT];
522 ec_PDOassignt PDOassign[EC_MAX_MAPT];
523 ec_PDOdesct PDOdesc[EC_MAX_MAPT];
524 ec_eepromSMt eepSM;
525 ec_eepromFMMUt eepFMMU;
526};
527
542 uint16_t readLength;
543
550 uint16_t readOffset;
551
563
570 uint16_t writeLength;
571
578 uint16_t writeOffset;
579};
580
582 supportedProtocols, writeLength, writeOffset)
583
584
591struct SlaveInfoSyncManager {
600 uint32_t flags;
601
608 uint16_t length;
609
615 uint16_t startAddress;
616
627 uint8_t type;
628};
629
630NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(SlaveInfoSyncManager, flags, length,
631 startAddress, type)
632
633
640struct SlaveInfoFmmu {
646 uint8_t active;
647
654 uint8_t logicalEndBit;
655
662 uint8_t logicalStartBit;
663
669 uint32_t logicalStartAddress;
670
676 uint16_t logicalLength;
677
684 uint8_t physicalStartBit;
685
691 uint16_t physicalStartAddress;
692
699 uint8_t type;
700};
701
702NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(SlaveInfoFmmu, active, logicalEndBit,
703 logicalStartBit, logicalStartAddress,
704 logicalLength, physicalStartBit,
705 physicalStartAddress, type)
706
707
713struct SlaveInfo {
720 uint16_t alStatusCode;
721
728 uint16_t aliasAddress;
729
735 std::vector<SlaveInfoFmmu> fmmus;
736
743 SlaveInfoMailbox mailbox;
744
752 uint32_t productCode;
753
759 uint32_t position;
760
768 uint32_t revisionNumber;
769
776 std::vector<SlaveInfoSyncManager> syncManagers;
777
783 std::string name;
784
793 uint32_t vendorId;
794};
795
796NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(SlaveInfo, alStatusCode, aliasAddress, fmmus,
797 mailbox, productCode, position,
798 revisionNumber, syncManagers, name, vendorId)
799
800
812SlaveInfo getSlaveInfo(ecx_contextt* context, uint16 position);
813
830void logSlaveInfo(ecx_contextt* context, uint16 position);
831
849void initFieldbus(std::unique_ptr<Fieldbus>& fieldbus,
850 const std::string& iface);
851
856class Slave {
857 public:
868 explicit Slave(ecx_contextt& context, uint16_t position);
869
878 uint16_t position() const;
879
888 uint32_t vendorId() const;
889
898 uint32_t productCode() const;
899
908 uint32_t revisionNumber() const;
909
915 int getState() const;
916
936 bool setState(int targetState, int timeoutMs = 0, int intervalMs = 100);
937
959 tl::expected<void, std::string> loadParameters(bool readValues = false);
960
973 void logParameters() const;
974
991
1008
1015 void clearParameters();
1016
1025 std::unordered_map<mm::comm::base::Parameter::Address,
1027 parametersMap();
1028
1041 mm::comm::base::Parameter& findParameter(uint16_t index, uint8_t subindex);
1042
1070 template <typename T = std::vector<uint8_t>>
1071 T upload(uint16_t index, uint8_t subindex, bool refresh = true) {
1072 std::lock_guard<std::recursive_mutex> lock(controlPlaneMutex());
1073
1074 // Check if the device is in a valid state for uploading
1075 auto state = context_.slavelist[position_].state;
1076 if (state == EC_STATE_INIT || state == EC_STATE_BOOT) {
1077 throw std::runtime_error(
1078 "To upload object dictionary entries, the device must be in the (2) "
1079 "PRE-OPERATIONAL, (4) SAFE-OPERATIONAL, or (8) OPERATIONAL state. "
1080 "The current state is " +
1081 convertSlaveStateToString(state) + ".");
1082 }
1083
1084 // Find the previously loaded parameter
1085 auto& parameter = findParameter(index, subindex);
1086
1087 // Refresh data if needed (SDO read)
1088 if (refresh) {
1089 const std::unique_ptr<std::uint8_t[]> data =
1090 std::make_unique<std::uint8_t[]>(parameter.byteLength);
1091 auto wkc =
1092 ecx_SDOread(&context_, position_, parameter.index, parameter.subindex,
1093 false, &parameter.byteLength, data.get(), kSdoTimeoutUs);
1094 if (wkc <= 0) {
1095 LOG_F(ERROR, "Device %d: SDO read failed for %#04x:%02x! WKC: %d",
1096 position_, parameter.index, parameter.subindex, wkc);
1097 auto id = mm::comm::base::makeParameterId(parameter.index,
1098 parameter.subindex);
1099 throw std::runtime_error("Device " + std::to_string(position_) +
1100 ": SDO read failed for " + id +
1101 "! WKC: " + std::to_string(wkc));
1102 } else {
1103 std::vector<uint8_t> receivedData(data.get(),
1104 data.get() + parameter.byteLength);
1105 if (!parameter.trySetValue(receivedData)) {
1106 LOG_F(ERROR,
1107 "Device %d: Failed to set the value of parameter %#04x:%02x!",
1108 position_, parameter.index, parameter.subindex);
1109 }
1110 }
1111 }
1112
1113 // Return the appropriate type
1114 if constexpr (std::is_same_v<T, std::vector<uint8_t>>) {
1115 return parameter.data; // parameter.data should be std::vector<uint8_t>
1116 } else {
1117 // Otherwise, try to get the value as the requested type T
1118 auto value = parameter.getValue();
1119 if (auto ptr = std::get_if<T>(&value)) {
1120 return *ptr;
1121 } else {
1122 throw std::bad_variant_access(); // Type mismatch
1123 }
1124 }
1125 }
1126
1151 template <typename T = std::vector<uint8_t>>
1152 bool download(uint16_t index, uint8_t subindex, const T& value) {
1153 std::lock_guard<std::recursive_mutex> lock(controlPlaneMutex());
1154
1155 // Check if device is in valid state for download
1156 auto state = context_.slavelist[position_].state;
1157 if (state == EC_STATE_INIT || state == EC_STATE_BOOT) {
1158 throw std::runtime_error(
1159 "To download object dictionary entries, the device must be in the "
1160 "(2) PRE-OPERATIONAL, (4) SAFE-OPERATIONAL, or (8) OPERATIONAL "
1161 "state. The current state is " +
1162 convertSlaveStateToString(state) + ".");
1163 }
1164
1165 auto& parameter = findParameter(index, subindex);
1166
1167 // Convert value to raw byte data
1168 std::vector<uint8_t> data;
1169 if constexpr (std::is_same_v<T, std::vector<uint8_t>>) {
1170 data = value;
1171 } else {
1172 // Set the value in the parameter model
1173 if (!parameter.trySetValue(value)) {
1174 LOG_F(ERROR,
1175 "Device %d: Failed to set the value of parameter %#04x:%02x!",
1176 position_, parameter.index, parameter.subindex);
1177 return false;
1178 }
1179 data = parameter.data; // Use the parameter's byte representation
1180 }
1181
1182 // Check if data size matches the expected parameter size
1183 if (data.size() != parameter.byteLength) {
1184 LOG_F(ERROR, "Data size mismatch: expected %d, got %zu",
1185 parameter.byteLength, data.size());
1186 throw std::runtime_error("Data size does not match the parameter size!");
1187 }
1188
1189 // Perform the SDO write
1190 auto wkc =
1191 ecx_SDOwrite(&context_, position_, parameter.index, parameter.subindex,
1192 false, parameter.byteLength, data.data(), kSdoTimeoutUs);
1193
1194 // Check write result
1195 if (wkc <= 0) {
1196 LOG_F(ERROR, "Device %d: SDO write failed for %#04x:%02x! WKC: %d",
1197 position_, parameter.index, parameter.subindex, wkc);
1198 return false;
1199 }
1200
1201 return true;
1202 }
1203
1213
1222 void updatePdoMappings();
1223
1235 void logPdoMappings() const;
1236
1242 mm::comm::base::PdoMappings& getPdoMappings();
1243
1266 void updateOutputs();
1267
1289 void updateParametersFromInputs();
1290
1316 tl::expected<std::vector<uint8_t>, std::string> readFile(
1317 const std::string& filename,
1318 size_t maxFileSize = 1 * 1024 * 1024, // 1 MB default max file size
1319 int retries = 5,
1320 std::chrono::steady_clock::duration retryWait =
1321 std::chrono::milliseconds(100));
1322
1336 tl::expected<std::vector<std::uint8_t>, std::string> readSdo(
1337 uint16_t index, uint8_t subindex);
1338
1352 tl::expected<ec_ODlistt, std::string> readODList(
1353 int retries = 5, std::chrono::steady_clock::duration retryWait =
1354 std::chrono::milliseconds(100));
1355
1374 tl::expected<void, std::string> readODDescription(
1375 uint16_t item, ec_ODlistt& odList, int retries = 5,
1376 std::chrono::steady_clock::duration retryWait =
1377 std::chrono::milliseconds(100));
1378
1395 tl::expected<ec_OElistt, std::string> readOE(
1396 uint16_t item, ec_ODlistt& odList, int retries = 5,
1397 std::chrono::steady_clock::duration retryWait =
1398 std::chrono::milliseconds(100));
1399
1400 private:
1401 ecx_contextt& context_;
1402 const uint16_t position_;
1405 std::unordered_map<mm::comm::base::Parameter::Address,
1407 parametersMap_;
1410 pdoMappings_;
1411};
1412
1413class Master {
1414 public:
1421 explicit Master();
1422
1433 explicit Master(const std::string& iface);
1434
1486 void init(const std::string& iface);
1487
1498 void deinit();
1499
1506 ~Master();
1507
1517 Fieldbus& getFieldbus() const;
1518
1527 std::string getInterfaceName() const;
1528
1537 size_t getIoMapSize() const;
1538
1601 tl::expected<int, std::string> initSlaves();
1602
1614 const std::vector<std::unique_ptr<Slave>>& slaves() const;
1615
1625 inline int expectedWkc() const {
1626 return fieldbus_->context.grouplist[fieldbus_->group].outputsWKC * 2 +
1627 fieldbus_->context.grouplist[fieldbus_->group].inputsWKC;
1628 }
1629
1639 int roundtrip();
1640
1670
1681 bool start();
1682
1683 private:
1697 std::unique_ptr<Fieldbus> fieldbus_;
1698
1710 std::vector<std::unique_ptr<Slave>> slaves_;
1711};
1712}; // namespace mm::comm::soem
Represents a device parameter identified by index and subindex.
Definition base.h:529
std::pair< uint16_t, uint8_t > Address
Alias for a pair of uint16_t and uint8_t representing a parameter address.
Definition base.h:539
int roundtrip()
Performs a complete send/receive process data cycle on the fieldbus.
Definition soem.cc:1827
Master()
Default constructor for the Master class.
Definition soem.cc:1744
const std::vector< std::unique_ptr< Slave > > & slaves() const
Returns a reference to the list of slaves.
Definition soem.cc:1823
tl::expected< int, std::string > initSlaves()
Initializes the slave devices on the EtherCAT network.
Definition soem.cc:1796
void exchangeProcessDataAndUpdateParameters()
Exchanges process data with slaves and updates parameters based on the response.
Definition soem.cc:1832
size_t getIoMapSize() const
Returns the total size of the I/O map for the current group.
Definition soem.cc:1791
Fieldbus & getFieldbus() const
Returns a reference to the Fieldbus instance.
Definition soem.cc:1787
void init(const std::string &iface)
Initializes the fieldbus using the specified network interface.
Definition soem.cc:1751
std::string getInterfaceName() const
Retrieves the interface name used by the fieldbus.
Definition soem.cc:1789
void deinit()
Deinitializes the fieldbus and releases associated resources.
Definition soem.cc:1769
bool start()
Initializes and starts the fieldbus master.
Definition soem.cc:1855
~Master()
Destructor for the Master class.
Definition soem.cc:1785
int expectedWkc() const
Calculates the expected working counter (WKC) for the current fieldbus group.
Definition soem.h:1625
uint32_t productCode() const
Gets the Product Code of the slave device.
Definition soem.cc:1196
uint32_t vendorId() const
Gets the Vendor ID of the slave device.
Definition soem.cc:1192
std::unordered_map< mm::comm::base::Parameter::Address, mm::comm::base::Parameter > & parametersMap()
Returns a reference to the internal parameters map.
Definition soem.cc:1510
mm::comm::base::Parameter & findParameter(uint16_t index, uint8_t subindex)
Finds and returns a reference to a Parameter in the parameters map.
Definition soem.cc:1514
uint32_t revisionNumber() const
Gets the Revision Number of the slave device.
Definition soem.cc:1200
T upload(uint16_t index, uint8_t subindex, bool refresh=true)
Uploads a parameter value from the device's object dictionary.
Definition soem.h:1071
tl::expected< void, std::string > loadParameters(bool readValues=false)
Loads the parameters (object dictionary entries) from the EtherCAT slave device.
Definition soem.cc:1322
void clearParameters()
Clears all loaded object dictionary parameters.
Definition soem.cc:1506
void logTxPdoMappedParameters()
Logs all mapped TxPDO parameters with their current values.
Definition soem.cc:1491
Slave(ecx_contextt &context, uint16_t position)
Constructs a Slave object with a given context and position.
Definition soem.cc:1187
void logRxPdoMappedParameters()
Logs all mapped RxPDO parameters with their current values.
Definition soem.cc:1476
bool setState(int targetState, int timeoutMs=0, int intervalMs=100)
Attempts to set the slave to the specified EtherCAT state and optionally waits until it is reached.
Definition soem.cc:1206
void logParameters() const
Logs all loaded object dictionary parameters.
Definition soem.cc:1470
int getState() const
Reads the current state of the slave directly from the device.
Definition soem.cc:1204
uint16_t position() const
Gets the position of the slave.
Definition soem.cc:1190
bool download(uint16_t index, uint8_t subindex, const T &value)
Downloads a value to the specified object dictionary entry via SDO.
Definition soem.h:1152
uint8_t type
Definition co_dictionary.h:1
const char ** name
Definition co_dictionary.h:7
uint8_t * value
Definition co_dictionary.h:9
uint16_t index
Definition co_dictionary.h:0
std::string makeParameterId(int index, int subindex)
Formats the given index and subindex into a parameter identifier string.
Definition base.h:1657
Definition soem.cc:41
constexpr int kFoeReadTimeoutUs
Definition soem.h:37
mm::comm::base::PdoMappings readPdoMappings(ecx_contextt *context, uint16_t slave)
Read and parse all mapped PDO entries for a given slave.
Definition soem.cc:1085
constexpr int kFoeTimeoutUs
Definition soem.h:30
void logPdoMappingEntries(const std::vector< mm::comm::base::PdoMappingEntry > &entries)
Logs PDO mapping entries grouped by PDO index.
Definition soem.cc:1156
uint16_t getSlaveState(ecx_contextt *context, uint16_t slave, int timeoutUs)
Reads the current state of a specific EtherCAT slave directly from the device via an FPRD datagram.
Definition soem.cc:675
std::string convertSlaveStateToString(int state)
Converts a numeric EtherCAT state value into a human-readable string.
Definition soem.cc:690
void resetBootMailboxTracking()
Clears the internal record of which slaves hold BOOT-sized mailbox sync managers.
Definition soem.cc:728
constexpr int kSdoTimeoutUs
Definition soem.h:27
std::string drainMailboxErrors(ecx_contextt *context)
Empties SOEM's error list and describes the first entry found.
Definition soem.cc:54
void transitionSlaves(ecx_contextt *context, const std::vector< uint16_t > &positions, uint16_t requiredState, uint16_t targetState, const char *targetName, std::chrono::steady_clock::duration timeout, std::chrono::steady_clock::duration resendInterval, std::function< void()> tick, std::function< bool()> shouldAbort)
Transitions multiple EtherCAT slaves to a target state using a single-threaded fire-then-poll pattern...
Definition soem.cc:733
std::string uiConfigWithDefaultPdoMapping
Default UI configuration used for PDO mapping.
Definition soem.h:146
void initFieldbus(std::unique_ptr< Fieldbus > &fieldbus, const std::string &iface)
Initializes a Fieldbus instance for EtherCAT communication.
Definition soem.cc:1711
void updateMailboxSyncManagersOnNextState(ecx_contextt *context, uint16_t slave, int targetState)
Updates the mailbox and sync manager (SM) configurations for an EtherCAT slave when transitioning to ...
Definition soem.cc:867
void logIoMap(uint8_t *ioMap, size_t totalBytes)
Logs the I/O map as a formatted hexadecimal string.
Definition soem.cc:1177
void checkPdoMapping(ecx_contextt *context, uint16 slave)
Diagnoses and prints the PDO mapping for a given slave.
Definition soem.cc:591
void configureDetectedSmmModule(ecx_contextt *context, uint16_t slave)
Reads the detected SMM module ID from the slave device and configures the module identification objec...
Definition soem.cc:997
constexpr int kFoeRemoveTimeoutUs
Definition soem.h:42
int drainMailbox(ecx_contextt *context, uint16_t slave)
Discards whatever is sitting in a slave's read mailbox.
Definition soem.cc:100
std::map< std::string, std::string > mapMacAddressesToInterfaces()
Maps MAC addresses to their corresponding network interface names.
Definition soem.cc:134
int setPdoMappingFromUiConfig(ecx_contextt *context, uint16 slave)
Sets PDO mapping for a specified EtherCAT slave using UI configuration.
Definition soem.cc:400
uint16 position
Definition soem.h:812
void logSlaveInfo(ecx_contextt *context, uint16 position)
Logs detailed information about a specific EtherCAT slave in JSON format.
Definition soem.cc:307
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(SlaveInfoMailbox, readLength, readOffset, supportedProtocols, writeLength, writeOffset) struct SlaveInfoSyncManager
Information about a slave's Sync Manager (SM) configuration.
Definition soem.h:581
std::recursive_mutex & controlPlaneMutex()
The single mutex that serialises every control-plane transaction.
Definition soem.cc:49
constexpr int kFoeRemoveEsiTimeoutUs
Definition soem.h:46
SlaveInfo getSlaveInfo(ecx_contextt *context, uint16 position)
Definition soem.cc:255
std::vector< uint8_t > readSii(ecx_contextt *context, uint16 position)
Read the complete Slave Information Interface (SII) EEPROM from an EtherCAT slave device.
Definition soem.cc:1042
bool setSlaveState(ecx_contextt *context, uint16_t slave, uint16_t targetState, std::chrono::steady_clock::duration timeout)
Transitions a single EtherCAT slave to targetState.
Definition soem.cc:859
Specialization of std::hash for std::pair<uint16_t, uint8_t>.
Definition util.h:612
Represents the mapped PDO entries for a slave device.
Definition base.h:171
Structure representing the Fieldbus configuration and context for EtherCAT communication.
Definition soem.h:503
boolean ecaterror
Definition soem.h:519
ec_idxstackT idxstack
Definition soem.h:518
ec_eepromFMMUt eepFMMU
Definition soem.h:525
ec_groupt grouplist[EC_MAXGROUP]
Definition soem.h:514
std::string iface
Definition soem.h:505
uint8 group
Definition soem.h:506
int slavecount
Definition soem.h:513
uint8 esibuf[EC_MAXEEPBUF]
Definition soem.h:515
uint32 esimap[EC_MAXEEPBITMAP]
Definition soem.h:516
int64 DCtime
Definition soem.h:520
ec_eepromSMt eepSM
Definition soem.h:524
ec_PDOassignt PDOassign[EC_MAX_MAPT]
Definition soem.h:522
uint8 map[4096]
Definition soem.h:510
ecx_contextt context
Definition soem.h:504
int roundtripTime
Definition soem.h:507
ec_PDOdesct PDOdesc[EC_MAX_MAPT]
Definition soem.h:523
ecx_portt port
Definition soem.h:511
ec_slavet slavelist[EC_MAXSLAVE]
Definition soem.h:512
ec_SMcommtypet SMcommtype[EC_MAX_MAPT]
Definition soem.h:521
ec_eringt elist
Definition soem.h:517
Information about a slave's mailbox configuration.
Definition soem.h:535
uint16_t writeOffset
Offset of the mailbox write area within the slave's memory.
Definition soem.h:578
uint16_t supportedProtocols
Supported mailbox protocols as a bitmask.
Definition soem.h:562
uint16_t readOffset
Offset of the mailbox read area within the slave's memory.
Definition soem.h:550
uint16_t readLength
Length of the mailbox read area (in bytes).
Definition soem.h:542
uint16_t writeLength
Length of the mailbox write area (in bytes).
Definition soem.h:570