|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Internet and Network > MCP. - MCP (Model-Context Protocol) server operations > Status & Configuration - Server status and features > MCP Commands - Server Status |
MiniRobot Language (MRL) - MCP Server Status Commands
MCP.GetStatusByte / MCP.GetStatus
Get Server Status as Byte Value
Purpose
The MCP.GetStatusByte command retrieves the MCP server status as a compact byte value. This is useful for quick status checks where a numeric representation is preferred over a detailed status string.
This command is particularly useful when:
• Fast status checking is required
• Binary operations on status flags are needed
• Minimal data transfer is desired
• Integrating with low-level control systems
Syntax
MCP.GetStatusByte|$$RETURN_VAR
Parameters
$$RETURN_VAR - The variable that will receive the status byte value (0-255).
Return Value
Returns a numeric byte value (0-255) where each bit represents a specific status flag:
Bit 0 (1) - Server running (1) / Stopped (0)
Bit 1 (2) - Feature available
Bit 2 (4) - Error state
Bit 3 (8) - Busy/processing
Bit 4-7 - Reserved for future use
Examples
' Example 1: Get status byte
MCP.GetStatusByte|$$StatusByte
PRT.Status byte value: $$StatusByte
' Example 2: Check specific bit flags
MCP.GetStatusByte|$$Status
' Check if server is running (bit 0)
BND.$$Status|1|$$IsRunning
IVV.$$IsRunning!0
PRT.Server is active
EIF.
' Example 3: Check for errors
MCP.GetStatusByte|$$Status
BND.$$Status|4|$$HasError
IVV.$$HasError!0
PRT.Error condition detected!
EIF.
Remarks
The status byte provides a compact representation of server state. Use bitwise AND operations to test individual flags. This is more efficient than parsing a status string when you only need specific state information.
Error Conditions
The command will fail with an error if:
• The return variable parameter is missing
• Too many parameters are provided
See also:
• MCP.GetStatus - Get Server Status
• MCP.GetFeature - Get Feature Capability
• MCP.IsRunning - Check if Server is Running