Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

PI Manual Logger

DigCode

  • Last UpdatedNov 22, 2022
  • 3 minute read

Syntax

DigCode(DigitalState, [TagName])

Arguments

Argument

Data Type

Description

DigitalState

String

The name of any tour digital state in the current tour. The digital state must be surrounded by double or single quotes.

TagName

String

Optional argument. A digital tag name included within the tour that belongs to the user-defined digital state set to which the DigitalState argument belongs. The tag name must be surrounded by double or single quotes.

TagName is not required when the DigitalState argument is a SYSTEM digital state that is specifically included in the tour. TagName is required when the DigitalState argument is a digital state from a user-defined digital state set.

Returns

Returns the digital code for the digital state passed. If only one argument is passed, the digital state must be defined as part of the SYSTEM digital states for the tour. If a second argument is passed, the digital state must be one of the states for the tag passed as the second argument. The tag passed as the second argument must be a digital tag (PointType = "Digital").

Examples

  • Example 1

    DigCode("Unit Down")

  • This example returns the digital code for the tour digital state "Unit Down".

  • Example 2

    DigCode("Off", "PimlDigitalDemoTag")

  • This example returns the digital code for the Off digital state of the PimlDigitalDemoTag digital tag.

  • Example 3

    If(CurrentValue("T2002.ML") == DigCode("Manual", "DigitalModesTag"),Skip(), CollectNow())

  • or

    If(CurrentValue("T2002.ML") == DigCode("Manual","T2002.ML"), Skip(), CollectNow())

  • where T2002.ML and DigitalModesTag are digital tags included in the tour and are associated with the "Modes" digital state set that includes the "Manual" state.

  • Example 4

    If(CurrentValue("T1001.ML") == DigCode("Unit Down"), Skip(), CollectNow())

  • where "Unit Down" is a SYSTEM digital state that is included in the tour.

  • Note that typically the first tag in a group represents the status of the equipment. This can be a digital state, such as on/off, running/out of service, and so forth. If this status shows the equipment is off, no other tags need to be collected.

  • Assume the following tag and group structure in your tour, where R-200 is a group and T1001.ML, T1002.ML, and T1003.ML are tags within this group:

    • R-200

    • - T1001.ML

    • - T1002.ML

    • - T1003.ML

  • If the first tag in the group, T1001.ML, represents the status of the equipment for the whole group, then the above CMDE formula can be assigned at the group level, R-200. In this case, remember:

    • No CMDE is applied to the first tag, so T1001.ML is always due for collection.

    • If the tag T1001.ML is assigned the SYSTEM digital state ‘Unit Down’ during a tour run, then tags T1002.ML and T1003.ML will be skipped. Otherwise, they will be due for collection.

  • Another alternative is to create a subgroup, R-200a, within group R-200 such as:

    • R-200

    • T1001.ML

    • R-200a

    • - T1002.ML

    • - T1003.ML

  • where the above CMDE formula is assigned to subgroup R-200a. In this case, remember:

    • No CMDE is applied to the first tag, so T1001.ML is always due for collection.

    • If the tag T1001.ML is assigned the SYSTEM digital state ‘Unit Down’ during a tour run, then the tags within subgroup R-200a, which include T1002.ML and T1003.ML, will be skipped. Otherwise, they will be due for collection.

  • An additional alternative is to associate the CMDE formula with each tag within the group to which its collection status is dependent.

TitleResults for “How to create a CRG?”Also Available in