How to Create User Program Using SCL in SIMATIC Manager

Поделиться
HTML-код
  • Опубликовано: 14 дек 2024

Комментарии • 4

  • @elscitech
    @elscitech  Год назад

    ======🔴Timestamps🔴=========
    00:00:00 - Step 1: Introduction
    00:00:35 - Step 2: Create New Project in SIMATIC Manager
    00:02:30 - Step 3: Insert a New SCL Source
    00:05:28 - Step 4: Program Simulation using PLCSIM
    00:07:14 - Other useful videos suggestion

    • @elscitech
      @elscitech  Год назад

      Please share video to your friends...

  • @dexterms7263
    @dexterms7263 Год назад

    can you do anther video and give us an exmple

    • @elscitech
      @elscitech  Год назад

      please see some examples in below link:
      support.industry.siemens.com/cs/attachments/1137188/SCLV4_e.pdf
      or see two our samples:
      1:
      ======================================
      FUNCTION FC410 : BOOL
      TITLE = 'FC OGS03 Calculations'
      //
      // Calculations for the greenseparator are made in this function.
      //
      VERSION: '2.0'
      AUTHOR: 'EMR'
      NAME: 'Calc'
      FAMILY: 'OGS03'
      VAR_TEMP
      i: INT;
      CakeWidth: REAL;
      NrBeams: REAL;
      BeamsUsed: DINT;
      CakeOffset: REAL;
      Position: REAL;
      Result1, Result2: REAL;
      END_VAR
      OK:=true;
      // calculate the cakewidth
      i:=1;
      CakeWidth:=0;
      WHILE ("DB OGS03 Positions".Blockwidth[i]>0) OR (i1500.0) OR (CakeWidth0.0 THEN
      NrBeams := TRUNC("DB OGS03 Positions".Blockwidth[i] / "DB OGS03 Setup".Beamwidth);
      "DB OGS03 Positions".Beams_Block[i] := REAL_TO_DINT(NrBeams);
      "DB OGS03 Setup".Nr_Beams_in_use := "DB OGS03 Setup".Nr_Beams_in_use + REAL_TO_INT(NrBeams);
      "DB OGS03 Setup".Nr_blocks:=i;
      ELSE
      "DB OGS03 Positions".Beams_Block[i] := 0;
      END_IF;
      END_FOR;
      // Check the calculated number of beams and calculate the number of beams to store
      IF ("DB OGS03 Setup".Nr_Beams_in_use >= "DB OGS03 Setup".Nr_Beams - "DB OGS03 Setup".Nr_beams_to_store_max) AND ("DB OGS03 Setup".Nr_Beams_in_use "DB OGS03 Setup".Max_Separation_Spc) OR ("DB OGS03 Setup".Set_Separation_Spc 0 THEN
      "DB OGS03 Positions".Separation[i] := TRUNC("DB OGS03 Positions".place[i] + 70 +((INT_TO_REAL("DB OGS03 Setup".Nr_blocks - i) * "DB OGS03 Setup".Set_Separation_Spc) * 10.0));
      ELSE
      "DB OGS03 Positions".Separation[i] := 0;
      END_IF;
      END_FOR;
      OK:=true;
      FC410:=OK;
      END_FUNCTION
      ======================================
      2:
      ======================================
      FUNCTION FC414 : BOOL
      TITLE = 'FC OGS03 Recipe'
      //
      // Calculations for the greenseparator are made in this function.
      //
      VERSION: '2.0'
      AUTHOR: 'EMR'
      NAME: 'Calc'
      FAMILY: 'OGS03'
      // Block Parameters
      VAR_INPUT
      ActivateActual: BOOL;
      SetNext: BOOL;
      CopyNextActual: BOOL;
      END_VAR
      VAR_TEMP
      i: INT;
      END_VAR
      OK:=true;
      IF CopyNextActual THEN
      "DB OGS03 Recipe".Recipe_actual.RecipeNr:="DB OGS03 Recipe".Recipe_next.RecipeNr;
      END_IF;
      IF ActivateActual OR CopyNextActual THEN
      // check and correct cutting wire size before copying values
      FOR i:=1 TO 30 DO
      IF ("DB OGS03 Recipe".Recipe_actual.Blockwidth[i]>0.0) & (("DB OGS03 Recipe".Recipe_actual.Blockwidth[i] - "DB OGS03 Setup".CuttingwireSize) / "DB OGS03 Setup".Beamwidth) < 1.0 THEN
      "DB OGS03 Setup".CuttingwireSize := "DB OGS03 Recipe".Recipe_actual.Blockwidth[i] - "DB OGS03 Setup".Beamwidth;
      END_IF;
      END_FOR;
      // check cutting wire size after correction
      IF "DB OGS03 Setup".CuttingwireSize 0.0 THEN
      "DB OGS03 Positions".Blockwidth[i] := "DB OGS03 Recipe".Recipe_actual.Blockwidth[i] - "DB OGS03 Setup".CuttingwireSize;
      ELSE
      "DB OGS03 Positions".Blockwidth[i] := 0.0; //clear unused positions
      END_IF;
      END_FOR;
      "DB OGS03 Setup".Set_Separation_Spc := "DB OGS03 Recipe".Recipe_actual.SeparationSpace;
      "DB OGS03 Setup".Nr_separations_skip := "DB OGS03 Recipe".Recipe_actual.NotSeparated;
      END_IF;
      IF SetNext THEN
      "DB OGS03 Recipe".Recipe_next.RecipeNr:="DB OGS03 Recipe".Recipe_actual.RecipeNr;
      // check and correct cutting wire size before copying values
      END_IF;

      FC414:=OK;
      END_FUNCTION