Hi Nick, thanks for the reply, we tried to do the read the SDO synchronously with following minimal example, but we still get a DL_TYPE_MISMATCH as result. #include "comm/datalayer/datalayer.h"
#include "comm/datalayer/datalayer_system.h"
#include "comm/ethercat/master/fbs/sdo_generated.h"
// ... further includes
int main(int ac, char *av[])
{
comm::datalayer::DlResult result;
comm::datalayer::DatalayerSystem datalayer;
datalayer.start(false);
// connect to client
// * in process communication (runs as bundle of rexroth-automation) use factory()->createClient()
// * inter process communication (runs on same target) use factory()->createClient(DL_IPC_AUTO)
// * on other device use factory()->createClient("tcp://<ip>:2069")
comm::datalayer::IClient *client = datalayer.factory()->createClient(DL_IPC_AUTO);
if (client->isConnected())
{
std::cout << "Client connected" << std::endl;
}
else
{
std::cout << "Client not connected" << std::endl;
}
comm::datalayer::Variant data;
do
{
uint16_t address = 1003;
uint16_t objectIndex = 0x6041;
uint8_t objectSubIndex = 0;
flatbuffers::FlatBufferBuilder flatBufferBuilder;
auto sdoRequest = comm::ethercat::master::fbs::CreateSDORequest(flatBufferBuilder,
comm::ethercat::master::fbs::Addresstype::Addresstype_fixedphysical,
address,
objectIndex,
objectSubIndex,
comm::ethercat::master::fbs::SDOFlags::SDOFlags_noFlags);
auto sdo = comm::ethercat::master::fbs::CreateSDO(flatBufferBuilder, sdoRequest);
flatBufferBuilder.ForceDefaults(true);
flatBufferBuilder.Finish(sdo);
std::cout << "------------------StartCycle--------------------------" << std::endl;
result = data.shareFlatbuffers(flatBufferBuilder);
std::cout << "data.shareFlatbuffers(builder) " << result.toString() << std::endl;
result = client->readSync("fieldbuses/ethercat/master/instances/ethercatmaster/device_access/coe/sdo", &data);
std::cout << "client->readSync(...) " << result.toString() << std::endl;
std::cout << "------------------StopCycle---------------------------" << std::endl;
std::this_thread::sleep_for(std::chrono::seconds(1));
} while (!endProcess);
} We would appreciate any information that could help us to resolve this issue. Best regards Chris
... View more