Learn WINCC-PCS7-SCRIPTS with Real Code Examples
Updated Nov 27, 2025
Code Sample Descriptions
1
WinCC VBScript Example
Dim temp
temp = HMIRuntime.Tags("Tank_Temperature").Read
If temp > 90 Then
HMIRuntime.Tags("HighTemp_Alarm").Write 1
Else
HMIRuntime.Tags("HighTemp_Alarm").Write 0
End If
Simple VBScript that checks a tag value and triggers an alarm if out of range.
2
C Script Example in WinCC
#include "apdefap.h"
void ToggleOutput()
{
float level;
GetTagFloat("Tank_Level", &level);
if(level > 75.0)
{
SetTagBit("Pump_On", 1);
}
else
{
SetTagBit("Pump_On", 0);
}
}
Internal C script in WinCC that toggles a digital output based on tag state.