मुख्य सामग्री पर जाएँ

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.

ParameterTypeDescription
ReturnsAny

connect()​

connect() -> Any

Connect and start monitoring the M2.

ParameterTypeDescription
ReturnsAny

disconnect()​

disconnect() -> Any

Stop monitoring and close the connection.

ParameterTypeDescription
ReturnsAny

home()​

home() -> Any

Home the laser head.

ParameterTypeDescription
ReturnsAny

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.

ParameterTypeDescription
dxfloat = 0.0
dyfloat = 0.0
dzfloat = 0.0
speedfloat = 18000.0
ReturnsAny

move_to()​

move_to(x: float, y: float, speed: float = 18000.0) -> Any

Move to an absolute XY coordinate in millimeters.

ParameterTypeDescription
xfloat
yfloat
speedfloat = 18000.0
ReturnsAny

set_hold()​

set_hold(hold: bool = True) -> Any

Pause the current job, or resume it when hold is false.

ParameterTypeDescription
holdbool = True
ReturnsAny

start()​

start() -> Any

Start a job already staged on the device.

ParameterTypeDescription
ReturnsAny