CURRENT_PROFILE_NAME is a read-only built-in string containing the name of the current profile. It will also contain the profile being reset when called from a Subchain Reset Sequence. In a non-dynamic project it will always return an empty string.
Test()(INT result) STRING profile; profile := CURRENT_PROFILE_NAME; END;