Read function (for DVSYS object)
DVSYS.Read() reads the specified DeltaV parameter path and returns a RtValue object. This function immediately returns the read status, and if successful, both the read status and value. If the read is not successful, the function continues to be called until the parameter is successfully read, at which time the value of the read is also returned.
Because DVSYS.Read() immediately returns a value without blocking the execution of the script, it may likely return only a bad status on the initial function call, even though it is likely to return a good status once the parameter is successfully read.
Emerson recommends using DVSYS.Read() for scripts that run periodically, such as in timer and function animations, and where receiving a temporary result for the first update or two, until the correct data arrives, is sufficient.
For scripts that run only once and where a choice must be made based on available information in the DeltaV system, Emerson recommends using the DVSYS.ReadAsync().
- Arguments
- 1
- Return values (RtValue object)
-
- A number representing the status of the read attempt. 0 represents a successful read.
- The value read. The data type returned is determined by the
<read-as suffix>.
- Syntax
DVSYS.Read(path string)- Examples
-
Example Result let pv = DVSYS.Read("FIC101/PID1/PV.CV");A successful read: a status of 0, and the PV of FIC101's PID1 block. let actModeName = DVSYS.Read("FIC101/PID1/MODE.ACTUAL.STR");const x = DVSYS.Read('MOD1/SGGN1/OUT.CV').Status.Text const y = DVSYS.Read('MOD1/SGGN2/OUT.CV').Status.Text Dsp.Text1.Label = x Dsp.Text2.Label = yA successful read: a status of 0, and the OUT value of SGGN1 on the Text1 label and the OUT value of SGGN2 on the Text2 label.