PIPutVal() and PIPutValX()
- Last UpdatedNov 21, 2022
- 2 minute read
- PI System
- PI DataLink 2023 SP1
- Visualization
Writes a value to the Data Archive server or PI AF server and returns a string that indicates the status.
-
Only use the PIPutVal and PIPutValX functions within Visual Basic for Applications (VBA). Do not enter these functions in the Excel formula bar. See Functions to write data.
-
In the current version of PI DataLink, there is no difference between the PIPutVal function and the PIPutValX function. In PI DataLink versions earlier than PI DataLink 2013, the PIPutVal function only supported three traditional PI point types: real, integer, and digital. In those versions of PI DataLink, the PIPutValX function added support for string points and subsecond time stamps.
Syntax
PIPutVal(DataItem, Value, TimeStamp, RootPath, OutCell)
PIPutValX(DataItem, Value, TimeStamp, RootPath, OutCell)
Arguments
|
Argument |
Type |
Description |
|---|---|---|
|
DataItem |
String |
The name of the PI point or PI AF attribute to which the function writes a value. |
|
Value |
Reference |
A reference to the cell that contains the value to be written, either a string or a number. |
|
TimeStamp |
String |
The time stamp for the value. See Time inputs. |
|
RootPath |
String |
The path to the data item. See Data items. |
|
OutCell |
Reference |
A reference to the cell where PI DataLink writes the string that macro function returns. The returned string varies:
|
Notes
The PIPutVal and PIPutValX functions cannot write to PI AF attributes that are configuration attributes. These functions can only write to a PI AF attribute for which the Configuration Item check box is not selected. You can check the status of the check box on the Attributes tab in PI System Explorer.
The PIPutVal and PIPutValX functions support all Data Archive data types. The functions interpret time stamps using client-machine time-zone information for Data Archive unless the PI Data Archive time zone setting is enabled.
The functions do not verify the user-specified range for a point before writing the value. The range is defined as zero to zero + span, where zero and span are point attributes specified during point creation. The function returns a Value Written string even if Over Range or Under Range is stored in Data Archive.