Macro Connection with Terminal Session in UiPath


I have a macro that I am trying to connect to my terminal session in UiPath. I am not sure how to code it into VB to identify the open terminal connection and the particular screen so that the Macro can run and do actions in Mainframe. (UiPath Terminal)