2/13/2024 12:48 PM | |
Joined: 8/3/2009 Last visit: 4/17/2025 Posts: 15311 Rating:
|
Hello nikolaj@automatio... Do not throw things at me but this is a system behaviour. Check the Manual: https://support.industry.siemens.com/cs/ww/en/view/109813306/109377913227 -------------- Note Current system behavior for dynamic access to elements of a user data typeWhen you compose the tag name of a user data type element dynamically in Runtime, the composed tag name isnotrecognized under the following condition:
Example: 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 Help: 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. --------- Bye Murof |
If this Information really helps, you could use the Rate function |
|
Follow us on