OPC Studio User's Guide and Reference
IsOptional Property (DataField)



OpcLabs.BaseLib Assembly > OpcLabs.BaseLib.DataTypeModel Namespace > DataField Class : IsOptional Property
Determines whether the field may be omitted from the encoded data.
Syntax
'Declaration
 
<DataMemberAttribute()>
<DefaultValueAttribute(False)>
Public Property IsOptional As Boolean
'Usage
 
Dim instance As DataField
Dim value As Boolean
 
instance.IsOptional = value
 
value = instance.IsOptional
[DataMember()]
[DefaultValue(false)]
public bool IsOptional {get; set;}
[DataMember()]
[DefaultValue(false)]
public:
property bool IsOptional {
   bool get();
   void set (    bool value);
}
Remarks
Whether the field is encoded may depend on other factors, such as the value of a switch field.
Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also