OMRON CJ2 0x809F error

JuanPLC74

Member
Join Date
Feb 2017
Location
Houston
Posts
23
I'm working on a welding machine run by an Omron CJ2M-CPU35
When the operator tries to run one of our sequences, the PLC goes into an error state Err HH, and throws the Error 0x809F, Time Cycle exceeded.
What steps can I take so this error goes away.
Thanks
 
From manual W472
0x809F Cycle time too long. Operation stops.
Points to a programming issue, maybe sub routines, or long execution functions.

Hope this helps.
 
You could extend the Cycle Time setting by selecting Manual Setting in "PLC Settings" -> "Timings".
The default is 1000mSec = 1 Sec. That is a pretty long time for the high speed processing in the CJ2.
Remember to download settings and power cycle PLC for new setting to take effect.

BUT if you have a program task that takes long to complete that could be your issue.
Furthermore are you running all tasks all the time. If yes, then only enable the tasks you need using TKON and disable unused tasks with TKOF. That will reduce overall scan time.

You can also monitor the scan time while online.

PLC Timings Setup.JPG
 
You could extend the Cycle Time setting by selecting Manual Setting in "PLC Settings" -> "Timings".
The default is 1000mSec = 1 Sec. That is a pretty long time for the high speed processing in the CJ2.
Remember to download settings and power cycle PLC for new setting to take effect.

BUT if you have a program task that takes long to complete that could be your issue.
Furthermore are you running all tasks all the time. If yes, then only enable the tasks you need using TKON and disable unused tasks with TKOF. That will reduce overall scan time.

You can also monitor the scan time while online.

I extended the watch cycle time to the max.
I found out that one function block is the one that throws the PLC into the error state... the code in the function block does not seem that long. Could it be possible that there is a divide by zero operation?
This machine had run good in the past, the issue seems to have happened some couple months ago when running this sequence which calls this function block.. I can't believe the code worked before but now it doesnt.
 
If you post the FB code maybe someone can figure out why it is stalling.

// Code is here
StepNum := real_to_int (((int_to_real (Z2) / 100.0 * dint_to_real (ZPPI)) - dint_to_real (ZPosPulses)) / (int_to_real (StepDistanceIn) / 100.0 * dint_to_real (ZPPI)));

If StepNum = 0 Then
StepDistancePulses := 0;
StepDistanceOut := 0;
Else

StepDistancePulses := real_to_dint (((int_to_real (Z2) / 100.0 * dint_to_real (ZPPI)) - dint_to_real (ZPosPulses)) / int_to_real (StepNum));

(
StepDistanceOut := real_to_int (dint_to_real (StepDistancePulses) / dint_to_real (ZPPI) * 1000.0);
End_If;


Rminor := int_to_real (Dminor) / 2.0 / 100.0;


AngleR := int_to_Real(Angle);


If DMajor = 0 Then
Rmajor := Rminor;
Else
Rmajor := int_to_real (DMajor) / 2.0 / 100.0;
End_If;

If StraightDist = 0 Then



ZOffset := Sqrt (Expt(Rmajor,2) - Expt(Rminor,2));

Repeat

X1 := (Cos(AngleR * 3.141592654 / 180.0) * ZOffset - Sqrt(Expt(Rminor,2) + Expt(ZOffset,2) - Expt(Rmajor,2))) / Sin(AngleR * 3.141592654 / 180.0);
If X1 > Rminor Then
ZOffset := ZOffset + 0.01;
End_if;
Until Abs(X1) < Rminor
End_Repeat;


ZOffset := ZOffset + (int_to_real(ZPosIn) / 100.0);

Repeat

X1 := (Cos(AngleR * 3.141592654 / 180.0) * ZOffset - Sqrt(Expt(Rminor,2) + Expt(ZOffset,2) - Expt(Rmajor,2))) / Sin(AngleR * 3.141592654 / 180.0);
If X1 < -Rminor Then
ZOffset := ZOffset - 0.01;
End_if;
Until Abs(X1) < Rminor
End_Repeat;


Inrsec1 := 1800 - Real_to_Int(ACos(X1/Rminor) * 180.0 / 3.14159265 * 10.0) + Offset;
Inrsec2 := 1800 + Real_to_Int(ACos(X1/Rminor) * 180.0 / 3.14159265 * 10.0) + Offset;


X2 := (Cos(AngleR * 3.141592654 / 180.0) * (ZOffset + ZValue) + Sqrt(Expt(Rminor,2) + Expt(ZOffset + ZValue,2) - Expt(Rmajor,2))) / Sin(AngleR * 3.141592654 / 180.0);


If X2 > Rminor Then
SingleMode := true;
Inrsec3 := 0;
Inrsec4 := 0;
Else
SingleMode := false;
Inrsec3 := 1800 - Real_to_Int(ACos(X2/Rminor) * 180.0 / 3.14159265 * 10.0) + Offset;
Inrsec4 := 1800 + Real_to_Int(ACos(X2/Rminor) * 180.0 / 3.14159265 * 10.0) + Offset;
End_If;


If Inrsec1 = Inrsec3 Then
Inrsec1 := Inrsec1 - 10;
Inrsec2 := Inrsec2 + 10;
Inrsec3 := Inrsec3 + 10;
Inrsec4 := Inrsec4 - 10;
End_If;
Else

Distance := SQRT(EXPT(Rmajor,2) - EXPT(Rmajor - (int_to_real(Z2 - ZPosIn) / 100.0),2));
SingleMode := false;


Num := (int_to_real (StraightDist) / 100.0 / 2.0) + Distance;
If Num > Rminor Then
Num := Rminor;
End_if;


InrsecAngle := Real_to_Int (ACOS(Num / Rminor) * 180.0 / 3.1415 * 10.0);
If InrsecAngle = 0 or Distance = 0.0 Then
InrsecAngle := 1;
End_If;

Inrsec1 := (900 - InrsecAngle) + Offset;
Inrsec2 := (2700 + InrsecAngle) + Offset;
Inrsec3 := (900 + InrsecAngle) + Offset;
Inrsec4 := (2700 - InrsecAngle) + Offset;
End_If;


If Direction = 0 or Direction = 3 then
(*Calculate the rotational target positions in pulses*)
Angle1DistPulses := lreal_to_dint ((int_to_lreal (StepCompleted) * dint_to_lreal (APPR)) + (Int_to_lreal (Inrsec1 - (Offset * 2)) / 3600.0 * dint_to_lreal (APPR)));
Angle2DistPulses := lreal_to_dint ((int_to_lreal (StepCompleted) * dint_to_lreal (APPR)) + (Int_to_lreal (Inrsec2 - (Offset * 2)) / 3600.0 * dint_to_lreal (APPR)));
Angle3DistPulses := lreal_to_dint ((int_to_lreal (StepCompleted) * dint_to_lreal (APPR)) + (Int_to_lreal (Inrsec3 - (Offset * 2)) / 3600.0 * dint_to_lreal (APPR)));
Angle4DistPulses := lreal_to_dint ((int_to_lreal (StepCompleted) * dint_to_lreal (APPR)) + (Int_to_lreal (Inrsec4 - (Offset * 2)) / 3600.0 * dint_to_lreal (APPR)));
Else
Angle1DistPulses := lreal_to_dint ((int_to_lreal (StepCompleted) * dint_to_lreal (APPR)) + (Int_to_lreal (Inrsec1) / 3600.0 * dint_to_lreal (APPR)));
Angle2DistPulses := lreal_to_dint ((int_to_lreal (StepCompleted) * dint_to_lreal (APPR)) + (Int_to_lreal (Inrsec2) / 3600.0 * dint_to_lreal (APPR)));
Angle3DistPulses := lreal_to_dint ((int_to_lreal (StepCompleted) * dint_to_lreal (APPR)) + (Int_to_lreal (Inrsec3) / 3600.0 * dint_to_lreal (APPR)));
Angle4DistPulses := lreal_to_dint ((int_to_lreal (StepCompleted) * dint_to_lreal (APPR)) + (Int_to_lreal (Inrsec4) / 3600.0 * dint_to_lreal (APPR)));
End_If;

ZeroDistPulses := lreal_to_dint (int_to_lreal (StepCompleted + 1) * dint_to_lreal (APPR));

AVC1LockMin := Inrsec1 + 20;
AVC1LockMax := Inrsec2 - 20;
AVC2LockMin := Inrsec3 - 20;
AVC2LockMax := Inrsec4 + 20;
the PLC goes into Err HH, Error code 809F everytime this block is activated, picture attached.

I will try to move this function to a task of itself. However I will look if all the calculations are permitted, it seems weird to me that this calculations would overcycle the PLC, it being a CJ2M-CPU35. Plus we've designed many machines with this function block and as far as I know only two are showing this behavior.

FBStallComplete.jpg
 
Yes! I will look into those, maybe some input is coming in with a wrong/unexpected value? I'll have to check the math myself.
 
CP1H-XA40DT1-D PLC-ERROR 809f

Hi all,
i have an issue with omron plc error 0x809F .i need a solution for solve this issue.
kindly please help.
 

Similar Topics

Hello all, I am trying to send some strings to a serial card to communicate to a hand held scanner. I know I can save strings in registers and...
Replies
2
Views
2,351
I am using direct operation and have my EtherCat setup to handle 9 servos (Basic Positioning). Does anyone have a reference with multiple servos...
Replies
0
Views
1,494
Hi, Sorry if this has been already posted elsewhere, I couldn't find it doing a quick search. Can anyone advise whether there is a totaliser...
Replies
7
Views
4,304
Has anyone done SMS messaging from an Omron CJ2J-CPU31 PLC? If so could you help please. Omron here in Oz have not had any experience doing this...
Replies
5
Views
120
I have an old plc in the system I have, moxa nport was used to communicate with scada, I want to replace the plc with cj2m cpu33 and eliminate...
Replies
1
Views
62
Back
Top Bottom