Sorry, I have problems with this usage (really confused) since I got alwyas (EXCEPTION_ACCESS_VIOLATION) with "scicosim" function. I am doing this (I tried many combinations - I don't find right one :( ):
void myPMSM_block(scicos_block *blk, int flag) { double* Te; switch (flag) { case Initialization: Te = (double *) MALLOC(sizeof(double)); *(blk->work) = Te; break; case DerivativeState: *Te = 3./2.*pp/2.*(ke*Iq);// + (Ld - Lq)*Id*Iq); dId = 1./Ld*(Ud - Rs*Id + Lq*pp/2.*Iq*Wm); //derivace i_d prud dIq = 1./Lq*(Uq - Rs*Iq);// - (Ld*Id + ke)*pp/2.*Wm); //derivace i_q prud dWm = 1./Jm*(Te[0] - B*Wm - Tload); //rychlost dTheta = Wm; //poloha der_theta = w_m break; case OutputUpdate: Id_out = Id; Iq_out = Iq; Te_out = Te[0]; break; case Ending: scicos_free(Te); break; } } -- View this message in context: http://mailinglists.scilab.org/EXCEPTION-ACCESS-VIOLATION-with-scicosim-function-tp4026020p4026023.html Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com. _______________________________________________ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users