Model 2461 Interactive SourceMeter® Instrument Reference Manual Section 8: TSP command reference2461-901-01 A/November 2015 8-67display.waitevent()This function causes the instrument to wait for a user to respond to a prompt that was created with a promptcommand.Type TSP-Link accessible Affected by Where saved Default valueFunction YesUsageobjectID, subID = display.waitevent()objectID, subID = display.waitevent(timeout)objectID A number that identifies the object, such as a prompt message, that is displayed onthe front panelsubID The returned value after a button is pressed on the front panel:• display.BUTTON_YES• display.BUTTON_NO• display.BUTTON_OK• display.BUTTON_CANCELtimeout The amount of time to wait before timing out; time is 0 to 300 s, where the default of0 waits indefinitelyDetailsThis command waits until a user responds to a front-panel prompt that was created with thedisplay.prompt() command.Examplesmu.source.sweeplinear("test", 1, 10, 10)display.prompt(display.BUTTONS_YESNO, "Would you like to start the sweep now?")sweepTest, result = display.waitevent()if result == display.BUTTON_YES thentrigger.model.initiate()enddisplay.prompt(display.BUTTONS_YESNO, "Would you like to switch to the Graphscreen?")promptID, result = display.waitevent()if result == display.BUTTON_YES thendisplay.changescreen(display.SCREEN_GRAPH)endCreate a linear sweep.Display the prompt "Would you like to start the sweep now?"If the user presses Yes, the sweep starts.If the user presses No, the sweep does not start and the message is removed.Display the prompt "Would you like to switch to the Graph screen?"If the user presses Yes, the Graph screen is displayed.If the user presses No, the user remains on the present screen.Also seedisplay.input.prompt() (on page 8-61)display.prompt() (on page 8-64)