Review this procedure, its how smog stations wil now use your cars PCM to pass or fail you in smog testing. All results are from software that already runs on your PCM and reports via a PCM scanner the results.
I/M Smog tests As you can see, the PCM does the testing and smog station just has to query pcm for the results.