The code:
For Pearl and Diamond
94000130 fcff0000
b21c4d28 00000000
b0000004 00000000
da000000 000002e2
d6000000 000002e4
d2000000 00000000
For Platinum (US version)
94000130 FCFF0000
B2101D40 00000000
DA000000 0000008E
D6000000 00000090
d2000000 00000000
For Platinum (Japanese version):
94000130 FCFF0000
B2101140 00000000
DA000000 0000008E
D6000000 00000090
D2000000 00000000
Press L + R in the game, then look at your money in the character profile. This is your OT's secret ID. If the money shows only 4 digits, then your secret ID starts with a zero, followed by the 4 digits. For example, if the money area shows 4837, then your SID is 04837.