Autor Thema: Step 7V13/V14  (Gelesen 346 mal)

0 Mitglieder und 1 Gast betrachten dieses Thema.

Offline Alen231

  • Newbie
  • *
  • Beiträge: 2
    • Profil anzeigen
Step 7V13/V14
« am: 05. Oktober 2018, 15:51:05 »
Dear all,

I tried to use OSCAT library for S-1200 in V13 and V14.

In general there I have a lot of missing data types and mainly problem with T_PLC_MS. I’m missing SYS_TIMER.TIME in STIME (FB64). I went through forum and didn’t find answer.

I’m not sure how to make SYS_TIMER in S7-1200.

Please advice.

Thanks
Alen.

Offline d.sengstock

  • Newbie
  • *
  • Beiträge: 2
    • Profil anzeigen
    • E-Mail
Re: Step 7V13/V14
« Antwort #1 am: 08. Oktober 2018, 18:01:17 »
Hello Alen231,

T_PLC_MS is not available for S7-1200, but instead of "T_PLC_MS" use

1.
FUNCTION_BLOCK "FB002_Systemzeit"
{ S7_Optimized_Access := 'False' }
VERSION : 0.1
   VAR_OUTPUT
      outputTime {InstructionName := 'DTL'; LibVersion := '1.0'} : DTL;
   END_VAR

   VAR
      returnValue : Int;
   END_VAR


BEGIN
#returnValue:= RD_SYS_T(OUT=>#outputTime);
END_FUNCTION_BLOCK

2.
FUNCTION_BLOCK "FB001"
{ S7_Optimized_Access := 'False' }
VERSION : 0.1
   VAR_INPUT
     
   END_VAR

   VAR_OUTPUT DB_SPECIFIC
     
   END_VAR

   VAR DB_SPECIFIC
     
   END_VAR
   VAR
      Systemzeit : "FB002_Systemzeit";
   END_VAR
   VAR DB_SPECIFIC
      Systemzeit_1 {InstructionName := 'DTL'; LibVersion := '1.0'} : DTL;
   END_VAR
   VAR
      "T_PLC_MS_" : Int;
   END_VAR

BEGIN
#Systemzeit(outputTime => #Systemzeit_1);
(* read system timer  *)
#T_PLC_MS_ := (#Systemzeit_1.SECOND*100); // or (#Systemzeit_1.NANOSECOND/1000000)
END_FUNCTION_BLOCK
Attached *.scl source-code
« Letzte Änderung: 09. Oktober 2018, 09:01:15 von d.sengstock »

Offline Alen231

  • Newbie
  • *
  • Beiträge: 2
    • Profil anzeigen
Re: Step 7V13/V14
« Antwort #2 am: 11. Oktober 2018, 11:54:41 »
Many thanks.