Sie sind auf Seite 1von 5

The Read Real-Time Clock (TODR) instruction reads the current time and date from the hardware

clock and loads it in an 8-byte Time buffer starting at address T.The Set Real-Time Clock (TODW) instruction writes the current time and date to the hardware clock beginning at the 8-byte Time buffer address specified by T.TODR: Error Conditions that Set ENO = 0: 0006 Indirect address 000C Clock cartridge not present TODW: Error Conditions that Set ENO = 0: 0006 Indirect address 0007 TOD data error 000C Clock not present You must code all date and time values in BCD format (for example, 16#02 for the year 2002). See the Table below. Format of 8-byte Time Buffer (T) T Byte 0 1 2 3 4 5 6 7 DescriptionByte Data

year (0-99) current year (BCD value) month (1-12) day (1-31) current month (BCD value)

current day (BCD value)

hour (0-23) current hour (BCD value) minute (0-59) second (0-59) 00 current minute (BCD value) current second (BCD value)

reserved always set to 00 current day of the week, 1=Sunday (BCD value)

day of week (1-7)

The time-of-day clock initializes the following date and time after extended power outages or memory has been lost: Date: 01-Jan-90 Time: 00:00:00 Day of Week: Tip: Sunday

The S7-200 CPU does not perform a check to verify that the day of week is correct based upon the date. Invalid dates, such as February 30, may be accepted. You should ensure that the date you enter is correct.Do not use the TODR/TODW instruction in both the main program and in an interrupt routine. A TODR/TODW instruction in an interrupt routine which attempts to execute while another TODR/TODW instruction is in process will not be executed. SM4.3 is set indicating that two simultaneous accesses to the clock were attempted (non-fatal error 0007).The time-of-day clock in the S7-200 uses only the least significant two digits for the year, so for the year 2000, the year is represented as 00. The S7-200 PLC does not use the year information in any way. However, user programs that use arithmetic or compares with the year's value must take into account the two-digit representation and the change in century.Leap year is correctly handled through year 2096. Symbol Group Symbol Names 0=OFF=LOW System Status Always_On First_Scan_On Retentive_Lost RUN_Power_Up condition Clock_60s 1 min. Clock_1s of 1 s. Clock_Scan cycle Mode_Switch RUN SM0.0 Always ON SM0.1 ON for the first scan cycle only SM0.2 ON for one scan cycle if retentive data is lost SM0.3 ON for 1 scan cycle when RUN mode is entered from a power-up SM0.4 Clock pulse that is ON for 30 s, OFF for 30 s, for a duty cycle time of SM0.5 Clock pulse that is ON for 0.5 s, OFF for 0.5 s, for a duty cycle time SM0.6 Scan cycle clock which is ON for one cycle and OFF for the next SM0.7 Indicates the current position of the mode switch: 0 = TERM, 1 = Address 1=ON=HIGH The S7-200 CPU system updates SMB0-SMB29

Instruction Execution Status Result_0 SM1.0 Set to 1 by the execution of certain instructions when the result of the operation = 0 Overflow_Illegal SM1.1 Set to 1 by the execution of certain instructions on overflow or illegal numeric value

Neg_Result Divide_By_0 Table_Overflow overfill the table Table_Empty empty table Not_BCD binary value

SM1.2 Set to 1 when a math operation produces a negative result SM1.3 Set to 1 when an attempt is made to divide by zero SM1.4 Set to 1 when the Add to Table instruction attempts to SM1.5 Set to 1 when a LIFO or FIFO instruction attempts to read from an SM1.6 Set to 1 when an attempt is made to convert a non-BCD value to a

Not_Hex SM1.7 Set to 1 when an ASCII value cannot be converted to a valid hexadecimal value Freeport Received Character Receive_Char SMB2 Contains each character received from Port 0 or Port 1 during Freeport communication Freeport Parity Error Parity_Err SM3.0 Set for Port 0 or 1 if a parity error is detected in a character received by Port 0 or Port 1 Interrupt Queue Overflow, Run-time Program Error, Interrupts Enabled, Freeport Transmitter Idle, and Value Forced Comm_Int_Ovr (interrupt routine only) Input_Int_Ovr routine only) Timed_Int_Ovr routine only) RUN_Err Int_Enable enabled Xmit0_Idle Xmit1_Idle Force_On forced (22x only) SM4.0 Set to 1 if the communication interrupt queue overflows SM4.1 Set to 1 if the input interrupt queue overflows (interrupt SM4.2 Set to 1 if the timed interrupt queue overflows (interrupt SM4.3 Set to 1 when a run-time programming error is detected SM4.4 Indicates the global interrupt enable state: SM4.5 Set to 1 when the transmitter is idle (Port 0) SM4.6 Set to 1 when the transmitter is idle (Port 1) SM4.7 Set to 1 when a value is forced: 1 = value forced, 0 = no value 1 = interrupts are

I/O Error Status Bits IO_Err Too_Many_D_IO Too_Many_A_IO Too_Many_IM the I/O bus DP_Err CPU ID Register CPU_ID SMB6 Identifies the CPU model number SM5.0 Set to 1 if any I/O errors are present SM5.1 Set to 1 if too many digital I/O points are connected to the I/O bus SM5.2 Set to 1 if too many analog I/O points are connected to the I/O bus SM5.3 Set to 1 if too many intelligent I/O modules are connected to SM5.7 Set to 1 if a DP standard bus fault is present (S7-215 only)

I/O Module ID and Error Registers EM0_ID EM0_Err EM1_ID EM1_Err EM2_ID EM2_Err EM3_ID EM3_Err EM4_ID EM4_Err EM5_ID EM5_Err EM6_ID EM6_Err S SMB11 SMB12 SMB13 MB14 SMB15 SMB16 SMB17 SMB18 SMB19 SMB20 SMB21 SMB9 SMB8 Module 0 ID register Module 0 error register SMB10 Module 1 ID register Module 1 error register Module 2 ID register Module 2 error register Module 3 ID register Module 3 error register Module 4 ID register Module 4 error register Module 5 ID register Module 5 error register Module 6 ID register Module 6 error register

Scan Times in Milliseconds Last_Scan SMW22 Scan time of the last scan cycle

Minimum_Scan RUN mode Maximum_Scan RUN mode

SMW24 SMW26

Minimum scan time recorded since entering the Maximum scan time recorded since entering the

Analog Adjustment Potentiometers Pot0_Value Pot1_Value SMB28 SMB29 Set to value corresponding to analog adjustment 0 Set to value corresponding to analog adjustment 1

Das könnte Ihnen auch gefallen