TwinCAT 3 C++ Q&A|Why can't the created interface be found in the Type System after instantiating a module with a custom interface in C++?

 Problem Description:


The module instance in C++ carries a custom interface named IStateMachine:

However, the Type System under the TwinCAT system does not contain this interface:

Answer:
This is because the custom interface was not defined with a fixed size:


It is necessary to ensure that the size of the custom interface matches the system interface, or it will be automatically ignored by TwinCAT. The modification method is as follows: