S7-200 timed event help

Gazzr

Member
Join Date
Nov 2006
Location
UK
Posts
64
Hi all,
I'm trying to gather some information from a S7-224 Plc, and want to create a shift log. I think I know how to do the maths to achieve the desired percentage and store it to memory, but the problem is the activation of this process.
I want to trigger the setting of a flag to be "on" between the hours of say 06.00 - 18.00. Then another for 18.00 - 06.00.
After doing a lot of reading I think I need to use the READ_RTC, store it somewhere then compare a set location (Containing my desired trigger time)to this stored time. When they match - set my flag. Just not sure exactly how to achieve this.
Any assistance would be appreciated.
 
Hello.

I took a program-example I made earlier and modified it a little to make it more modular. And aplied some comparators to cheek the day and time if order to activate som flags.

Anyway... try it.


Cheers
Knutabru
 
Thanks for the response Knutabru. Unfortunately I can't open the file. I get an error saying "can not open SIMATIC project in current mode". (Opening with Step 7 MicroWIN v4.0)
Just re read my post and it sounds a little complicated. All I want to do is SET a flag on at a given time. Then RESET at another specified time.
Thanks.
 
What if the plc happens to be turned off at the time of your set or reset event ? A comparison for between times would be a catch all.
 
What SP in MicroWin do you have?
I use Ver.4 SP4 and just opened my project at work with no problems.

I think I have covered for your needs with comparators for the time between as "L D[AR2,P#0.0]" suggested.
 
I will take the example to work and try it there. That is v4.0 sp4 full version. I have the trial version at home, so it may not be the latest.
 
Got the file opened at work. Exactly what I was after, thankyou. Also made me understand sub routines much better. I could follow the first sub routine to read the clock and store to temp location, but the second one threw me a little. How do the same 3 / 4 blocks read all the different time segments from different locations, then write them back all again seperately? I'm guessing it's to do with the address's given in the read clock SR. Also, why were they converted from a byte to something else, to then be returned to byte form for comparison?
 
The READ_RTC takes the input byte (here LB7) and stores the day, month, hour etc. into a 8 bytes long area, starting with the byte at input "T" (LB7)
For a thorough description, left-click once on the READ_RTC-block an hit F1.
Excerpt from the help:
Format of 8-byte Time Buffer (T)
T Byte Description Byte Data
0 year (0-99) current year (BCD value)
1 month (1-12) current month (BCD value)
2 day (1-31) current day (BCD value)
3 hour (0-23) current hour (BCD value)
4 minute (0-59) current minute (BCD value)
5 second (0-59) current second (BCD value)
6 00 reserved – always set to 00
7 day of week (1-7) current day of the week, 1=Sunday (BCD value)

As you can see, the format is all in BCD. If the time is 13 the bits in the byte (LB10) will be "0001 0011" if you give that to a comparator right away, it will see the number 19. Therfore we must convert the BCD to a "normal" value. And because of the instructions available in the S7-200, we must take the conversion-trip to an integer-word before we can present the value correctly in a byte.

The DayOfWeek is not necessary to convert from a BCD as it never goes higher than 7, but i take it trough the converting-process for consistency in the program.

And there you are, the date and time presented for easy access.
Bob's your uncle!

Cheers!
 

Similar Topics

Hi all, Currently having trouble getting a speed reference to write over modbus to an Omron M1... I can successfully write a run command and...
Replies
2
Views
67
HI i would like to know how to get a variable that will store the amount of times a program has been executed. The issue is I have 3 DBs for 1 FB...
Replies
2
Views
65
Hi folk, I would like to know what kind of Parameters should I setup for controlling with Profibus. My old Lenze 8200 motec 0.25kW have a busted...
Replies
0
Views
66
Hi, I have attached herewith one image which our programmer has been used in S7 1500 PLC. Now we need to use the same instructions in S7 1200 PLC...
Replies
4
Views
114
commentaire communiqué siemens s7-1200 avec vfd delta ? (cablage et sur tia portal )
Replies
0
Views
94
Back
Top Bottom