S5 95U (b) JC instruction

barryoc

Lifetime Supporting Member
Join Date
Nov 2009
Location
Kilkenny
Posts
148
Hi,

I working on an an s5 95U and trying to do a small bit of indirect addressing. I have the DO instruction working fine but im struggling with a JC to load FY7 for the DO instruction. I have 3 bits F2.1, F2.2, F2.3. If F2.1 is true i want to load FY7 with 32, if F2.2 load FY7 with 33 and F2.3 FY7 =0.

I have tried using the following but am getting bogged down somewhere. Can some examine and point me where im going wrong. The cpu is stopping with cycle time overrun error.

Regards,
Barry

FB3 Name

M003: AN F2.1
AN F2.2
JC = M001
L KF +32
T FY7

M001: AN F2.1
AN F2.3
JC = M002
L KF +33
T FY7

M002: AN F2.2
AN F2.3
JC = M003
L KF +0
T FY7
 
Your logic can jump back to M003 giving an endless loop

Code:
FB3 Name 
 
[COLOR=Red][B]M003:[/B][/COLOR] AN F2.1
AN F2.2
JC = M001
L KF +32
T FY7
 
M001: AN F2.1
AN F2.3
JC = M002
L KF +33
T FY7
 
M002: AN F2.2
AN F2.3
JC [COLOR=Red][B]= M003[/B][/COLOR]
L KF +0
T FY7
 
An alternative coding (syntax not checked):

Code:
FB3 Name 
 L KF +32
A F 2.1
JC =M001

L KF +33
A F 2.2
JC =M001

L KF 0
A F 2.3
JC =M001

JU =M002
M001: T FY 7
M002: NOP
 
LD,

Many thanks for your help once again, I have used your code and its working perfectly. I will try to fix the code i posted to see where i went wrong.

Regards,
Barry.
 

Similar Topics

Hi there! This is something so old and having machine with it....... Last time unit was powered around 3yr ago and it did not work since than...
Replies
5
Views
221
Hi All, We have a hydraulic press that is being controlled by Siemens S5-95U PLC . Lately the S5-95U has been randomly stopping during operation...
Replies
5
Views
2,414
Dear All,, We have a Siemens Simatic S5-95U and there is stopped red LED active Tried resetting the PLC,switching the Run/Stop toggle push button...
Replies
6
Views
3,035
I m new in STEP 5 and i need help I have problem with the onboard's analog output 4-20mA, i want to forced it to see if it work or not but i...
Replies
8
Views
1,927
the steps to have a backup from the plc siemens Simatic s5 95u?
Replies
4
Views
2,338
Back
Top Bottom