ID : 5492
TrackBufferRead
Function
From the tracking buffer, read out specified data.
This command is available in Ver.1.6.* or higher.
Syntax
TrackBufferRead (Conveyor number, Index number [, Option])
Guaranteed Entry
- Conveyor number
-
Specify the conveyor number (1 to 16) to be used by integer type data.
(If your robot controller is Ver.1.11.* or lower, available conveyor number is 1 or 2.) - Index number
-
Specify the Index number obtained by the TrackBufferIndexes command by integer type data.
Setting value Description -1 Read the data specified as a tracking-target work in TrackTargetPos command.
This entry is available for Ver.2.0.*. or higher.0 or larger Read the specified index number. - Option
-
Specify by integer type data. The content of return value can be selected. This is an optional value. This should be "-1" if this is omitted.
Setting value Return value -2 All data described in the following -1 to 11.
(Data structure of the tracking buffer might expand. In this case, the number of data stored in "-2" will increase.)
(Ver. 1.10.* or higher.)-1 All data described in the following 0 to 10. 0 Encoder value at the trigger detection (integer type data) 1 Current position of the target workpirce. (Position type data)
(Values are based on the currently selected work coordinate or tool coordinate.)X[mm] (Single Precision Real Number Type data) 2 Y[mm] (Single Precision Real Number Type data) 3 Z[mm] (Single Precision Real Number Type data) 4 Rx[deg] (Single Precision Real Number Type data) 5 Ry[deg] (Single Precision Real Number Type data) 6 Rz[deg] (Single Precision Real Number Type data) 7 User data (integer type data) 8 Values are based on the vision sensor detection coordinate of the target workpiece.
(Variant type data array)
(Ver. 1.7.* or higher.)X-coordinate[pixel] (Single Precision Real Number Type data) 9 Y-coordinate[pixel] (Single Precision Real Number Type data) 10 Posture angle[deg] (Single Precision Real Number Type data) 11 Attribute data (integer type data) (Ver. 1.10.* or higher.) 12 The remaining time until the arrival of the target workpiece at the downstream limit (integer type data) [msec] (Ver. 2.3.* or higher.) 13 The distance between the target workpiece and the downstream limit (integer type data) (Ver. 2.5.* or higher.)
Return Value
Values specified by "Option" are returned with variant type data.
If the data specified by "Index number" is not exist in the tracking buffer, variant type data whose VarType command result is VT_NULL(0) will be returned.
Description
Read the data specified by the tracking buffer by means of the index number obtained by the TrackBufferIndexes command.
Related Terms
TrackBufferDelete, TrackBufferIndexes, TrackSetSensor, TrackSetVision, TrackTargetPos, TrackTargetRelease, Commands for Conveyor Tracking, Commands for Circular Tracking
Attention
This command is dedicated for conveyor and circular tracking.
Example
Obtain a one-dimensional array of data Index number stored in the tracking buffer.
Dim vIndex as Variant
vIndex = TrackBufferIndexes(1)
From the one dimensional array, take out index numbers one by one, and then refer to and output all data of target index.
Dim idx as long
For idx = LBound(vIndex) To UBound(vIndex)
Dim vVal as Variant
vVal = TrackBufferRead( 1, vIndex(idx) ,-2)
PrintDbg "enc=" & vVal(0), _
"x=" & vVal(1), _
"y=" & vVal(2), _
"z=" & vVal(3), _
"rx=" & vVal(4), _
"ry=" & vVal(5), _
"rz=" & vVal(6), _
"usr=" & vVal(7), _
"vx=" & vVal(8), _
"vy=" & vVal(9), _
"θ=" & vVal(10), _
"attr=" & vVal(11)
Next
From the one dimensional array, take out index numbers one by one, and then refer to and output userdata of applicable index.
Dim idx as long
For idx = LBound(vIndex) To UBound(vIndex)
Dim vVal as Variant
vVal = TrackBufferRead( 1, vIndex(idx), 7 )
PrintDbg "usr=" & vVal
Next
From the one dimensional array, take out index numbers one by one, and then refer to and output attribute data of applicable index.
Dim idx as long
For idx = LBound(vIndex) To UBound(vIndex)
Dim vVal as Variant
vVal = TrackBufferRead( 1, vIndex(idx), 11 )
PrintDbg "attr=" & vVal
Next
Obtain the remaining time until the arrival of the workpiece which Index number is 5 at the downstream limit.
I[0] = TrackBufferRead(1, 5, 12)
Obtain the distance between the specified workpiece and the downstream limit.
Dim restLength As Float
restLength = TrackBufferRead (1, -1, 13)
ID : 5492

