Displays a pop-up dialog box on the LCD display of the Precise Hardware Manual Control Pendant.
Controller.ShowDialogMCP( button_mask, message, button_return)
-or-
Controller.ShowDialogMCP( button_mask, message, button_return, text_field )
Prerequisites
Precise Hardware Manual Control Pendant must be connected to the controller.
Parameters
button_mask
A required Integer expression whose bits specify the MCP key presses that will terminate the dialog box. A value of -1 indicates that the maximum number of keys are permitted to terminate the dialog process.
message
A required String expression containing the message to be displayed on the LCD display. If a text_field is specified, the message must include a substring ('##...##') that defines where the characters of the text_field are output in the MCP display. The number of pound signs (#) defines the width of the input field.
button_return
A required ByRef Integer variable that receives the bit flag that indicates the button that was pressed to terminate the dialog operation.
text_field
An optional ByRef String variable that receives the value of any text entered into the dialog box text field. The initial value of this variable is displayed as the default value of the text field. Given the key pad layout of the Precise MCP, the text_field can only contain a numeric value that consists of 0-9, ., + or - characters.
Remarks
This method provides a simple way for a GPL procedure to communicate with the operator via the Precise Hardware Manual Control Pendant. (Note: If you wish to develop a more sophisticated interface, please refer to the /dev/mcp communication device.)
When ShowDialogMCP is called, its operation is as follows:
- Waits if another thread is already displaying a MCP dialog box.
- Replaces the standard MCP display with the contents of the message and the optional embedded text_field, and lights the LED on the APP key.
- If the optional text_field is defined, accepts presses of the 0-9, ., +, - or DEL keys and presents the results in the LCD display.
- If the display and keypad are switched back to their standard mode due to a manual control operation or error message, blinks the APP key LED until the APP key is pressed to re-display the dialog.
- When one of the specified termination keys is pressed, un-displays the dialog box.
- Returns the termination key button bit flag and the optional text field value.
The MCP keypad buttons that can be specified to terminate the dialog mode are listed in the table below together with their associated button_mask and button_return values.
Key Label | button_mask& button_return |
---|---|
Enter |
&H000001 |
Record |
&H000002 |
Yes |
&H000004 |
No |
&H000008 |
Quit |
&H000010 |
Prev |
&H000020 |
Next |
&H000040 |
F1 |
&H010000 |
F2 |
&H020000 |
F3 |
&H040000 |
F4 |
&H080000 |
By default, when a dialog is first displayed on the MCP, a beep is generated to alert the operator. The beeping operation can be suppressed by resetting the "Beep MCP when APP mode started" (DataID 636) system parameter.
If the thread displaying the dialog box is paused or stopped, the dialog box is un-displayed immediately.
Examples
Dim but As Integer
Dim ss, CRLF As String
CRLF = Chr(GPL_CR) & Chr(GPL_LF)
ss = " Ready to begin" & CRLF & CRLF _
& " <Yes> or <No>"
Controller.ShowDialogMCP(&H4+&H8, ss, but)
Dim but As Integer
Dim reply, ss, CRLF As String
CRLF = Chr(GPL_CR) & Chr(GPL_LF)
ss = " Enter part number:" & CRLF _
& " '#########'" & CRLF & CRLF _
& " <Enter> or <Quit>"
reply = "12" ' Default reply value
Controller.ShowDialogMCP(&H1+&H10, ss, but, reply)
If but = &H10 Then
Console.Writeline("Request cancelled")
Else
Console.WriteLine("You entered: " & reply)
End If
See Also
Controller Class | Controller.ShowDialog | Controller.SystemMessage | /dev/mcp Device