Set
| Description: |
Set tag value. Set is somewhat different from other functions in this reference. Set is a submodule that is a part of every tag that is able to write a value. It is included in the general function reference only for ease of discovery. |
| Warning: | Use only when a standard VTScada widget is not available for your custom code. |
| Returns: | Nothing |
Usage: ![]() |
Script Only. |
| Related to: | OkToWrite |
Format: ![]() |
TabObject.Set(NewVal) |
| Parameters: |
| NewVal |
| The value to write to the tag. |
| Comments: |
As a general practice, you should use the existing VTScada widgets to create control objects on your pages. But, there may be times when you need a custom button or other control that will write a value to a linked tag. For this, you can use Set. |
Example:
If WinButton(232, 148, 412, 100,
0 { normal appearance },
Concat("Press Me ", ButtonPresses) { label },
1 { focus id enables button },
0 { default system font },
ToggleVal { monitor state});
[
{ Write 1 to the relevant tag. }
MyTag.Set(1);
]
