How can I create a submodule and add it in a plugged in Profinet slave?
I'm not sure what you mean with "create a submodule".
If you want to add a module below your Profinet slave you just have to use the method add(...)
but also specify the module ID parameter.
There are some devices which have so called slots. For slots you use the method plug(...)
of the slot object instead of add(...)
of the parent device object.
Check out the CODESYS store: http://store.codesys.com/CODESYS® a trademark of 3S-Smart Software Solutions GmbH
Inspiring Automation Solutions