Ok. What I want to obtain in the end is some kind of functional mock-up unit for co-simulation.
I have a master C++ project which calls, synchronises and manages different simulation models (Omnet, Matlab, Modellica, etc.) using functions like Set(), Get(), TimeStep(), EventStep(). A possible scenario is a model ruled by continuous dynamics running in Matlab that also requires communication networks. Due to Matlab's lacks to face that, this part is implemented by Omnet. Therefore Matlab triggers communication events and waits for results whereas it tackles continuous dynamics process in parallel (obviously, times are synchronized).
So far, I have been able to successfully do that following the "embedding2" example for a simple Omnet model (e.g. TicToc). Now I want to add TCP/IP communication, but it's being freaking complicated.
So, you are right, I want to set and get parameters from somewhere else, and also to control the evolution of the simulation and make changes in the middle.
I tried with "CNullEnvir" developing all the methods that have to do with XML, but it gets frozen when executes "sim->doOneEvent(mod);". On the other hand, I don't think I know how to correctly use "cEnvirBase", it gets frozen setting up the network or calling the run method.
Thanks for your help.