Is this a terminal emulator? If so, you would use a Text Adapter. Here is some information on Text Adapters. That is how you would perform the interrogation. You would use a Windows Adapter to start the terminal session and once the session is up, you would start the Text Adapter.