Date post: | 16-Apr-2017 |
Category: |
Technology |
Upload: | schneider-electric |
View: | 774 times |
Download: | 6 times |
Custom Properties in InduSoft Web Studio
January 2016
THANK YOU!Together, we are stronger!
15+ years of innovation, collaboration, evolution, and success!
Agenda
InduSoft (Fabio Terezinho)– Introduction – Description and Demos– Special Scenarios– Q&A
Introduction
Definition
Custom Properties (also known as Mnemonics) are place holders (aliases) that can configured to screen scripts, screen animations and objects properties.
Goal / Benefit
Custom Properties allows you to configure generic Symbols or generic screens, and assign values, tags, or expressions to their properties dynamically during the runtime. Therefore, you can re-use your “templates” of symbols and screens, improving productivity and enhancing overall consistency and quality.
Description and Demos
Syntax
#CustomPropertyName:CustomPropertyValue Where:
CustomPropertyName = Identifier (alias name) of the custom property.
CustomPropertyValue = Actual (default) value of the custom property. It can be a literal value (numeric or alphanumeric), a tag, or even an expression between parentheses. It can also be omitted (no default value), so there is no default value for the custom property, but its value can still be set dynamically during the runtime.
Runtime behavior
During the runtime, only the CustomPropertyValue is used and the remaining text from the aforementioned syntax is ignored. Examples:
Custom Property(full syntax)
Custom Property Name(alias used as identifier)
Custom Property Value(used during the runtime)
#MyNumValue:10 MyNumValue 10
#MyTextValue:”ABC” MyTextValue “ABC”
#MyTag:Second MyTag Second
#MyExpression:(Minute*10) MyExpression (Minute*10)
Applicability
Linked Symbols
Screens
$Open() built-in function
Pass Mnemonic values through the function:Syntax: $Open(ScreenName, X1, Y1, X2, Y2, Resize, ID, CustomPropertyList)Example: $Open("Popup", -1, -1, -1, -1, 0, 0, "#MyNumber:10 #MyText:""ABC""")
Pass Mnemonic values through an external file:Syntax: $Open(ScreenName, X1, Y1, X2, Y2, Resize, ID, FileName)Example: $Open("Popup", -1, -1, -1, -1, 0, 0, “MyMnemonic1")Remarks: The text file must be saved on the \Web sub-folder of the project, with the extension “.mne”. Each Custom Property must be configured in a different line of the file, as illustrated below:
Special Scenarios
Tag Fields
Replace Custom Property value partially using tag fields configured on the objects and animations.
Assume you have a screen where you configure the following syntaxes on different objects:
#MyTag:Minute#MyTag:Minute->Min#MyTag:Minute->Max#MyTag:Minute->Unit
$Open("MyScreen", -1, -1, -1, -1, 0, 0, "#MyCustomProperty:Second")
This function will replace values as indicated in the following table:
Custom Property configured on the objects and animations Custom Property passed by the built-in function $Open() Actual value executed during the
runtime#MyCustomProperty:Minute #MyCustomProperty:Second Second
#MyCustomProperty:Minute->Min #MyCustomProperty:Second Second->Min#MyCustomProperty:Minute->Max #MyCustomProperty:Second Second->Max#MyCustomProperty:Minute->Unit #MyCustomProperty:Second Second->Unit
Class Tags
Replace Custom Property value partially using class tags on the objects and animations
Assume you have a screen where you configure the following syntaxes on different objects:
#MyTag:MyTagA.MemberX#MyTag:MyTagA.MemberY#MyTag:MyTagA.MemberZ
$Open("MyScreen", -1, -1, -1, -1, 0, 0, "#MyCustomProperty:MyTagB")
This function will replace values as indicated in the following table:
Custom Property configured on the objects and animations
Custom Property passed by the built-in function $Open()
Actual value executed during the runtime
#MyCustomProperty:MyTagA.MemberX #MyCustomProperty:MyTagB MyTagB.MemberX#MyCustomProperty:MyTagA.MemberY #MyCustomProperty:MyTagB MyTagB.MemberX#MyCustomProperty:MyTagA.MemberZ #MyCustomProperty:MyTagB MyTagB.MemberX
Array Tags
Replace Custom Property value partially using array tags
Assume you have a screen where you configure the following syntaxes on different objects:
#MyTag:MyArray[1]#MyTag:MyArray[2]#MyTag:MyArray[3]
$Open("MyScreen", -1, -1, -1, -1, 0, 0, "#MyCustomProperty:NewArray")
This function will replace values as indicated in the following table:
Custom Property configured on the objects and animations
Custom Property passed by the built-in function $Open()
Actual value executed during the runtime
#MyCustomProperty:MyArray[1] #MyCustomProperty:NewArray NewArray[1]#MyCustomProperty:MyArray[2] #MyCustomProperty:NewArray NewArray[2]#MyCustomProperty:MyArray[3] #MyCustomProperty:NewArray NewArray[3]
Q&A
THANK YOU!