GSF.PhasorProtocols.IEC61850_90_5.DigitalDefinition.GetLabel C# (CSharp) Method

GetLabel() public method

Gets the individual labels for specified bit in this DigitalDefinition.

In the final version of the protocol each digital bit can be labeled, but we read them out as one big string in the "Label" property so this property allows individual access to each label.

Note that the draft 6 implementation of the protocol supports one label for all 16-bits, however draft 7 (i.e., version 1) supports a label for each of the 16 bits.

public GetLabel ( int index ) : string
index int Index of desired bit label to access.
return string
        public string GetLabel(int index)
        {
            if (index < 0 || index >= LabelCount)
                throw new IndexOutOfRangeException("Invalid label index specified.  Note that there are " + LabelCount + " labels per digital available in " + DraftRevision + " of the IEC 61850-90-5 protocol");

            return Label.PadRight(MaximumLabelLength).Substring(index * 16, 16).GetValidLabel();
        }