SlideShare a Scribd company logo
Processamento em “Background” (Global Script)

SIMATIC HMI
© Siemens AG 2007. All rights reserved.

Date:
File:

09.03.14
SWINCC_09e.1

SITRAIN Training for
Automation and Industrial Solutions
Objetivos

- Funções de Projeto
- Funções Standard
- Funções Internas
- “Actions” Globais (válidas
para o projeto todo)

SIMATIC HMI
© Siemens AG 2007. All rights reserved.

Date:
File:

09.03.14
SWINCC_09e.2

SITRAIN Training for
Automation and Industrial Solutions
Actions em Global Script (C) e Funções
Funções de Projeto
Funções Standard
Funções Internas

Campo de Saída para:
-Busca de arquivos
-Compilar todas funções

Actions

SIMATIC HMI
© Siemens AG 2007. All rights reserved.

Date:
File:

09.03.14
SWINCC_09e.3

SITRAIN Training for
Automation and Industrial Solutions
Exemplo de uma Função de Projeto e/ou uma Função
Standard
Controle de um motor:
Eventos/ mouse/ botão esq. mouse/ função em C...
BitSet ( 1, "MotorStatus", 2);

0

/*Bit 2 é setado na tag “MotorStatus”, para re-setar
o bit, use: BitSet ( 0, “MotorStatus”, 2)*/

Função definida no “Global Script”(Standard Functions):
void BitSet(BOOL OnOff, char* lpszWordtag, WORD wbitnumber)
{
WORD
int

winput = 0;
iscreen = 1;

// Cria as variáveis locais

winput = GetTagWord ( lpszWordtag ) ;
iscreen <<= ( wbitnumber );
if (OnOff == 0 ) {
winput = (WORD) ( winput & (~iscreen) );
}
else {
winput = (WORD) ( winput | iscreen );
}
SetTagWord ( lpszWordtag, winput);
}

SIMATIC HMI
© Siemens AG 2007. All rights reserved.

Date:
File:

09.03.14
SWINCC_09e.4

// Leitura das variáveis de processo
// Cria máscara binária
// Reset bit ?
// Reset bit
// Set bit
// Sobrescreve variável de processo

SITRAIN Training for
Automation and Industrial Solutions
Processamento em “Background” (Actions) com Global
Script
Operating hours.PAS
WORD HOUR, MINUTE;
BYTE Z_ON;
Z_ON = GetTagByte ("Z_On");
if (Z_ON) {
MINUTE = GetTagWord ("Minutes");
MINUTE = MINUTE + 1;
SetTagWord ("Minutes", MINUTE);
HOUR = MINUTE / 60;
SetTagWord ("operating hours", HOUR);
}
return(HOUR);

Nota: O “Global Script” deve estar ativado na lista de inicialização do WinCC

SIMATIC HMI
© Siemens AG 2007. All rights reserved.

Date:
File:

09.03.14
SWINCC_09e.5

SITRAIN Training for
Automation and Industrial Solutions
Exemplo com Funções a partir de DLLs
Contando com a Função DLL

Eventos/ Botão/ Mouse/ Press left/ C action...
#pragma
code("c:a_WinCC_Kurs_Prj_301_00ab_paslibrarydemo_dll.dll")
int CountingDll(int start, int end);
#pragma code()
int result, start, end, partial step;
partial step = GetTagDWord("partial step");
printf("rnrnoutput of 10 partial steps with DLL function ");
printf("to max. value: %d",partial step*10);
for (start=0;start<10;start++) {
end = start * partial step + partial step;
result = countingDll(start*partial step,end);
printf("rnReturn value DLL function: (%d) %d",start,result);
}

SIMATIC HMI
© Siemens AG 2007. All rights reserved.

Date:
File:

09.03.14
SWINCC_09e.6

SITRAIN Training for
Automation and Industrial Solutions
Actions em Global Script (VBS) e Procedimentos 1/2

Procedures
(Function)

A ser criado pelo usuário
(vazio)

Janela de relatório de compilação

SIMATIC HMI
© Siemens AG 2007. All rights reserved.

Date:
File:

09.03.14
SWINCC_09e.7

SITRAIN Training for
Automation and Industrial Solutions
Actions em Global Script (VBS) e Procedimentos 2/2

In the project
Module
Procedure A
Procedure B
Procedure C
Action
Instruction 1
Instruction 2
Trigger

Instruction a
Instruction b

Procedure C
….
Instruction n
Procedure D
Procedure E

SIMATIC HMI
© Siemens AG 2007. All rights reserved.

Date:
File:

09.03.14
SWINCC_09e.8

SITRAIN Training for
Automation and Industrial Solutions
Exemplo de uma Função de Projeto em VBS
.pdl

Chamada

SIMATIC HMI
© Siemens AG 2007. All rights reserved.

Date:
File:

09.03.14
SWINCC_09e.9

SITRAIN Training for
Automation and Industrial Solutions
Exemplo de uma Função de Projeto em VBS
.pdl

Chamada

SIMATIC HMI
© Siemens AG 2007. All rights reserved.

Date:
File:

09.03.14
SWINCC_09e.9

SITRAIN Training for
Automation and Industrial Solutions

More Related Content

Viewers also liked

Arquitetura control logix
Arquitetura control logixArquitetura control logix
Arquitetura control logixSaddam Lande
 
Parceria Senai Siemens
Parceria Senai SiemensParceria Senai Siemens
Parceria Senai Siemensguest33f87b
 
Dispositivos e redes de comunicaçãos
Dispositivos e redes de comunicaçãosDispositivos e redes de comunicaçãos
Dispositivos e redes de comunicaçãos
confidencial
 
Conversion plc-5-o-slc-500-a-logix-5000-esp
Conversion plc-5-o-slc-500-a-logix-5000-espConversion plc-5-o-slc-500-a-logix-5000-esp
Conversion plc-5-o-slc-500-a-logix-5000-espgiomar bolivar
 
Apostila do treinamento profibus 2 instalação
Apostila do treinamento profibus 2  instalaçãoApostila do treinamento profibus 2  instalação
Apostila do treinamento profibus 2 instalação
confidencial
 
Apostila do treinamento profibus configuração
Apostila do treinamento profibus   configuraçãoApostila do treinamento profibus   configuração
Apostila do treinamento profibus configuração
confidencial
 
03 funções e blocos de funções
03   funções e blocos de funções03   funções e blocos de funções
03 funções e blocos de funçõesconfidencial
 
S7 bas-04
S7 bas-04S7 bas-04
S7 bas-04
confidencial
 
11 erros que causam stop
11   erros que causam stop11   erros que causam stop
11 erros que causam stopconfidencial
 
Ko 7 kdp-07
Ko 7 kdp-07Ko 7 kdp-07
Ko 7 kdp-07
confidencial
 
S7 bas-07
S7 bas-07S7 bas-07
S7 bas-07
confidencial
 
S7 bas-12
S7 bas-12S7 bas-12
S7 bas-12
confidencial
 
Wincc procedimento para configuracao de comunicacao com s7
Wincc procedimento para configuracao de comunicacao com s7Wincc procedimento para configuracao de comunicacao com s7
Wincc procedimento para configuracao de comunicacao com s7
confidencial
 
Checklist profibus
Checklist profibusChecklist profibus
Checklist profibus
confidencial
 
Logix 5000 (1)
Logix 5000 (1)Logix 5000 (1)
Logix 5000 (1)
Paulo Henrique Oliveira
 

Viewers also liked (20)

Arquitetura control logix
Arquitetura control logixArquitetura control logix
Arquitetura control logix
 
Parceria Senai Siemens
Parceria Senai SiemensParceria Senai Siemens
Parceria Senai Siemens
 
Estrutura de rede
Estrutura de redeEstrutura de rede
Estrutura de rede
 
Dispositivos e redes de comunicaçãos
Dispositivos e redes de comunicaçãosDispositivos e redes de comunicaçãos
Dispositivos e redes de comunicaçãos
 
Conversion plc-5-o-slc-500-a-logix-5000-esp
Conversion plc-5-o-slc-500-a-logix-5000-espConversion plc-5-o-slc-500-a-logix-5000-esp
Conversion plc-5-o-slc-500-a-logix-5000-esp
 
Apostila do treinamento profibus 2 instalação
Apostila do treinamento profibus 2  instalaçãoApostila do treinamento profibus 2  instalação
Apostila do treinamento profibus 2 instalação
 
Apostila do treinamento profibus configuração
Apostila do treinamento profibus   configuraçãoApostila do treinamento profibus   configuração
Apostila do treinamento profibus configuração
 
Pro2 03p
Pro2 03pPro2 03p
Pro2 03p
 
03 funções e blocos de funções
03   funções e blocos de funções03   funções e blocos de funções
03 funções e blocos de funções
 
S7 bas-04
S7 bas-04S7 bas-04
S7 bas-04
 
11 erros que causam stop
11   erros que causam stop11   erros que causam stop
11 erros que causam stop
 
Ko 7 kdp-07
Ko 7 kdp-07Ko 7 kdp-07
Ko 7 kdp-07
 
Pro2 12p
Pro2 12pPro2 12p
Pro2 12p
 
S7 bas-07
S7 bas-07S7 bas-07
S7 bas-07
 
S7 bas-12
S7 bas-12S7 bas-12
S7 bas-12
 
Wincc procedimento para configuracao de comunicacao com s7
Wincc procedimento para configuracao de comunicacao com s7Wincc procedimento para configuracao de comunicacao com s7
Wincc procedimento para configuracao de comunicacao com s7
 
Checklist profibus
Checklist profibusChecklist profibus
Checklist profibus
 
Logix 5000 (1)
Logix 5000 (1)Logix 5000 (1)
Logix 5000 (1)
 
S7 bas-02
S7 bas-02S7 bas-02
S7 bas-02
 
Pro2 11p
Pro2 11pPro2 11p
Pro2 11p
 

Similar to A d swincc09_globalescript_pt

A d swincc03_create_project_pt
A d swincc03_create_project_ptA d swincc03_create_project_pt
A d swincc03_create_project_ptconfidencial
 
Ch8 v70 os_en
Ch8 v70 os_enCh8 v70 os_en
Ch8 v70 os_en
confidencial
 
A d swincc01e
A d swincc01eA d swincc01e
A d swincc01e
confidencial
 
Lo #5 manufacturing technology (jan 2016)
Lo #5 manufacturing technology (jan  2016)Lo #5 manufacturing technology (jan  2016)
Lo #5 manufacturing technology (jan 2016)
Abdulaziz AlSuwaidi
 
The fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose ReactThe fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose React
Oliver N
 
[Webinar] Camunda Optimize Release 3.0
[Webinar] Camunda Optimize Release 3.0[Webinar] Camunda Optimize Release 3.0
[Webinar] Camunda Optimize Release 3.0
camunda services GmbH
 
S7 PLCSim Advanced 2.0 - SIMATIC Siemens
S7 PLCSim Advanced 2.0 - SIMATIC SiemensS7 PLCSim Advanced 2.0 - SIMATIC Siemens
S7 PLCSim Advanced 2.0 - SIMATIC Siemens
FelipeSchaefferFerna
 
A d swincc08_reportdesigner_pt
A d swincc08_reportdesigner_ptA d swincc08_reportdesigner_pt
A d swincc08_reportdesigner_ptconfidencial
 
Mechatronics engineer
Mechatronics engineerMechatronics engineer
Mechatronics engineer
Samuel Narcisse
 
Ae01 system overview
Ae01 system overviewAe01 system overview
Ae01 system overview
confidencial
 
PLC BASED AUTOMATED SYSTEM IN PROCESS INDUSTRY (Final Presentation)
PLC BASED AUTOMATED SYSTEM IN PROCESS INDUSTRY (Final Presentation)PLC BASED AUTOMATED SYSTEM IN PROCESS INDUSTRY (Final Presentation)
PLC BASED AUTOMATED SYSTEM IN PROCESS INDUSTRY (Final Presentation)Shahid Faizee
 
S7 bas-16
S7 bas-16S7 bas-16
S7 bas-16
confidencial
 
Ae08 system vb_script
Ae08 system vb_scriptAe08 system vb_script
Ae08 system vb_script
confidencial
 
Ch1 1 v70_system_overview_en
Ch1 1 v70_system_overview_enCh1 1 v70_system_overview_en
Ch1 1 v70_system_overview_en
confidencial
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104swena_gupta
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104swena_gupta
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104swena_gupta
 
manuales y guías PLC siemens Simatic S7
manuales y guías  PLC siemens Simatic S7manuales y guías  PLC siemens Simatic S7
manuales y guías PLC siemens Simatic S7
SANTIAGO PABLO ALBERTO
 
DEVENDRAPLC .pptx
DEVENDRAPLC .pptxDEVENDRAPLC .pptx
DEVENDRAPLC .pptx
DEVENDRA SHRIVASH
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
PVS-Studio
 

Similar to A d swincc09_globalescript_pt (20)

A d swincc03_create_project_pt
A d swincc03_create_project_ptA d swincc03_create_project_pt
A d swincc03_create_project_pt
 
Ch8 v70 os_en
Ch8 v70 os_enCh8 v70 os_en
Ch8 v70 os_en
 
A d swincc01e
A d swincc01eA d swincc01e
A d swincc01e
 
Lo #5 manufacturing technology (jan 2016)
Lo #5 manufacturing technology (jan  2016)Lo #5 manufacturing technology (jan  2016)
Lo #5 manufacturing technology (jan 2016)
 
The fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose ReactThe fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose React
 
[Webinar] Camunda Optimize Release 3.0
[Webinar] Camunda Optimize Release 3.0[Webinar] Camunda Optimize Release 3.0
[Webinar] Camunda Optimize Release 3.0
 
S7 PLCSim Advanced 2.0 - SIMATIC Siemens
S7 PLCSim Advanced 2.0 - SIMATIC SiemensS7 PLCSim Advanced 2.0 - SIMATIC Siemens
S7 PLCSim Advanced 2.0 - SIMATIC Siemens
 
A d swincc08_reportdesigner_pt
A d swincc08_reportdesigner_ptA d swincc08_reportdesigner_pt
A d swincc08_reportdesigner_pt
 
Mechatronics engineer
Mechatronics engineerMechatronics engineer
Mechatronics engineer
 
Ae01 system overview
Ae01 system overviewAe01 system overview
Ae01 system overview
 
PLC BASED AUTOMATED SYSTEM IN PROCESS INDUSTRY (Final Presentation)
PLC BASED AUTOMATED SYSTEM IN PROCESS INDUSTRY (Final Presentation)PLC BASED AUTOMATED SYSTEM IN PROCESS INDUSTRY (Final Presentation)
PLC BASED AUTOMATED SYSTEM IN PROCESS INDUSTRY (Final Presentation)
 
S7 bas-16
S7 bas-16S7 bas-16
S7 bas-16
 
Ae08 system vb_script
Ae08 system vb_scriptAe08 system vb_script
Ae08 system vb_script
 
Ch1 1 v70_system_overview_en
Ch1 1 v70_system_overview_enCh1 1 v70_system_overview_en
Ch1 1 v70_system_overview_en
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104
 
manuales y guías PLC siemens Simatic S7
manuales y guías  PLC siemens Simatic S7manuales y guías  PLC siemens Simatic S7
manuales y guías PLC siemens Simatic S7
 
DEVENDRAPLC .pptx
DEVENDRAPLC .pptxDEVENDRAPLC .pptx
DEVENDRAPLC .pptx
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
 

More from confidencial

19 exercises v1.00_en
19 exercises v1.00_en19 exercises v1.00_en
19 exercises v1.00_en
confidencial
 
18 syntax rules v1.0
18 syntax rules v1.018 syntax rules v1.0
18 syntax rules v1.0
confidencial
 
17 demonstration server client system-v1.00_en
17 demonstration server client system-v1.00_en17 demonstration server client system-v1.00_en
17 demonstration server client system-v1.00_en
confidencial
 
15 final steps of configuration v1.00_en
15 final steps of configuration v1.00_en15 final steps of configuration v1.00_en
15 final steps of configuration v1.00_en
confidencial
 
14 mass data engineering v1.00_en
14 mass data engineering v1.00_en14 mass data engineering v1.00_en
14 mass data engineering v1.00_en
confidencial
 
13 locking functions and operating modes v1.00_en
13 locking functions and operating modes v1.00_en13 locking functions and operating modes v1.00_en
13 locking functions and operating modes v1.00_en
confidencial
 
12 archiving system v1.00_en
12 archiving system v1.00_en12 archiving system v1.00_en
12 archiving system v1.00_en
confidencial
 
11 customizing the os v1.00_en
11 customizing the os v1.00_en11 customizing the os v1.00_en
11 customizing the os v1.00_en
confidencial
 
10 basics automatic mode control v1.00_en
10 basics automatic mode control v1.00_en10 basics automatic mode control v1.00_en
10 basics automatic mode control v1.00_en
confidencial
 
09 basics operating and monitoring v1.00_en
09 basics operating and monitoring v1.00_en09 basics operating and monitoring v1.00_en
09 basics operating and monitoring v1.00_en
confidencial
 
08 basics control functions v1.00_en
08 basics control functions v1.00_en08 basics control functions v1.00_en
08 basics control functions v1.00_en
confidencial
 
07 connection to the process v1.00_en
07 connection to the process v1.00_en07 connection to the process v1.00_en
07 connection to the process v1.00_en
confidencial
 
06 station and network configuration v1.00_en
06 station and network configuration v1.00_en06 station and network configuration v1.00_en
06 station and network configuration v1.00_en
confidencial
 
05 project setup v1.00_en
05 project setup v1.00_en05 project setup v1.00_en
05 project setup v1.00_en
confidencial
 
03 requirements and functional process description v1.00_en
03 requirements and functional process description v1.00_en03 requirements and functional process description v1.00_en
03 requirements and functional process description v1.00_en
confidencial
 
02 pcs 7 documentation and support v1.00 en
02 pcs 7 documentation and support v1.00 en02 pcs 7 documentation and support v1.00 en
02 pcs 7 documentation and support v1.00 en
confidencial
 
01 introduction v1.00_en
01 introduction v1.00_en01 introduction v1.00_en
01 introduction v1.00_en
confidencial
 
00 st pcs7-sys_v8.0_register 20 en
00 st pcs7-sys_v8.0_register 20 en00 st pcs7-sys_v8.0_register 20 en
00 st pcs7-sys_v8.0_register 20 en
confidencial
 
Fluxograma processo acucar_alcool_etanol_verde
Fluxograma processo acucar_alcool_etanol_verdeFluxograma processo acucar_alcool_etanol_verde
Fluxograma processo acucar_alcool_etanol_verde
confidencial
 
01tiaportal handson-basicov11v2-140421084257-phpapp01
01tiaportal handson-basicov11v2-140421084257-phpapp0101tiaportal handson-basicov11v2-140421084257-phpapp01
01tiaportal handson-basicov11v2-140421084257-phpapp01
confidencial
 

More from confidencial (20)

19 exercises v1.00_en
19 exercises v1.00_en19 exercises v1.00_en
19 exercises v1.00_en
 
18 syntax rules v1.0
18 syntax rules v1.018 syntax rules v1.0
18 syntax rules v1.0
 
17 demonstration server client system-v1.00_en
17 demonstration server client system-v1.00_en17 demonstration server client system-v1.00_en
17 demonstration server client system-v1.00_en
 
15 final steps of configuration v1.00_en
15 final steps of configuration v1.00_en15 final steps of configuration v1.00_en
15 final steps of configuration v1.00_en
 
14 mass data engineering v1.00_en
14 mass data engineering v1.00_en14 mass data engineering v1.00_en
14 mass data engineering v1.00_en
 
13 locking functions and operating modes v1.00_en
13 locking functions and operating modes v1.00_en13 locking functions and operating modes v1.00_en
13 locking functions and operating modes v1.00_en
 
12 archiving system v1.00_en
12 archiving system v1.00_en12 archiving system v1.00_en
12 archiving system v1.00_en
 
11 customizing the os v1.00_en
11 customizing the os v1.00_en11 customizing the os v1.00_en
11 customizing the os v1.00_en
 
10 basics automatic mode control v1.00_en
10 basics automatic mode control v1.00_en10 basics automatic mode control v1.00_en
10 basics automatic mode control v1.00_en
 
09 basics operating and monitoring v1.00_en
09 basics operating and monitoring v1.00_en09 basics operating and monitoring v1.00_en
09 basics operating and monitoring v1.00_en
 
08 basics control functions v1.00_en
08 basics control functions v1.00_en08 basics control functions v1.00_en
08 basics control functions v1.00_en
 
07 connection to the process v1.00_en
07 connection to the process v1.00_en07 connection to the process v1.00_en
07 connection to the process v1.00_en
 
06 station and network configuration v1.00_en
06 station and network configuration v1.00_en06 station and network configuration v1.00_en
06 station and network configuration v1.00_en
 
05 project setup v1.00_en
05 project setup v1.00_en05 project setup v1.00_en
05 project setup v1.00_en
 
03 requirements and functional process description v1.00_en
03 requirements and functional process description v1.00_en03 requirements and functional process description v1.00_en
03 requirements and functional process description v1.00_en
 
02 pcs 7 documentation and support v1.00 en
02 pcs 7 documentation and support v1.00 en02 pcs 7 documentation and support v1.00 en
02 pcs 7 documentation and support v1.00 en
 
01 introduction v1.00_en
01 introduction v1.00_en01 introduction v1.00_en
01 introduction v1.00_en
 
00 st pcs7-sys_v8.0_register 20 en
00 st pcs7-sys_v8.0_register 20 en00 st pcs7-sys_v8.0_register 20 en
00 st pcs7-sys_v8.0_register 20 en
 
Fluxograma processo acucar_alcool_etanol_verde
Fluxograma processo acucar_alcool_etanol_verdeFluxograma processo acucar_alcool_etanol_verde
Fluxograma processo acucar_alcool_etanol_verde
 
01tiaportal handson-basicov11v2-140421084257-phpapp01
01tiaportal handson-basicov11v2-140421084257-phpapp0101tiaportal handson-basicov11v2-140421084257-phpapp01
01tiaportal handson-basicov11v2-140421084257-phpapp01
 

Recently uploaded

PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
NCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdfNCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdf
Vivekanand Anglo Vedic Academy
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Sourabh Kumar
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 

Recently uploaded (20)

PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
NCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdfNCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdf
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 

A d swincc09_globalescript_pt

  • 1. Processamento em “Background” (Global Script) SIMATIC HMI © Siemens AG 2007. All rights reserved. Date: File: 09.03.14 SWINCC_09e.1 SITRAIN Training for Automation and Industrial Solutions
  • 2. Objetivos - Funções de Projeto - Funções Standard - Funções Internas - “Actions” Globais (válidas para o projeto todo) SIMATIC HMI © Siemens AG 2007. All rights reserved. Date: File: 09.03.14 SWINCC_09e.2 SITRAIN Training for Automation and Industrial Solutions
  • 3. Actions em Global Script (C) e Funções Funções de Projeto Funções Standard Funções Internas Campo de Saída para: -Busca de arquivos -Compilar todas funções Actions SIMATIC HMI © Siemens AG 2007. All rights reserved. Date: File: 09.03.14 SWINCC_09e.3 SITRAIN Training for Automation and Industrial Solutions
  • 4. Exemplo de uma Função de Projeto e/ou uma Função Standard Controle de um motor: Eventos/ mouse/ botão esq. mouse/ função em C... BitSet ( 1, "MotorStatus", 2); 0 /*Bit 2 é setado na tag “MotorStatus”, para re-setar o bit, use: BitSet ( 0, “MotorStatus”, 2)*/ Função definida no “Global Script”(Standard Functions): void BitSet(BOOL OnOff, char* lpszWordtag, WORD wbitnumber) { WORD int winput = 0; iscreen = 1; // Cria as variáveis locais winput = GetTagWord ( lpszWordtag ) ; iscreen <<= ( wbitnumber ); if (OnOff == 0 ) { winput = (WORD) ( winput & (~iscreen) ); } else { winput = (WORD) ( winput | iscreen ); } SetTagWord ( lpszWordtag, winput); } SIMATIC HMI © Siemens AG 2007. All rights reserved. Date: File: 09.03.14 SWINCC_09e.4 // Leitura das variáveis de processo // Cria máscara binária // Reset bit ? // Reset bit // Set bit // Sobrescreve variável de processo SITRAIN Training for Automation and Industrial Solutions
  • 5. Processamento em “Background” (Actions) com Global Script Operating hours.PAS WORD HOUR, MINUTE; BYTE Z_ON; Z_ON = GetTagByte ("Z_On"); if (Z_ON) { MINUTE = GetTagWord ("Minutes"); MINUTE = MINUTE + 1; SetTagWord ("Minutes", MINUTE); HOUR = MINUTE / 60; SetTagWord ("operating hours", HOUR); } return(HOUR); Nota: O “Global Script” deve estar ativado na lista de inicialização do WinCC SIMATIC HMI © Siemens AG 2007. All rights reserved. Date: File: 09.03.14 SWINCC_09e.5 SITRAIN Training for Automation and Industrial Solutions
  • 6. Exemplo com Funções a partir de DLLs Contando com a Função DLL Eventos/ Botão/ Mouse/ Press left/ C action... #pragma code("c:a_WinCC_Kurs_Prj_301_00ab_paslibrarydemo_dll.dll") int CountingDll(int start, int end); #pragma code() int result, start, end, partial step; partial step = GetTagDWord("partial step"); printf("rnrnoutput of 10 partial steps with DLL function "); printf("to max. value: %d",partial step*10); for (start=0;start<10;start++) { end = start * partial step + partial step; result = countingDll(start*partial step,end); printf("rnReturn value DLL function: (%d) %d",start,result); } SIMATIC HMI © Siemens AG 2007. All rights reserved. Date: File: 09.03.14 SWINCC_09e.6 SITRAIN Training for Automation and Industrial Solutions
  • 7. Actions em Global Script (VBS) e Procedimentos 1/2 Procedures (Function) A ser criado pelo usuário (vazio) Janela de relatório de compilação SIMATIC HMI © Siemens AG 2007. All rights reserved. Date: File: 09.03.14 SWINCC_09e.7 SITRAIN Training for Automation and Industrial Solutions
  • 8. Actions em Global Script (VBS) e Procedimentos 2/2 In the project Module Procedure A Procedure B Procedure C Action Instruction 1 Instruction 2 Trigger Instruction a Instruction b Procedure C …. Instruction n Procedure D Procedure E SIMATIC HMI © Siemens AG 2007. All rights reserved. Date: File: 09.03.14 SWINCC_09e.8 SITRAIN Training for Automation and Industrial Solutions
  • 9. Exemplo de uma Função de Projeto em VBS .pdl Chamada SIMATIC HMI © Siemens AG 2007. All rights reserved. Date: File: 09.03.14 SWINCC_09e.9 SITRAIN Training for Automation and Industrial Solutions
  • 10. Exemplo de uma Função de Projeto em VBS .pdl Chamada SIMATIC HMI © Siemens AG 2007. All rights reserved. Date: File: 09.03.14 SWINCC_09e.9 SITRAIN Training for Automation and Industrial Solutions

Editor's Notes

  1. ConteúdoPage Objetivos.....................................................................................................................................2 Actions em Global Script (C) e Funções .........................................................................................3 Exemplo de uma Função de Projeto e/ou uma Função Standard ..................................................4 Processamento em “Background” (Actions) com Global Script ......................................................5 Exemplo com Funções a partir de DLLs ..........................................................................................6 Actions em Global Script (VBS) e Procedimentos 1/2 ………………………………………………..7 Actions em Global Script (VBS) e Procedimentos 2/2 ………………………………………………..8 Exemplo de uma Função de Projeto em VBS ……………………..……………………………………9
  2. Informação Geral“Global Scripts” é o termo geral para funções em C e “Actions”. Há uma série de funções em linguagem C para programação de “Actions” no WinCC. Estas funções em C estão divididas em grupos e podem ser utilizadas tanto no “Graphics Designer” quanto em “Global Scripts”. Funções de ProjetoTodas as funções específicas de projeto ficam armazenadas nesta pasta. As funções podem ser usadas no projeto (biblioteca de funções). Funções StandardÉ aqui que ficam locadas as funções que podem ser usadas em mais de um projeto. Funções pré-definidas estão disponíveis e podem ser expandidas por suas funções. Funções InternasO sistema fornece as funções listadas aqui. O usuário não pode alterar as funções internas. Estas funções contém todas funções básicas necessárias para programação dos objetos do WinCC. Estas funções também incluem todas funções da biblioteca padrão C. As funções estão assim subdivididas:- alarmFunções para recepção e processamento de mensagens. - allocateFunções para gerenciamento dinâmico de memória (necessário, por exemplo, se o valor de retorno for uma string)- c_bibFunções de biblioteca padrão C - graphicsFunções para leitura e manipulação de propriedades de objetos do WinCC - tagFunções para leitura e escrita de tags a partir do “data manager” - winccFunções para interação com componentes individuais do WinCC Runtime ActionsAs “Actions” estão disponíveis somente no “Global Script”. É onde as “Actions” são definidas para rodar em “background” e não conectadas diretamente aos objetos do WinCC (tela, janela, objeto gráfico, etc.)
  3. ObjetivoUm bit de uma dword deve ser re-setado. Esta função será gravada em local centralizado, pois será bastante utilizada. Este armazenamento central pode ser específico de um projeto (project functions) ou para mais de um projeto (standard functions). ProcedimentoA função é criada no “Global Script” após serem definidos o método de funcionamento e os parâmetros a serem transferidos. Após a função ser salva como “project function” ou “standard function”, ela pode ser utilizada no “Graphics Designer” em vários locais e com vários parâmetros. (Funções escritas por você não podem ser usadas no “Global Script”). A vantagem do armazenamento central é a facilidade de realizar alterações e atualizações da função. As alterações são feitas em apenas um local e são atualizadas automaticamente nos locais de chamada (desde que os parâmetros não sejam alterados). Os parâmetros são passados na sintaxe da linguagem C. Chamada da FunçãoA chamada da função mostrada acima tem a seguinte aparência no “Graphics Designer”: Por exemplo, setar o Bit 2 numa Word: Eventos/ mouse/ left mouse button/ C function...BitSet ( 1, &amp;quot;MotorStatus&amp;quot;, 2);Isto seta o Bit 2 da variável &amp;quot;MotorStatus&amp;quot;. Para re-setar o Bit, você deve chamar a mesma função com os seguintes parâmetros: BitSet ( 0, &amp;quot;MotorStatus&amp;quot;, 2);
  4. Informação GeralVocê tem um Project-wide ActionSystem (PAS) disponível no WinCC para “actions” independente de telas. Estas “actions” rodam em “background” e podem ser inicializadas ciclicamente (disparo por tempo), aciclicamente (num certo horário) ou dependendo de um evento (tag). Estas “actions” servem para implantar rotinas para o projeto inteiro. As “actions” individuais são criadas no Editor “Global Script”. ExemploUm contador de horas de operação está implementado como exemplo. Se um certo motor ou mesmo um componente do sistema está funcionando, um contador interno é incrementrado, o qual grava os minutos e segundos. Um disparo é feito a cada minuto, executando a rotina (“action”). Um bit de inicialização torna possível gravar as horas de operação separadamente do WinCc Runtime e armazena nas variáveis especificadas. Procedimento1. Crie as variáveis (tags) internas na “Data Manager”2. Crie uma “Action” no Editor “Global Script” (por exemplo, operating hours.PAS) 3. Selecione o “Global Script Runtime” na lista de inicilaização do WinCC. 4. Ative o “Runtime”
  5. Informação GeralA programação de “actions” no WinCC permite uma grande possibilidade de opções de implementação. Também é possível acessar funções externas armazenadas em DLLs, por exemplo, com uma “action” em C. Estas DLLs podem ser tanto Standard como bibliotecas de função criadas por você. O uso de uma função de DLL é especialmente recomendado quando são necessários cálculos muito extensos. Porque o código já está armazenado em modo executável na DLL e não precisa ser interpretado em Runtime, há um ganho na tempo de processamento na execução dos cálculos. ExemploNo exemplo acima, não é feito nada mais pela DLL do que um loop de um valor inicial até um valor final. Os resultados intermediários são mostrados numa janela de diagnóstico. Numa comparação direta, você não vê uma vantagem significativa de tempo de execução ao utilizar a DLL, até que haja várias operações. NotaPara criar a DLL, você pode utilizar o “Application Wizard” a partir do Visual C++, como por exemplo (MFC-AppWizard (dll)). Todas as funções a serem utilizadas são inseridas nesta DLL e são declaradas como funções externas em C. Adicionalmente, cada função deve ser inserida na tabela de exportação. FAQ solutionPergunta FAQ 830 1801: Como eu posso implementar corretamente uma DLL própria no WinCC?
  6. Informação Geral“Global Script” é o termo geral usado para se referir a funções e “actions” com ANSI-C e VBS. Há uma série de funções em C disponíveis para programar “actions” no WinCC. Estas funções estão divididas em grupos e podem ser utilizadas no “Graphics Designer”, bem como, até certo ponto, no “Global Script”. Project ModulesTodas as rotinas específicas do projeto são agrupadas nesta pasta. As rotinas só são aplicáveis no projeto (ScriptLib Catalog). Procedure + Você as cria e as modifica Characteristics+ Elas podem ser protegidas contra alterações e visualização através de senha + Elas não têm gatilho + Elas são salvas em um módulo Standard ModulesAqui é onde as funções estão localizadas e podem ser usadas para vários projetos. (ScriptLibStd Catalog). ActionsAs “actions” somente estão disponíveis no “Global Script”. É aqui que as “actions” são definidas para serem executadas em “background” e não são conectadas diretamente aos objetos do WinCC (tela, janela, objeto gráfico, etc.). Por exemplo a transmissão diária de valores para uma planilha Excel. Code TemplatesOs “Code Templates” munem o programador com instruções usadas com freqüência, tais como loops e instruções condicionais. Você pode inserir estes templates no seu código usando o “drag &amp; drop”.
  7. O VBS no WinCC o habilita a utilizar rotinas, módulos e “actions” para tornar dinâmico seu ambiente Runtime. ProcedimentoUma rotina (procedure) corresponde a uma função em C. Você guarda o código em rotinas as quais você gostaria de utilizar em várias partes da sua configuração. Você chama o código em uma “action” ou em outra rotina pelo nome. No WinCC você pode criar rotinas com ou sem valor de retorno. Rotinas não tem gatilho, sua chamada sempre é feita através de uma “action”. ModulesNos “modules”, você agrupa rotinas de acordo com sua função. Por exemplo, você cria módulos para rotinas que são usadas em determinada tela ou que pertençam a um determinado tópico, como funções matemáticas auxiliares ou funções de acesso ao banco de dados. Actions“Actions” sempre são disparadas por um gatilho (trigger), em outras palavras, um evento de disparo. Você configura “actions” para propriedades de objetos, eventos que ocorrem em objetos gráficos ou globalmente no projeto. Nas “actions” você pode chamar códigos usados com freqüência em forma de rotinas.
  8. Informação GeralPara aplicações freqüentes, você pode criar uma função global (Global Script function). Então a função é chamada num objeto de tela e “alimentada” com os operandos. Operandos do ScriptPara 1 = Nome do Objeto IO Field1 Para 2 = Nome do Objeto IO Field2 Para 3 = Nome do Objeto Output Field3 FSumme=z é o valor de retorno da funçãoCLng Function = retorna um valor convertido em um tipo “Variant”, com o sub-tipo “Long” Execução1. Célula: Declaração de variáveis (tag’s)2. Célula : Pela propriedade do “OutputValue”, lê o valor do 1º IO Field.3. Célula : Pela propriedade do “OutputValue”, lê o valor do 2º IO Field.4. Célula : Chama a função Summe e preenche o campo de saída com o valor de retorno.