The global ControllerClass provides a means for GPL programs to access a number of system wide features and facilities of the Guidance Controller System, e.g. High Power control, E-Stop logic, Configuration Database values, etc. These capabilities are represented as properties and methods of the Controller Class. Since this class is global, it does not have any properties or fields that have values that are local to a specific routine or program scope. So, the ControllerClass can be referenced directly without the need for creating instances of ControllerObjects. For example, to enable high power to the amplifies for non-Category 3 (CAT-3) safe systems, the following GPL statement could be used:
Controller.PowerEnabled = True
In this instruction, “Controller” refers to the global ControllerClass and “EnablePower” is a property of this class. Likewise, if we wish to test if high power is currently enabled, the following instructions could be utilized:
If (Controller.PowerEnabled) Then
:
End If
Of special interest are the SystemMessage, ShowDialog and ShowDialogMCP methods of this class. These methods allow GPL programs to easily output information to the operator and prompt for simple responses. For the first two methods, the output and input appear on the web page that displays the Operator Control Panel. For the third method, the output and input are performed via the PreciseFlex™ Hardware Manual Control Pendant. In the following example, text is output to the system message log displayed on the Operator Control Panel and then displays a pop-up to prompt for a "Yes" or "No" answer.
Dim button As Integer
Controller.SystemMessage("Sample output to Operator Control Panel")
Controller.ShowDialog("Yes,No","Do you like this pop-up?", button)
Controller.SystemMessage("Operator pressed button " & CStr(button))
All of the properties and methods for the ControllerClass are discussed in detail in the Reference Documentation section. Table 19-21 summarizes the members of the class.
| Member | Type | Description |
|---|---|---|
|
Controller.Command |
Method |
Executes a console command and returns any output as a String value. |
|
Controller.ErrorLog |
Property |
Returns an entry from the system Error Log as a String value or clears the Error Log. |
|
Controller.Load |
Method |
Loads a GPL project into memory and compiles it in preparation for execution. |
|
Controller.PDb |
Property |
Sets and gets any accessible value in the configuration parameter database. |
|
Controller.PDbNum |
Property |
Optimized means to set and get numeric values in the configuration parameter database. |
|
Controller.PowerEnabled |
Property |
Sends a request to either turn on or off high (motor) power to the amplifier. Returns whether high power is on or off. |
|
Controller.PowerState |
Property |
Returns the current state of the high power sequence. |
|
Controller.RecordButton |
Property |
Sets and gets the latched Boolean value that indicates if the hardware MCP RECORD button has been pressed. |
|
Controller.ShowDialog |
Method |
Displays a pop-up dialog box on the web Operator Control Panel. |
|
Controller.ShowDialogMCP |
Method |
Displays a pop-up dialog box on the LCD display of the PreciseFlex™ Hardware Manual Control Pendant. |
|
Controller.SleepTick |
Method |
Delays further execution of a thread for a specified number of Trajectory Generator periods. |
|
Controller.SoftEStop |
Property |
Sets and gets the Boolean flag that triggers a Soft E-Stop. |
|
Controller.SystemMessage |
Method |
Enters a message into the GPL system message log that is displayed on the web Operator Control Panel. |
|
Controller.SystemSpeed |
Property |
Sets and gets the property that can reduce the speed of all robot motions. |
|
Controller.Tick |
Property |
Returns the execution repetition period for the Trajectory Generator. |
|
Controller.Timer |
Property |
Returns the value of the controller’s microsecond clock in units of seconds. |
|
Controller.Unload |
Method |
Unloads an idle GPL project from memory. |