9.3 Tag Functions

From SysCAD Documentation
Jump to navigation Jump to search

Navigation: PGMs

PGM Main Page Defining a Class Defining a Function Tag Functions Mathematical Functions Defining a Subroutine
Example PGM Files Predefined Classes Predefined Functions Tag Functions (9.3) String Functions Trigger Subroutines

Introduction

The following functions for getting and setting flowsheet tags are supported by the PGM Language in SysCAD 9.3. For SysCAD 9.2 format, please see Tag Functions

Get a Tag from SysCAD

The user may use the following syntax when fetching a tag from SysCAD:

variable = ["full tag"]
  • full tag: refer to Tags for the correct tag syntax. The tag must be in quotes. It may optionally include the conversions units.
  • variable: this should be of the same data type as the value that is to be returned. Both numerical and string data types are allowed with this function.
  • This syntax is used for fetching both numerical and string type tags.

If the user does not want to use the actual SysCAD tag, but rather a String variable containing a tag or string function returning a tag, then the Syntax is similar:

variable = [StringVariable]

(Previously in SysCAD 9.2 the user would use the following syntax: GetTag, GetDynTag and GetDynStrTag. These commands still work in SysCAD 9.3 and hence users will not need to rewrite their code when upgrading to 9.3)

Example:

Real      Flow_Split
Real      Pressure_1@("P", "kPag")
Real      Pressure_2@("P", "kPag")
String    MyTag, UnitTag, Condition@

Flow_Split = ["X_001.GM.IOs.[P_001].Split (%)"]
Pressure_1 = ["XPG_001.P_Reqd (kPag)"]

MyTag      = "X_001.GM.IOs.[P_001].Split (%)"
Flow_Split = [MyTag]
UnitTag    = "X_001"
Pressure_2 = [Concatenate(UnitTag, ".OperatingP.Result (kPag)")]
Condition  = ["PlantModel.StateDesc"]       ;Use the same syntax when the tag being fetched is a string variable
$

Set a Tag in SysCAD

The user may use the following syntax when setting a tag in SysCAD:

Setting a numerical tag:

["full tag"] = variable

Setting a numerical tag using a String variable containing a tag:

[StringVariable] = variable

Setting a string tag:

[str "full tag"] = String variable
  • full tag: refer to Tags for the correct tag syntax. The tag must be in quotes. It may optionally include the conversions units.
  • variable: this should be of the same data type as the value that is to be returned. Both numerical and string data types are allowed with this function.
  • When using string variables, the user MUST include a 'str' or 'string' before the tag, as shown above and in the example below.

(Previously in SysCAD 9.2 the user would use the following syntax: SetTag, SetDynTag and SetDynStrTag)

Example:

String MyTag, CtrlOutputTag
 
["X_001.GM.IOs.[P_001].Split (%)"] = 10
["XPG_001.P_Reqd (kPag)"] = 500

CtrlOutputTag = "FUEL.QmReqd (t/h)" 
[str"FUEL_ADDITION_PID.Cfg.[0].Output_Tag"] = CtrlOutputTag

MyTag = "X_001.GM.IOs.[P_001].Split (%)"
[MyTag] = 10