I have done same thing with my SR16 several times with good results. I suppose you want to copy your midi groves from SR18 to Sonar. The culprit is your midi interface. Try these simple steps and see what happens.
1. Connect SR18 midi out with your interface midi in.
2. Insert a drum track for example Session Drummer 3, choose drum kit, check if you hear sound by clicking on any drum
3. Press play on SR18, you should be hearing SR18 groove played on SD3 ...
4. ... and be able to record it as a midi.