Gets axis state
Namespace: EAL.Interfaces.MotionAssembly: EAL (in EAL.dll) Version: 1.1.5.0 (1.1.5.0)
Syntax
C# |
---|
int GetState() |
Visual Basic |
---|
Function GetState As Integer |
Visual C++ |
---|
int GetState() |
Return Value
Type: Int32Axis state
Examples
Synchronous method
Asynchronous method
Copy | |
---|---|
private void Sample() { using (IEALConnection ealConnection = new EALConnection()) { ealConnection.Connect("192.168.0.10"); // Connects IAxis axis = ealConnection.Motion.Axes[0]; // Gets axis axis.Movement.Power(false); // Powers-off axis.SetCondition(AxisCondition.AXIS_CONDITION_ACTIVE_PARAMETERIZATION); // Activate parameterisation mode int state1 = axis.GetState(); // state1 will be 0 axis.SetCondition(AxisCondition.AXIS_CONDITION_ACTIVE); // Activate Operating mode int state2 = axis.GetState(); // state2 will be 2 axis.Movement.Power(true); // Powers-on int state3 = axis.GetState(); // state2 will be 4 } } |
Copy | |
---|---|
private void Sample() { using (IEALConnection ealConnection = new EALConnection(true)) // Asynchronous flag is true { ealConnection.Connect("192.168.0.10"); // Connect task will be added to queue IAxis axis = ealConnection.Motion.Axes[0]; // Gets axis 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.WaitUntilQueueComplete(); // Wait untill all tasks in the queue completes int state1 = axis.GetState(); // state1 will be 0 axis.SetCondition(AxisCondition.AXIS_CONDITION_ACTIVE); // Activate Operating mode task will be added to queue ealConnection.WaitUntilQueueComplete(); // Wait untill all tasks in the queue completes int state2 = axis.GetState(); // state2 will be 2 axis.Movement.Power(true); // Powers-on task will be added to the queue ealConnection.WaitUntilQueueComplete(); // Wait untill all tasks in the queue completes int state3 = axis.GetState(); // state2 will be 4 } } |