I asked one of the immi officer, and she said different code gives different result (when applying for an NPC).
That's correct. National Police Checks (NPC's) are conducted by the Australian Federal Police (AFP). When a person applies for an NPC, whether it's an individual, employer, government agency, etc, they need to provide the reason for making the application. Depending on the reason given, you may also need to provide additional details.
The AFP discloses information according to both federal and state legislation. So the reason, along with any additional information that may be required, is used by the AFP to determine what information is to be disclosed under relevant federal and/or state laws.
Generally, an NPC won't include spent convictions. But if the reason for obtaining the NPC is immigration related, it will show spent convictions because of requirements under federal law. Likewise, an NPC obtained for employment as a teacher will also show spent convictions because of requirements under state law in most, if not all, Australian states and territories. These special circumstances are known as "exclusions" under the Spent Convictions Scheme.
You can read up on how it all works at the AFP web site:
AFP - Criminal records
AFP - Criminal records - National Police Checks
AFP - Criminal records - Spent Convictions Scheme <-- This page should answer any questions you still have.
AFP - Criminal records - Frequently Asked Questions
It's also worth noting that since your NPC was obtained for immigration purposes, federal law most likely requires that the AFP disclose everything on the NPC. That would include convictions (spent or not), infringements and possibly even arrests where no charge was laid.
So basically, what's disclosed all comes down to legislative requirements surrounding the reason for the NPC being obtained.