1 2 3 4 5 6 7 8 9 10 11 12 | // Sets the new session state and logs it {attribute 'hide'} METHOD SetSessionState : SparkplugSessionStateType VAR_INPUT NewState : SparkplugSessionStateType; IF SessionState <> NewState THEN WriteDeviceLog( gc_sparkplug.CMP_EDGE, CmpLog.LogClass.LOG_INFO, 'Device State: %s', TO_STRING( NewState ) ); END_IF SetSessionState := NewState; |