If SONAR has been setting LocalOff and you never turn local control back on, you may want to set SendLocalOn=1 to turn local control back on when SONAR exits.
If you want to start working with MIDI, you probably want to do as others have posted. Connect MIDI Out on your keyboard to MIDI In on your MIDI interface, and MIDI Out on the interface to MIDI In on your keyboard. Then allow SONAR to set local control OFF when it starts. This avoids doubled notes. With local control off, playing on the keyboard sends the MIDI data to SONAR and SONAR echoes it to the port and channel of the current track which then plays the notes in the sound producing engine of the keyboard. Unlike soft synths, there is no latency.
To work this way, set these .ini variables in TTSSEQ.INI in the Options section ...
SendLocalOff=1 //This turns off local control when SONAR starts
SendLocalOn=1 //This turns on local control when SONAR exits
Hope that helps.