raydriver.xtool.m2
M2 WS-V2 driver.
M2Session
Monitor and control an xTool M2 over its WS-V2 TLS service. This session does not upload G-code
jobs. start controls a job that is already staged on the device, such as a job sent by xTool
Studio.
is_job_running
is_job_running: bool
Whether the state currently indicates an active or held job.
resource_uri
resource_uri: Optional[str]
WebSocket URI of the configured device.
state
state: types.DeviceState
Current snapshot of the machine state.
cancel()
cancel() -> Any
Cancel the current job.
| Parameter | Type | Description |
|---|---|---|
| Returns | Any |
connect()
connect() -> Any
Connect and start monitoring the M2.
| Parameter | Type | Description |
|---|---|---|
| Returns | Any |
disconnect()
disconnect() -> Any
Stop monitoring and close the connection.
| Parameter | Type | Description |
|---|---|---|
| Returns | Any |
home()
home() -> Any
Home the laser head.
| Parameter | Type | Description |
|---|---|---|
| Returns | Any |
jog()
jog(
dx: float = 0.0,
dy: float = 0.0,
dz: float = 0.0,
speed: float = 18000.0,
) -> Any
Move by relative XYZ deltas in millimeters.
| Parameter | Type | Description |
|---|---|---|
dx | float = 0.0 | |
dy | float = 0.0 | |
dz | float = 0.0 | |
speed | float = 18000.0 | |
| Returns | Any |
move_to()
move_to(x: float, y: float, speed: float = 18000.0) -> Any
Move to an absolute XY coordinate in millimeters.
| Parameter | Type | Description |
|---|---|---|
x | float | |
y | float | |
speed | float = 18000.0 | |
| Returns | Any |
set_hold()
set_hold(hold: bool = True) -> Any
Pause the current job, or resume it when hold is false.
| Parameter | Type | Description |
|---|---|---|
hold | bool = True | |
| Returns | Any |
start()
start() -> Any
Start a job already staged on the device.
| Parameter | Type | Description |
|---|---|---|
| Returns | Any |