S7 questions

arocon

Member
Join Date
Oct 2006
Location
Dubai
Posts
171
Dear all,

I am new-bie in PLC and trying to learn. Could anybody explain follwoing code in S7:
Network 2 Startup monitorin



A #Motor

L #Response_Time

SD #Timer_No

AN #Motor

R #Timer_No

L #Timer_No

T #Timer_bin

LC #Timer_No

T #Timer_BCD

A #Timer_No

AN #Response

S #Fault

R #Motor



Network 3 Start lamp and fault reset



A #Response

= #Start_Dsp

R #Fault


Thank you in advance.


 
arocon said:
Dear all,

I am new-bie in PLC and trying to learn. Could anybody explain follwoing code in S7:
Network 2 Startup monitorin



A #Motor // If BOOL Bit #Motor is ON
L #Response_Time //Run On - Delay Timer #Timer_No,
SD #Timer_No // with a preset = #Response_Time

AN #Motor // If BOOL Bit #Motor is OFF
R #Timer_No // Reset the Timer

L #Timer_No // Load the actual time in binery format and store
T #Timer_bin

LC #Timer_No // Load the actual time in BCD format and store
T #Timer_BCD

A #Timer_No // If the timer has completed
AN #Response // An no response is seen
S #Fault // Set a Fault bit
R #Motor // and turn off the motor



Network 3 Start lamp and fault reset



A #Response // If Response is seen
= #Start_Dsp // Turn on Start_Dsp
R #Fault // And RESET Fault


Thank you in advance.


Seems to be looking at a motor feedback bit.

Can't remember if the time valuse are time remaining (counting down) or time used (counting up)



EDIT: Not sure how it resets the fault once set as I would expect the output to be disabled when fault active, unless there's a reset pushbutton piece of code somewhere.
 
Ok, two things:

1. It's too bad, because the person who wrote this code didn't understand S7 very well (I'll explain why below), so it may or may not be a good thing to study this particular program.

2. To understand how S7 STL works, I find it useful to read it as though you were describing it to someone over the telephone. For instance, line by line it would go like this:

If the motor is running....
Load the Response Time
and Start an OnDelay Timer.
When the motor stops running,
and reset the Timer.
Load the time value,
and transfer it to an integer variable.
Load the time value in BCD,
and transfer it to a BCD variable.
etc, etc


Just refer to the Siemens help to understand each instruction.

Now, the reason I say that the person who wrote this didn't understand S7 very well is because you don't have to reset an On Delay S7 timer; if the start condition goes false, it resets on its own. It doesn't hurt anything, but makes me wonder about the rest of the program.

Have fun.
 
Hello,
I think it is necessery to reset the timer. because when the #motor signal is on,the timer will go on the time of last time runing if you don't reset the timer.
the program to detect the motor if normally start in set time,if not they will alarm that make the light on.
 
leon.LEE said:
Hello,
I think it is necessery to reset the timer. because when the #motor signal is on,the timer will go on the time of last time runing if you don't reset the timer.
the program to detect the motor if normally start in set time,if not they will alarm that make the light on.

No, you are incorrect there. These timers are not retentative. Once the run timer condition is dropped, then the accumulated value will reset.

The reset function does work on on-delay timers, but it just causes the timer to reset even if the timer has already timed out and the condition is still on to run the timer.

S_PEXT and S_ODTS timers can be effected by the reset.

For
 
yes,you are right.i'm so sorry for make this mistake.i explain again.why the timer need reset?beacause maybe there are monitor on pc to observe the value of this time .if the motor is off or running normally ,we need reset the timer.I don't think it is a bad habit for programer.
best regards!
 

Similar Topics

Hello, I am new to Codesys, and am trying to learn about it for a project we're developing. I've got a couple questions, but first a little...
Replies
1
Views
72
I'm trying to build my Classic Step 7 programming skills this weekend. I get stuck on little things that are not covered in YouTube tutorials. I'm...
Replies
7
Views
248
Hello all, I'm a new member here. I've joined as I want to learn about PLC programming. I've got a few questions to begin with. To get me...
Replies
37
Views
4,420
Hi guys, I am pretty new when it comes to programming. I am working with CX-Programmer and I am having a problem where I have a sensor on my...
Replies
6
Views
621
So I have been wondering, the copy of the ethernet/ip molex tool I have (2.3.0 build 3) was from the molex website and only has a few tabs: List...
Replies
12
Views
1,241
Back
Top Bottom