Beckhoff / ADS

Beckhoff protocol to communicate with TwinCAT devices.
MIT License
502 stars 194 forks source link

Add an example to read WSTRING with OOI #122

Closed Frants1987 closed 3 years ago

Frants1987 commented 3 years ago

Hello, I started to build an application using the OOI version of the lib. However, I'm missing an example on how to read strings / wstrings from TwinCAT. I tried using:

Frants1987 commented 3 years ago

OK, I got it to work with AdsVariable<std::array<unsigned short, 80>> but please point me to a better solution if there is one. Btw. thanks for making the code available to the public.

pbruenn commented 3 years ago

I don't know any better solution. This might be helpful:

using WSTRING = std::array<uint16_t, 80>;
AdsVariable<WSTRING> var;