SlideShare a Scribd company logo
1 of 10
Date: 04/22/14
File: SWINCC_09e.1
SIMATIC HMI
Siemens AG 2000. All rights reserved.©
SITRAIN Training for
Automation and Drives
Background Processing (Global Script)
Date: 04/22/14
File: SWINCC_09e.2
SIMATIC HMI
Siemens AG 2000. All rights reserved.©
SITRAIN Training for
Automation and Drives
Objectives
- Project Functions
- Standard Functions
- Internal Functions
- Project-wide Actions
Date: 04/22/14
File: SWINCC_09e.3
SIMATIC HMI
Siemens AG 2000. All rights reserved.©
SITRAIN Training for
Automation and Drives
Global Script
Output field for:
-Search files
-Compile All Functions
Project functions
Standard functions
Internal functions
Actions
Date: 04/22/14
File: SWINCC_09e.4
SIMATIC HMI
Siemens AG 2000. All rights reserved.©
SITRAIN Training for
Automation and Drives
Example of a Project Function and/or Standard Function
void BitSet(BOOL OnOff, char* lpszWordtag, WORD wbitnumber)
{
WORD winput = 0; // Create local tags
int iscreen = 1;
winput = GetTagWord ( lpszWordtag ) ; // Read process tags
iscreen <<= ( wbitnumber ); // Create bit mask
if (OnOff == 0 ) { // Reset bit ?
winput = (WORD) ( winput & (~iscreen) ); // Reset bit
}
else {
winput = (WORD) ( winput | iscreen ); // Set bit
}
SetTagWord ( lpszWordtag, winput); // Rewrite process tag
}
Switching on a motor:
Events/ Mouse/ Left mouse button/ C function...
BitSet ( 1, "MotorStatus", 2);
/*Bit 2 is set in the “MotorStatus” tag, to reset the
bit use: BitSet ( 0, “MotorStatus”, 2)*/
A function defined in the Global Script (Standard Functions:
0
Date: 04/22/14
File: SWINCC_09e.5
SIMATIC HMI
Siemens AG 2000. All rights reserved.©
SITRAIN Training for
Automation and Drives
Internal Functions: Example of Graphics 1/3
Date: 04/22/14
File: SWINCC_09e.6
SIMATIC HMI
Siemens AG 2000. All rights reserved.©
SITRAIN Training for
Automation and Drives
Internal Functions: Example of Graphics 2/3
Activate dialog box
Event/ Button/ Mouse/ Press left/ C-Action...
Box_mit_Pos1 (lpszPictureName, lpszObjectName,
"Bildfenster1", ”Motor.pdl");
20
20
Date: 04/22/14
File: SWINCC_09e.7
SIMATIC HMI
Siemens AG 2000. All rights reserved.©
SITRAIN Training for
Automation and Drives
Internal Functions: Example of Graphics 3/3
You can place dialog screen windows where you want them on the screen. To establish a
reference to the operated object, it is advantageous if the dialog box appears where it
is used. You can attain this positioning with the following steps:
- Scanning the properties of the operated object and the entire screen
- Scanning the size and stretching the dialog window
- Specifying the appearance location of the dialog window (to the right or left next
to the operated object)
These functions are combined in a standard function that can then be used from
any location (each screen and operating object).
Activate dialog box
Events/ Button/ Mouse/ Press left/ C action...
Box_mit_Pos2 (lpszPictureName, lpszObjectName,
”Bildfenster1", ”Motor.pdl");
Date: 04/22/14
File: SWINCC_09e.8
SIMATIC HMI
Siemens AG 2000. All rights reserved.©
SITRAIN Training for
Automation and Drives
Background Processing (Actions) with 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);
Date: 04/22/14
File: SWINCC_09e.9
SIMATIC HMI
Siemens AG 2000. All rights reserved.©
SITRAIN Training for
Automation and Drives
Example with Functions from DLLs
#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);
}
Events/ Button/ Mouse/ Press left/ C action...
Counting with the DLL function
Date: 04/22/14
File: SWINCC_09e.9
SIMATIC HMI
Siemens AG 2000. All rights reserved.©
SITRAIN Training for
Automation and Drives
Example with Functions from DLLs
#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);
}
Events/ Button/ Mouse/ Press left/ C action...
Counting with the DLL function

More Related Content

What's hot

E client server_wincc60engl
E client server_wincc60englE client server_wincc60engl
E client server_wincc60englconfidencial
 
E multiclient server_wincc60engl
E multiclient server_wincc60englE multiclient server_wincc60engl
E multiclient server_wincc60englconfidencial
 
Ae02 system projecthandling
Ae02 system projecthandlingAe02 system projecthandling
Ae02 system projecthandlingconfidencial
 
Ae04 system messages
Ae04 system messagesAe04 system messages
Ae04 system messagesconfidencial
 
Ae03 system graphics
Ae03 system graphicsAe03 system graphics
Ae03 system graphicsconfidencial
 
Ae11 system reporting
Ae11 system reportingAe11 system reporting
Ae11 system reportingconfidencial
 
Ae09 system storing_archives
Ae09 system storing_archivesAe09 system storing_archives
Ae09 system storing_archivesconfidencial
 
7 serv1 16_what's_next sa_courses_july 2012
7 serv1 16_what's_next sa_courses_july 20127 serv1 16_what's_next sa_courses_july 2012
7 serv1 16_what's_next sa_courses_july 2012James M. Njoroge
 
Ch1 1 v70_system_overview_en
Ch1 1 v70_system_overview_enCh1 1 v70_system_overview_en
Ch1 1 v70_system_overview_enconfidencial
 
Ch4 v70 system_configuration_en
Ch4 v70 system_configuration_enCh4 v70 system_configuration_en
Ch4 v70 system_configuration_enconfidencial
 
Ch3 v70 project_structure_en
Ch3 v70 project_structure_enCh3 v70 project_structure_en
Ch3 v70 project_structure_enconfidencial
 

What's hot (20)

A d swincc06e
A d swincc06eA d swincc06e
A d swincc06e
 
E client server_wincc60engl
E client server_wincc60englE client server_wincc60engl
E client server_wincc60engl
 
A d swincc02e
A d swincc02eA d swincc02e
A d swincc02e
 
A d swincc08e
A d swincc08eA d swincc08e
A d swincc08e
 
A d swincc10e
A d swincc10eA d swincc10e
A d swincc10e
 
E multiclient server_wincc60engl
E multiclient server_wincc60englE multiclient server_wincc60engl
E multiclient server_wincc60engl
 
Ae02 system projecthandling
Ae02 system projecthandlingAe02 system projecthandling
Ae02 system projecthandling
 
Ae04 system messages
Ae04 system messagesAe04 system messages
Ae04 system messages
 
Ae03 system graphics
Ae03 system graphicsAe03 system graphics
Ae03 system graphics
 
Ae11 system reporting
Ae11 system reportingAe11 system reporting
Ae11 system reporting
 
A d swincc03e
A d swincc03eA d swincc03e
A d swincc03e
 
Ae09 system storing_archives
Ae09 system storing_archivesAe09 system storing_archives
Ae09 system storing_archives
 
7 serv1 16_what's_next sa_courses_july 2012
7 serv1 16_what's_next sa_courses_july 20127 serv1 16_what's_next sa_courses_july 2012
7 serv1 16_what's_next sa_courses_july 2012
 
Label 15 english
Label 15 englishLabel 15 english
Label 15 english
 
Ch1 1 v70_system_overview_en
Ch1 1 v70_system_overview_enCh1 1 v70_system_overview_en
Ch1 1 v70_system_overview_en
 
20 what’s next
20 what’s next20 what’s next
20 what’s next
 
Ch4 v70 system_configuration_en
Ch4 v70 system_configuration_enCh4 v70 system_configuration_en
Ch4 v70 system_configuration_en
 
Ch8 v70 os_en
Ch8 v70 os_enCh8 v70 os_en
Ch8 v70 os_en
 
Ch3 v70 project_structure_en
Ch3 v70 project_structure_enCh3 v70 project_structure_en
Ch3 v70 project_structure_en
 
Scl 1e
Scl 1eScl 1e
Scl 1e
 

Viewers also liked

Fluxograma processo acucar_alcool_etanol_verde
Fluxograma processo acucar_alcool_etanol_verdeFluxograma processo acucar_alcool_etanol_verde
Fluxograma processo acucar_alcool_etanol_verdeconfidencial
 
Gea 01 - condicionamento e neutralização alcoólica
Gea  01 - condicionamento e neutralização alcoólicaGea  01 - condicionamento e neutralização alcoólica
Gea 01 - condicionamento e neutralização alcoólicaconfidencial
 
Ae06 system plc_jobs
Ae06 system plc_jobsAe06 system plc_jobs
Ae06 system plc_jobsconfidencial
 
Ae10 system scheduler
Ae10 system schedulerAe10 system scheduler
Ae10 system schedulerconfidencial
 
Simatic pdm guia de configuração de ofertas rev 2
Simatic pdm guia de configuração de ofertas   rev 2Simatic pdm guia de configuração de ofertas   rev 2
Simatic pdm guia de configuração de ofertas rev 2confidencial
 
DMC Siemens Automation Summit 2014 Presentation: Siemens Best Practices When ...
DMC Siemens Automation Summit 2014 Presentation: Siemens Best Practices When ...DMC Siemens Automation Summit 2014 Presentation: Siemens Best Practices When ...
DMC Siemens Automation Summit 2014 Presentation: Siemens Best Practices When ...DMC, Inc.
 
Gea 02 - biodiesel transesterificação
Gea   02 - biodiesel transesterificaçãoGea   02 - biodiesel transesterificação
Gea 02 - biodiesel transesterificaçãoconfidencial
 
Gea 17705-flux branq
Gea  17705-flux branqGea  17705-flux branq
Gea 17705-flux branqconfidencial
 
DMC Siemens Automation Summit 2014 Presentation: Getting the Most Out of WinC...
DMC Siemens Automation Summit 2014 Presentation: Getting the Most Out of WinC...DMC Siemens Automation Summit 2014 Presentation: Getting the Most Out of WinC...
DMC Siemens Automation Summit 2014 Presentation: Getting the Most Out of WinC...DMC, Inc.
 
Sitrains7 1200pwmpid-150301123045-conversion-gate01
Sitrains7 1200pwmpid-150301123045-conversion-gate01Sitrains7 1200pwmpid-150301123045-conversion-gate01
Sitrains7 1200pwmpid-150301123045-conversion-gate01confidencial
 

Viewers also liked (13)

Fluxograma processo acucar_alcool_etanol_verde
Fluxograma processo acucar_alcool_etanol_verdeFluxograma processo acucar_alcool_etanol_verde
Fluxograma processo acucar_alcool_etanol_verde
 
Gea 01 - condicionamento e neutralização alcoólica
Gea  01 - condicionamento e neutralização alcoólicaGea  01 - condicionamento e neutralização alcoólica
Gea 01 - condicionamento e neutralização alcoólica
 
Ae06 system plc_jobs
Ae06 system plc_jobsAe06 system plc_jobs
Ae06 system plc_jobs
 
Ae10 system scheduler
Ae10 system schedulerAe10 system scheduler
Ae10 system scheduler
 
Simatic pdm guia de configuração de ofertas rev 2
Simatic pdm guia de configuração de ofertas   rev 2Simatic pdm guia de configuração de ofertas   rev 2
Simatic pdm guia de configuração de ofertas rev 2
 
Teoria
TeoriaTeoria
Teoria
 
Aplicações
AplicaçõesAplicações
Aplicações
 
DMC Siemens Automation Summit 2014 Presentation: Siemens Best Practices When ...
DMC Siemens Automation Summit 2014 Presentation: Siemens Best Practices When ...DMC Siemens Automation Summit 2014 Presentation: Siemens Best Practices When ...
DMC Siemens Automation Summit 2014 Presentation: Siemens Best Practices When ...
 
Profibus pa
Profibus paProfibus pa
Profibus pa
 
Gea 02 - biodiesel transesterificação
Gea   02 - biodiesel transesterificaçãoGea   02 - biodiesel transesterificação
Gea 02 - biodiesel transesterificação
 
Gea 17705-flux branq
Gea  17705-flux branqGea  17705-flux branq
Gea 17705-flux branq
 
DMC Siemens Automation Summit 2014 Presentation: Getting the Most Out of WinC...
DMC Siemens Automation Summit 2014 Presentation: Getting the Most Out of WinC...DMC Siemens Automation Summit 2014 Presentation: Getting the Most Out of WinC...
DMC Siemens Automation Summit 2014 Presentation: Getting the Most Out of WinC...
 
Sitrains7 1200pwmpid-150301123045-conversion-gate01
Sitrains7 1200pwmpid-150301123045-conversion-gate01Sitrains7 1200pwmpid-150301123045-conversion-gate01
Sitrains7 1200pwmpid-150301123045-conversion-gate01
 

Similar to A d swincc09e

A d swincc09_globalescript_pt
A d swincc09_globalescript_ptA d swincc09_globalescript_pt
A d swincc09_globalescript_ptconfidencial
 
A d swincc03_create_project_pt
A d swincc03_create_project_ptA d swincc03_create_project_pt
A d swincc03_create_project_ptconfidencial
 
A d swincc08_reportdesigner_pt
A d swincc08_reportdesigner_ptA d swincc08_reportdesigner_pt
A d swincc08_reportdesigner_ptconfidencial
 
0001 funtion configuration_guide_no2_en
0001 funtion configuration_guide_no2_en0001 funtion configuration_guide_no2_en
0001 funtion configuration_guide_no2_enSrikanthPadi2
 
4 edicion bloques
4 edicion bloques4 edicion bloques
4 edicion bloquesFercho Oe
 
Siemens simatic simatic pcs 7 5
Siemens simatic simatic pcs 7   5Siemens simatic simatic pcs 7   5
Siemens simatic simatic pcs 7 5Dien Ha The
 
Ch3 v70 project_structure_en
Ch3 v70 project_structure_enCh3 v70 project_structure_en
Ch3 v70 project_structure_enconfidencial
 
Reducing boot time in embedded Linux
Reducing boot time in embedded LinuxReducing boot time in embedded Linux
Reducing boot time in embedded LinuxChris Simmonds
 
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 SiemensFelipeSchaefferFerna
 
Cloud in examples—(how to) benefit from modern technologies in the cloud
Cloud in examples—(how to) benefit from modern technologies in the cloudCloud in examples—(how to) benefit from modern technologies in the cloud
Cloud in examples—(how to) benefit from modern technologies in the cloudProfinit
 
Tool overview – how to capture – how to create basic workflow .pptx
Tool overview – how to capture – how to create basic workflow .pptxTool overview – how to capture – how to create basic workflow .pptx
Tool overview – how to capture – how to create basic workflow .pptxRUPAK BHATTACHARJEE
 
SIMCLOUD: Running Operational Simulators in the Cloud
SIMCLOUD: Running Operational Simulators in the CloudSIMCLOUD: Running Operational Simulators in the Cloud
SIMCLOUD: Running Operational Simulators in the CloudFinmeccanica
 
Siemens s7 300-400-working with step 7 v5.0
Siemens s7 300-400-working with step 7 v5.0Siemens s7 300-400-working with step 7 v5.0
Siemens s7 300-400-working with step 7 v5.0Dien Ha The
 
OpenMP for beginners
OpenMP for beginnersOpenMP for beginners
OpenMP for beginnersWoohyunKim16
 
Ch1 1 v70_system_overview_en
Ch1 1 v70_system_overview_enCh1 1 v70_system_overview_en
Ch1 1 v70_system_overview_enconfidencial
 
Webinar Presentation: "Diagnostic Flash Application with OTX"
Webinar Presentation: "Diagnostic Flash Application with OTX"Webinar Presentation: "Diagnostic Flash Application with OTX"
Webinar Presentation: "Diagnostic Flash Application with OTX"KPIT
 

Similar to A d swincc09e (20)

A d swincc09_globalescript_pt
A d swincc09_globalescript_ptA d swincc09_globalescript_pt
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_pt
 
A d swincc08_reportdesigner_pt
A d swincc08_reportdesigner_ptA d swincc08_reportdesigner_pt
A d swincc08_reportdesigner_pt
 
0001 funtion configuration_guide_no2_en
0001 funtion configuration_guide_no2_en0001 funtion configuration_guide_no2_en
0001 funtion configuration_guide_no2_en
 
4 edicion bloques
4 edicion bloques4 edicion bloques
4 edicion bloques
 
Readme
ReadmeReadme
Readme
 
Siemens simatic simatic pcs 7 5
Siemens simatic simatic pcs 7   5Siemens simatic simatic pcs 7   5
Siemens simatic simatic pcs 7 5
 
S7 bas-16
S7 bas-16S7 bas-16
S7 bas-16
 
Ch3 v70 project_structure_en
Ch3 v70 project_structure_enCh3 v70 project_structure_en
Ch3 v70 project_structure_en
 
Reducing boot time in embedded Linux
Reducing boot time in embedded LinuxReducing boot time in embedded Linux
Reducing boot time in embedded Linux
 
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
 
simulation
simulationsimulation
simulation
 
Cloud in examples—(how to) benefit from modern technologies in the cloud
Cloud in examples—(how to) benefit from modern technologies in the cloudCloud in examples—(how to) benefit from modern technologies in the cloud
Cloud in examples—(how to) benefit from modern technologies in the cloud
 
Processes
ProcessesProcesses
Processes
 
Tool overview – how to capture – how to create basic workflow .pptx
Tool overview – how to capture – how to create basic workflow .pptxTool overview – how to capture – how to create basic workflow .pptx
Tool overview – how to capture – how to create basic workflow .pptx
 
SIMCLOUD: Running Operational Simulators in the Cloud
SIMCLOUD: Running Operational Simulators in the CloudSIMCLOUD: Running Operational Simulators in the Cloud
SIMCLOUD: Running Operational Simulators in the Cloud
 
Siemens s7 300-400-working with step 7 v5.0
Siemens s7 300-400-working with step 7 v5.0Siemens s7 300-400-working with step 7 v5.0
Siemens s7 300-400-working with step 7 v5.0
 
OpenMP for beginners
OpenMP for beginnersOpenMP for beginners
OpenMP for beginners
 
Ch1 1 v70_system_overview_en
Ch1 1 v70_system_overview_enCh1 1 v70_system_overview_en
Ch1 1 v70_system_overview_en
 
Webinar Presentation: "Diagnostic Flash Application with OTX"
Webinar Presentation: "Diagnostic Flash Application with OTX"Webinar Presentation: "Diagnostic Flash Application with OTX"
Webinar Presentation: "Diagnostic Flash Application with OTX"
 

More from confidencial

19 exercises v1.00_en
19 exercises v1.00_en19 exercises v1.00_en
19 exercises v1.00_enconfidencial
 
18 syntax rules v1.0
18 syntax rules v1.018 syntax rules v1.0
18 syntax rules v1.0confidencial
 
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_enconfidencial
 
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_enconfidencial
 
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_enconfidencial
 
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_enconfidencial
 
12 archiving system v1.00_en
12 archiving system v1.00_en12 archiving system v1.00_en
12 archiving system v1.00_enconfidencial
 
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_enconfidencial
 
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_enconfidencial
 
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_enconfidencial
 
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_enconfidencial
 
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_enconfidencial
 
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_enconfidencial
 
05 project setup v1.00_en
05 project setup v1.00_en05 project setup v1.00_en
05 project setup v1.00_enconfidencial
 
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_enconfidencial
 
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 enconfidencial
 
01 introduction v1.00_en
01 introduction v1.00_en01 introduction v1.00_en
01 introduction v1.00_enconfidencial
 
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 enconfidencial
 
01tiaportal handson-basicov11v2-140421084257-phpapp01
01tiaportal handson-basicov11v2-140421084257-phpapp0101tiaportal handson-basicov11v2-140421084257-phpapp01
01tiaportal handson-basicov11v2-140421084257-phpapp01confidencial
 
Sitrain introdução a ihm
Sitrain introdução a ihmSitrain introdução a ihm
Sitrain introdução a ihmconfidencial
 

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
 
01tiaportal handson-basicov11v2-140421084257-phpapp01
01tiaportal handson-basicov11v2-140421084257-phpapp0101tiaportal handson-basicov11v2-140421084257-phpapp01
01tiaportal handson-basicov11v2-140421084257-phpapp01
 
Sitrain introdução a ihm
Sitrain introdução a ihmSitrain introdução a ihm
Sitrain introdução a ihm
 

Recently uploaded

Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfsumitt6_25730773
 
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...vershagrag
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...jabtakhaidam7
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxMuhammadAsimMuhammad6
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptxrouholahahmadi9876
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...Amil baba
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxpritamlangde
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 

Recently uploaded (20)

Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdf
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 

A d swincc09e

  • 1. Date: 04/22/14 File: SWINCC_09e.1 SIMATIC HMI Siemens AG 2000. All rights reserved.© SITRAIN Training for Automation and Drives Background Processing (Global Script)
  • 2. Date: 04/22/14 File: SWINCC_09e.2 SIMATIC HMI Siemens AG 2000. All rights reserved.© SITRAIN Training for Automation and Drives Objectives - Project Functions - Standard Functions - Internal Functions - Project-wide Actions
  • 3. Date: 04/22/14 File: SWINCC_09e.3 SIMATIC HMI Siemens AG 2000. All rights reserved.© SITRAIN Training for Automation and Drives Global Script Output field for: -Search files -Compile All Functions Project functions Standard functions Internal functions Actions
  • 4. Date: 04/22/14 File: SWINCC_09e.4 SIMATIC HMI Siemens AG 2000. All rights reserved.© SITRAIN Training for Automation and Drives Example of a Project Function and/or Standard Function void BitSet(BOOL OnOff, char* lpszWordtag, WORD wbitnumber) { WORD winput = 0; // Create local tags int iscreen = 1; winput = GetTagWord ( lpszWordtag ) ; // Read process tags iscreen <<= ( wbitnumber ); // Create bit mask if (OnOff == 0 ) { // Reset bit ? winput = (WORD) ( winput & (~iscreen) ); // Reset bit } else { winput = (WORD) ( winput | iscreen ); // Set bit } SetTagWord ( lpszWordtag, winput); // Rewrite process tag } Switching on a motor: Events/ Mouse/ Left mouse button/ C function... BitSet ( 1, "MotorStatus", 2); /*Bit 2 is set in the “MotorStatus” tag, to reset the bit use: BitSet ( 0, “MotorStatus”, 2)*/ A function defined in the Global Script (Standard Functions: 0
  • 5. Date: 04/22/14 File: SWINCC_09e.5 SIMATIC HMI Siemens AG 2000. All rights reserved.© SITRAIN Training for Automation and Drives Internal Functions: Example of Graphics 1/3
  • 6. Date: 04/22/14 File: SWINCC_09e.6 SIMATIC HMI Siemens AG 2000. All rights reserved.© SITRAIN Training for Automation and Drives Internal Functions: Example of Graphics 2/3 Activate dialog box Event/ Button/ Mouse/ Press left/ C-Action... Box_mit_Pos1 (lpszPictureName, lpszObjectName, "Bildfenster1", ”Motor.pdl"); 20 20
  • 7. Date: 04/22/14 File: SWINCC_09e.7 SIMATIC HMI Siemens AG 2000. All rights reserved.© SITRAIN Training for Automation and Drives Internal Functions: Example of Graphics 3/3 You can place dialog screen windows where you want them on the screen. To establish a reference to the operated object, it is advantageous if the dialog box appears where it is used. You can attain this positioning with the following steps: - Scanning the properties of the operated object and the entire screen - Scanning the size and stretching the dialog window - Specifying the appearance location of the dialog window (to the right or left next to the operated object) These functions are combined in a standard function that can then be used from any location (each screen and operating object). Activate dialog box Events/ Button/ Mouse/ Press left/ C action... Box_mit_Pos2 (lpszPictureName, lpszObjectName, ”Bildfenster1", ”Motor.pdl");
  • 8. Date: 04/22/14 File: SWINCC_09e.8 SIMATIC HMI Siemens AG 2000. All rights reserved.© SITRAIN Training for Automation and Drives Background Processing (Actions) with 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);
  • 9. Date: 04/22/14 File: SWINCC_09e.9 SIMATIC HMI Siemens AG 2000. All rights reserved.© SITRAIN Training for Automation and Drives Example with Functions from DLLs #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); } Events/ Button/ Mouse/ Press left/ C action... Counting with the DLL function
  • 10. Date: 04/22/14 File: SWINCC_09e.9 SIMATIC HMI Siemens AG 2000. All rights reserved.© SITRAIN Training for Automation and Drives Example with Functions from DLLs #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); } Events/ Button/ Mouse/ Press left/ C action... Counting with the DLL function

Editor's Notes

  1. ContentsPage Background Processing (Global Script)............................................................................................1 Objectives........................................................................................................................................2 Global Script......................................................................................................................................3 Example of a Project Function and/or a Standard Function............................................................4 Internal Functions: Example of Graphics 1/3.....................................................................................5 Internal Functions: Example of Graphics 2/3.....................................................................................6 Internal Functions: Example of Graphics 3/3.....................................................................................7 Background Processing (Actions) with Global Script........................................................................8 Example with Functions from DLLs.................................................................................................9
  2. General InformationGlobal Script is the general term for C functions and actions. There is a series of C functions available for programming extensive actions in WinCC. These C functions are divided into groups and can be used both in the Graphics Designer as well as to a certain extent in Global Script. Project FunctionsAll project-specific functions are combined under this header. The functions are applicable within the project (function library). Standard FunctionsThis is where functions are located that can be used for more than one project. Pre-defined functions are present that can be expanded by your functions. Internal FunctionsThe system provides the functions listed here. The user can not change the internal functions. These functions contain all basic functions necessary for processing WinCC objects. These functions also include all the functions in the C standard library. There is a subdivision into:- alarmFunctions for receiving and processing individual messages. - allocateFunctions for dynamic memory management (required if the returnvalue is a character string, for example)- c_bibStandard C library functions - graphicsFunctions for reading and manipulating object propertiesof individual WinCC objects - tagFunctions for reading and writing tags from the data manager - winccFunctions for influencing the individual WinCC Runtimecomponents ActionsActions are available only in the Global Script. This is where actions are defined that run in the background and are not connected directly with the selected WinCC object (screen, screen window, graphic object, etc.).
  3. TaskA bit is to be reset in a data word. This function is to be stored centrally, because it is a function that is frequently used. This central storage can be either project-specific (project functions) or for more than one project (standard functions). ProcedureThe function is created in Global Script after the method of functioning and the parameters to be transferred have been clarified. After the function has been saved in the project functions or standard functions, it can be used in the Graphics Designer at various locations and with various parameters. (Functions you write yourself can not be used in Global Script.)The advantage of central storage is how easy it is to make changes and to maintain the function. Changes only have to be carried out at one location and are immediately available at all call-up locations (as long as the transfer parameters do not change). Parameters are transferred in the C syntax. Function CallThe call of the function named above has the following appearance in the Graphics Designer.For example, Setting Bit 2 in a word: Events/ mouse/ left mouse button/ C function...BitSet ( 1, &amp;quot;MotorStatus&amp;quot;, 2);This sets Bit 2 in the &amp;quot;MotorStatus&amp;quot; tag. To reset the bit, you have to call the same function with the paramaters: BitSet ( 0, &amp;quot;MotorStatus&amp;quot;, 2);
  4. GeneralYou can find functions for reading (Get) and manipulating (Set) object Information properties of individual WinCC objects under the internal Graphics functions. The functions are divided according to the object properties groups. Some functions can be used only with certain objects.- StyleStyles (for example, line end and line weight)- FlashFlash (for example, background flashing color and flashing frequency)- FillFill (yes/no and fill level)- FontFont (for example, font, orientation, and writing style)- AxesAxes (only for bar graphs: axis labeling and axis division)- ColorColors (for example, foreground color and border color)- I_OInput/output (only for I/O fields: output values and input values)- GeometryGeometry (for example, polygon corners and X-Y coordinates)- LimitsLimits (only for bar graphs and I/O fields: various limit values, etc.)- MiscMiscellaneous (for example, border adaptation, screen name, and visibility) ExampleA dialog box from which various buttons can be operated is to be called in one screen. Example 1 shows the basic function for positioning and outputting the dialog box.The function is expanded somewhat in Example 2, so that the box can always be output at the lower right corner of the button to permit easier assignment to the operated element. ProcedureThe geometry functions help to determine the button position. Then there is a check to determine whether the box fits to the right of and below the button. If this is not the case, then the box is output to the left of the button and above the lower screen edge. SetPictureName and SetVisible functions carry out theoutput.
  5. ExampleHere you see the functions necessary for outputting the dialog box at a certain location on the screen. The function contains four transfer parameters.- lpszPictureNameScreen name for the current screen- lpszObjectNameName of the operated object- lpszBScreenNameName of the configured screen window- lpszBoxNameName of the screen to be output in the specified screen windowThe value for the left, upper corner of the dialog box must first be permanently specified in the present example. Function Definitionvoid Box_with_Pos1(char* lpszPictureName, char* lpszObjectName, char* lpszBScreenName, char* lpszBoxName){ Tag Declarationint BScreenXPos, BScreenYPos; BScreenXPos = 20;BScreenYPos = 20; Outputting the BoxSetLeft( lpszPictureName, lpszBScreenName, BScreenXPos);SetTop( lpszPictureName, lpszBScreenName, BScreenYPos);SetPictureName( lpszPictureName, lpszBScreenName, lpszBoxName);SetVisible( lpszPictureName, lpszBScreenName, 1);} NoteThere is a function that determines the position of the operated object and outputs the dialog box on the lower, right corner of the operated object on the next page
  6. Function Definitionvoid Box_mit_Pos2(char* lpszPictureName, char* lpszObjectName, char* lpszBScreenrName, char* lpszBoxName){ Tag Declarationint ButtonXPos, ButtonYPos, ButtonWidth, ButtonHeight;int ScreenWidth, ScreenHeight;int BScreenXPos, BScreenYPos, BScreenWidth, BScreenHeight;int XInterval=0, YInterval=0; Fetching CurrentButtonXPos = GetLeft(lpszPictureName,lpszObjectName); DataButtonYPos = GetTop(lpszPictureName,lpszObjectName);ButtonWidth = GetWidth(lpszPictureName,lpszObjectName);ButtonHeight = GetHeight(lpszPictureName,lpszObjectName);ScreenWidth = GetWidth(lpszPictureName,NULL);ScreenHeight = GetHeight(lpszPictureName,NULL);BScreenWidth = GetWidth(lpszPictureName,lpszBWindowName);BWindowHeight = GetHeight(lpszPictureName,lpszBWindowName); Output DataBScreenXPos = ButtonXPos + ButtonWidth + XInterval;BWindowYPos = ButtonYPos + ButtonHeight + YInterval;if ((BScreenXPos + BScreenWidth) &amp;gt; ScreenWidth) {BScreenXPos = ButtonXPos - BScreenWidth - XInterval;}if ((BScreenYPos + BScreenHeight) &amp;gt; ScreenHeight) {BScreenYPos = ScreenHeight - BScreenHeight;} Outputting the BoxSetLeft(lpszPictureName,lpszBScreenName,BScreenXPos);SetTop(lpszPictureName,lpszBScreenName,BScreenYPos);SetPictureName(lpszPictureName,lpszBScreenName,lpszBoxName);SetVisible(lpszPictureName,lpszBScreenName,1);}
  7. GeneralYou have a Project-wide ActionSystem (PAS) available in WinCC for actions Informationindependent of the screen. These actions run in the background and can be started cyclically (time trigger), acyclically (at a certain time), or even dependent on an event (tag). These actions serve to implement actions for an entire project. The individual actions are created in the Global Script Editor. ExampleAn operating hours counter is to be implemented as an example. If a certain drive or even system component is working, an internal counter is incremented, which records the minutes and hours. A minute trigger starts the action. A start bit makes it possible to record the operating hours separately from the WinCC Runtime and store it in assigned tags. Procedure1. Create internal tags in the data manager.2. Create an action in the Global Script Editor (for example, operating hours.PAS).3. Select Global Script Runtime in the startup list. 4. Activate the Runtime.
  8. GeneralAction programming from WinCC offers a multitude of generation possibilities. Information It is also possible to access external functions stored in DLLs, for example, within the C action. These DLLs can be both standard DLLs as well as function libraries you create yourself. Using a function from a DLL is especially recommended where extensive calculations must be carried out. Because the code is already stored in an executable way in the DLL and does not have to be interpreted at runtime, there is a significantly faster processing speed for extensive calculations. ExampleIn the example above, nothing more is done for the DLL function than processing a loop from a start value to an end value. The intermediate results are output in a diagnostics window. In a direct comparison, you do not see a significant time advantage in using DLL functions until there are very many operations. NoteTo create the DLL, you can use the Application Wizard from Visual C++, for example (MFC-AppWizard (dll)). All functions to be used are entered in this DLL and are declared as external &amp;quot;C.&amp;quot; In addition, each function must also be entered in the export table. FAQ solutionFAQ 830 1801 Question: How can I implement a selfmade DLL in WinCC in the correct way?