Usually, a TSM script initiates the interaction by sending a message to the DIP, which then responds with the information requested. Messages sent by TSM scripts have TSM as the sender and the channel number on which the TSM script is running.
Note:
The channel number (mchan) must be saved by the DIP for responding to the appropriate TSM script later.
A DIP reads the message using mesgrcv and decides what action to take based on the message id (mcont). The message id is set by the TSM script through the second argument to the dbase instruction. Typically, the DIP contains a switch statement on the message id with specific cases for all known message ids, as shown in Sample DIP.
DIP interrupt
Sometimes a DIP initiates the interaction between itself and a TSM script. This is done by sending the DIP interrupt message id defined in tsm_dip.h, which interrupts the TSM script instruction currently executing. See Flow control instructions in Using TAS Script Instructions for additional information.