from several years I used the Spll routine (Solar Library) to lock the sgen sinewave to the grid voltage (for to this I use "sgen.alpha=theta").
Furthermore I use the grid frequency (measure with the Ecap feature) to match this with the sgen.freq. All my code worked very well for several time, but over the time my line numbers is increased a lot (and the number of inrternal varables too).
Due to this code incrementation, sometimes my sgen sinewave goes crazy, assuming strange forms and if I go to debug the characteristic values (frequency, alpha etc) they have meaningless values.
I temporarily fixed it by moving some variable declarations before or after the following line:
extern Uint16 RamfuncsLoadStart, RamfuncsLoadEnd, RamfuncsRunStart;
or moving this line:
but continuing to develop my code from time to time the problem arises and I lose whole days to find the right order to give to the declarations of the variables to make my sinusoidal signal work.
Please can someone help me?
Thanks a lot,