Difference between revisions of "MC-Basic:PlcMotionStatusQuery"

From SoftMC-Wiki
Jump to: navigation, search
Line 10: Line 10:
 
|DESCRIPTION=
 
|DESCRIPTION=
 
Queries variables of a PlcMotionStatus object.
 
Queries variables of a PlcMotionStatus object.
 +
 +
;<''handle''>
 +
Motion status handle which was returned by [[AXY:MC-Basic:PlcMotionStatusCreate|PlcMotionStatusCreate]].
 +
 +
;<''index''>
 +
* 1: Bits 0-3: Motion status
 +
** 0: not initialized
 +
** 1: precomputing (move command given)
 +
** 2: moving - accelerating
 +
** 3: moving - cruising (jog is in velocity)
 +
** 4: moving - decelerating
 +
** 5: settling
 +
** 6: done (target position reached)
 +
** 7: aborted (motion aborted by another move command)
 +
** 8: error (error during motion)
 +
* 2: Error code in case of the motion package is in state ''error''.
  
 
|TYPE=
 
|TYPE=
Long
+
* <''handle''>: Long
 +
* <''index''>: Long
 +
* Return: Long
  
 
|RANGE=
 
|RANGE=
* index: 1 ..  
+
* <''index''>: 1, 2 ..  
  
 
|UNITS=
 
|UNITS=
Line 31: Line 49:
 
|EXAMPLE=
 
|EXAMPLE=
 
<pre>
 
<pre>
dim MOT_READY as const long = 123
 
 
dim MotStatHanlde as long
 
dim MotStatHanlde as long
  
Line 38: Line 55:
 
Move A1 PlcMotionStatus= MotStatHanlde
 
Move A1 PlcMotionStatus= MotStatHanlde
  
do
+
while A1.isMoving
 
   sleep 100
 
   sleep 100
loop until PlcMotionStatusQuery(MotStatHanlde, MOT_READY)
+
  Print PlcMotionStatusQuery(MotStatHanlde, 1)
 +
end while
  
 
PlcMotionStatusDestroy(MotStatHanlde)
 
PlcMotionStatusDestroy(MotStatHanlde)

Revision as of 09:02, 15 November 2012

Queries variables of a PlcMotionStatus object.

<handle>

Motion status handle which was returned by PlcMotionStatusCreate.

<index>
  • 1: Bits 0-3: Motion status
    • 0: not initialized
    • 1: precomputing (move command given)
    • 2: moving - accelerating
    • 3: moving - cruising (jog is in velocity)
    • 4: moving - decelerating
    • 5: settling
    • 6: done (target position reached)
    • 7: aborted (motion aborted by another move command)
    • 8: error (error during motion)
  • 2: Error code in case of the motion package is in state error.

Syntax

Print PlcMotionStatusQuery(<handle>, <index>)

Availability

4.10.x

Type

  • <handle>: Long
  • <index>: Long
  • Return: Long

Range

  • <index>: 1, 2 ..

Scope

Task or Terminal

Limitations

  • Read-Only

Examples

dim MotStatHanlde as long

MotStatHanlde = PlcMotionStatusCreate

Move A1 PlcMotionStatus= MotStatHanlde

while A1.isMoving
  sleep 100
  Print PlcMotionStatusQuery(MotStatHanlde, 1)
end while 

PlcMotionStatusDestroy(MotStatHanlde)

See Also