Difference between revisions of "MC-Basic:PlcMotionStatusQuery"

From SoftMC-Wiki
Jump to: navigation, search
(Created page with "{{MC-Basic |SHORT FORM= |SYNTAX= Print MotionStatusQuery(<''handle''>, <''index''>) |AVAILABILITY= 4.10.x |DESCRIPTION= Queries variables of a MotionStatus object. |TYPE= ...")
 
 
(18 intermediate revisions by 3 users not shown)
Line 3: Line 3:
  
 
|SYNTAX=
 
|SYNTAX=
Print MotionStatusQuery(<''handle''>, <''index''>)
+
Print PlcMotionStatusQuery(<''handle''>, <''index''>)
  
 
|AVAILABILITY=
 
|AVAILABILITY=
Line 9: Line 9:
  
 
|DESCRIPTION=
 
|DESCRIPTION=
Queries variables of a MotionStatus object.
+
Queries variables of a PlcMotionStatus object.
 +
 
 +
;<''handle''>
 +
Motion status handle which was returned by [[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: done (target position reached)
 +
** 6: aborted (motion aborted by another move command)
 +
** 7: error (error during motion)
 +
* 1: Bits 4-31: Reserved for future
 +
* 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 27: Line 45:
  
 
|LIMITATIONS=
 
|LIMITATIONS=
* Read-Only
+
* Read only
  
 
|EXAMPLE=
 
|EXAMPLE=
 
<pre>
 
<pre>
dim MOT_READY as const long = 123
 
 
dim MotStatHanlde as long
 
dim MotStatHanlde as long
  
MotStatHanlde = MotionStatusCreate
+
MotStatHanlde = PlcMotionStatusCreate
  
Move A1 MotionStatus= MotStatHanlde
+
Move A1 100 PlcMotionStatus= MotStatHanlde
  
do
+
while A1.isMoving
 
   sleep 100
 
   sleep 100
loop until MotionStatusQuery(MotStatHanlde, MOT_READY)
+
  Print PlcMotionStatusQuery(MotStatHanlde, 1)
 +
end while
  
MotionStatusDestroy(MotStatHanlde)
+
PlcMotionStatusDestroy(MotStatHanlde)
 
</pre>
 
</pre>
  
 
|SEE ALSO=
 
|SEE ALSO=
* [[AXY:MC-Basic:element.MotionStatus|element.MotionStatus]]
+
* [[MC-Basic:element.PlcMotionStatus|element.PlcMotionStatus]]
* [[AXY:MC-Basic:MotionStatusCreate|MotionStatusCreate]]
+
* [[MC-Basic:PlcMotionStatusCreate|PlcMotionStatusCreate]]
* [[AXY:MC-Basic:MotionStatusDestroy|MotionStatusDestroy]]
+
* [[MC-Basic:PlcMotionStatusDestroy|PlcMotionStatusDestroy]]
  
 
}}
 
}}
  
[[Category:Axystems:PLC]]
+
[[Category:PLC]]

Latest revision as of 09:20, 22 May 2014

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: done (target position reached)
    • 6: aborted (motion aborted by another move command)
    • 7: error (error during motion)
  • 1: Bits 4-31: Reserved for future
  • 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 100 PlcMotionStatus= MotStatHanlde

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

PlcMotionStatusDestroy(MotStatHanlde)

See Also