Entry type: Manual, Entry ID: 109755216, Entry date: 11/21/2018
SIMATIC WinCC WinCC Engineering V15.1 - Programming reference
|Document:||WinCC Engineering V15.1 - Programming reference (10/2018, English)|
|Type of topic:||Function|
A list of SmartTag objects which represent all of the tags in WinCC Runtime.
The SmartTags list has a limited range of functions. You can only use the tag names to access a SmartTag object. Access via the index or by using "For each" instruction is not supported.
In order to access a tag, which has still not been created in the project, using the SmartTags list, no value is returned. Assignment to a non-existing tag is not executed:
"intVar" remains empty when the "FillLevel" tag has not been created.
Current system behavior for dynamic access to elements of a user data type
When you compose the tag name of a user data type element dynamically in Runtime, the composed tag name is not recognized under the following condition:
You have configured a user data type "Motor" with the elements "RPM" (Int), "On" (Bool) and "Off" (Bool). In the project, you have configured the tag "Motor1" as instance of the user data type. You want to output the values of the elements in only one I/O field in runtime. You have configured an additional I/O field for input of the element name. The value you enter is saved to the internal tag strElementName. With the following script you output the value of an element in the I/O field "IOFieldOutputValue":
Dim strDynElementName, objIOFieldOutputValue
Set objIOFieldOutputValue = objscreen.ScreenItems("IOFieldOutput")
'Get element name from tag value
strDynElementName = SmartTags("strElementName").Value
'Create tag name
objIOFieldOutputValue.ProcessValue = SmartTags("Motor1."+strDynElementName).Value
Configure a separate I/O field for each user data type element, for example, in an additional screen. Interconnect the "process value" with the respective user data type element.
Use the following syntax to access a tag that is connected at a faceplate interface ("Properties"):
Use the SmartTags list to return a SmartTag object. Use the tag name to reference the SmartTag object.
'Writes tag value to local tag and returns a user-defined text through the operating system channel for debug alarms.
strAirPressure = "Current air pressure: " + CStr(SmartTags("AirPressure"))
In Runtime Advanced and Panels you address the tag directly using its name. If the tag name corresponds to the VBS name conventions, you do not need to use the SmartTags list. Follow the example below:
strAirPressure = "Current air pressure: " + CStr(AirPressure)