Professional Documents
Culture Documents
3 – Simple Sample: calling a script by a tag change - Entries - Forum - Industry Support - Siemens
1 Entries
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
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
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