Who do you call attention on deck for?

When an officer with the rank of 0-6 is on deck or the commanding officer of his or her respected commands.