Set

Writes a value to a tag.
Use this command to set a percentage for a tag can only be done with HMI tags. Percentage calculations require maximum and minimum values, so you cannot set a percentage value for controller tags because they do not have minimum and maximum properties.
Syntax
Set [&] Set [/V] <
tag_name
> <
value
|
tag
>
where
[&]
forces the command to be evaluated asynchronously, which can dramatically improve the performance of tag writes.
[/V]
performs read-back verify on the write. It provides an extra level of security by performing a read immediately after the write to verify that the value was actually altered in the programmable controller or OPC server. This option is useful if the communications network is in poor condition, or susceptible to noise interference. If the verification fails, the error message is sent to the Factory Diagnostics system.
<tag_name>
is a relative or absolute reference to the tag whose value will be set.
<value
|
tag>
is a value and tag to set.
Value
Description
For analog tags
  • Numeric value within the range specified by the tag's minimum and maximum values.
  • Percentage of the total min/max range. A tag must expose High EU (maximum) and Low EU (minimum) properties for a percentage to be used. The formula is:
    value = min + percentage/100 * (max - min)
  • Tag name of another analog or digital tag.
For digital tags
  • Numeric value zero (0) or one (1).
  • Tag's on or off label specified in the tag database. Setting a digital tag to its on label will write the value one (1) to the programmable controller, and setting to its off label will write the value zero (0). A tag must expose Contact Closed Label (on label) and Contact Open Label (off label) properties for this command to work.
  • Tag name of another digital or analog tag. If it is an analog tag with a value that is not 0, the value 1 is written to the digital tag, otherwise the value 0 is written.
For string tags
  • A string enclosed in quotation marks. The string can contain any character, as well as spaces.
  • Tag name of another string tag.
Remarks
This command is run locally on the HMI server,
FactoryTalk View SE
Client, or
FactoryTalk View Studio
that issued it.
Enclose tag names that contain dashes or begin with a number, in curly brackets
{ }
when you use them in an expression. This distinguishes the characters in the tag name from the characters in an expression.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal