Home > Libraries > ID 0011 > Detail
 
  LOGO! Hour counter
 
 
  Step7-MicroWin: [V4.0]
  CPU:   [all CPU22x]
  Operating system:    --
  Other:    --
Author:     Damir Krdzalic Homepage:    http://www.damir.com
Created:   28.09.2004 License:   Freeware
Update:   05.11.2004 Price:  
Views:   553 Downloads:   195
 
QUESTION:
How to realize the LOGO!-Function Hour counter in STEP 7 Micro/WIN ?

ANSWER:
The following library emulates the Hour counter function in S7-200. Additional features compared to LOGO Version are the time is shown Hours and Minutes, the max amount of blocks are limited only trough the CPU program-memory size.



The Library "Logo functions V1.2" add the "Hour counter" function. The functions "Pulse_Relay" and "Weekly_timer" are described in previous entries, see the links at bottom of this entry.

Description:
The Hour counter contains 2 Functions. On one side he shows the left operating time, on the other side he contain a configurable maintenance timer wich shows when the next service interval would be reuired.

Hour counter



Parameter Variable Type Explication
EN [BOOL] enabling Function, should be always TRUE(1)
Input [BOOL] signal input, function is enabled as long Signal TRUE(1) applied
Reset [BOOL] at Signal TRUE(1), reset Time MN to starting value MI
RAL [BOOL] at Signal TRUE (1), reset Time OT to 0 and MN on starting value MI
MI [WORD] preselect, maintenance interval in hours[1..65535]
Q [BOOL] Q=0 -> reset OUT if Reset=1 or RAL=1
Q=1 -> reset OUT if Reset=1 or RAL=1 or IN=0
Memory [DWORD] temporary memory
MN_h [WORD] remaining time up to maintenance interval (Display for Hours) [0..65535]
MN_m [WORD] remaining time up to maintenance interval (Display for Minutes) [0..59]
OT_h [WORD] accumulated operating time (Display for Hours)) [0..65535]
OT_m [WORD] accumulated operating time (Display for Minutes) [0..59]
Output [BOOL] signal output, Signal TRUE(1) if maintenance interval timer MN = 0

Functionality:
The hours counter monitors input "IN". When "IN" = 1, the function computes the time expired and the time-to-go MN. The function shows these times at parameters "MN_h", "MN_m", "OT_h" and "OT_m".

Output "Q" is set when the time-to-go MN = 0. A signal at input "Reset" resets output "OUT" and sets the preset value of "MI" at the counter for the duration of MN. The hours counter OT continues the count.

With a signal at the reset input "RAL", you reset output "OUT" and set the preset value of "MI" at the counter for the duration of MN. The hours counter OT is reset to zero.

Depending on your configuration of parameter "Q",
Q=0 -> OUT is reset with a signal at input "Reset" or "RAL" (Reset OR RAL are High -> Q=0).
Q=1 -> OUT is reset with a signal at input "Reset" or "RAL" or "IN"=0 (Reset OR RAL are High OR IN is Low -> Q=0).

Limit value of OT
The value of the operating hours in OT are retained when you reset the hours counter with a signal at input "Reset". The hours counter OT continues the count as long as IN= 1, irrespective of the status at the reset input "Reset".
The counter limit of OT is 65.535 h (~7,4 years).
If the counter overflow this value it starts at 0 again.
The initial value of OT could be preset. The function should not run at this time.




Notice:
To prevent a loss of process values the Parameters MN_h, OT_h (if required MN_m, OT_m) should be stored frequently. These values could be stored into the internal Eeprom or at CPUs with Firmware Rel>= 2.0 into the external Eeprom. Keep in mind that the values could be written to the Eeprom only about 100.000 times. If you store the data into the CPU internal eeprom the CPU will be DAMAGE otherwise the memory cartridge. DO NOT STORE the Data continuously at high frequency.

Example:
If you store the data every hour the eeprom would live up to 11-12 years.

Internal Eeprom Library :
see links at the bottom of this entry

External Memory cartridge: (CPU Firmware >= Rel 2.0) :
use the Data logging wizard

History
Version: Fixed / Changed:
V1.3 - add LOGO! random generator
V1.2.2 - absolute address Q0.0 used in program. Only affected  
  when time MN was passed and IN=0

Download (36 KB)
The author makes no warranty, expressed or implied, with regard to this informations and/or software. All implied warranties, including the warranties of merchantability and fitness for a particular use, are hereby excluded. Under no circumstances shall the author of this product or the author(s) of S7-200.net, be liable for any incidental or consequential damages, nor for any damages. Attachments could contain viruses, the user is repsonsible to check the downloaded files before using. The user has no claims, especialy not for error correction or support.
Rate this entry
   
    
5 votes
 Last Forum topics regarding this entry:
  error message while library import 08.10.04 18:16
  show all topics
 Similar entries wich could interrest:
  ID 0006 Library LOGO! Pulse Relay
  ID 0009 Library LOGO! Weekly timer
  ID 0002 Library Internal Eeprom
  ID 0026 Workshop Exchange libraries properly on updates
  ID 0031 Library LOGO! Random generator
 
optimized for MS Internet Explorer and 1024 x 768 resoltution
   
  © Copyright 2003-2006 S7-200.NET - all rights reserved.
S7-200.NET and his author(s) are not liable for any incidental or consequential damages, nor for any damages caused by informations or software published on this page. Simatic, Step7-MicroWin and
S7-200 are registered trademarks of Siemens AG in Germany and other countries. Further designated trademarks and brands are the property of their respective owners.
 
 S7-200.NET ©2003-2006
External eprom
linear read & write access
+ linear access
+ variables >32Bit (string)
+ backup whole V-Memory
More...
Yearly timer
events by date & time
+ up top 3 configurations
+ min. Resolution = 1 min
+ unlimitted blocks
More...
Random event
counter generated events
+ quality assurance
+ security applications
+ unique characteristic
More...
Weekly Timer
Switch devices by clock
+ up top 3 configurations
+ overlapping configurations
+ unlimitted blocks
More...