Programming Guide : Inter-Frame Communication Techniques : How You Can Communicate with an External Program Using External User Events : How You Can Register the External Event
 
Share this page          
How You Can Register the External Event
When you want a frame to receive a particular event from an external program, you must register the frame with OpenROAD for that particular event. Registering a frame tells OpenROAD to notify the frame whenever an external program sends the specified event. For example, if frame A is registered to receive the external _update event, whenever OpenROAD receives the external_update event from the external program, it notifies frame A that the event has occurred. OpenROAD then adds the external_update event to the event queue. (If the specified frame is not running at the time, OpenROAD simply ignores the event. This does not cause an error.)
You can register one frame for any number of external events. You can also register more than one frame for the same external event.
To register the frame to receive the external event, use the FrameExec RegisterUserEvent Method. To remove an event from the list of registered events for the frame, use the FrameExec UnRegisterUserEvent Method.
RegisterUserEvent Method
The RegisterUserEvent method registers a frame to receive the specified external event. The syntax follows:
FrameExec_var.RegisterUserEvent (eventname =
          varchar(32))
To specify the frame to be registered, you must reference the FrameExec variable for the running instance of the frame. (You cannot use the frame name because OpenROAD lets you open the same frame more than once.) For more information about how to reference the FrameExec variable, see SendUserEvent Method.
To register the event for the frame that currently has the input focus, use the following syntax:
CurFrame.RegisterUserEvent(eventname = varchar(32))
eventname
Specifies the name of the user event. This must be the same as the name you use in the corresponding user event block (see UserEvent Event Block). This parameter is case sensitive.
The following example illustrates registering the external_update user event:
CurFrame.RegisterUserEvent(eventname =
    'external_update');
UnRegisterUserEvent Method
The UnRegisterUserEvent method removes one or all external events from the list of registered events for a frame. The syntax follows:
FrameExec_var.UnRegisterUserEvent(eventname =
    varchar(32))
To specify the frame, you must reference the FrameExec variable for the running instance of the frame. For more information about how to reference the FrameExec variable, see SendUserEvent Method.
eventname
Specifies the name of the user event. If you do not specify the event name, all registered events for the frame are removed from the list. This parameter is case sensitive.
The following example illustrates this:
CurFrame.UnRegisterUserEvent(eventname =
    'external_update');