another clock question

walters

Member
Join Date
Feb 2005
Location
reusel
Posts
185
i have tried to program my S7-300 PLC for the clock function but i cant get it to work can someone give me an easy example of one (i prefer with commennt of what happens) i know i ask mutch but im only a beginner and i must show the time on a tp170B color panel from my PLC i nevr programmed in STL so thats hard for me to understand. please help me
 
i have tried to program my S7-300 PLC for the clock function but i cant get it to work
OK. Show us what you've done so far and we'll see what we can do to help.

Kind regards,
 
ik heb het voorbeeld hieronder gevolged want dit is wat er op de site van siemens stond maar ik vind het op het eind vrij raar met die local area en dus krijg ik het niet geprogrammeerd

  1. Creation of the data area "Date/time-PLC" in a data block in the control (DB1):

    Define a data area inside the control, that consists of "DATE_AND_TIME" and four "BYTE" tags. The organization of this data area as structure has proven to be favorable for the subsequent configuration of the area indicator in the TP.


Fig. 1: Creation of the data area in the control


  1. Cyclical transfer of the system time of the control to the defined data area:

    Transfer the system time of the control according to a cycle of one second to the defined tag of the type "DATE_AND_TIME". You can implement this inside a time interrupt-OB (e.g. OB35 or OB32) by means of the system function SFC1 "READ_CLK".


Fig. 2: Reading the system time of the CPU


  1. Creation of the area indicator "Date/time-PLC" in ProTool:
    Note:

    The area pointer "Date /Time PLC" is available for all Windows-based Panels i.e. this sort of time synchronization can also be used for other Windows-based Panels apart from the TP170A.

Via the menu item " target system > area indicator" insert an indicator , type "Date/time-PLC". Afterwards, link this area indicator to the defined data area (structure: Date_Time_PLC) in the control. Via the log cycle, you determine the update period of the system time in the TP170A with the current system time of the CPU. A log cycle of 15 seconds is recommended.




Fig. 3: Creation of the area indicator "Date/time-PLC"


Transfer of a user-defined system time to both, the CPU and the TP170A

  1. Definition of the tags for Date and time in ProTool (Tags in DB10)
    In ProTool, define six tags of the data type "Byte" for the entry of date and type at the TP170A and one tag of the data type "Bool" as trigger for the transfer to the CPU. Within one picture, you can provide the tags with values and set the trigger bit via a push button.


Fig. 4: Tags in ProTool


  1. Processing of the transferred time-related values in the control (FC10 in the STEP 7-Project)
    Verify the status of the trigger bit in the S7-program. Having set the trigger bit, copy the date-/ and time-related values into the local area of your block. Afterwards, by using the function "SET_CLK" (SFC0), you can set the system time of the CPU with the values in the local area. Reset the trigger bit.
http://support.automation.siemens.c...#Übertragen der CPU-Systemzeit auf das TP170A
 
I assume that as you posted the Siemens help files for doing this that you haven't actually done anything in the PLC which was what Jean Pierre was refering to.

I will give you some clues as to what to do.

In OB1, in the temporary data, there is the OB1_DATE_TIME, you can use this instead of the system date and time. (it's the same thing really). This data is 8 bytes long, so you could use SFC20 (block move) to move this local data to a DB area that is also 8 bytes long. Set the DB up in bytes and label them YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, MILLISECOND and DAY_OF_WEEK. Although, to get the day of the week you need to some manipulation with the bytes.

This thread explains this http://www.plctalk.net/qanda/showthread.php?t=9284

Then in the TP170 set up some output fields that point to the correct area (byte) in the DB, voila you have your system time displayed on the TP.

You could also search this site for the keyword 'SFC1', you should get a good few hits that would help you in your quest.

Then, if you still can't get it working, post what you have and we will see what we can do.

Paul
 
from display

now my new assignment is that i have to find out if it is possible to set the PLC clock with the TP and then i have to read out the new PLC time
 

Similar Topics

Hi, obviously new here and I hope I pose this question correctly. Ive been reading thru and trying to make sure this comes out right. Our lab in...
Replies
1
Views
1,570
Hello I need to message read the entire 16 channel raw analog inputs from a 1769-L33ER Compact Logic controller to another 1769-L33ER Compact...
Replies
8
Views
231
I am noticing a problem where i am using MOV instruction and writing literal text into source and String datatype in destination. It works fines...
Replies
6
Views
426
I'm not actually in front of the equipment yet, but this is the information that I have been given by a client: ------------ Data from HART...
Replies
2
Views
317
hi guys, i need 2 diffirent brands to report to each other the first is a AB Micro850 with 2080-OF2 for 4-20Ma output the second is Clickplc...
Replies
9
Views
1,312
Back
Top Bottom