You are on page 1of 2

8/8/22, 10:21 AM WinCC V7.

3 – Simple Sample: calling a script by a tag change - Entries - Forum - Industry Support - Siemens

WinCC V7.3 – Simple Sample: calling a script by a tag change

Created by: Denilson Pegaia at: 10/1/2015 8:02 PM (0 Replies)


Rating (1)
Thanks 2

Actions New post

1 Entries

10/1/2015 8:02 PM Rate (1)


Denilson Pegaia “Simple
Samples” are small projects that demonstrate simple features.
The
target is give a quick overview about the theme and be used as start
point for related discussions. Follow there are a short description
and the
configuration main steps.

Description:

Platinum Member
By
changing a value of a tag (HMI_Tag_1), a script will be called and
increment the value of a second tag (HMI_Tag_2).

WinCC
could call scripts triggered by time or by Tag change. It makes
Joined: 9/23/2005 possible, for example, to call a script (indirectly) by a PLC
command.
Last visit: 8/5/2022
Posts: 4113
Requirements:
Rating:
WinCC V7.3.
(1295)
Project with a minimum
configuration (stop button, tags, etc.).

Configuration
main steps:

Create
a project.
Activate
Global Script Runtime (WinCC Explorer → Project →
Computer →
Properties → Properties → Stratup)
Create
two tags (“HMI_Tag_1” and “HMI_Tag_2” both as “Signed
16-
bit value” - WinCC Explorer → Tag Management)
Create
a Action (WinCC Explorer → Global Script → VBS Editor →
Open →
File → New → Action)
Create
a script as follow:
Option
Explicit
Function
action
Dim
aaa
Set
aaa = HMIRuntime.Tags("HMI_Tag_2")
aaa.Read
aaa.Value
= aaa.Value + 1
aaa.Write

End
Function

Configure
the action's trigger to “HMI_Tag_1” (Menu → Tools → info
/
trigger → tab trigger → select Ta → Add → Tag Name =
“HMI_Tag_1”)
Create
a Picture
Insert
a I/O Field (Smart Objects).
Link
the I/O Field with “HMI_Tag_1” (Right mouse click →
Configuration Dialog → Tag = “HMI_Tag_1”)
Insert
a I/O Field (Smart Objects).
Link
the I/O Field with “HMI_Tag_2” (Right mouse click →
Configuration Dialog → Tag = “HMI_Tag_2”)

Thanks:
Thanks
to the Siemens United States Technical Support (in special Mr.
David
Crockett) for the Help with this TIP.

References:
Portal
SIMATIC WinCC in Online
Support
https://support.industry.siemens.com/cs/br/pt/view/93906404/en

Manual
WinCC V7.3: Working with
WinCC
https://support.industry.siemens.com/cs/ww/en/view/102754925

https://support.industry.siemens.com/forum/ww/en/posts/wincc-v7-3-simple-sample-calling-a-script-by-a-tag-change/135065/?page=0&pageSize=10 1/2
8/8/22, 10:21 AM WinCC V7.3 – Simple Sample: calling a script by a tag change - Entries - Forum - Industry Support - Siemens
10/1/2015 8:02 PM Rate (1)
WinCC V7.3 Scripting:
VBS, ANSI-C, VBA
https://support.industry.siemens.com/cs/ww/en/view/102777678

Application and tools


Demo projects for SIMATIC
WinCC V7.3
https://support.industry.siemens.com/cs/br/pt/view/93148272/en

Example Blocks for WinCC


V7 and STEP 7 V5 (for S7-300 with SCL and
S7-400 with CFC, SCL)
https://support.industry.siemens.com/cs/br/pt/view/68679830/en

Example blocks for WinCC


V7 and STEP 7 (TIA Portal) (for S7-1200 and
S7-1500 in SCL)
https://support.industry.siemens.com/cs/br/pt/view/31624179/en

Project:
Due a size / format
restrictions, the project are first compacted with 7z
format
(project.z7) and after that attached to a zip archive (data.zip).

Attachment
Data.zip (456 Downloads)

Denilson Pegaia
Siemens Industry Sector
Technical Support

Suggestion To thank Answer Quote  


This contribution was helpful to
Zamper Shahma

1 Entries

 
© Siemens AG 2009-2022 - Corporate Information | Privacy Policy | Cookie policy | Terms Of Use | Digital ID | Forum Terms

https://support.industry.siemens.com/forum/ww/en/posts/wincc-v7-3-simple-sample-calling-a-script-by-a-tag-change/135065/?page=0&pageSize=10 2/2

You might also like