Step 7V13/V14

Begonnen von Alen231, 05. Oktober 2018, 15:51:05

Vorheriges Thema - Nächstes Thema

0 Mitglieder und 1 Gast betrachten dieses Thema.

Alen231

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.


[gelöscht durch Administrator]

d.sengstock

#1
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

[gelöscht durch Administrator]

Alen231