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