Difference between revisions of "MC-Basic:CASTLOCATION"
(CASTLOCATION) |
(CASTLOCATION) |
||
Line 4: | Line 4: | ||
|SYNTAX= | |SYNTAX= | ||
− | <'' | + | <''location_variable''> = castlocation (<''long_scalar_expression''>, <''long_expression''>) |
− | <'' | + | <''location_variable''> = castlocation (<''double_scalar_expression''>, <''long_expression''>) |
− | <'' | + | <''location_variable''> = castlocation (<''long_array''>, <''long_expression''>) |
− | <'' | + | <''location_variable''> = castlocation (<''double_array''>, <''long_expression''>) |
Line 16: | Line 16: | ||
Version 4.9.11 and up. | Version 4.9.11 and up. | ||
|DESCRIPTION= | |DESCRIPTION= | ||
− | Creates and returns a generic | + | Creates and returns a generic location-type point, using the robot type given by the second, long-type argument, whereas coordinate values are taken from the first argument. If the first argument is a scalar, the resulting point will be composed of identical coordinates. Using an array as first argument will result in a point composed of the first "number-of-coordinates" (determined by the robot type) array elements. |
|TYPE= | |TYPE= | ||
− | + | Location | |
|RANGE= | |RANGE= | ||
Line 39: | Line 39: | ||
|EXAMPLE= | |EXAMPLE= | ||
<pre> | <pre> | ||
− | + | GenLocation = CASTLOCATION(0.5, TYPE_XYZ) | |
− | ? | + | ? CASTLOCATION(ArrayOf6Longs, TYPE_XYZR) |
</pre> | </pre> | ||
Revision as of 13:05, 6 November 2012
Creates and returns a generic location-type point, using the robot type given by the second, long-type argument, whereas coordinate values are taken from the first argument. If the first argument is a scalar, the resulting point will be composed of identical coordinates. Using an array as first argument will result in a point composed of the first "number-of-coordinates" (determined by the robot type) array elements.
Syntax
<location_variable> = castlocation (<long_scalar_expression>, <long_expression>)
<location_variable> = castlocation (<double_scalar_expression>, <long_expression>)
<location_variable> = castlocation (<long_array>, <long_expression>)
<location_variable> = castlocation (<double_array>, <long_expression>)
Availability
Version 4.9.11 and up.
Type
Location
Scope
Configuration, Task, Terminal
Limitations
Only a single-dimension array can be used as argument.
Number of array elements must be equal or greater than number of coordinates.
Examples
GenLocation = CASTLOCATION(0.5, TYPE_XYZ) ? CASTLOCATION(ArrayOf6Longs, TYPE_XYZR)