My transponder is a TQ KTX2 mode S which works very well but is very fiddly to set. So having got the controllers full attention I pass my details as TOO suggests but set the squawk as soo as I stop transmitting. This hasn't been a problem as brevity in my RT means the ATC see my allocated code within seconds.