[?]: Set Date and Time in S7-312C using SFC0

SIMATIC S7-200/300/400, Step7, PCS7, CFC, SFC, PDM, PLCSIM,
SCL, Graph, SPS-VISU S5/S7, IBHsoftec, LOGO ...
waard
Posts: 3
Joined: Mon Mar 21, 2011 9:27 am

[?]: Set Date and Time in S7-312C using SFC0

Post by waard »

Hi, i want to set date and time in PLC using touch panel TP170A. I try to do this with next method:
1 I write in PLC's DB9 date and time using INPUT FIELD (TP170a) and variable of type DT, that's OK
2 i try to use that 8 bytes in DB9 from DBB28 to set plc's time with SFC0 like this:

Code: Select all

      L     W#16#1002                     
      T     LW     0
      L     8                         // 8 bytes   
      T     LW     2
      L     9                          // db9 
      T     LW     4
      L     28                         //from dbb28  
      SLD   3
      OD    DW#16#84000000
      T     LD     6

      CALL  "SET_CLK"
       PDT    :=#DaT               // DaT - TEMP - type: Date and time; Address - 0
       RET_VAL:=#ret              // ret TEMP - INT, address - 2.0 
And that's not working....
Maybe someone know what the problem here, thanks
dsekulic
Posts: 186
Joined: Sun Feb 12, 2006 5:47 pm
Location: Europe

Re: Set Date and Time in S7-312C using SFC0

Post by dsekulic »

Hi,
take a look in this FAQ
http://support.automation.siemens.com/W ... n/24106357
regards
Answers to FAQs
Faq & Info
Faq & Info
Posts: 178
Joined: Thu Oct 13, 2005 6:42 pm
Location: Frequently Asked Questions – Часто Задаваемые Вопросы

Re: [?]: Set Date and Time in S7-312C using SFC0

Post by Answers to FAQs »

denhondt
Posts: 7
Joined: Sun Jul 04, 2010 10:10 pm

Re: [?]: Set Date and Time in S7-312C using SFC0

Post by denhondt »

This is how i do this

Link PDF File of Function

https://docs.google.com/viewer?a=v&pid= ... NDVi&hl=nl