For my simulation, I use several schedulers from Matlab to Energy+. Till now, is was using exaclty 44 schedules, and it works fine. Today I had to add more schedule, and when I launch the simulation, I got an -20 error.
Error happen when I call the function ep.write(mlepEncodeRealData(ver, 0, (kStep-1)*TIMESTEP, SP));. It looks like when the variable packet generated by the function mlepEncodeRealData have a lenght greater than 1024 characters, communication become impossible, and the simulation crashes.
A solution I found is to replace the line 36 by sprintf('%20.10e ', realvalues)]; (instead of sprintf('%20.15e ', realvalues)];, in order to reduce string lenght.
Is there an efficient solution to avoid this problem ?