Opc.Ua.NonExclusiveLimitAlarmState.UpdateState C# (CSharp) Method

UpdateState() private method

Updates the state.
private UpdateState ( TwoStateVariableState limit, bool active ) : void
limit TwoStateVariableState The limit.
active bool if set to true is the state is active.
return void
        private void UpdateState(TwoStateVariableState limit, bool active)
        {
            TranslationInfo state = null;

            if (active)
            {
                state = new TranslationInfo(
                     "ConditionStateActive",
                     "en-US",
                     ConditionStateNames.Active);
            }
            else
            {
                state = new TranslationInfo(
                     "ConditionStateInactive",
                     "en-US",
                     ConditionStateNames.Inactive);
            }

            limit.Value = new LocalizedText(state);
            limit.Id.Value = active;

            if (limit.TransitionTime != null)
            {
                limit.TransitionTime.Value = DateTime.UtcNow;
            }
        }
        #endregion
NonExclusiveLimitAlarmState