RaphaelM Posted September 14, 2012 Share Posted September 14, 2012 Hello, I have a strange problem in a CPLC. To understand this problem, I have created a new project with just my CPLC and defined a global variable in Global Includes. I try to evaluate the speed of treatment for equation loops. When I start my CPLC with certain equations, all my outputs are set to 1 and can't be changed no matter what I do. I don't understand because my equations include only local variables. See my code : /* ******************************** */ #include #include #define _EnumMode_ #define _PPScriptMode_ #include "../../Include/pp_proj.h" void realtimeinterrupt_plcc() { int i1=0, i2=0, val_1=4; double timer1=2.0, timer2=5, alpha=0, beta=0; timer1= GetCPUClock(); for(i1=0; i1<100; i1++) { for(i2=0; i2<100; i2++) { val_1 = val_1 + (i1+1)*(i1+1); //alpha = val_1 / (val_1 + i2); //beta = val_1 / (val_1 + i1); //alpha=cos(beta); } } timer2= GetCPUClock(); delta = timer2 - timer1; // delta is defined in Global Includes } /* ******************************** */ If I start the CPLC with the red equations, all outputs are set to 1. Thanks for your help, RM Link to comment Share on other sites More sharing options...
Omron Forums Support Posted September 14, 2012 Share Posted September 14, 2012 Raphael, Since these are all local variables, except "delta", they should have no effect on your ACC-65E. I suspect the problem lies elsewhere. Try looking elsewhere in your project to see if you are writing to GateIo.DataReg[n] corresponding to your card's outputs. Link to comment Share on other sites More sharing options...
RaphaelM Posted September 14, 2012 Author Share Posted September 14, 2012 Like I said in introduction of my post, I have created a new project to isolate the problem. So there is nothing which can change the outputs. In addition, if I start the program without the red equation of my code, there is no error on the outputs. When this error appears, the execution of the CPLC is stoped (normally, the cplc is executed in infinite loop). Link to comment Share on other sites More sharing options...
Recommended Posts