Reading a structure format with ANSL library

pvi

Hello,
I am trying to use ANSL library for reading variables from PLC.
All works with simple data types, but it’s not clear how to get a format of structures.
For structured variables ANSL_RESP_GET_FORMAT event also has a pointer to ANSL_VARIABLE_DATA_TYPE, m_DataType indicates it’s a structure, but m_pTypes (/* the element types for structures */) is 0.
Can anyone advise how to get structure format with ANSL API ?
Thanks.

Also comment in ANSLUIF.h seems has a typo: /* the total number of bytes for this nesting level (nested elements will structures will be)*/

Hi @Illia_Antipov, obviously no one from the Community has an idea. Can you please get in contact with the support team at your local B&R office and update us when you have a solution?

Hi @kovarj, according to support team this is not possible for structures.

”AnslUIF can only provide basic data type information but will not provide format information for structs.
The structure of the data including the alignment must already be known to the client so that it can directly access the members.”

1 Like

thanks for clarification, so others can benefit from it :slight_smile: