pause

abstract suspend fun pause(): Result<String>

Pauses the current running program via the dashboard server.

IMPORTANT: Not recommend for URScripts. If a URscript is in pause mode, it should be stopped with stop before executing the next URscript. If this is not done, the next URScript will be terminated immediately.

Return

Result containing the response string on success, or an Exception on failure. Response messages may include:

  • "Pausing program"

  • "Failed to execute: pause"

Samples

import com.wolfscowl.ur_client.UR
import com.wolfscowl.ur_client.examples.Examples.ur
import com.wolfscowl.ur_client.interfaces.state.await
import com.wolfscowl.ur_client.interfaces.state.awaitBlocking
import com.wolfscowl.ur_client.interfaces.state.awaitBlockingUntil
import com.wolfscowl.ur_client.interfaces.state.awaitUntil
import com.wolfscowl.ur_client.model.element.JointPosition
import com.wolfscowl.ur_client.model.element.Pose
import com.wolfscowl.ur_client.model.element.RunningState
import com.wolfscowl.ur_client.model.element.Vec3
import com.wolfscowl.ur_client.model.robot_state.mode.RobotMode
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.runBlocking
import kotlin.system.exitProcess

fun main() { 
   //sampleStart 
   val ur = UR("192.168.2.1")

runBlocking {
    val result = ur.pause().getOrElse { it.message }
    println(result)
} 
   //sampleEnd
}