Языки программирования плк сименс

Основы языка

Рекомендовано к изданию методическим советом факультета автоматики и вычислительной техники ФГБОУ ВПО «ВятГУ» в качестве учебно-методического пособия для выполнения лабораторных работ для студентов направления подготовки 220201 «Управление и информатика в технических системах», всех профилей подготовки всех форм обучения

Заведующий кафедры ЭПиАПУ, к.т.н., доцент C.И. Охапкин

Семеновых В. И. , Луппов А. В., Шевчук Е.А.

Основы языка программирования Step 7 Lite и программного обеспечения ПЛК S7-300: учебно-методическое пособие для студентов направления 220201 «Управление и информатика в технических системах» всех профилей подготовки, всех форм обучения / В.И. Семеновых, Луппов А.В., Шевчук Е.А. – Киров: ПРИП ФГБОУ ВПО «ВятГУ», 2013. – 147 с.

© Семеновых В.И., Луппов А.В., Шевчук Е.А. 2013

1.1 Программируемый логический контроллер 6

1.2 ПЛК Siemens SIMATIC S7-300 7

1.3 Визуальный контроль индикаторов в S7-300 11

2 ТИПОВАЯ АРХИТЕКТУРА ПРОЦЕССОРА S7 13

3 ОСНОВЫ РАЗРАБОТКИ ПРОГРАММЫ 19

3.2 Принцип выполнения программы в S7-CPU 20

3.5 Способы обработки программы 23

3.6 Иерархия вызовов в программе пользователя 25

3.8 Обращение к данным в областях памяти 30

4 ОБЗОР ПАКЕТА STEP 7 LITE 32

4.1 Создание решения автоматизации 32

4.2 Структура пользовательского интерфейса Step 7 Lite 33

4.3 Окно проекта в Step 7 Lite 34

4.3 Справка и документация по Step 7 Lite 37

5 РАБОТА С ПРОЕКТОМ В STEP 7 LITE 38

5.1 Понятие проекта в Step 7 Lite 38

5.3 Определение символьных имен 39

5.4 Структура и компоненты таблицы символьных имен 42

5.6 Редактирование элементов LAD в области кода 50

5.7 Создание блоков данных 54

5.8 Установка online-соединения с процессором 56

5.9 Загрузка в ЦПУ и обратная загрузка в программатор 58

БИБЛИОГРАФИЧЕСКИЙ СПИСОК 59

Введение

Процесс автоматизации производства зародился вместе с самим производством и в процессе своего развития прошел целый ряд этапов: от управления при помощи простейших технических устройств, до современных автоматизированных систем управления, построенных на базе вычислительной техники.

Комплексное использование вычислительной техники при автоматизации производства позволяет создавать гибкие автоматизированные производства (ГАП). Создание ГАП – генеральное направление развития и автоматизации производственных процессов. В настоящее время широкое применение при создании автоматизированных систем управления широко применяются программируемые логические контроллеры фирмы SIEMENS, при создании управляющих программ для которых применяется язык программирования Step 7.

Пакет Step 7 Lite предназначен для создания проектов, решающих задачи автоматизации станков, участков, технологических процессов. Рассматриваемый пакет позволяет проводить разработку программных средств в пределах одного проекта, в результате чего на основе требований к программной и аппаратной частям происходит создание и конфигурирование необходимых средств, рабочих программ и блоков данных для решения задач автоматизации.

Целью данного методического пособия является знакомство студентов с внутренней структурой ПЛК S7-300, основными инструкциями языка программирования ПЛК Step 7 Lite, освоение программы Step 7 Lite и приемов работы, позволяющих научиться создавать проект.

Источник

Introduction to SCL Programming in Siemens TIA Portal

With the Industrial automation and IT worlds converging, IT specialists and Automation Engineers are pushed to develop new skills, in order to stay relevant in the industry.

IT engineers are entering the programming area and starting to write PLC programs using programming languages such as Python and C++, whereas Automation Engineers are learning to deal with SQL databases and being able to write PLC programs using high-level programming languages such as Structured Control Language (SCL).

In this tutorial, you learn about the SCL PLC programming language and how to get started with it in Siemens TIA Portal.

Prerequisites

In this tutorial, we use Siemens TIA Portal software version 16. However, you can use other versions to follow along. This tutorial is meant for people with practical experience with Siemens S7 CPUs such as S7-1200 and S7-1500 CPUs and those familiar with the fundamentals of Ladder Logic PLC programming language.

Still, if you are a beginner in PLC programming, you can follow this tutorial. Having the mentioned skills will speed up your learning process for SCL programming.

Siemens PLC Programming Languages

PLC programmers are acquainted with the standard that standardized programming languages for programmable logic controllers or PLCs. Five PLC programming languages are identified in DIN EN-61131-3 (or IEC 61131-3) standard:

  • Ladder Diagram
  • Function Block Diagram
  • Sequential Function Chart
  • Instruction List, and
  • Structured Text

It’s important to mention that Structured Text (ST) is known as Structured Control Language (SCL) in Siemens software.

If you have ever programmed Siemens PLCs, you will know that when we create programming blocks, the Ladder Diagram is typically the default language and is generally acceptable for the new programming block.

Three standard PLC programming languages are included in the majority of Siemens CPU types, which are Ladder Diagram (LD), Function Block Diagram (FBD), and Structured Control Language (SCL).

But what about Sequential Function Chart and Instruction List? Some Siemens CPUs also support these languages to provide total compliance with the IEC 61131-3 standard.

SCL Definition

SCL is short for Structured Control Language and is built on PASCAL and used for advanced programming. We use letters of SCL to define this programming language. We understand it is Structured Language from S and L letters, and from the letter C, we figure out Control. So, SCL is a structured language utilized to execute control instructions in Siemens PLCs.

Other forms of structured text languages may go by different names and be used by other PLC manufacturers. For example, Rockwell and Omron call this language the Structured Text in their PLC programming software.

Structured Control Language VS Ladder Diagram

If you have programmed Ladder Diagram before for Siemens PLCs, you know that its instructions are displayed graphically like counters, math functions, and shifts, to name a few.

So, a diagrammatic technique of presenting the logic’s flow, details, and connections to external I/O points is called a Ladder. In other words, a Ladder is designed to express a sequence of logic that the PLC should follow according to your programming instructions.

The same goal is achieved using SCL, but it employs a text-based language to carry out the same reasoning.

For instance, we can use a SUB block to subtract two variables from each other in the Ladder Diagram. But in the SCL, that subtraction can be represented using an equation that appears to be more typical.

Creating SCL Programming Block

Let’s begin creating an SCL program right away! We must first launch the Siemens TIA Portal. To do this, double-click over the TIA Portal icon on the desktop or press the Windows button on the bottom left side of the screen, scroll down through apps until you find and expand the Siemens Automation folder, and then click on the TIA Portal icon to open it.

Press the Create new project item, give our project the name SCL Programming and then hit the Create button.

Once the project is built, we will add an S7-1500 CPU to create an SCL programming block. First, left-click over the Configure a device tab, select Add new device item, expand and go through the SIMATIC S7-1500 folder until you find and choose the CPU 1511C-1 PN, and then hit the Add button. One of the Siemens S7-1500 PLC Starter Kits uses this CPU and is popular among buyers.

When the Project View is opened, right-click over the Main OB under the PLC_1 folder in the Project tree, select the Switch programming language item, and then a pop-up menu is displayed. We see that programming languages supported by this PLC model are Function Block Diagram and Ladder Diagram.

The STL (or Statement List) option is grayed out. All CPUs in S7-1200 and S7-1500 series have this trait. It’s worth mentioning that the STL programming language fulfills the Instruction List (IL) language defined in IEC 61131-3 standard.

If you have selected S7-300 or S7-400 CPUs for the PLC configuration, the STL programming language option is available for you to choose for programming their Main OBs.

To build the SCL program, double-click on the Add new block item under the Programs block folder in the left pane of the screen. When the Add new block window opens, select the Function tab and give the new block the name SCL Application.

Expand the Language drop-down menu and select the SCL. Leave the numbering method as Automatic since we want the possible new free block to be assigned automatically and to avoid occurring numbering conflicts during the compilation procedure.

Once the SCL block is created, it appears under the Program block folder in the Project tree.

Double-click over the SCL Application block to open the SCL programming window, which is currently blank.

SCL Programming Window Overview

You can input the SCL program in the programming window, which serves as your workspace. Let us explore different sections that make up the SCL programming window:

  1. Sidebar: It offers the ability to specify breakpoints and bookmarks.
  2. Line Numbers: The program code is presented with the line numbers to the left of it.
  3. Outline View: It emphasizes code portions that are connected.
  4. Code Area: The SCL program is written, developed, edited, and modified in the code section.
  5. Display of the absolute operands: This table demonstrates the mapping of symbolic operands to absolute addresses.

SCL Programming Window Customization

The TIA Portal gives you the power so you can customize how the programming window and program code look. To do so, select the Settings option from the Options menu in the top toolbar.

Once the Settings window is visible in the workspace, expand the General item and select the Script/text editors. As you can see, in the first two sections of this window, you can set the font, font size, and font colors.

Based on syntax, lines are indented to give you a better picture of the program. You can use tab spacing to define the depth of indentation.

So, if you scroll down within the Script/text editors window, you can set the tab spacing. Also, you can choose the Indent among one of the three existing options: None, Paragraph, and Smart.

Additionally, you can show or hide the line numbers to the left of the program code. To do so, you can check or uncheck the Show line numbers box accordingly.

Conclusion

By reading this tutorial, you are now able to answer the following question:

  • Why is it vital to learn SCL programming?
  • Does the SCL language supported by the majority of Siemens PLCs?
  • What is the SCL definition?
  • What is SCL stands for?
  • What do the other PLC manufacturers call SCL in their programming software?
  • What is the difference between Structured Control Language and Ladder Diagram?
  • How do we create an SCL programming block in the Siemens TIA Portal software?
  • How can we customize the SCL programming window?

The skills you gain in SCL programming will allow you to build and test efficient, reliable PLC logic for various applications and tasks.

Источник

Читайте также:  Уровень косвенности в программировании
Оцените статью