10/1/2015 5:34 PM | |
Joined: 9/23/2005 Last visit: 12/12/2024 Posts: 4366 Rating: (1457)
|
“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:
By clicking on button, text and values are logging in the script diagnostic tool (GSC). Printing data (text and values) on the script diagnostic tool (GSC) is the bases to a good development and maintenance of scripts.
Requirements: WinCC Professional V13 SP1.
Project with a minimum configuration (stop button, tags, etc. “WinCC Professional V13 SP1 – Simple Sample: Invert Bit https://support.industry.siemens.com/tf/br/en/posts/135044/).
Configuration main steps: VB Script print text
Open a screen Place a GSC Diagnostic (Controls → Print job / Script diagnostic) Place a button
Sub OnClick(ByVal item)
HMIRuntime.Trace "This is a test"
End Sub
VB Script print a new line
Sub OnClick(ByVal item)
HMIRuntime.Trace vbNewLine
End Sub
VB Script print a Tag Value
Sub OnClick(ByVal item)
Dim MyAuxObj Set MyAuxObj = HMIRuntime.Tags("HMI_Tag_1") MyAuxObj.Read
HMIRuntime.Trace MyAuxObj.Value
End Sub
C Script print text
Open a screen Place a GSC Diagnostic (Controls → Print job / Script diagnostic) Place a button
#include "GlobalDefinitions.h" void OnClick(char* screenName, char* objectName, char* propertyName) { //Insert the code starting here
printf("This is a test"); }
C Script print a new line
#include "GlobalDefinitions.h" void OnClick(char* screenName, char* objectName, char* propertyName) { //Insert the code starting here
printf("\r\n"); }
C Script print a Tag Value
#include "GlobalDefinitions.h" void OnClick(char* screenName, char* objectName, char* propertyName) {
short int MyAuxTag; MyAuxTag = GetTagSWord ("HMI_Tag_1"); printf ("%d", MyAuxTag);
}
References: Manual WinCC Professional V13.0 https://support.industry.siemens.com/cs/br/pt/view/92323076/en
Online helps system WinCC Professional V13.0 SP1 https://support.industry.siemens.com/cs/br/pt/view/109096785/en
FAQ Which VBS information and VBS programming tools are there in WinCC (TIA Portal)? https://support.industry.siemens.com/cs/br/pt/view/59885894/en
Tips and tricks for creating scripts in WinCC (TIA Portal) https://support.industry.siemens.com/cs/br/pt/view/57132412/en
Project: As project.zip
AttachmentProject.zip (320 Downloads) |
Denilson Pegaia |
|
This contribution was helpful to1 thankful Users |
Follow us on