You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old June 10th, 2008, 10:27 AM   #1
arocon
Member
United Arab Emirates

arocon is offline
 
Join Date: Oct 2006
Location: Dubai
Posts: 171
Arrow S7 questions

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.


  Reply With Quote
Old June 10th, 2008, 11:06 AM   #2
PeterW
Member
Canada

PeterW is offline
 
Join Date: Jun 2006
Location: Edmonton
Posts: 2,517
Quote:
Originally Posted by arocon
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.
  Reply With Quote
Old June 10th, 2008, 11:09 AM   #3
S7Guy
Member
United States

S7Guy is offline
 
Join Date: Nov 2003
Location: Dayton, Ohio
Posts: 1,250
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.
  Reply With Quote
Old June 10th, 2008, 06:15 PM   #4
leon.LEE
Member
China

leon.LEE is offline
 
Join Date: Jun 2008
Location: TSINGTAO
Posts: 16
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.
  Reply With Quote
Old June 10th, 2008, 07:47 PM   #5
PeterW
Member
Canada

PeterW is offline
 
Join Date: Jun 2006
Location: Edmonton
Posts: 2,517
Quote:
Originally Posted by leon.LEE
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
  Reply With Quote
Old June 10th, 2008, 09:52 PM   #6
leon.LEE
Member
China

leon.LEE is offline
 
Join Date: Jun 2008
Location: TSINGTAO
Posts: 16
Smile

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!
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
2 questions regarding WinCC & S7 mi91240 LIVE PLC Questions And Answers 2 August 15th, 2007 03:29 AM
Questions abt Siemens S7 200 Preeya LIVE PLC Questions And Answers 3 April 9th, 2007 07:39 AM
S7 Profibus FMS CP-card questions..... JIMCON LIVE PLC Questions And Answers 4 March 1st, 2006 04:14 AM
Siemens S7 Timer Questions GTX LIVE PLC Questions And Answers 6 April 30th, 2004 09:55 AM
More Stupid S7 questions. Peter Nachtwey LIVE PLC Questions And Answers 4 September 17th, 2003 07:06 AM


All times are GMT -5. The time now is 08:29 PM.


.