Waits for the given time
Namespace: EAL.EALConnectionAssembly: EAL (in EAL.dll) Version: 1.1.5.0 (1.1.5.0)
Syntax
C# |
---|
public void Wait( int time ) |
Visual Basic |
---|
Public Sub Wait ( time As Integer ) |
Visual C++ |
---|
public: virtual void Wait( int time ) sealed |
Parameters
- time
- Type: System..::..Int32
Duration to wait in ms
Implements
IEALConnection..::..Wait(Int32)Remarks
In synchronization method, ealConnection.Wait method is equalent to Thread.Sleep method
Examples
Synchronous method
Asynchronous method
Copy | |
---|---|
private static void Sample() { using (IEALConnection ealConnection = new EALConnection()) { ealConnection.Connect("192.168.0.10", false, 10000, 2000, 500); // Eatablishes connection, with give least time, given busy timeout and with given max delay IAxis axis = ealConnection.Motion.Axes[0]; axis.Movement.Power(false); // Powers-off axis.SetCondition(AxisCondition.AXIS_CONDITION_ACTIVE_PARAMETERIZATION); // Switches to parameterisation mode ealConnection.Initialize(); // Initializes the axis axis.SetCondition(AxisCondition.AXIS_CONDITION_ACTIVE); // Switches to operating mode axis.Movement.Power(true); // Powers on axis.Movement.Home(); // Executes Homing axis.Movement.MoveAbsolute(0, 400, 100, 100, 0); // Moves the axis to position 10000 axis.Movement.Wait(10000); // Waits task until last movement command completes axis.Movement.MoveAbsolute(10000, 400, 100, 100, 0); // Moves the axis to position 10000 ealConnection.Wait(1000); // axis1 waits for 1 second double actualPosition = axis.GetActualPosition(); // Reads actualPosition Thread.Sleep(1000); // Thread sleeps for one second actualPosition = axis.GetActualPosition(); // Reads actualPosition } } |
Copy | |
---|---|
private static void Sample() { using (IEALConnection ealConnection = new EALConnection(true)) // Asynchronous flag is true { ealConnection.Connect("192.168.0.10", false, 10000, 2000, 500); // Eatablish connection, with give least time, given busy timeout and with given max delay // task will be added to queue IAxis axis = ealConnection.Motion.Axes[0]; axis.Movement.Power(false); // Powers-off task will be added to the queue axis.SetCondition(AxisCondition.AXIS_CONDITION_ACTIVE_PARAMETERIZATION); // Activate parameterisation mode task will be added to queue ealConnection.Initialize(); // Initializes the axis axis.SetCondition(AxisCondition.AXIS_CONDITION_ACTIVE); // Activate Operating mode task will be added to queue axis.Movement.Power(true); // Powers on task will be added to queue. axis.Movement.Home(); // Homing task will be added to queue. axis.Movement.MoveAbsolute(0, 400, 100, 100, 0); // Moves the axis to position 10000 // task will be added to queue. axis.Movement.Wait(10000); // Waits task until last movement command completes will be added to queue axis.Movement.MoveAbsolute(10000, 400, 100, 100, 0); // Moves the axis to position 10000 // task will be added to queue. ealConnection.Wait(1000); // axis1 wait task for 1 second will be added to queue ealConnection.WaitUntilQueueComplete(); // Now it will wait untill all are executed. double actualPosition = axis.GetActualPosition(); // Reads actualPosition Thread.Sleep(1000); // Thread sleeps for one second actualPosition = axis.GetActualPosition(); // Reads actualPosition } } |