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 October 15th, 2008, 02:34 AM   #1
Simmo
Member
United Kingdom

Simmo is offline
 
Join Date: Oct 2008
Location: Liverpool
Posts: 3
Unhappy Variable on/off timer S7 300

Hi guys, I am having a brain freeze on how to produce a timer with the on and off times changeable via the HMI. For example i have a solenoid on a ghlue nozzle, currently the glue is fired as one continuous line onto the product, i need to produce a variable pattern eg on for 500ms then off for 1 second and so on until i loose the glue output. these on and off times need to br varible via the HMI. Can anybody help me please as i just cant think at the minute!!!

Thanks

Simmo
  Reply With Quote
Old October 15th, 2008, 03:45 AM   #2
RMA
Member
Scotland

RMA is offline
 
RMA's Avatar
 
Join Date: Sep 2004
Location: North of Hamburg, Germany
Posts: 2,052
I don't have Step7 to hand at the moment so I can't give a detailed answer, but if you use the IEC Timers (maybe SFB3/4 etc.???) the time is defined in ms instead of the daft BCD code which S5Time uses. It should then be pretty easy to do what you want.
  Reply With Quote
Old October 15th, 2008, 06:31 AM   #3
WJhsson
Member
Sweden

WJhsson is offline
 
WJhsson's Avatar
 
Join Date: Jul 2004
Location: North
Posts: 38
Here is one way to do it:





Exchange mw10 and mw12 with locals to clean it up.
change the timebase so it suits you demands. In the sample the time equals integer = 1 = 1 sec.

Be sure that the on- and off-times never equals 0 because then it will lock itself!!
__________________
:-)
  Reply With Quote
Old October 15th, 2008, 06:51 AM   #4
Madman
Member
Belarus

Madman is offline
 
Madman's Avatar
 
Join Date: Nov 2007
Location: Madhouse
Posts: 36
about timebase...
  Reply With Quote
Old November 7th, 2008, 02:52 AM   #5
Simmo
Member
United Kingdom

Simmo is offline
 
Join Date: Oct 2008
Location: Liverpool
Posts: 3
Thanks Guys

Sorry about the delay was called out of country, thanks for your rapid responses, i will try this thanks!!
  Reply With Quote
Old November 7th, 2008, 05:01 AM   #6
cjd1965
Member
United Kingdom

cjd1965 is offline
 
Join Date: Apr 2007
Location: UK
Posts: 1,567
I agree with the IEC timer comment, and you can then set the HMI units directly in m/sec, without having to convert to S5Time.
You will need to display the HMI in x.xxx secs but you can do this on most HMI's quite easily

That is what I usually do.
  Reply With Quote
Old November 7th, 2008, 06:54 AM   #7
Simmo
Member
United Kingdom

Simmo is offline
 
Join Date: Oct 2008
Location: Liverpool
Posts: 3
nEVER USED AN Iec TIMER BEFORE COULD YOU SHOW ME HOW TO SET THIS UP PLEASE,
  Reply With Quote
Old December 11th, 2009, 02:59 AM   #8
petfalcon
Member
Belgium

petfalcon is offline
 
Join Date: Dec 2009
Location: belgium
Posts: 2
Fancy Exclamation

Hi there I am also currently using timers here
setting a timer up is pretty simple.

use madmans tabel for the time base
For example if you want to load a timer with a 1 second interval and a preset value of 30 seconds.
First L W#16#2030
T MW 10

Then just put mw 10 at the PV input of youre prefered timer.
Easy huh.
  Reply With Quote
Old December 11th, 2009, 05:57 AM   #9
PeterW
Member
Canada

PeterW is offline
 
Join Date: Jun 2006
Location: Edmonton
Posts: 2,522
Quote:
Originally Posted by Simmo View Post
nEVER USED AN Iec TIMER BEFORE COULD YOU SHOW ME HOW TO SET THIS UP PLEASE,
You find them in the standard library, SFB4 for example is Delay On.

The only problem with them is the fact they need IDB's, for this reason I only use them in FB's where I create them as STAT's.
  Reply With Quote
Old December 11th, 2009, 06:02 AM   #10
TurpoUrpo
Lifetime Supporting Member
Finland

TurpoUrpo is offline
 
Join Date: May 2008
Location: Finland
Posts: 1,453
Nice digup: October 15th, 2008, 09:34 up:
  Reply With Quote
Old December 11th, 2009, 06:15 AM   #11
PeterW
Member
Canada

PeterW is offline
 
Join Date: Jun 2006
Location: Edmonton
Posts: 2,522
Quote:
Originally Posted by TurpoUrpo View Post
Nice digup: October 15th, 2008, 09:34 up:

lol, its 5am here, never looked at the dates.

Why do people do this
  Reply With Quote
Old December 12th, 2009, 02:58 AM   #12
petfalcon
Member
Belgium

petfalcon is offline
 
Join Date: Dec 2009
Location: belgium
Posts: 2
I guess we just love the sound of our own typing?
I know there must be something weird about us
  Reply With Quote
Old December 12th, 2009, 10:42 AM   #13
Paul B
Member
United States

Paul B is offline
 
Paul B's Avatar
 
Join Date: Sep 2009
Location: North Carolina
Posts: 574
Thanks to Bob Harris, I use functions (FC's) to convert HMI integer setpoints to S5time. The code inside the function looks like what WJhsson posted above. One function for hundredths, one for tenths, one for seconds, and one for minutes. The input is declared as an IN-OUT and if the input is greater than the time the S5timer will support, the function clamps it.

One thing that is not good about S5 timers or IEC timers is once the timer starts timing it no longer looks at the preset. So if you set a timer to 5 minutes and it starts timing, changing the preset to 10 seconds has no effect. Obviously this is not a good thing, not the way AB or GE works.

To combat this, as well as making the time conversion to S5 time format unnecessary, simply make your own timer function. For an integer timer, declare Timer.ACC, Timer.PRE, Timer.1shot, and Timer.DN in a data block (structures work well).

Inside your timer function declare local variables as needed. When enable input is on, use an ADD_I instruction to add a one to the Timer.ACC if the ACC not GEQ the PRE. Next rung compares the ACC to the PRE and sets the Done output.

When you call your FC it will be a timer and work the way normal timers from AB or GE work. Plus you don't have to worry about running out of S5 timers (we had 128 when I started with S7-300 ten years ago) or using lots of instance data blocks like the IEC timers.

I call the timer all the time. I use boolean permissives in series with the enable input along with a 1-second pulse generated from an S5 timer. Alternatively you could call the timer FC in OB35. In the hardware configuration if you set OB35 to be called every 100ms then your timer FC would have a 100ms time base.

I will be glad to post a library of examples if requested. This was one of the big "gotchas" back when I started and people helped me get through them.
__________________
"I never let a cowboy make the coffee."
Yeah, thats what Granny always said to my Grandad.
And he'd say: "Never tell a joke that ain't that funny more than once."
"And if you wanna hear God laugh, tell Him your plans."
Van Zant "Help Somebody"
  Reply With Quote
Old December 12th, 2009, 10:48 AM   #14
JRW
Member
United States

JRW is offline
 
JRW's Avatar
 
Join Date: Jun 2002
Location: Upstate South Cackalacky
Posts: 1,825
I use this one

AB users like it
Attached Files
File Type: zip Abtypeti.zip (18.8 KB, 205 views)
  Reply With Quote
Old December 12th, 2009, 11:33 AM   #15
Paul B
Member
United States

Paul B is offline
 
Paul B's Avatar
 
Join Date: Sep 2009
Location: North Carolina
Posts: 574
Here is a library with code examples of what I use for timer presets from an HMI.

Included:

Four functions to convert Integer setpoints to S5 time (hundredths, tenths, seconds, minutes)

Two custom timers (int and dint) that do not use S5 timers

Ladder-logic examples
Attached Files
File Type: zip Paul_b_t.zip (36.7 KB, 236 views)
__________________
"I never let a cowboy make the coffee."
Yeah, thats what Granny always said to my Grandad.
And he'd say: "Never tell a joke that ain't that funny more than once."
"And if you wanna hear God laugh, tell Him your plans."
Van Zant "Help Somebody"
  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
Re-use timer S7 SCL? Danny Van den Heuvel LIVE PLC Questions And Answers 4 July 23rd, 2008 07:32 AM
move a timer help in siemens S7 300 ason LIVE PLC Questions And Answers 19 January 13th, 2006 06:16 PM
comparing S7 timer values..... kegman LIVE PLC Questions And Answers 1 October 3rd, 2005 04:19 PM
S7 - Timer with variable times RMA LIVE PLC Questions And Answers 19 February 11th, 2005 01:47 PM
S7 IEC timer - RESET functionality. JesperMP LIVE PLC Questions And Answers 6 May 28th, 2004 04:26 AM


All times are GMT -5. The time now is 06:27 PM.


.