help with step 7 s300

gh_ounie

Member
Join Date
Dec 2007
Location
aleppo
Posts
73
happy new year:

i'm new in s7 300 and hwould to ask ?
how could I call FCs to OB by useing s_UC?
pls Iwant some one to expline it to me
 
UC unconditional call?

such as

UC FC50


is unconditionally call FC50 without parameters, therefore, the FC needs to be programmed without any IN, OUT etc parameters.
 
JesperMP said:
There is no S_UC command or block in STEP7, but there is S_CU which in LAD inserts an UP counter.
Is this what you mean ?
thank you JesperMP:
yes that is exact what I meant I'm not familiar with step 7 until now
i knwo it's counter but what i need to know how could these counter
call FCs in OB1.
REGARDS
 
If what you want to do is to activate an FC if a counter has reached a set value, then here is an example:

Paste this in STL, and switch to LAD:

Network 1:
A M 0.0
CU C 0
BLD 101
A M 0.1
L C#55
S C 0
A M 0.2
R C 0
NOP 0
NOP 0
NOP 0

Network 2:
A C 0
CC FC 1

FC1 is called when C0 has reached the setvalue of "55".
M0.0 counts C0 up.
M0.1 accepts the setpoint.
M0.2 resets C0
 
JesperMP said:
If what you want to do is to activate an FC if a counter has reached a set value, then here is an example:

Paste this in STL, and switch to LAD:

Network 1:
A M 0.0
CU C 0
BLD 101
A M 0.1
L C#55
S C 0
A M 0.2
R C 0
NOP 0
NOP 0
NOP 0

Network 2:
A C 0
CC FC 1

FC1 is called when C0 has reached the setvalue of "55".
M0.0 counts C0 up.
M0.1 accepts the setpoint.
M0.2 resets C0

That will not work.

M0.0 counts up, this is correct
M0.2 resets the counter, this is correct
M0.1 Presets the counter, it makes the value of C0 = 55

This might be better
Code:
   Network 1:
   
   A M 0.0
   CU C 0
   BLD   101
   NOP   0
   NOP   0
   A M 0.2
   R C 0
   NOP   0
   NOP   0
   NOP   0
   
   Network 2:
   
   L MW 20   // Contains the value at which the counter should call the FC
   L C 0	// Value of the counter
   <=I   // Compares if the counted value is greater then the setpoint MW 20
   CC FC 1   // If counter is equal or greater then setpoint, call FC 1

The way Jesper suggested, it would call FC 1 whenever the counter value is greater then zero.

If in doubt, just press F1 in LAD/STL/FBD-editor and search for the componants.

The second network won't convert to LAD. Sorry for this, but I don't like working in LAD that much and don't know how to do it in LAD. Tried the 'CMP <=I block' w/o Type Check of Adresses, but it still gives errors.

EDIT: several cosmetic changes:p
 
Last edited:
I never use the S5 counters so it may excuse my ignorance.

After looking into it a bit more, I have to sat that the purpose of an S5 UP counter baffles me ! As soon as it leaves zero, the output is set, no matter what the setpoint value is. What can one achieve by that ??

The S5 DOWN counter makes more sense, when you use the "S" input the setpoint gets set, and each activatiof of the "CD" will count down towards zero.
As long as the count value is not zero, the output will be TRUE.
When zero is reached, the output is set to FALSE.


I have modified my code so that it will work as I intended originally:

Network 1:
A M 0.0
CD C 0
BLD 101
A M 0.1
L C#55
S C 0
A M 0.2
R C 0
NOP 0
NOP 0
NOP 0

Network 2:
AN C 0
CC FC 1
 

Similar Topics

i'm new with step 7 s300 and i hope anybody help me unlock individual blocks regard
Replies
2
Views
2,258
I really struggle with STL in Siemens Step 7 Classic. I'll learn chunks, but then I don't use it enough to retain and build on the knowledge. When...
Replies
17
Views
3,216
Hi, Can someone translate this for me please, or at least help to explain what the instructions mean? SET SAVE =...
Replies
17
Views
4,618
Hello everyone I am new to Siemens Step 7 and having some issues I was going to add the a FC to OB1 (Network 28 In Image 1) But it was asking...
Replies
9
Views
2,392
Hello everyone I'm new here and was hoping someone can help me out. I have a pneumatic punching/ bending machine that broke down running on a...
Replies
39
Views
5,172
Back
Top Bottom