Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PI Adapter Improvements #246

Merged
merged 40 commits into from
Jun 6, 2024
Merged

PI Adapter Improvements #246

merged 40 commits into from
Jun 6, 2024

Conversation

ritchiecarroll
Copy link
Member

@ritchiecarroll ritchiecarroll commented May 2, 2024

Added new SkipAnalogAlternateTagSync, defaults to true, i.e., use point-tag name instead. This is important since default analog alt-tag matches field device label, which not always desirable as a PI tag name.

Added ReplaceValues, defaults to false, i.e., do not replace duplicates,

See new and related properties below:

    /// <summary>
    /// Gets or sets flag that determines if tag synchronization should skip digitals when alternate tag
    /// field is being used.
    /// </summary>
    public bool SkipDigitalAlternateTagSync { get; set; }  /* default: true */

    /// <summary>
    /// Gets or sets flag that determines if tag synchronization should skip analogs when alternate tag
    /// field is being used.
    /// </summary>
    public bool SkipAnalogAlternateTagSync { get; set; }  /* default: true */

    /// <summary>
    /// Gets or sets the flag that determines if compression will be used during archiving when compression
    /// is configured for tag. If disabled, configured tag compression and ReplaceValues setting are ignored.
    /// </summary>
    public bool UseCompression { get; set; } /* default: true */

    /// <summary>
    /// Gets or sets flag that determines if existing PI values should be replaced when UseCompression
    /// is enabled.
    /// </summary>
    public bool ReplaceValues { get; set; } /* default: false */

    /// <summary>
    /// Gets or sets the PI AF value status to use when storing measurements that have been marked as having bad data.
    /// </summary>
    /// <remarks>
    /// This defaults to <see cref="AFValueStatus.Good"/> meaning values are stored with normal status quality in PI.
    /// </remarks>
    public AFValueStatus BadDataValueStatus { get; set; } /* default: AFValueStatus.Good */

    /// <summary>
    /// Gets or sets the PI AF value status to use when storing measurements that have been marked as having bad time.
    /// </summary>
    /// <remarks>
    /// This defaults to <see cref="AFValueStatus.Good"/> meaning values are stored with normal status quality in PI.
    /// </remarks>
    public AFValueStatus BadTimeValueStatus { get; set; } /* default: AFValueStatus.Good */

    /// <summary>
    /// Gets or sets the flag that determines if the descriptor state should be updated for existing tags.
    /// </summary>
    public bool UpdateExistingDescriptorState { get; set; }  /* default: true */

    /// <summary>
    /// Gets or sets the flag that determines if the compression enabled state should be added to tags if
    /// none already exists.
    /// </summary>
    public bool AddTagCompressionState { get; set; }  /* default: false */

    /// <summary>
    /// Gets or sets the defined compression deviations for data types used when AddTagCompressionState or
    /// UpdateExistingTagCompressionState is enabled. Use format "DataType=Deviation,DataType=Deviation,..."
    /// </summary>
    public string CompDevDataTypeMap { get; set; } /* default:
        IPHM=0.1,
        IPHA=0.001,
        VPHM=10,
        VPHA=0.001,
        FREQ=0.0001,
        DFDT=0.0001,
        ALOG=0.001,
        DIGI=0
        FLAG=0,
        ALRM=0,
        QUAL=0,
        *=0.001 */

    /// <summary>
    /// Gets or sets the defined value spans for data types used when AddTagCompressionState or 
    /// UpdateExistingTagCompressionState is enabled. Use format "DataType=Span,DataType=Span,...".
    /// </summary>
    public string SpanDataTypeMap { get; set; }  /* default:
        IPHM=100,
        IPHA=360,
        VPHM=750000,
        VPHA=360,
        FREQ=100,
        DFDT=100,
        ALOG=1000,
        DIGI=1,
        FLAG=1,
        ALRM=1,
        QUAL=1,
        *=100 */

    /// <summary>
    /// Gets or sets the defined step enabled for values for data types used when AddTagCompressionState or 
    /// UpdateExistingTagCompressionState is enabled. Use format "DataType=StepEnabled,DataType=StepEnabled,...". 
    /// </summary>
    public string StepEnabledDataTypeMap { get; set; }  /* default:
        IPHM=0,
        IPHA=0,
        VPHM=0,
        VPHA=0,
        FREQ=0,
        DFDT=0,
        ALOG=0,
        DIGI=1,
        FLAG=1,
        ALRM=1,
        QUAL=1,
        *=0 */

    /// <summary>
    /// Gets or sets the defined zero values for data types used when AddTagCompressionState or 
    /// UpdateExistingTagCompressionState is enabled. Use format "DataType=ZeroValue,DataType=ZeroValue,...".
    /// </summary>
    public string ZeroValueDataTypeMap { get; set; }  /* default:
        IPHM=0,
        IPHA=-180,
        VPHM=0,
        VPHA=-180,
        FREQ=0,
        DFDT=0,
        ALOG=-500,
        DIGI=0,
        FLAG=0,
        ALRM=0,
        QUAL=0,
        *=0 */

Added ArchiveFilterDataTypes which gets or sets the data types to archive. Value of * (or empty string) means all values archived, a value of DIGI means only archive digital values. Separate multiple values with a comma, for example: DIGI,VPHM,FREQ:

    /// <summary>
    /// Gets or sets the data types to archive. Value of <c>*</c> (or empty string) means all values archived,
    /// <c>DIGI</c> means only archive digital values. Separate multiple values with a comma, for example: 
    /// <c>DIGI,VPHM,FREQ</c>.
    /// </summary>
    public string ArchiveFilterDataTypes { get; set; }  /* default: "*" */

Added ArchiveOnChangeDataTypes which gets or sets the data types to only archive on data change. Empty string value means all values archived, '*' means archive all values on change, 'DIGI' means only archive digital values on change, Separate multiple values with a comma, for example: DIGI,VPHM,FREQ:

    /// <summary>
    /// Gets or sets the data types to only archive on change. Empty string value means all values archived,
    /// <c>*</c> means archive all values on change, <c>DIGI</c> means only archive digital values on
    /// change. Separate multiple values with a comma, for example: <c>DIGI,VPHM,FREQ</c>.
    /// </summary>
    public string ArchiveOnChangeDataTypes { get; set; }  /* default: "" */

The following properties are related to expanding status, quality and/or digital words into OSI PI digital state sets for compatibility with the IEEE C37.118 Interface for PI, which supports such features:

    /// <summary>
    /// Gets or sets flag that determines if IEEE C37.118 status bits should be expanded to tags.
    /// </summary>
    public bool ExpandStatusBitsToTags { get; set; } /* default: false */

    /// <summary>
    /// Gets or sets flag that determines if status word should be written to PI as a separate tag. Commonly
    /// disabled if IEEE C37.118 status bits are expanded to tags, see <see cref="ExpandStatusBitsToTags"/>.
    /// </summary>
    public bool WriteStatusWord { get; set; } /* default: true */

    /// <summary>
    /// Gets or sets flag that determines if IEEE C37.118 quality bits should be expanded to tags.
    /// </summary>
    public bool ExpandQualityBitsToTags { get; set; }  /* default: false */

    /// <summary>
    /// Gets or sets flag that determines if quality word should be written to PI as a separate tag. Commonly
    /// disabled if IEEE C37.118 quality bits are expanded to tags, see <see cref="ExpandQualityBitsToTags"/>.
    /// </summary>
    public bool WriteQualityWord { get; set; } /* default: true */

    /// <summary>
    /// Gets or sets the comma separated digital state set names for IEEE C37.118 status states. Specify digital
    /// state set name for each of the following digital states using value of 'X' (without quotes) as the name to
    /// indicate state is not mapped: CompositeQual, ConfigChange, ConnectState, DataSorting, DataValid,
    /// LeapSecond, NominalFreq, PMUError, SyncError, Timelock, TimeQuality, and Trigger. If specified digital
    /// set name does not exist, it will be created.
    /// </summary>
    public string IEEEC37118DigitalStates { get; set; } /* default:
        C37118_CompositeQual,C37118_ConfigChange,C37118_ConnectState,C37118_DataSorting,
        C37118_DataValid,C37118_LeapSecond,C37118_NominalFreq,C37118_PMUError,C37118_SyncError,
        C37118_Timelock,C37118_TimeQuality,C37118_Trigger */

    /// <summary>
    /// Gets or sets the semicolon separated tag naming expressions for IEEE C37.118 status states. Specify tag
    /// naming expression for each of the following digital states: CompositeQual, ConfigChange, ConnectState,
    /// DataSorting, DataValid, LeapSecond, NominalFreq, PMUError, SyncError, Timelock, TimeQuality, and
    /// Trigger.  Expression can be left blank if no digital state name is mapped for the corresponding state in
    /// <see cref="IEEEC37118DigitalStates"/>.
    /// </summary>
    public string IEEEC37118TagNameExpressions { get; set; } /* default: 
        {CompanyAcronym}_{DeviceAcronym}.COMPOSITE_QUAL;
        {CompanyAcronym}_{DeviceAcronym}.CONFIG_CHANGE;
        {CompanyAcronym}_{DeviceAcronym}.CONNECT_STATE;
        {CompanyAcronym}_{DeviceAcronym}.DATA_SORTING;
        {CompanyAcronym}_{DeviceAcronym}.DATA_VALID;
        {CompanyAcronym}_{DeviceAcronym}.LEAP_SECOND;
        {CompanyAcronym}_{DeviceAcronym}.NOMINAL_FREQ;
        {CompanyAcronym}_{DeviceAcronym}.PMU_ERROR;
        {CompanyAcronym}_{DeviceAcronym}.SYNC_ERROR;
        {CompanyAcronym}_{DeviceAcronym}.TIME_LOCK;
        {CompanyAcronym}_{DeviceAcronym}.TIME_QUALITY;
        {CompanyAcronym}_{DeviceAcronym}.TRIGGER */

    /// <summary>
    /// Gets or sets flag that determines if digital bits should be expanded to tags.
    /// </summary>
    public bool ExpandDigitalBitsToTags { get; set; }  /* default: false */

    /// <summary>
    /// Gets or sets flag that determines if digital word should be written to PI as a separate tag. Commonly
    /// disabled if digital bits are expanded to tags, see <see cref="ExpandDigitalBitsToTags"/>.
    /// </summary>
    public bool WriteDigitalWord { get; set; } /* default: true */

    /// <summary>
    /// Gets or sets pre-existing digital state set names mapped to a regular expression for matching digital labels. 
    /// Use format "DigitalStateName=Expression;DigitalStateName=Expression;...". Use "*" for default expression.
    /// </summary>
    public string DigitalBitStateExpressionMap { get; set; } /* default: "" */

    /// <summary>
    /// Gets or sets the semicolon separated digital state set name to tag name expression map. One expression
    /// should exist for each state defined in <see cref="DigitalBitStateExpressionMap"/>.
    /// Use format "DigitalStateName=Expression;DigitalStateName=Expression;...". Use "*" for default expression.
    /// </summary>
    public string DigitalBitTagNameExpressionMap { get; set; } /* default: "" */

    /// <summary>
    /// Gets or sets the semicolon separated regular expressions for excluding digital labels from being expanded
    /// to tags.
    /// </summary>
    public string DigitalBitExcludedExpressions { get; set; | /* default: SPARE_BIT;RESERVED_BIT */

…y key for the ActiveMeasurements configuration data source
@ritchiecarroll ritchiecarroll marked this pull request as ready for review May 31, 2024 23:11
@clackner-gpa clackner-gpa merged commit 0a364d7 into master Jun 6, 2024
1 check passed
@clackner-gpa clackner-gpa deleted the PIUpdates branch June 6, 2024 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants