@DicrostonyxI suppose the caveat here is all military's are different.
My experience is that in a unit, things are far less formal and rank is only used when you have fucked up, or in formal dispatches, otherwise nicknames are used with the exception of senior ranks (Sgt and above) and officers, and even then, that varies with the individual.
However, when a junior rank likes to be known by their rank, that's always a good indication that the individual is a prick and can safely be treated as such.
Rank might be used when temporarily attached to a new unit (ie as support staff -Chef, radio op, medic, Engr, clerk) until such times as the individual is 'bed into' the attached unit; that time depends on whether the individual is known to the unit beforehand by previous experience or reputation.
When attached to another unit, you may keep your nickname, or one might be given to you. For instance, a Welsh person in a Purely English unit, will inevitably be know as 'Taff' until such time another Welsh person joins at which point you may either be given a new nickname that corresponds with a incident of notoriety within the unit or simply be called 'Taff one' and the other 'Taff 2'
If you are a Scot then you become 'Jock'.
These names tend to get carried over to exercises and actual Operations. So in a briefing, it's simply "Taff, take your section and do x" or "Scouse and mad-dog, you are on stag 22-2400 hrs, Peanut and Screech, you take over 2400 till 2" etc etc."
I would actually pay less attention on rank when writing a military story and more on the acronyms. These vary depending on units and their speciality, ranging from alert states to ready states (CEFO etc), The army sure loves it's acronyms.
Also, in the UK, different branches have different words for exactly the same thing and stand by if you get it wrong... (ie, in the army a hot drink is called a 'brew' but in the marines/navy, it's a 'wet') so having your marines asking if you want a 'brew' would be more jarring than the use of rank to someone of military experience.