Jump to content
OMRON Forums

CPLC problem with a ACC65E


RaphaelM

Recommended Posts

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

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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

Guest
This topic is now closed to further replies.

×
×
  • Create New...