Spel Class Methods

Accel Method, Spel Class

Description

Sets acceleration and deceleration for point to point motion commands Go, Jump, and Pulse.

Syntax
Sub Accel (PointToPointAccel As Integer, PointToPointDecel As Integer, _[JumpDepartAccel As Integer], [JumpDepartDecel As Integer], _[JumpApproAccel As Integer], [JumpApproDecel As Integer])

Parameters

  • PointToPointAccel
    An integer greater than or equal to 1 indicating the percentage of maximum acceleration rate (units: %)
  • PointToPointDecel
    An integer greater than or equal to 1 indicating the percentage of maximum deceleration rate (units: %)
  • JumpDepartAccel
    Optional. An integer greater than or equal to 1 indicating the depart acceleration for Jump.
  • JumpDepartDecel
    Optional. An integer greater than or equal to 1 indicating the depart deceleration for Jump.
  • JumpApproAccel
    Optional. An integer greater than or equal to 1 indicating the approach acceleration for Jump.
  • JumpApproDecel
    Optional. An integer greater than or equal to 1 indicating the approach deceleration for Jump.

See Also
Accels, Speed

Accel Example
VB Example:

m_spel.Accel(50, 50)  
m_spel.Go ("pick")  

C# 例:

m_spel.Accel(50, 50);  
m_spel.Go ("pick");  

AccelR Method, Spel Class

Description
Sets acceleration and deceleration for tool rotation motion.

Syntax
Sub AccelR (Accel As Single, [Decel As Single])

Parameters

  • Accel
    A real number from 0.1 to 5000 (units: deg/sec2) that defines the tool rotation acceleration when ROT is used in motion commands. If Decel is omitted, this value is used for both the Acceleration and Deceleration rates.
  • Decel
    A real number from 0.1 to 5000 (units: deg/sec2) that defines the tool rotation deceleration when ROT is used in motion commands. Optional.

See Also
Arc, Arc3, BMove, Jump3CP, Power, SpeedR, TMove

AccelR Example
VB Example:

Sub MoveToPlace()  
    m_spel.AccelR(100)  
    m_spel.Move("place ROT")  
End Sub  

C# Example:

void MoveToPlace()  
{  
	m_spel.AccelR(100);  
	m_spel.Move("place ROT");  
}  

AccelS Method, Spel Class

Description
Sets acceleration and deceleration for linear interpolar (straight line) motion commands Jump3CP, Move, TMove.

Syntax
Sub AccelS (Accel As Single, Decel As Single,[JumpDepartAccel As Single], [JumpDepartDecel As Single], _[JumpApproAccel As Single], [JumpApproDecel As Single])

Parameters

  • Accel
    A real number (units: mm/s2) that specifies the acceleration for linear or CP motion. If Decel is omitted, this value is applied for both the acceleration and deceleration rates.
  • Decel
    Optional. A real number (units: mm/sec2) that specifies the deceleration for linear or CP motion.
  • JumpDepartAccel
    Optional. A real number (units: mm/sec2) that specifies the depart acceleration for depart operation for Jump or Jump3CP.
  • JumpDepartDecel
    Optional. A real number (units: mm/sec2) that specifies the depart deceleration for depart operation for Jump or Jump3CP.
  • JumpApproAccel
    Optional. A real number (units: mm/sec2) that specifies the approach acceleration for approach operation for Jump or Jump3CP.
  • JumpApproDecel
    Optional. A real number (units: mm/sec2) that specifies the approach deceleration for approach operation for Jump or Jump3CP.

See Also
Accel, SpeedS, Jump3CP, Move, TMove

AccelS Example
VB Example:

Sub MoveToPlace()  
    m_spel.Base(P1)  
    m_spel.Move(pick)  
    m_spel.AccelS(500, 300)  
    m_spel.Move(place)  
End Sub  

C# Example:

void MoveToPlace()  
{  
    m_spel.AccelS(500);  
    m_spel.Move(pick);  
    m_spel.AccelS(500, 300);  
    m_spel.Move(place);  
}  

Agl Method, Spel Class

Description
Returns the joint angle for the selected rotational axis, or position for the selected linear axis.

Syntax
Function Agl (JointNumber As Integer) As Single

Parameters

  • JointNumber
    An integer indicating the axis number (range: 1 to number of joints of the robot)

Return Value
Returns the joint angle for the selected rotational axis, or position for the selected linear axis.

See Also
Pls, CX - CT

Agl Example
C# Example:

Dim j1Angle As Single  
j1Angle = m_spel.Agl(1)  

C# Example:

float j1Angle;  
j1Angle = m_spel.Agl(1);  

AIO_In Method, Spel Class

Description
Reads analog value from optional analog I/O input channel.

Syntax
Function AIO_In (Channel As Integer) As Single
Parameters

  • Channel
    Specifies the analog I/O channel number.

Return Value
Return the analog input value of the analog I/O channel which specified in channel number in real number. Return value range differs depending on the input range configuration of the analog I/O board.

See Also
AIO_InW, AIO_Out, AIO_OutW

AIO_In Example
VB Example:

Dim val As Single  
val = m_spel.AIO_In(2)  

C# Example:

float val;  
val = m_spel.AIO_In(2);  

AIO_InW Method, Spel Class

Description
Reads analog value from optional analog I/O input channel.

Syntax
Function AIO_InW (Channel As Integer) As Integer

Parameters

  • Channel
    Specifies the analog I/O channel number.

Return Value
Returns the input states (Integer expression from 0 to 65535) of specified analog I/O channel.

The following table shows input voltage (current) and return value of each input channel according to input range configuration of analog I/O board.

Input Data Input Range Configuration
Hexadecimal Decimal ±10.24(V) ±5.12(V) 0-5.12(V) 0-10.24(V) 0-24(mA)
0xFFFF 65535 10.23969 5.11984 5.12000 10.24000 24.00000
0x8001 32769 0.00031 0.00016 2.56008 5.12016 12.00037
0x8000 32768 0.00000 0.00000 2.56000 5.12000 12.00000
0x0000 0 -10.24000 -5.12000 0.00000 0.00000 0.00000

See Also
AIO_In, AIO_Out, AIO_OutW

AIO_InW Example
VB Example:

Dim val As Integer  
val = m_spel.AIO_InW(2)  

C# Example:

int val;  
val = m_spel.AIO_InW(2);  

AIO_Out Method, Spel Class

Description
Reads or set analog value from the optional analog I/O output channel.

Syntax
Function AIO_Out (Channel As Integer) As Single
Sub AIO_Out (Channel As Integer, Value As Single)

Parameters

  • Channel
    Specifies the analog I/O channel number.
  • Value
    An expression or number that specifies the real number indicating the voltage [V] or current [mA] you want to output.

Return Value
Returns specified analog I/O channel voltage and current output state in real number. Unit of voltage output is [V] and current output is [mA].
For Function AIO_Out (Channel As Integer) As Single: When outputting the speed information of the robot on specified channel, a return value can be acquired by this method.

Remarks
Output the real value indicating specified voltage [V] or current [mA] to analog output port which specified on channel port. Set the voltage output range of analog output port or selection of voltage and current output by the switch on the board. If setting a value which out of range of analog I/O port, output the border value (maximum and minimum value) which is not out of the range.
For Sub AIO_Out (Channel As Integer, Value As Single): The output setting of this method becomes an error if outputting the speed information by specified channel. Stop the speed information output and execute this method.

See Also
AIO_In, AOI_InW, AIO_OutW

AIO_Out Example
VB Example:

Dim val As Single  
val = m_spel.AIO_Out(1)  

C# Example:

float val;  
val = m_spel.AIO_Out(1);  

AIO_OutW Method, Spel Class

Description
Reads or set analog value from the optional analog I/O output channel.

Syntax
Function AIO_OutW (Channel As Integer) As Integer
Sub AIO_OutW (Channel As Integer, OutputData As Integer)

Parameters

  • Channel
    Specifies the analog I/O channel number.
  • OutputData
    An expression or number that specifies the output data (0 to 65535).

Return Value
Returns the output state of specified analog I/O channel in Long integers from 0 to 65535.
The following table shows output voltage (current) and return value of each output channel according to output range configuration of analog I/O board.

Output Data Output Range Configuration
Hexadecimal Decimal ±10(V) ±5(V) 0-5(V) 0-10(V) 4-20(mA) 0-20(mA)
0xFFFF 65535 9.99970 4.99985 5.00000 10.00000 20.00000 20.00000
0x8001 32769 0.00031 0.00015 2.50008 5.00015 12.00024 10.00031
0x8000 32768 0.00000 0.00000 2.50000 5.00000 12.00000 10.00000
0x0000 0 -10.00000 -5.00000 0.00000 0.00000 4.00000 0.00000

This method is available when outputting the speed information of the robot on specified channel.

See Also
AIO_In, AOI_InW, AIO_Out

AIO_OutW Example
VB Example:

Dim val As Integer  
val = m_spel.AIO_OutW(1)  

C# Example:

int val;  
val = m_spel.AIO_OutW(1);  

Arc Method, Spel Class

Description
Arc moves the arm to the specified point using circular interpolation in the XY plane.

Syntax
Sub Arc (MidPoint As Integer, EndPoint As Integer)
Sub Arc (MidPoint As SpelPoint, EndPoint As SpelPoint)
Sub Arc (MidPoint As String, EndPoint As String)

Parameters
Each syntax has two parameters that specify the mid point and end point of the arc.

  • MidPoint
    An integer, SpelPoint or character string indicating the mid point.
  • EndPoint
    Specifies the target point using an integer, SpelPoint or character string. When using a character string, you can include ROT, CP, SYNC, Till, Find, and a parallel processing statement.

See Also
AccelR, AccelS, SpeedR, SpeedS
Arc3, CVMove, Go, Jump, Jump3, Jump3CP, Move
BGo, BMove, TGo, TMove
Find, Till

Arc Example
VB Example:

' Points specified using SpelPoint  
Dim midPoint, endPoint As SpelPoint  
midPoint = m_spel.GetPoint("P1")  
endPoint = m_spel.GetPoint("P2")  
m_spel.Arc(midPoint, endPoint)  
  
' Points specified using expressions  
m_spel.Arc("P1", "P2")  
m_spel.Arc("P1", "P2 CP")  
  
' Using parallel processing  
m_spel.Arc("P1", "P2 \!D50; On 1; D90; Off 1\!")  

C# Example:

// Points specified using SpelPoint  
SpelPoint midPoint, endPoint;  
midPoint = m_spel.GetPoint("P1");  
endPoint = m_spel.GetPoint("P2");  
m_spel.Arc(midPoint, endPoint);  
  
// Points specified using expressions  
m_spel.Arc("P1", "P2");  
m_spel.Arc("P1", "P2 CP");  
  
// Using parallel processing  
m_spel.Arc("P1", "P2 \!D50; On 1; D90; Off 1\!");  

Arc3 Method, Spel Class

Description
Arc3 moves the arm to the specified point using circular interpolation in 3 dimensions.

Syntax
Sub Arc3 (MidPoint As Integer, EndPoint As Integer)
Sub Arc3 (MidPoint As SpelPoint, EndPoint As SpelPoint)
Sub Arc3(MidPoint As String, EndPoint As String)

Parameters
Each syntax has two parameters that specify the mid point and end point of the arc.

  • MidPoint
    An integer, SpelPoint or character string indicating the mid point.
  • EndPoint
    Specifies the target point using an integer, SpelPoint or character string. When using a character string, you can include ROT, CP, SYNC, Till, Find, and a parallel processing statement.

See Also
AccelR, AccelS, SpeedR, SpeedS
Arc, CVMove, Go, Jump, Jump3, Jump3CP, Move
BGo, BMove, TGo, TMove
Find, Till

Arc3 Example
VB Example:

' Points specified using SpelPoint  
Dim midPoint, endPoint As SpelPoint  
midPoint = m_spel.GetPoint("P1")  
endPoint = m_spel.GetPoint("P2")  
m_spel.Arc3(midPoint, endPoint)  
  
' Points specified using expressions  
m_spel.Arc3("P1", "P2")  
m_spel.Arc3("P1", "P2 CP")  
  
' Using parallel processing  
m_spel.Arc3("P1", "P2 \!D50; On 1; D90; Off 1\!")  

C# Example:

// Points specified using SpelPoint  
SpelPoint midPoint, endPoint;  
midPoint = m_spel.GetPoint("P1");  
endPoint = m_spel.GetPoint("P2");  
m_spel.Arc3(midPoint, endPoint);  
  
// Points specified using expressions  
m_spel.Arc3("P1", "P2");  
m_spel.Arc3("P1", "P2 CP");  
  
// Using parallel processing  
m_spel.Arc3("P1", "P2 \!D50; On 1; D90; Off 1\!");  

Arch Method, Spel Class

Description
Defines ARCH parameters (Z height to move before beginning horizontal motion) for use with the JUMP instructions.

Syntax
Sub Arch (ArchNumber As Integer, DepartDist As Integer, ApproDist As Integer)

Parameters

  • ArchNumber
    An integer indicating the arch number from 0 to 6.
  • DepartDist
    For the Jump command: the depart distance (vertical distance from the starting point) in mm moved before starting horizontal motion. For the Jump3 and Jump3CP commands: the depart distance in mm moved before starting span motion.
  • ApproDist
    For the Jump command: the approach distance (vertical distance from the target point) in mm moved when horizontal motion has completely finished. For the Jump3 and Jump3CP commands: the approach distance in mm moved when span motion has completely finished.

See Also
Jump, Jump3, Jump3CP

Arch Example
VB Example:

Sub SetArchs()  
    With m_spel  
        .Arch(1, 30, 30)  
        .Arch(2, 60, 60)  
        .Jump("P1 C1")  
        .Jump("P2 C2")  
    End With  
End Sub  

C# Example:

void SetArchs()  
{  
    m_spel.Arch(1, 30, 30);  
    m_spel.Arch(2, 60, 60);  
    m_spel.Jump("P1 C1");  
    m_spel.Jump("P2 C2");  
}  

Arm Method, Spel Class

Description
Selects the current robot arm.

Syntax
Sub Arm (ArmNumber As Integer)

Parameters

  • ArmNumber
    An integer or formula (valid range: 0 to 15) to select up to 16 different arms. Arm 0 is the standard (default) robot arm. Arm(s) 1-15 are auxiliary arms defined by the ArmSet instruction.

See Also
ArmSet, GetArm, Tool

Arm Example
VB Example:

m_spel.Arm(1)  

C# Example:

m_spel.Arm(1);  

ArmClr Method, Spel Class

Description
Clears (undefines) an arm for the current robot.

Syntax
Sub ArmClr (ArmNumber As Integer)

Parameters

  • ArmNumber
    An integer or formula (valid range: 1 to 15) that specifies the arm number for which to clear the settings. As Arm 0 is the standard (default) setting, it cannot be cleared. Arm(s) 1-15 are auxiliary arms defined by the ArmSet instruction.

See Also
ArmSet, GetArm, Tool

ArmClr Example
VB Example:

m_spel.ArmClr(1)  

C# Example:

m_spel.ArmClr(1);  

ArmDef Method, Spel Class

Description
Returns whether a robot arm is defined or not.

Syntax
Function ArmDef (ArmNumber As Integer) As Boolean

Parameters

  • ArmNumber
    An integer between 0 and 15. Arm 0 is the standard (default) robot arm and is always set. Arm(s) 1-15 are auxiliary arms defined by using the ArmSet method.

Return Value
True if the specified arm is defined, False if not.

See Also
ArmSet, GetArm, Tool

ArmDef Example
VB Example:

x = m_spel.ArmDef(1)  

C# Example:

x = m_spel.ArmDef(1);  

ArmSet Method, Spel Class

Description
Defines an auxiliary robot arm.

Syntax
Sub ArmSet ( ArmNumber As Integer, Param1 As Single, Param2 As Single, Param3 As Single, Param4 As Single, Param5 As Single )

Parameters

  • ArmNumber
    Integer (valid range: 1 to 15)
  • Param1
    (For SCARA Robots) The horizontal distance from the center line of the elbow joint to the center line of the new orientation axis (i.e. the position where the center line of the new auxiliary arm orientation axis is located). (For Cartesian Robots) The positional offset in the X-axis direction (units: mm).
  • Param2
    (For SCARA Robots) The offset (in degrees) between the line subtended between the standard elbow joint center line and the center of the orientation axis and the line subtended between the new auxiliary arm elbow joint center line and the center of the orientation axis. (These 2 lines should intersect at the elbow center line and the angle formed is the Param2.) (For Cartesian Robots) Y axis direction position offset from the original Y position specified in mm.
  • Param3
    (For SCARA & Cartesian Robots) The Z height offset difference between the new orientation axis center line and the old orientation axis center line.
  • Param4
    (For SCARA Robots) The distance from the shoulder center line to the elbow center line of the new auxiliary arm. (For Cartesian Robots) This is a dummy parameter (Specify 0).
  • Param5
    (For SCARA & Cartesian Robots) The angular offset (in degrees) between the new arm orientation axis and the old arm orientation axis.

See Also
Arm, Tool, TLSet

ArmSet Example
VB Example:

Sub SetArms()  
    With m_spel  
        .ArmSet(1, 1.5, 0, 0, 0, 0)  
        .ArmSet(2, 3.2, 0, 0, 0, 0)  
    End With  
End Sub  

C# Example:

void SetArms()  
{  
    m_spel.ArmSet(1, 1.5, 0, 0, 0, 0);  
    m_spel.ArmSet(2, 3.2, 0, 0, 0, 0);  
}  

Atan Method, Spel Class

Description
Returns the arc tangent of a numeric expression.

Syntax
Function Atan (number As Double) As Double

Parameters

  • number
    Angle tangent (real number)

Return Value
Arc tangent of the specified value

See Also
Atan2

Atan Example
VB Example:

Dim angle As Doubleangle = m_spel.Atan(.7)  

C# Example:

double angle;  
  
angle = m_spel.Atan(.7);  

Atan2 Method, Spel Class

Description
Returns the angle of the imaginary line connecting points (0,0) and (X, Y) in radians.

Syntax
Function Atan2 (Dx As Double, Dy as Double) As Double

Parameters

  • Dx
    A real number indicating the X coordinate
  • Dy
    A real number indicating the Y coordinate

Return Value
A double value containing the angle.

See Also
Atan

Atan2 Example
VB Example:

Dim angle As Double  
  
angle = m_spel.Atan2(-25, 50)  

C# Example:

double angle;  
  
angle = m_spel.Atan2(-25, 50);  

ATCLR Method, Spel Class

Description
Clears and initializes the average torque for one or more joints.

Syntax
Sub ATCLR ()

See Also
ATRQ, PTCLR, PTRQ

ATCLR Example
VB Example:

m_spel.ATCLR()  

C# Example:

m_spel.ATCLR();  

AtHome Method, Spel Class

Description
Returns True if the current robot is at the home position.

Syntax
Function AtHome () As Boolean

Return Value
True if the current robot is at it's home position, False if not.

See Also
Home

AtHome Example
VB Example:

If m_spel.AtHome() Then  
    lblCurPos.Text = "Robot is at home position"  
Else  
    lblCurPos.Text = "Robot is not at home position"  
End If  

C# Example:

if(m_spel.AtHome())  
    lblCurPos.Text = "Robot is at home position";  
else  
    lblCurPos.Text = "Robot is not at home position";  

ATRQ Method, Spel Class

Description
Returns the average torque for the specified joint.

Syntax
Function ATRQ (JointNumber As Integer) As Single

Parameters

  • JointNumber
    An integer indicating the axis number (range: 1 to number of joints of the robot)

Return Value
Real value from 0 to 1.

See Also
ATCLR, PTCLR, PTRQ

ATRQ Example
VB Example:

Dim val As Single  
Dim i As Integer  
For i = 1 To 4  
val = m_spel.ATRQ(i)  
Next i  

C# Example:

float avgTorque;  
for(int i = 1; i <= 4; i++)  
    avgTorque = m_spel.ATRQ(i);  

AvgSpeed Method, Spel Class

Description
Returns the average value of the absolute speed values for the specified joints.

Syntax
Function AvgSpeed (JointNumber As Integer) As Single

Parameters

  • JointNumber
    An integer indicating the axis number (range: 1 to number of joints of the robot)

Return Value
Real value from 0 to 1.

Remarks
This method returns the average value of the absolute speed values for the specified joints. The loading state of the motor can be obtained by this method. The result is a real value from 0 to 1 with 1 being the maximum average speed value.

You must execute this method before AvgSpeedClear method is executed.

This method is time restricted. You must execute thismethod within 60 seconds after AvgSpeedClear method is executed. When this time is exceeded, error 4088 occurs.

When using the virtual controller or conducting dry-run, the average of the absolute speed values is calculated from the commanded speed instead of the actual speed.
This method does not support the PG additional axes.

See Also
AvgSpeedClear, PeakSpeed, PeakSpeedClear

AvgSpeed Example
VB Example:

Dim val As Single  
Dim i As Integer  
For i = 1 To 4  
val = m_spel.AvgSpeed(i)  
Next i  

C# Example:

float avgSpeed;  
for(int i = 0; i <=4; i++)  
    avgSpeed = m_spel.AvgSpeed(i);  

AvgSpeedClear Method, Spel Class

Description
Clears and initializes the average of the absolute speed values for one or more joints.

Syntax
Sub AvgSpeedClear ()

Remarks
This method clears the average of the absolute speed values for the specified joints.
You must execute this method before executing AvgSpeed method.
This method does not support the PG additional axes.

See Also
AvgSpeed, PeakSpeed, PeakSpeedClear

AvgSpeedClear Example
VB Example:

m_spel.AvgSpeedClear()  

C# Example:

m_spel.AvgSpeedClear();  

AxisLocked Method, Spel Class

Description
Returns True when specified axis release free joint state.

Syntax
Function AxisLocked (AxisNumber As Integer) As Boolean

Parameters

  • AxisNumber
    A number between 1 and 9 indicating the axis number

Return Value
True if the specified axis is under servo control.

See Also
SLock, SFree

AxisLocked Example
VB Example:

If m_spel.AxisLocked(1) Then  
    lblAxis1.Text = "Robot axis \#1 is locked"  
Else  
    lblAxis1.Text = "Robot axis \#1 is free"  
End If  

C# Example:

if (m_spel.AxisLocked(1))  
    lblAxis1.Text = "Robot axis \#1 is locked";  
else  
    lblAxis1.Text = "Robot axis \#1 is free";  

Base Method, Spel Class

Description
Defines the base coordinate system.

Syntax
Sub Base (OriginPoint As SpelPoint [, XAxisPoint As SpelPoint] [, YAxisPoint As SpelPoint] [, Alignment As SpelBaseAlignment] )

Parameters

  • OriginPoint
    Point data that specifies the origin and orientation of the base coordinate system
  • XAxisPoint
    Optional. SpelPoint on the X-axis of the base coordinate system.
  • YAxisPoint
    Optional. SpelPoint on the Y-axis of the base coordinate system.
  • Alignment
    Specifies which axis should be priority matched to the base when the parameters XAxisPoint and YAxisPoint are given. Optional.

See Also
Local

Base Example
VB Example:

Dim originPoint As New SpelPoint  
originPoint.X = 50  
originPoint.Y = 50  
m_spel.Base(originPoint)  

C# Example:

SpelPoint originPoint = new SpelPoint();  
originPoint.X = 50;  
originPoint.Y = 50;  
m_spel.Base(originPoint);  

BGo Method, Spel Class

Description
Executes Point to Point relative motion in the selected local coordinate system.

Syntax
Sub BGo (PointNumber As Integer)
Sub BGo (Point As SpelPoint)
Sub BGo (Point As SpelPoint, AttribExpr As String)
Sub BGo (PointExpr As String)

Parameters
Each syntax has one parameter that specifies the end point which the arm travels to during the BGo motion. This is the final position at the end of the point to point motion.

  • PointNumber
    Specifies the target point using a previously taught point number from the current robot point memory stored in the controller.
  • Point
    Specifies the target point using the SpelPoint data type.
  • AttribExpr
    Specifies the end point attributes using a string expression.
    It can contain CP, SYNC, Till or Find search expressions, and parallel processing statements.
  • PointExpr
    Specifies the target point using a string expression.
    It can contain CP, SYNC, Till or Find search expressions, and parallel processing statements.

See Also
Accel, Speed
Arc, Arc3, CVMove, Go, Jump, Jump3, Jump3CP, Move
BMove, TGo, TMove
Find, Till

BGo Example
VB Example:

' Using a point number  
m_spel.Tool(1)  
m_spel.BGo(100)  
  
' Using a SpelPoint  
Dim pt As SpelPoint  
pt = m_spel.GetPoint("P*")  
pt.X = 125.5  
m_spel.BGo(pt)  
  
' Using an attribute expression  
m_spel.BGo(pt, "Till")  
  
' Using a point expression  
m_spel.BGo("P0 /L /2")  
m_spel.BGo("P1 :Z(-20)")  
  
' Using a parallel processing  
m_spel.BGo("P1 \!D50; On 1; D90; Off 1\!")  
  
' Using point label  
m_spel.BGo("pick")  

C# Example:

// Using a point number  
m_spel.Tool(1);  
m_spel.BGo(100);  
  
// Using a SpelPoint  
SpelPoint pt;  
pt = m_spel.GetPoint("P*");  
pt.X = 125.5;  
m_spel.BGo(pt);  
  
// Using an attribute expression  
m_spel.BGo(pt, "Till");  
  
// Using a point expression  
m_spel.BGo("P0 /L /2");  
m_spel.BGo("P1 :Z(-20)");  
  
// Using a parallel processing  
m_spel.BGo("P1 \!D50; On 1; D90; Off 1\!");  
  
// Using point label  
m_spel.BGo("pick");  

BMove Method, Spel Class

Description
Executes linear interpolated relative motion in the selected local coordinate system

Syntax
Sub BMove (PointNumber As Integer)
Sub BMove (Point As SpelPoint)
Sub BMove (Point As SpelPoint, AttribExpr As String)
Sub BMove (PointExpr As String)

Parameters
Each syntax has one parameter that specifies the end point which the arm travels to during the BMove motion. This is the final position at the end of the linear interpolated motion.

  • PointNumber
    Specifies the target point using a previously taught point number from the current robot point memory stored in the controller.
  • Point
    Specifies the target point using the SpelPoint data type.
  • AttribExpr
    Specifies the end point attributes using a string expression.
    It can contain ROT, CP, SYNC, Till or Find search expressions, and parallel processing statements.
  • PointExpr
    Specifies the target point using a string expression.
    It can contain ROT, CP, SYNC, Till or Find search expressions, and parallel processing statements.

See Also
AccelR, AccelS, SpeedR, SpeedS
Arc, Arc3, CVMove, Go, Jump, Jump3, Jump3CP, Move
BGo, TGo, TMove
Find, Till

BMove Example
VB Example:

' Using a point number  
m_spel.Tool(1)  
m_spel.BMove(100)  
  
' Using a SpelPoint  
Dim pt As SpelPoint  
pt = m_spel.GetPoint("P*")  
pt.X = 125.5  
m_spel.BMove(pt)  
  
' Using a point expression  
m_spel.BMove("P0 /L /2 ROT")  
m_spel.BMove("P1 :Z(-20)")  
  
' Using a parallel processing  
m_spel.BMove("P1 \!D50; On 1; D90; Off 1\!")  
  
' Using point label  
m_spel.BMove("pick")  

C# Example:

// Using a point number  
m_spel.Tool(1);  
m_spel.BMove(100);  
  
// Using a SpelPoint  
SpelPoint pt;  
pt = m_spel.GetPoint("P*");  
pt.X = 125.5;  
m_spel.BMove(pt);  
  
// Using a point expression  
m_spel.BMove("P0 /L /2");  
  
// Using a parallel processing  
m_spel.BMove("P1 \!D50; On 1; D90; Off 1\!");  
  
// Using point label  
m_spel.BMove("pick");  

Box Method, Spel Class

Description
Specifies an approach check area defined within a box.

Syntax
Sub Box (AreaNumber As Integer, MinX As Single, MaxX As Single, MinY As Single, MaxY As Single, MinZ As Single, MaxZ As Single)
Sub Box (AreaNumber As Integer, MinX As Single, MaxX As Single, MinY As Single, MaxY As Single, MinZ As Single, MaxZ As Single, PolarityOn As Boolean)

Parameters

  • AreaNumber
    An integer from 1 to 15 indicating the number of the set area.
  • MinX
    A number or formula that specifies the minimum X coordinate position (real number) of the set area.
  • MaxX
    A number or formula that specifies the maximum X coordinate position (real number) of the set area.
  • MinY
    A number or formula that specifies the minimum Y coordinate position (real number) of the set area.
  • MaxY
    A number or formula that specifies the maximum Y coordinate position (real number) of the set area.
  • MinZ
    A number or formula that specifies the minimum Z coordinate position (real number) of the set area.
  • MaxZ
    A number or formula that specifies the maximum Z coordinate position (real number) of the set area.
  • PolarityOn
    Optional. Sets the remote output logic when the corresponding remote output is used. To set I/O output to on when the end effector is in the box area, use True. To set I/O output to off when the end effector is in the box area, use False.

See Also
BoxClr, BoxDef, Plane

Box Example
VB Example:

m_spel.Box(1, -5, 5, -10, 10, -20, 20)  

C# Example:

m_spel.Box(1, -5, 5, -10, 10, -20, 20);  

BoxClr Method, Spel Class

Description
Clears the definition of a box (approach check area).

Syntax
Sub BoxClr (BoxNumber As Integer)

Parameters

  • BoxNumber
    An integer expression or number (1 to 15) indicating the approach check area number to clear.

See Also
Box, BoxDef

BoxClr Example
VB Example:

m_spel.BoxClr(1)  

C# Example:

m_spel.BoxClr(1);  

BoxDef Method, Spel Class

Description
Returns whether Box has been defined or not.

Syntax
Function BoxDef (BoxNumber As Integer) As Boolean

Parameters

  • BoxNumber
    An integer expression or number (1 to 15) indicating the approach check area number to return the status for.

Return Value
True if the specified box is defined, False if not.

See Also
Box, BoxClr

BoxDef Example
VB Example:

x = m_spel.BoxDef(1)  

C# Example:

x = m_spel.BoxDef(1);  

Brake Method, Spel Class

Description
Reads or sets brake status for specified joint.

Syntax
Sub Brake (JointNumber As Integer, State As Boolean)
Function Brake (JointNumber As Integer) As Boolean

Parameters

  • JointNumber
    An integer indicating the axis number (range: 1 to number of joints of the robot)
  • State
    To apply the brake: On To release the brake: Off

Return Value
0 = Brake Off
1 = Brake On

Remarks
This method is used to turn brakes on or off for one joint of the 6-axis robot (including N series). This method is intended for use by maintenance personnel only.

When this method is executed, the robot control parameter is initialized.

WARNING


Use extreme caution when turning off a brake. Ensure that the joint is properly supported, otherwise the joint can fall and cause damage to the robot and personnel.

Note


Before releasing the brake, be ready to use the emergency stop switch

When the controller is in emergency stop status, the motor brakes are locked. Be aware that the robot arm may fall by its own weight when the brake is turned off with Brake command.

See Also
Reset, SFree, SLock

Brake Example
VB Example:

Dim state As Boolean  
state = m_spel.Brake(1)  

C# Example:

bool state;  
state = m_spel.Brake(1);  

BTst Method, Spel Class

Description
Returns the status of 1 bit in a number.

Syntax
Function BTst (Number As Integer, BitNumber As Integer) As Boolean

Parameters

  • Number
    An expression or number that specifies the number to use for the bit test.
  • BitNumber
    A number between 0 and 31 that specifies the bit number to test.

Return Value
True if the specified bit is set, False if not.

See Also
On, Off

BTst Example
VB Example:

x = m_spel.BTst(data, 2)  

C# Example:

x = m_spel.BTst(data, 2);  

BuildProject Method, Spel Class

Description
Builds the Epson RC+ 8.0 project specified by the Project property.

Syntax
Sub BuildProject ()

See Also
Project, ProjectBuildComplete, ProjectOverwriteWarningEnabled

BuildProject Example
VB Example:

With m_spel  
    .Project = "c:\EpsonRC80\projects\myproj\myproj.sprj"  
    If Not .ProjectBuildComplete() Then  
        .BuildProject()  
    End If  
End With  

C# Example:

m_spel.Project = @"c:\EpsonRC80\projects\myproj\myproj.sprj";  
if(\!m_spel.ProjectBuildComplete())  
    m_spel.BuildProject();  

Call Method, Spel Class

Description
Calls (executes) a SPEL+ function which can optionally return a value.

Syntax
Function Call (FuncName As String [, Parameters As String]) As Object

Parameters

  • FuncName
    Function name to call
    Parameters Optional. Specify a list of arguments. Use arguments separated by commas (,).

Return Value
The return value of the SPEL+ function.
The data type matches the data type of the function.

Remarks
Use the Call method to call a SPEL+ function and retrieve the return value. When assigning the result of Call to a variable, ensure that the correct data type is used, otherwise a type mismatch error will occur.
You can also call DLL functions declared in your SPEL+ code from your Visual Basic application.

Note


To stop the function executed by Call Method, use Stop Method. With Stop Method, the return value of Call Method becomes null. The function executed by Call Method cannot be paused by Pause or Halt Method. If you need to pause, use Xqt Method.

See Also
Xqt

Call Example

' Visual Basic Code  
Dim errCode As Integer  
errCode = m_spel.Call("GetPart", """Test"",2")  
  
// C# Code  
int errCode;  
errCode = m_spel.Call("GetPart", """Test"",2");  
  
' SPEL+ function  
Function GetPart(Info$ As String, Timeout As Integer) As Integer  
    Long errNum  
OnErr GoTo GPErr  
    Print Info$  
    errNum = 0  
    Jump P1  
    On vacuum  
    Wait Sw(vacOn) = On, Timeout  
    If TW = True Then  
        errNum = VAC_TIMEOUT  
    EndIf  
  
    GetPart = errNum  
    Exit Function  
GPErr:  
    GetPart = Err  
Fend  

CalPls Method, Spel Class

Description
Reads or sets the position and orientation pulse values for calibration.

Syntax
Function CalPls (JointNumber As Integer) As Integer
Sub CalPls (J1Pulses As Integer, J2Pulses As Integer, J3Pulses As Integer, J4Pulses As Integer, [J5Pulses As Integer], [J6Pulses As Integer], [J7Pulses As Integer], [J8Pulses As Integer], [J9Pulses As Integer])

Parameters

  • J1Pulses - J9Pulses
    Integers indicating the pulse values for Joints 1 to 9. J5Pulses to J9Pulses are optional

Return Value
When parameters are omitted, displays the current CalPls values.

Remarks
Specifies and maintains the correct position pulse value(s) for calibration.

CalPls is intended to be used for maintenance, such as after changing motors or when motor zero position needs to be matched to the corresponding arm mechanical zero position. This matching of motor zero position to corresponding arm mechanical zero position is called calibration. Normally, the calibration position Pulse values match the CalPls pulse values.

However, after performing maintenance operations such as changing motors, these two sets of values no longer match, and therefore calibration becomes necessary.

Calibration may be accomplished by moving the arm to a certain calibration position and then executing Calib. By executing Calib, the calibration position pulse value is changed to the CalPls value (the correct pulse value for the calibration position.)

Hofs values must be determined to execute calibration. To have Hofs values automatically calculated, move the arm to the desired calibration position, and execute Calib. The controller automatically.

Note


CalPls Values Cannot be Changed by cycling power

CalPls values are not initialized by turning main power to the controller off and then on again. The only method to modify the CalPls values is to execute the Calib command.

See Also
Hofs

CalPls Example
VB Example:

Dim val As Single  
Dim i As Integer  
For i = 1 To 4  
val = m_spel.CalPls(i)  
Next i  

C# Example:

float val;  
for(int i = 1; i <= 4; i++)  
	val = m_spel.CalPls(i);  

ClearPoints Method, Spel Class

Description
Clears the points in memory for the current robot.

Syntax
Sub ClearPoints ()

See Also
LoadPoints, Robot, SavePoints, SetPoint

ClearPoints Example
VB Example:

With m_spel  
    .ClearPoints()  
    .SetPoint(1, 100, 200, -20, 0, 0, 0)  
    .Jump(1)  
End With  

C# Example:

m_spel.ClearPoints();  
m_spel.SetPoint(1, 100, 200, -20, 0, 0, 0);  
m_spel.Jump(1);  

Connect Method, Spel Class

Description
Connects the Spel class instance with a Controller.

Syntax
Sub Connect (ConnectionName As String)
Sub Connect (ConnectionName As String, ConnectionPassword As String)
Sub Connect (ConnectionNumber As Integer)
Sub Connect (ConnectionNumber As Integer, ConnectionPassword As String)

Parameters

  • ConnectionName
    A character string indicating the connection name.
  • ConnectionNumber
    An integer indicating the connection number. The connection number is the number of the connection in the RC+ Setup - PC to Controller Communications dialog. Specify a value of -1 to use the last successful connection.
  • ConnectionPassword
    A character string indicating the connection password. If the controller requires a password for connection but the password has not been configured in the RC+ Setup - PC to Controller Communications dialog, you must set the password to connect with the controller.

Remarks
When a Spel class instance needs to communicate with the Controller, it automatically connects. If you want to explicitly connect to the Controller, use the Connect method.

See Also
Disconnect, Initialize

Note


When you change the connection number in [PC to Controller Communications] dialog, the parameter value of this method "ConnectionNumber" will be affected. Review the RC+ API program.

Connect Example
VB Example:

  Try  
    m_spel.Connect(1)  
  Catch ex As RCAPINet.SpelException  
    MsgBox(ex.Message)  
  End Try  

C# Example:

try{  
    m_spel.Connect(1);  
}  
catch(RCAPINet.SpelException ex){  
    MessageBox.Show(ex.Message);  
}  

Continue Method, Spel Class

Description
Causes all tasks in the Controller to resume if a pause has occurred.

Syntax
Sub Continue ()

Remarks
Use Continue to resume all tasks that have been paused by the Pause method or by safeguard open.
When the safeguard is open while tasks are running, the robot will decelerate to a stop and the robot motors will be turned off. After the safeguard has been closed, you can use Continue to resume the cycle.

See Also
Pause, Start, Stop

Continue Example
VB Example:

Sub btnContinue_Click( _  
     ByVal sender As System.Object, _  
     ByVal e As System.EventArgs) Handles btnContinue.Click  
  
    btnPause.Enabled = True  
    btnContinue.Enabled = False  
  Try  
    m_spel.Continue()  
  Catch ex As RCAPINet.SpelException  
    MsgBox(ex.Message)  
  End Try  
End Sub  

C# Example:

void btnContinue_Click(object sender, EventArgs e)  
{  
btnPause.Enabled = true;  
   btnContinue.Enabled = true;  
  
    try{  
                 m_spel.Continue();  
		}  
		catch(RCAPINet.SpelException ex){  
                 MessageBox.Show(ex.Message);  
		}  
}  

Ctr Method, Spel Class

Description
Returns the counter value of the specified input counter.

Syntax
Function Ctr (BitNumber As Integer) As Integer

Parameters

  • BitNumber
    Number of input bits configured as counters. Only 16 counters can be active at the same time.

Return Value
Returns the counter value.( integer from 0 to 65535)

See Also
CtReset

Ctr Example
VB Example:

lblCounter.Text = m_spel.Ctr(1).ToString()  

C# Example:

lblCounter.Text = m_spel.Ctr(1).ToString();  

CtReset Method, Spel Class

Description
Resets the counter value of the specified input counter. Also defines the input as a counter Input.

Syntax
Sub CtReset (BitNumber As Integer)

Parameters

  • BitNumber
    Number of input bits configured as counters. Only 16 counters can be active at the same time.

See Also
Ctr

CtReset Example
VB Example:

m_spel.CtReset(2)  

C# Example:

m_spel.CtReset(2);  

Curve Method, Spel Class

Description
Defines the data and points required to move the arm along a curved path. Many data points can be defined in the path to improve precision of the path.

Syntax
Sub Curve (FileName As String, Closure As Boolean, Mode As Integer, NumOfAxis As Integer, PointList As String)

Parameters

  • FileName
    A character string indicating the path and file name where the point data is stored. The extension .crv is appended to the specified file. When the Curve instruction is executed, fileName will be created.
  • Closure
    A Boolean expression that specifies whether the end point of the path is connected to the start point.
  • Mode
    Specifies whether or not the arm is automatically interpolated in the U-axis tangential direction.
Mode Setting Tangental Correction
0 No
2 Yes
  • NumOfAxes
    Integer expression between 2 and 4 which specifies the axis numbers controlled during the curved motion as follows: 2: Generate a curve in the XY plane with no U-Axis rotation. 3: Generate a curve in the XYZ plane with no U-Axis rotation. (Theta 1, Theta2, and Z) 4: Generate a curve in the XYZ plane with U-Axis rotation. (Controls all 4 Axes)
  • pointList
    {point expression | P(start:end) } [, output command ] ... This parameter is a series of point data separated by commas. If the point data is complete and listed in ascending or descending order, two point numbers can be combined using a colon and specified like P(1:5). Normally the series of points are separated by commas as shown below: Curve MyFile, O, 0, 4, P1, P2, P3, P4 Or use a colon to specify as shown below: Curve MyFile, O, 0, 4, P(1:4) In the case shown above the user defined a curve using points P1, P2, P3, and P4. output command is optional and is used to control output operation during curve motion. The command can be On or Off for digital outputs or memory outputs. Entering an output command following any point number in the point series causes execution of the output command when the arm reaches the point just before the output command. A maximum of 16 output commands may be included in one Curve statement. In the example below, the "On 2" command is executed just as the arm reaches the point P2, then the arm continues to all points between and including P3 and P10. Curve "MyFile", C, 0, 4, P1, P2, ON 2, P(3:10)

Remarks
Use Curve to define a spline path to be executed with the CVMove method. See the SPEL+ command Curve for more details.

See Also
Curve (SPEL+ Statement), CVMove Method

Curve Example
VB Example:

m_spel.Curve("mycurveFile", True, 0, 4, "P(1:3), On 1, P(4:7)")  
m_spel.CVMove("mycurveFile")  

C# Example:

m_spel.Curve("mycurveFile", True, 0, 4, "P(1:3), On 1, P(4:7)");  
m_spel.CVMove("mycurveFile");  

CVMove Method, Spel Class

Description
Performs the continuous spline path motion defined by the Curve instruction.

Syntax
Sub CVMove (FileName As String [, OptionList As String])

Parameters

  • FileName
    A string expression indicating the file name created by the Curve instruction.
  • OptionList
    Optional. A character string indicating the Till specification.

Remarks
Use CVMove to execute a path defined with the Curve method. See the SPEL+ command CVMove for more details. If you need to execute CVMove with CP, it is recommended that you execute CVMove from a SPEL+ task rather than from your application. The reason for this is that for CP motion to perform properly, the system needs to know ahead of time where the next motion target is. Since the RC+ API commands are executed one at a time, the system does not know ahead of time where the next target is.

See Also
Curve, CVMove (SPEL+ Command)

CVMove Example
VB Example:

m_spel.Curve("mycurveFile", True, 0, 4, "P(1:3), On 1, P(4:7)")  
m_spel.CVMove("mycurveFile", "CP Till Sw(1) = 1")  
m_spel.CVMove("mycurveFile")  

C# Example:

m_spel.Curve("mycurveFile", True, 0, 4, "P(1:3), On 1, P(4:7)");  
m_spel.CVMove("mycurveFile", "CP Till Sw(1) = 1");  
m_spel.CVMove("mycurveFile");  

CX, CY, CZ, CU, CV, CW, CR, CS, CT Methods, Spel Class

Description
Retrieves a coordinate value from a point - CV and CW are for the 6-axis robot- CS and CT are for the additional axis - CR is for the Joint 7-axis robot

Syntax
Function CX (PointExpr As String) As Single
Function CY (PointExpr As String) As Single
Function CZ (PointExpr As String) As Single
Function CU (PointExpr As String) As Single
Function CV (PointExpr As String) As Single
Function CW (PointExpr As String) As Single
Function CR (PointExpr As String) As Single
Function CS (PointExpr As String) As Single
Function CT (PointExpr As String) As Single

Parameters

  • PointExpr
    A string expression specifying the point from which to retrieve the specified coordinate. Any valid point expression can be used, as long as it starts with P0. P* can also be used to retrieve the coordinate from the current position.

Return Value
The specified coordinate value.
Return value of CX, CY, CZ : Real value (mm)
Return value of CU, CV, CW : Real value (deg)
Return value of CR, CS, CT : Real value

See Also
GetPoint, SetPoint

CX, CY, CZ, CU, CV, CW, CR, CS, CT Example
VB Example:

Dim x As Single, y As Single  
x = m_spel.CX("P1")  
y = m_spel.CY("P*")  

C# Example:

float x, y;  
x = m_spel.CX("P1");  
y = m_spel.CY("P*");  

Delay Method, Spel Class

Description
Delays for a specified number of milliseconds.

Syntax
Sub Delay (Milliseconds As Integer)

Parameters

  • Milliseconds
    The number of milliseconds to delay.

Delay Example
VB Example:

m_spel.Delay(500)  

C# Example:

m_spel.Delay(500);  

DegToRad Method, Spel Class

Description
Converts Degrees into Radians.

Syntax
Function DegToRad (degrees As Double) As Double

Parameters

  • degrees
    A real number indicating degrees to convert to radians.

Return Value
A double value containing radians.

See Also
RadToDeg

DegToRad Example
VB Example:

Dim rad As Double  
  
rad = m_spel.DegToRad(45)  

C# Example:

double rad;  
  
rad = m_spel.DegToRad(45);  

Disconnect Method, Spel Class

Description
Disconnects the Spel class instance from the current connection.

Syntax
Sub Disconnect ()

Remarks
Use Disconnect to disconnect from the current Controller connection.

See Also
Connect, Initialize

Disconnect Example
VB Example:

  Try  
    m_spel.Disconnect()  
  Catch ex As RCAPINet.SpelException  
    MsgBox(ex.Message)  
  End Try  

C# Example:

try{  
    m_spel.Disconnect();  
}  
catch(RCAPINet.SpelException ex){  
MessageBox.Show(ex.Message);}  

ECP Method, Spel Class

Description
Selects the current ECP definition.

Syntax
Sub ECP (ECPNumber As Integer)

Parameters

  • ECPNumber
    Optional. An integer from 0 to 15 indicating which of the 16 ECP definitions to use with the next motion instruction. ECP 0 disables the ECP selection

See Also
ECPSet

ECP Example
VB Example:

m_spel.ECP(1)  
m_spel.Move("P1 ECP")  

C# Example:

m_spel.ECP(1);  
m_spel.Move("P1 ECP");  

ECPClr Method, Spel Class

Description
Clears (undefines) an external control point for the current robot.

Syntax
Sub ECP (ECPNumber As Integer)

Parameters

  • ECPNumber
    An integer indicating the ECP number to clear (ECP 0 is the default. It cannot be cleared.)

See Also
ECP, ECPDef

ECP Example
VB Example:

m_spel.ECPClr(1)  

C# Example:

m_spel.ECPClr(1);  

ECPDef Method, Spel Class

Description
Returns ECP definition status.

Syntax
Function ECPDef (ECPNumber As Integer) As Boolean

Parameters

  • ECPNumber
    An integer indicating the ECP number of the status you want to call.

Return Value
True if the specified ECP is defined, False if not.

See Also
ECP, ECPClr

ECP Example
VB Example:

x = m_spel.ECPDef(1)  

C# Example:

x = m_spel.ECPDef(1);  

ECPSet Method, Spel Class

Description
Defines an ECP (external control point).

Syntax
Sub ECPSet ( ECPNumber As Integer, Point As SpelPoint)
Sub ECPSet (ECPNumber As Integer, XCoord as Double, YCoord as Double, ZCoord as Double, UCoord as Double [, VCoord As Double] [, WCoord as Double)]

Parameters

  • ECPNumber
    An expression or integer expression from 1 to 15 indicating which of the external control points to define.
  • Point
    A SpelPoint indicating the point data.
  • XCoord
    The external control point X coordinate.
  • YCoord
    The external control point Y coordinate.
  • ZCoord
    The external control point Z coordinate.
  • UCoord
    The external control point U coordinate.
  • VCoord
    Optional. The external control point V coordinate.
  • WCoord
    Optional. The external control point W coordinate.

See Also
ArmSet, ECP, GetECP, TLSet

ECPSet Example
VB Example:

m_spel.ECPSet(1, 100.5, 99.3, 0, 0)  

C# Example:

m_spel.ECPSet(1, 100.5, 99.3, 0, 0);  

EnableEvent Method, Spel Class

Description
Enables certain system events for the EventReceived event.

Syntax
Sub EnableEvent (EventNumber As RCAPINet.SpelEvents, Enabled as Boolean)

Parameters

  • EventNumber
    Event number to enable or disable.
  • Enabled
    True to enable the event or False to disable it.

See Also
EventReceived

EnableEvent Example
VB Example:

With m_spel  
  .EnableEvent(RCAPINet.SpelEvents.ProjectBuildStatus, True)  
  .BuildProject()  
End With  

C# Example:

m_spel.EnableEvent(RCAPINet.SpelEvents.ProjectBuildStatus, true);  
m_spel.BuildProject();  

ExecuteCommand Method, Spel Class

Description
Sends a command to Epson RC+ 8.0 and waits for it to complete

Syntax
Sub ExecuteCommand (Command As String , [ByRef Reply As String])

Parameters

  • Command
    A character string equivalent to the SPEL+command
  • Reply
    Returns the required response.

Remarks
Normally, ExecuteCommand is not required. Most operations can be performed by executing Spel methods. However, sometimes it is desirable to execute SPEL+ multi-statements. Multi-statements are one line commands that contain more than one statement separated by semi-colons. Use ExecuteCommand to execute multi-statements.

For example: m_spel.ExecuteCommand("JUMP pick; ON tipvac")
The maximum command line length is 200 characters.

See Also
Pause

ExecuteCommand Example
VB Example:

m_spel.ExecuteCommand("JUMP P1\!D50; ON 1\!")  

C# Example:

m_spel.ExecuteCommand("JUMP P1\!D50; ON 1\!");  

FBusIO_GetBusStatus Method, Spel Class

Description
Returns the status of the specified Fieldbus.

Syntax
Function FBusIO_GetBusStatus (BusNumber As Integer) As Integer

Parameters

  • BusNumber
    An integer indicating the Fieldbus system number. This number must be 16, which is the ID of the bus connected to the Fieldbus master board on the PC side of the controller.

Return Value
0 - OK
1 - Disconnected
2 - Power off

Remarks
Note
This method will only work if the Fieldbus Master option is active.

See Also
FBusIO_GetDeviceStatus, FBusIO_SendMsg, IsOptionActive

FBusIO_GetBusStatus Example
VB Example:

Dim val As Integer  
val = m_spel.FBusIO_GetBusStatus(16)  

C# Example:

int busStatus;  
busStatus = m_spel.FbusIO_GetBusStatus(16);  

FBusIO_GetDeviceStatus Method, Spel Class

Description
Returns the status of the specified Fieldbus device.

Syntax
Function FBusIO_GetDeviceStatus (BusNumber As Integer, DeviceID As Integer) As Integer

Parameters

  • BusNumber
    An integer indicating the Fieldbus system number. This number must be 16, which is the ID of the bus connected to the Fieldbus master board on the PC side of the controller.
  • DeviceID
    An integer indicating the Fieldbus ID of the device.

Return Value
0 - OK
1 - Disconnected
2 - Power off
3 - Synchronization error. Device is booting, or has incorrect baud rate.

Remarks
Note
This method will only work if the Fieldbus Master option is active.

See Also
FBusIO_GetBusStatus, FBusIO_SendMsg, IsOptionActive

FBusIO_GetDeviceStatus Example
VB Example:

Dim val As Integer  
val = m_spel.FBusIO_GetDeviceStatus(16, 10)  

C# Example:

dev
ideStatus = m_spel.FbusIO_GetDeviceStatus(16, 10);  

FBusIO_SendMsg Method, Spel Class

Description
Sends an explicit message to a Fieldbus device and returns the reply.

Syntax
Sub FBusIO_SendMsg (BusNumber As Integer, DeviceID As Integer, MsgParam As Integer, SendData As Byte(), ByRef RecvData As Byte())

Parameters

  • BusNumber
    An integer indicating the Fieldbus system number. This number must be 16, which is the ID of the bus connected to the Fieldbus master board on the PC side of the controller.
  • DeviceID
    An integer indicating the Fieldbus ID of the device.
  • MsgParam
    An integer expression indicating the message parameter. This is not available for DeviceNet.
  • SendData
    Specifies the data to send to the device as a byte array. This array must be dimensioned to the number of bytes to send. If there are no bytes to send, specify 0.
  • RecvData
    Specifies the data to receive from the device as a byte array. This array will automatically be redimensioned to the number of bytes received.

Remarks
Note
This method will only work if the Fieldbus Master option is active.

See Also
FBusIO_GetBusStatus, FBusIO_GetDeviceStatus, IsOptionActive

FBusIO_SendMsg Example
VB Example:

'Send explicit message to DeviceNet device  
Dim recvData() as Byte  
Dim sendData(6) as Byte  
Array.Clear(sendData, 0, sendData.Length)  
sendData(0) = 14 'Command  
sendData(1) = 1 'Class  
sendData(3) = 1 'Instance  
sendData(5) = 7 'Attribute  
' MsgParam is 0 for DeviceNet  
m_spel.FbusIO_SendMsg(16, 1, 0, sendData, recvData)  
  
' Send explicit message to Profibus device  
Dim recvData() As Byte;  
m_spel.FbusIO_SendMsg(16, 1, 56, Nothing, recvData);  

C# Example:

// Send explicit message to DeviceNet device  
byte[] sendData, recvData;  
byte[] sendData = new byte[6];  
Array.Clear(sendData, 0, sendData.Length);  
sendData[0] = 14; //Command  
sendData[1] = 1; //Class  
sendData[3] = 1; //Instance  
sendData[5] = 7; //Attribute  
//MsgParam is 0 for DeviceNet  
m_spel.FbusIO_SendMsg(16, 201, 0, sendData, out recvData);   
  
// Send explicit message to Profibus device  
byte[] recvData;  
m_spel.FbusIO_SendMsg(16, 1, 56, null, out recvData);  

FGGet Method, Spel Class

Description
Acquires a result of a Force Guide sequence or Force Guide object.

Syntax
Sub FGGet (Sequence As String, [Object As String], Property As SpelForceProps, ByRef Result As Boolean)
Sub FGGet (Sequence As String, [Object As String], Property As SpelForceProps, ByRef Result As Double)
Sub FGGet (Sequence As String, [Object As String], Property As SpelForceProps, ByRef Result As Integer)s
Sub FGGet (Sequence As String, [Object As String], Property As SpelForceProps, ByRef Result As String)

Parameters

  • Sequence
    Force guide sequence name or string variable indicating the Force Guide sequence name
  • Object
    Force guide object name or string variable indicating the Force Guide object name. Omitted when acquiring the result of a Force Guide sequence.
  • Property
    Result name to acquire the value
  • Result
    Variable indicating the returned value. The number and type vary according to the result.

See Also
FGRun

FGGet Example
VB Example:

Dim val As Integer  
m_spel.MotorsOn = True  
  
m_spel.FGRun("Sequence1")  
m_spel.FGGet("Sequence1","", SpelForceProps.EndStatus, val)  

C# Example:

int errCode;  
m_spel.MotorsOn = true;  
  
m_spel.FGRun("Sequence1");  
m_spel.FGGet("Sequence1","", SpelForceProps.EndStatus, val);  

FGRun Method, Spel Class

Description
Executes a Force Guide sequence.

Syntax
Sub FGRun (Sequence As String)

Parameters

  • Sequence
    Force guide sequence name or string variable indicating the Force Guide sequence name

Remarks
Executes a specified Force Guide sequence. The Force Guide sequence starts from the position where the FGRun statement was executed. Execute after moving to the assumed start position by the Go statement, Move statement, or other motion commands.

When the specified Force Guide sequence ends, the program proceeds to the next statement.
To acquire the results of sequences executed by FGRun, use FGGet.
When path motion is enabled by the CP parameter or CP statement, the program waits until the robot stops and then executes a Force Guide sequence.

When any of the following conditions is fulfilled at the time of execution start, an error occurs.
The robot specified in the program differs from the robot specified by the RobotNumber property. Specify the correct robot by the Robot statement.
The robot type specified in the program differs from the robot type specified by the RobotType property. Specify the correct robot by the Robot statement.
The tool number specified in the program differs from the tool number specified by the RobotTool property. Specify the correct tool number by the Tool statement.
Motor is in OFF state. Switch to ON state by the Motor statement.
Force control function is currently being executed. Stop force control by the FCEnd statement.
Conveyor tracking is currently being executed. Stop conveyor tracking by the Cnv_AbortTrack statement.
Currently in the torque control mode. Disable the torque control mode by the TC statement.

FGRun, when executed, automatically overwrites the following properties; therefore, it cannot be used together with the following properties:
FM object
AvgForceClear property
PeakForceClear property

This method cannot be executed while the program is running.

See Also
FGGet

FGRun Example
VB Example:

Dim errCode As Integer  
m_spel.MotorsOn = True  
  
m_spel.FGRun("Sequence1")  
errCode = m_spel.FGGet("Sequence1", SpelForceProps.EndStatus, val)  

C# Example:

int errCode;  
m_spel.MotorsOn = true;  
  
m_spel.FGRun("Sequence1");  
errCode = m_spel.FGGet("Sequence1", SpelForceProps.EndStatus, val);  

Find Method, Spel Class

Description
Sets the condition to save the coordinate during motion instructions.

Syntax
Sub Find (Condition As String)

Parameters

  • Condition
    Specifies the input state to use as a trigger.

See Also
Go, Jump

Find Example
VB Example:

m_spel.Find("Sw(5) = On")  

C# Example:

m_spel.Find("Sw(5) = On");  

Fine Method, Spel Class

Description
Specifies and displays the positioning accuracy for target points.

Syntax
Sub Fine (J1MaxErr As Integer, J2MaxErr As Integer, J3MaxErr As Integer, J4MaxErr As Integer , J5MaxErr As Integer, J6MaxErr As Integer [, J7MaxErr As Integer][, J8MaxErr As Integer] [, J9MaxErr As Integer])

Parameters

  • J1MaxErr - J9MaxErr
    A number ranging from 0 to 32767 indicating the allowable positioning error for each joint. The values for joints 7, 8, and 9 are optional.

See Also
Weight

Fine Example
VB Example:

m_spel.Fine(1000, 1000, 1000, 1000, 0, 0)  

C# Example:

m_spel.Fine(1000, 1000, 1000, 1000, 0, 0);  

GetAccel Method, Spel Class

Description
Returns specified acceleration/deceleration value.

Syntax
Function GetAccel (ParamNumber As Integer) As Integer

Parameters

  • ParamNumber
    An integer expression which can have the following values: 1: acceleration setting 2: deceleration setting 3: depart acceleration setting for Jump 4: depart deceleration setting for Jump 5: approach acceleration setting for Jump 6: approach deceleration setting for Jump

Return Value
Integer containing the specified acceleration/deceleration value.

See Also
Accel

GetAccel Example
VB Example:

Dim x As Integer  
x = m_spel.GetAccel(1)  

C# Example:

int x;  
x = m_spel.GetAccel(1);  

GetArm Method, Spel Class

Description
Returns the current Arm number for the current robot.

Syntax
Function GetArm () As Integer

Return Value
Integer containing the current arm number.

See Also
Arm, ArmSet, Robot, Tool

GetArm Example
VB Example:

saveArm = m_spel.GetArm()  
m_spel.Arm(2)  

C# Example:

m_spel.Arm(2);  

GetConnectionInfo Method, Spel Class

Description
Returns information about the Controller connections.

Syntax
Function GetConnectionInfo() As SpelConnectionInfo()

Return Value
An array of SpelConnectionInfo.

See Also
GetControllerInfo

Return Value
GetConnectionInfo returns an array of SpelConnectionInfo. The connection information is configured in Epson RC+ from the [Setup]-[PC to Controller Communication] dialog.

GetConnectionInfo Example
VB Example:

Dim info() As SpelConnectionInfo  
  
info = m_spel.GetConnectionInfo()  

C# Example:

SpelConnectionInfo[] info = m_spel.GetConnectionInfo();  

GetControllerInfo Method, Spel Class

Description
Returns information about the current Controller.

Syntax
Function GetControllerInfo() As SpelControllerInfo

Return Value
A SpelControllerInfo instance.

See Also
GetErrorMessage, GetRobotInfo, GetTaskInfo

Remarks
GetControllerInfo returns a new instance of the SpelControllerInfo class, which contains Controller information properties.

GetControllerInfo Example
VB Example:

Dim info As SpelControllerInfo  
Dim msg As String  
  
info = m_spel.GetControllerInfo()  
msg = "Project Name: " & info.ProjectName & vbCrLf _  
    & "Project ID: " & info.ProjectID  
MsgBox(msg)  

C# Example:

SpelControllerInfo info;  
string msg;  
  
info = m_spel.GetControllerInfo();  
msg = "Project Name:" + info.ProjectName + "\r\n ProjectID :" +   
"info.ProjectID";  
MessageBox.Show(msg);  

GetCurrentConnectionInfo Method, Spel Class

Description
Returns the information of the current controller connection.

Syntax
Function GetCurrentConnectionInfo () As SpelConnectionInfo

Return Value
SpelConnectionInfo

See Also
GetConnectionInfo, GetControllerInfo

GetCurrentConnectionInfo Example
VB Example:

Dim info As SpelConnectionInfo  
  
info = m_spel.GetCurrentConnectionInfo()  

C# Example:

SpelConnectionInfo info;    

info = m_spel.GetCurrentConnectionInfo();  

GetCurrentUser Method, Spel Class

Description
Returns the current Epson RC+ 8.0 user.

Syntax
Function GetCurrentUser () As String

Return Value
String variable containing the current user.

See Also
Login

GetCurrentUser Example
VB Example:

Dim currentUser As String  
  
currentUser = m_spel.GetCurrentUser()  

C# Example:

string currentUser;  
  
currentUser = m_spel.GetCurrentUser();  

GetECP Method, Spel Class

Description
Returns the current ECP number for the current robot.

Syntax
Function GetECP () As Integer

Return Value
Integer containing the current ECP number.

See Also
ECP, ECPSet

GetECP Example
VB Example:

saveECP = m_spel.GetECP()  
m_spel.ECP(2)  

C# Example:

saveECP = m_spel.GetECP();  
m_spel.ECP(2);  

GetErrorMessage Method, Spel Class

Description
Returns the error message for the specified error or warning code.

Syntax
Function GetErrorMessage (ErrorCode As Integer) As String

Parameters

  • ErrorCode
    Error code that returns an error message

Return Value
String containing the error message.
See Also
ErrorCode

GetErrorMessage Example
VB Example:

Dim msg As String  
  
If m_spel.ErrorOn Then  
  msg = m_spel.GetErrorMessage(m_spel.ErrorCode)  
  MsgBox(msg)  
End If  

C# Example:

string msg;  

if (m_spel.ErrorOn) {  
	msg = m_spel.GetErrorMessage(m_spel.ErrorCode);  
	MessageBox.Show(msg);  
}  

GetIODef Method, Spel Class

Description
Gets the definition information for an input, output, or memory I/O bit, byte, or word.

Syntax
Sub GetIODef(Type As SpelIOLabelTypes, Index As Integer, ByRef Label as String, ByRef Description As String)

Parameters

  • Type
    Specifies the I/O type as shown below: InputBit = 1 InputByte = 2 InputWord = 3 OutputBit = 4 OutputByte = 5 OutputWord = 6 MemoryBit = 7 MemoryByte = 8 MemoryWord = 9 InputReal = 10 OutputReal = 11
  • Index
    Specifies the bit or port number.
  • Label
    Returns the label.
  • Description
    Returns the description.

Return Value
The values are returned in the Label and Description parameters.

Remarks
Use GetIODef to get the labels and descriptions used for all I/O in the current project.

See Also
SetIODef

GetIODef Example
VB Example:

Dim label As String  
Dim desc As String    
m_spel.GetIODef(SpelIOLabelTypes.InputBit, 0, label, desc)  

C# Example:

string label, desc;  
  
m_spel.GetIODef(SpelIOLabelTypes.InputBit, 0, out label, out desc);  

GetJRange Method, Spel Class

Description
Gets the permissible working range of the specified joint in pulses.

Syntax
Function GetJRange (JointNumber As Integer, Bound As Integer) As Integer

Parameters

  • JointNumber
    An integer indicating the axis number (range: 1 to number of joints of the robot)
  • Bound
    Specifies one of the following two values as an integer. 1: Specifies lower limit value.2: Specifies upper limit value.

Return Value
Range configuration (integer value, pulses) of the specified joint.

See Also
JRange

GetJRange Example
VB Example:

Dim minRange As Integer  
Dim maxRange As Integer  
val1 = m_spel.GetJRange(1, 1)  
val2 = m_spel.GetJRange(1, 2)  

C# Example:

int minRange, maxRange;  
minRange = m_spel.GetJRange(1, 1);  
maxRange = m_spel.GetJRange(1, 2);  

GetLimitTorque Method, Spel Class

Description
Returns the limit torque for the specified joint for the current robot.

Syntax
Function GetLimitTorque (JointNumber As Integer) As Integer

Parameters

  • JointNumber
    An integer indicating the axis number.

Return Value
Integer value between 1 and 9 which represents the limit torque setting for the specified joint.

See Also
GetRealTorque, GetRobotPos, LimitTorque

GetLimitTorque Example
VB Example:

Dim j1LimitTorque As Integer  
j1LimitTorque = m_spel.GetLimitTorque(1)  

C# Example:

int j1LimitTorque;  
j1LimitTorque = m_spel.GetLimitTorque(1);  

GetLimZ Method, Spel Class

Description
Returns the current LimZ setting.

Syntax
Function GetLimZ () As Single

Return Value
Real value containing the LimZ value.

See Also
LimZ, Jump

GetLimZ Example
VB Example:

saveLimZ = m_spel.GetLimZ()  
m_spel.LimZ(-22)  

C# Example:

saveLimZ = m_spel.GetLimZ();  
m_spel.LimZ(-22);  

GetPoint Method, Spel Class

Description
Retrieves coordinate data for a robot point.

Syntax
Function GetPoint (PointNumber As Integer) As SpelPoint
Function GetPoint (PointName As String) As SpelPoint

Parameters

  • PointNumber
    Integer expression indicating a point in the Controller’s point memory for the current robot.
  • PointName
    Point labels containing modifier characters “Pxxx”, “P*” or “*” can be used in the character string.

Return Value
SpelPoint value

See Also
SetPoint

GetPoint Example
VB Example:

Dim pt As SpelPoint  
pt = m_spel.GetPoint("P*")  
pt.X = 25.0  
m_spel.Go(pt)  

C# Example:

SpelPoint pt;  
pt = m_spel.GetPoint("P0");  
pt.X = 25.0;  
m_spel.Go(pt);  

GetRealTorque Method, Spel Class

Description
Returns the torque for the specified joint for the current robot.

Syntax
Function GetRealTorque (JointNumber As Integer) As Double

Parameters

  • JointNumber
    An integer indicating the joint number for which you want to acquire the torque value.

Return Value
Double value between 0 and 1 which represents the portion of maximum torque for the current power mode and for the specified joint.

See Also
GetLimitTorque, GetRobotPos

GetRealTorque Example
VB Example:

Dim j1Torque As Double  
j1Torque = m_spel.GetRealTorque(1)  

C# Example:

double j1Torque;  
j1Torque = m_spel.GetRealTorque(1);  

GetRobotInfo Method, Spel Class

Description
Returns robot information.

Syntax
Function GetRobotInfo (RobotNumber As Integer) As SpelRobotInfo

Parameters

  • RobotNumber
    Specifies the robot number.

Return Value
SpelRobotInfo

See Also
GetControllerInfo, GetTaskInfo

GetRobotInfo Example
VB Example:

Dim info As SpelRobotInfo  
Dim msg As String  
  
info = m_spel.GetRobotInfo(1)  
msg = "Robot Model: " & info.RobotModel & vbCrLf _  
    & "Robot Serial: " & info.RobotSerial  
MsgBox(msg)  

C# Example:

SpelRobotInfo info;  
string msg;  
  
info = m_spel.GetRobotInfo(1);  
msg = "Robot Model: " + info.RobotModel +  
      "\r\n Robot Serial: " + info.RobotSerial;  
MessageBox.Show(msg);  

GetRobotPos Method, Spel Class

Description
Returns the current robot position.

Syntax
Function GetRobotPos( PosType As SpelRobotPosType, Arm As Integer, Tool As Integer, Local As Integer) As Single()

Parameters

  • PosType
    Specifies the position data type.
  • Arm
    Integer expression that specifies the robot arm.
  • Tool
    Integer expression that specifies the robot tool.
  • Local
    Integer expression that specifies local.

Return Value
Single data type array containing 9 elements. The data returned depends on the specified PosType.
World X, Y, Z, U, V, W, R, S, T
Joint J1, J2, J3, J4, J5, J6, J7, J8, J9
Pulse Pls1, Pls2, Pls3, Pls4, Pls5, Pls6, Pls7, Pls8, Pls9

See Also
GetPoint

GetRobotPos Example
VB Example:

Dim values() As Single  
values = m_spel.GetRobotPos(SpelRobotPosType.World, 0, 0, 0)  

C# Example:

float[] values;  
values = m_spel.GetRobotPos(SpelRobotPosType.World, 0, 0, 0);  

GetSpeed Method, Spel Class

Description
Returns one of the three speed settings for the current robot.

Syntax
Function GetSpeed (ParamNumber As Integer) As Integer

Parameters

  • ParamNumber
    Integer expression which determines one of the following values: 1: PTP motion speed 2: Jump depart speed 3: Jump approach speed

Return Value
Integer expression from 1-100.

See Also
Speed

GetSpeed Example
VB Example:

Dim ptpSpeed As Integer  
ptpSpeed = m_spel.GetSpeed(1)  

C# Example:

ptp
Speed = m_spel.GetSpeed(1);  

GetTaskInfo Method, Spel Class

Description
Returns task information.

Syntax
Function GetTaskInfo (TaskName As String) As SpelTaskInfo
Function GetTaskInfo (TaskNumber As Integer) As SpelTaskInfo

Parameters

  • TaskName
    Specifies the task name.
  • TaskNumber
    Specifies the task number.

Return Value
SpelTaskInfo

See Also
GetControllerInfo, GetRobotInfo

GetTaskInfo Example
VB Example:

Dim info As SpelTaskInfo  
Dim msg As String  
  
info = m_spel.GetTaskInfo(1)  
msg = "Task Name: " & info.TaskName & vbCrLf _  
    & "Task State: " & info.State  
MsgBox(msg)  

C# Example:

SpelTaskInfo info;  
string msg;  
  
info = m_spel.GetTaskInfo(1);  
msg= "Task Name: " + info.TaskName +   
     "\r\n Task State: " + info.State;  
MessageBox.Show(msg);  

GetTool Method, Spel Class

Description
Returns the current Tool number for the current robot.

Syntax
Function GetTool () As Integer

Return Value
Integer containing the current tool number.

See Also
Arm, TLSet, Tool

GetTool Example
VB Example:

saveTool = m_spel.GetTool()  
m_spel.Tool(2)  

C# Example:

saveTool = m_spel.GetTool();  
m_spel.Tool(2);  

GetVar Method, Spel Class

Description
Returns the value of a SPEL+ global preserve variable in the Controller.

Syntax
Function GetVar(VarName As String) As Object

Parameters

  • VarName
    The name of the SPEL+ global preserve variable. For an array, the entire array can be returned or just one element.

Return Value
You can use GetVar to retrieve values of any global preserve variables in the Controller's current project. Before you can retrieve values, the project must be successfully built.
If you want to retrieve an entire array, then supply the array name in VarName. To retrieve one element of an array, supply the subscript in VarName.

Remarks
You can use GetVar to retrieve values of any global preserve variables in the Controller's current project. Before you can retrieve values, the project must be successfully built.

See Also
SetVar

GetVar Example
In the SPEL+ project, the variable is declared:

Global Preserve Integer g_myIntVar  
Global Preserve Real g_myRealArray(10)  
Global Preserve String g_myStringVar$  
Function main  
   ...  
Fend  

In the Visual Basic project:
Since g_myIntVar is declared as in integer, the Visual Basic variable used to retrieve the value of g_myIntVar must be declared as an Integer. For g_myRealArray, the Visual Basic variable must be declared as a Single array.

Dim myIntVar As Integer  
Dim myRealArray() As Single  
Dim myStringVar As String  
  
myIntVar = m_spel.GetVar("g_myIntVar")  
myRealArray = m_spel.GetVar("g_myRealArray")  
myStringVar = m_spel.GetVar("g_myStringVar$")  

In the C# project:
Since g_myIntVar is declared as in integer, the C# variable used to retrieve the value of g_myIntVar must be declared as an int. For g_myRealArray, the C# variable must be declared as a float array.

int myIntVar;  
float[] myRealArray;  
string myStringVar;  
  
myIntVar = m_spel.GetVar("g_myIntVar");  
myRealArray = m_spel.GetVar("g_myRealArray");  
myStringVar = m_spel.GetVar("g_myStringVar$");  

Go Method, Spel Class

Description
Moves the arm in a Point to Point fashion from the current position to the specified point or XY position. The GO instruction can move any combination of the robot axes at the same time.

Syntax
Sub Go (PointNumber As Integer)
Sub Go (Point As SpelPoint)
Sub Go (Point As SpelPoint, AttribExpr As String)
Sub Go (PointExpr As String)

Parameters
Each syntax has one parameter that specifies the end point which the arm travels to during the Go motion. This is the final position at the end of the point to point motion.

  • PointNumber
    Specifies the end point using the point number of a previously taught point in the Controller’s point memory for the current robot.
  • Point
    Specifies the end point using the SpelPoint data type.
  • AttribExpr
    Specifies the end point attributes using a string expression.
    It can contain CP, LJM, SYNC, Till or Find search expressions, and parallel processing statements.
  • PointExpr
    Specifies the end point using a string expression.
    It can contain CP, LJM, SYNC, Till or Find search expressions, and parallel processing statements.

See Also
Accel, Speed
Arc, Arc3, CVMove, Jump, Jump3, Jump3CP, Move
BGo, BMove, TGo, TMove
Arch, Find, Sense, Till

Go Example
VB Example:

' Point specified using point number  
m_spel.Tool(1)  
m_spel.Go(100)  
  
' Using a SpelPoint  
Dim pt As SpelPoint  
pt = m_spel.GetPoint("P*")  
pt.X = 125.5  
m_spel.Go(pt)  
  
' Using a point expression  
m_spel.Go("P0 /L /2")  
m_spel.Go("P1 :Z(-20)")  
  
' Using parallel processing  
m_spel.Go("P1 \!D50; On 1; D90; Off 1\!")  
  
' Point specified using label  
m_spel.Go("pick")  

C# Example:

// Point specified using point number  
m_spel.Tool(1);  
m_spel.Go(100);  
  
// Point specified using SpelPoint  
SpelPoint pt;  
pt = m_spel.GetPoint("P0");  
pt.X = 125.5;  
m_spel.Go(pt);  
  
// Point specified using expression  
m_spel.Go("P0 /L /2");  
m_spel.Go("P1 :Z(-20)");  
  
// Using parallel processing  
m_spel.Go("P1 \!D50; On 1; D90; Off 1\!");  
  
// Point specified using label  
m_spel.Go("pick");  

Halt Method, Spel Class

Description
Suspends execution of the specified task.

Syntax
Sub Halt (TaskNumber As Integer)
Sub Halt (TaskName As String)

Parameters

  • TaskNumber
    The task number of the task to be paused (1 to 32).
  • TaskName
    A string expression indicating the task name to be paused.

Note


The function executed by Call method cannot be paused by Halt method.
If you need to pause, use Xqt Method.

See Also
Resume, Xqt

Halt Example
VB Example:

m_spel.Halt(3)  

C# Example:

m_spel.Halt(3);  

Here Method, Spel Class

Description
Teaches a point at the current position.

Syntax
Sub Here (PointNumber As Integer)
Sub Here (PointName As String)

Parameters

  • PointNumber
    An integer expression indicating a point in the point memory for the current robot. Any valid point number can be used, as long as it starts with 0.
  • PointName
    A string expression indicating the point label.

See Also
SetPoint

Here Example
VB Example:

m_spel.Here("P20")  

C# Example:

m_spel.Here("P20");  

HideWindow Method, Spel Class

Description
Hides an Epson RC+ 8.0 window that was previously displayed with ShowWindow.

Syntax
Sub HideWindow (WindowID As SpelWindows)

Parameters

  • WindowID
    The ID of the Epson RC+ 8.0 window to hide.

See Also
RunDialog, ShowWindow

HideWindow Example
VB Example:

Sub btnHideIOMonitor_Click _  
       ByVal sender As System.Object, _  
       ByVal e As System.EventArgs) _  
       Handles btnHideIOMonitor.Click  
  
    m_spel.HideWindow(RCAPINet.SpelWindows.IOMonitor)  
End Sub  

C# Example:

void btnHideIOMonitor_Click(object sender, EventArgs e)  
{  
   m_spel.HideWindow(RCAPINet.SpelWindows.IOMonitor);  
}  

Home Method, Spel Class

Description
Moves the robot arm to the user defined home position that is set with the HomeSet method.

Syntax
Sub Home ()

See Also
HomeSet, MCal

Home Example
VB Example:

With m_spel  
    .MotorsOn = True  
    .Home()  
End With  

C# Example:

m_spel.MotorsOn = true;  
m_spel.Home();  

Hofs Method, Spel Class

Description
Reads or sets the offset pulses used for software zero point correction.

Syntax
Function Hofs (JointNumber As Integer) As Integer
Sub Hofs (J1Pulses As Integer, J2Pulses As Integer, J3Pulses As Integer, J4Pulses As Integer, [J5Pulses As Integer], [J6Pulses As Integer], [ J7Pulses As Integer], [J8Pulses As Integer] , [J9Pulses As Integer])

Parameters

  • J1Pulses - J9Pulses
    Integers indicating the pulse values for Joints 1 to 9. J5Pulses to J9Pulses are optional

Return Value
The offset pulse value (integer value, in pulses).

Remarks
This method displays or sets the home position offset pulses. This method specifies the offset from the encoder 0 point (Z phase) to the mechanical 0 point.)

Although the robot motion control is based on the zero point of the encoder mounted on each joint motor, the encoder zero point may not necessarily match the robot mechanical zero point. To make the encoder position that matches the robot mechanical zero point as the zero point on the software, set the correction pulse amount by this method.

Note


Hofs Values SHOULD NOT be Changed unless Absolutely Necessary

The Hofs values are correctly specified prior to delivery. There is a danger that unnecessarily changing the Hofs value may result in position errors and unpredictable motion. Therefore, it is strongly recommended that Hofs values not be changed unless absolutely necessary.

To Automatically Calculate Hofs Values

To have Hofs values automatically calculated, move the arm to the desired calibration position, and execute Calib. The controller then automatically calculates Hofs values based on the CalPls pulse values and calibration position pulse values.

Saving and Restoring Hofs

Hofs can be saved and restored using the Save and Load commands in the [System Configuration] dialog-[Robot]-[Calibration] from the System Configuration menu.

See Also
CalPls, Home, Hordr, MCal

Hofs Example
VB Example:

Dim val As Integer  
val = m_spel.Hofs(1)  

C# Example:

int val;  
val = m_spel.Hofs(1);  

HomeSet Method, Spel Class

Description
Specifies the position used by the Home method.

Syntax
Sub HomeSet (J1Pulses As Integer, J2Pulses As Integer, J3Pulses As Integer, J4Pulses As Integer ,J5Pulses As Integer, J6Pulses As Integer [, J7Pulses As Integer] [, J8Pulses As Integer][, J9Pulses As Integer])

Parameters

  • J1Pulses - J9Pulses
    The Home position encoder pulse value for each joint. Joints 7, 8, and 9 are optional.

See Also
Home, MCal

HomeSet Example
VB Example:

' Set the home position at the current position  
With m_spel  
    .HomeSet(.Pls(1), .Pls(2), .Pls(3), .Pls(4), 0, 0)  
End With  

C# Example:

//Set the home position at the current position  
m_spel.HomeSet(m_spel.Pls(1), m_spel.Pls(2), m_spel.Pls(3),  
          m_spel.Pls(4), 0 ,0);  

Hordr Method, Spel Class

Description
Specifies the order of the axes returning to their HOME positions.

Syntax
Sub Hordr ( Home1 As Integer, Home2 As Integer, Home3 As Integer, Home4 As Integer, Home5 As Integer, Home6 As Integer [, Home7 As Integer] [, Home8 As Integer] [, Home9 As Integer] )

Parameters

  • Home 1 - 9
    A bit pattern indicating which axes return to home during each step of the Home process. Any number of axes from 0 to all axes can return home at the 1st step. Home 7 – 9 can be specified when R, S, or T axis is specified.

See Also
Home, HomeSet, Mcordr

Hordr Example
VB Example:

m_spel.Hordr(2, 13, 0, 0, 0, 0)  

C# Example:

m_spel.Hordr(2, 13, 0, 0, 0, 0);  

Hour Method, Spel Class

Description
Returns the accumulated system operating time in hours.

Syntax
Function Hour () As Single

Return Value
Integer expression representing time.

Hour Example
VB Example:

Dim hoursRunning As Single  
hoursRunning = m_spel.Hour()  

C# Example:

float hoursRunning;  
hoursRunning = m_spel.Hour();  

ImportPoints Method, Spel Class

Description
Imports a point file into the current project for the current robot.

Syntax
Sub ImportPoints ( SourcePath As String, ProjectFileName As String [, RobotNumber As Integer] )

Parameters

  • SourcePath
    A string expression indicating the file to import into the current project and its specific path. The extension .pts is appended.
  • ProjectFileName
    A string expression indicating the specific file to be imported into the project for the currently used robot or the specified robot if RobotNumber is provided. The extension .pts is appended.
  • RobotNumber
    Optional. An integer expression indicating the robot for which the points file is to be used. If you specify 0, it will be a points file.

See Also
SavePoints

ImportPoints Example
VB Example:

With m_spel  
    .ImportPoints("c:\mypoints\model1.pts", "robot1.pts")  
End With  

C# Example:

m_spel.ImportPoints(@"c:\mypoints\model1.pts", "robot1.pts");  

In Method, Spel Class

Description
Returns the status of the specified input port. Each port contains 8 input bits (one byte).

Syntax
Function In (PortNumber As Integer) As Integer
Function In (Label As String) As Integer

Parameters

  • PortNumber
    An integer indicating the input port. Each port comprises 8 input bits (one byte).
  • Label
    A string expression indicating the input byte label.

Return Value
Integer from 0 to 255 representing the status of the input port.

See Also
InBCD, Out, OpBCD, Sw

In Example
VB Example:

Dim port1Value As Integer  
port1Value = m_spel.In(1)  

C# Example:

int port1Value;  
port1Value = m_spel.In(1);  

InBCD Method, Spel Class

Description
Returns the input status of 8 inputs using BCD format. (Binary Coded Decimal)

Syntax
Function InBCD (PortNumber As Integer) As Integer
Function InBCD (Label As String) As Integer

Parameters

  • PortNumber
    An integer indicating the input port.
  • Label
    A string expression indicating the input byte label.

Return Value
Integer from 0 to 9 representing the status of the input port.
See Also
In, Out, OpBCD, Sw

InBCD Example
VB Example:

Dim port1Value As Integer  
port1Value = m_spel.InBCD(1)  

C# Example:

int port1Value;  
port1Value = m_spel.InBCD(1);  

Inertia Method, Spel Class

Description
Specifies the load inertia and eccentricity for the current robot.

Syntax
Sub Inertia (LoadInertia As Single, Eccentricity As Single)

Parameters

  • LoadInertia
    A real number indicating the total moment of inertia in kgm2 around the center of the hand joint, including hand and part.
  • Eccentricity
    A real number indicating the eccentricity in mm around the center of the hand joint, including hand and part.

See Also
Weight

Inertia Example
VB Example:

m_spel.Inertia(0.02, 1.0)  

C# Example:

m_spel.Inertia(0.02, 1.0);  

Initialize Method, Spel Class

Description
Initializes the Spel class instance.

Syntax
Sub Initialize ()

Remarks
Normally, the Spel class instance is automatically initialized when the first method has been executed. Initialization can take several seconds as Epson RC+ 8.0 loads into memory. So in some cases, you may want to call initialize first in your application during startup.
Initialize starts RC+ as a server process according to ServerInstance. Each ServerInstance corresponds to one controller and one project. If using the ServerInstance property, it must be set before executing Initialize.

See Also
Connect, Disconnect, ServerInstance

Initialize Example
VB Example:

m_spel.Initialize()  

C# Example:

m_spel.Initialize();  

InReal Method, Spel Class

Description
Returns the input data of 2 words (32 bits) as the floating-point data (IEEE754 compliant) of 32 bits.

Syntax
Function InReal (PortNumber As Integer) As Single

Parameters

  • PortNumber
    An integer indicating the input port.

Return Value
Returns the input port status in 32 bits floating-point data (IEEE754 compliant).

See Also
In, InBCD, InW, Out, OutW, OutReal

InReal Example
VB Example:

Dim val As Single  
val = m_spel.InReal(32)  

C# Example:

float val;  
val = m_spel.InReal(32);  

InsideBox Method, Spel Class

Description
Returns the check status of the approach check area.

Syntax
Function InsideBox (BoxNumber As Integer) As Boolean

Parameters

  • BoxNumber
    The number of the approach check area for which to return the detection status (integer between 1 and 15)

Return Value
True if the robot end effector is inside the specified box, False if not.

See Also
Box, InsidePlane

InsideBox Example
VB Example:

Dim isInside As Boolean  
isInside = m_spel.InsideBox(1)  

C# Example:

bool isInside;  
isInside = m_spel.InsideBox(1);  

InsidePlane Method, Spel Class

Description
Returns the check status of the approach check plane.

Syntax
Function InsidePlane (PlaneNumber As Integer) As Boolean

Parameters

  • PlaneNumber
    The number of the approach check plane for which to return the detection status (integer between 1 and 15)

Return Value
True if the robot end effector is inside the specified box, False if not.

See Also
InsideBox, Plane

InsidePlane Example
VB Example:

Dim isInside As Boolean  
isInside = m_spel.InsidePlane(1)  

C# Example:

bool isInside;  
isInside = m_spel.InsidePlane(1);  

InW Method, Spel Class

Description
Returns the status of the specified input word port. Each word port contains 16 input bits.

Syntax
Function InW (PortNumber As Integer) As Integer
Function InW (Label As String) As Integer

Parameters

  • PortNumber
    An integer indicating the input port.
  • Label
    A string expression indicating the input word label.

Return Value
Integer value from 0 to 65535 representing the input port

See Also
In, InBCD, Out, OpBCD, Sw

InW Example
VB Example:

  Dim data As Integer  
  data = m_spel.InW(0)  

C# Example:

int data;  
data = m_spel.InW(0);  

IsOptionActive Method, Spel Class

Description
Returns the status of software options.

Syntax
Function IsOptionActive (option As SpelOptions) As Boolean

Parameters

  • option
    An integer indicating the option number.

Return Value
False – Disabled
True – Enabled

See Also
GetControllerInfo

IsOptionActive Example
VB Example:

Dim ret As Boolean  
ret = m_spel.IsOptionActive(SpelOptions.FieldbusMaster)  

C# Example:

bool ret;  
ret = m_spel.IsOptionActive(SpelOptions.FieldbusMaster);  

JRange Method, Spel Class

Description
Defines the permissible working range of the specified robot joint in pulses.

Syntax
Sub JRange ( JointNumber As Integer, LowerLimitPulses As Integer, UpperLimitPulses As Integer)

Parameters

  • jointNumber
    An integer between 1 and 9 indicating the joint for which JRange will be specified.
  • LowerLimitPulses
    An integer indicating the encoder pulse count position for the lower limit range of the specified joint.
  • UpperLimitPulses
    An integer indicating the encoder pulse count position for the upper limit range of the specified joint

See Also
XYLim

JRange Example
VB Example:

m_spel.JRange(1, -30000, 30000)  

C# Example:

m_spel.JRange(1, -30000, 30000);  

JS Method, Spel Class

Description
Jump Sense detects whether the arm stopped prior to completing a JUMP instruction (which used a SENSE input) or if the arm completed the JUMP move.

Syntax
Function JS () As Boolean

Return Value
True if the SENSE input was detected during motion, False if not.

See Also
Jump, Jump3, Jump3CP, Sense, Till

JS Example
VB Example:

With m_spel  
    .Sense("Sw(1) = On")  
    .Jump("P1 Sense")  
    stoppedOnSense = .JS()  
End With  

C# Example:

m_spel.Sense("Sw(1) = On");  
m_spel.Jump("P1 Sense");  
stoppedOnSense = m_spel.JS();  

JTran Method, Spel Class

Description
Executes a relative joint move.

Syntax
Sub JTran (JointNumber As Integer, Distance As Single)

Parameters

  • JointNumber
    The specific joint to move.
  • Distance
    The distance to move. Units are in degrees for rotary joints and millimeters for linear joints.

See Also
PTran, Pulse

JTran Example
VB Example:

' Move joint 1 45 degrees in the plus direction.  
m_spel.JTran(1, 45.0)  

C# Example:

// Move joint 1 45 degrees in the plus direction.  
m_spel.JTran(1, 45.0);  

Jump Method, Spel Class

Description
Moves the arm from the current position to the specified point using point to point motion while first moving in a vertical direction up, then horizontally and then finally vertically downward to arrive on the final destination point.

Syntax
Sub Jump (PointNumber As Integer)
Sub Jump (Point As SpelPoint)
Sub Jump (Point As SpelPoint, AttribExpr As String)
Sub Jump (PointExpr As String)

Parameters
Each syntax has one parameter that specifies the end point which the arm travels to during the Jump motion. This is the final position at the end of the point to point motion.
PointNumber Specifies the end point by using the point number for a previously taught point in the Controller's point memory for the current robot.

  • Point
    Specifies the end point using the SpelPoint data type.
  • AttribExpr
    Specifies the end point attributes using a string expression.
    It can contain a C arch number, LimZ, CP, SYNC, Sence, Till or Find search expression, and parallel processing statements.
  • PointExpr
    Specifies the end point using a string expression.
    It can contain a C arch number, LimZ, CP, SYNC, Sence, Till or Find search expression, and parallel processing statements.

See Also
Accel, Speed
Arc, Arc3, CVMove, Go, Jump3, Jump3CP, Move
BGo, BMove, TGo, TMove
Arch, Find, Sense, Till

Jump Example
VB Example:

' Point specified using point number  
m_spel.Tool(1)  
m_spel.Jump(100)  
  
' Point specified using SpelPoint  
Dim pt As SpelPoint  
pt = m_spel.GetPoint("P*")  
pt.X = 125.5  
m_spel.Jump(pt)  
  
' Point specified using expression  
m_spel.Jump("P0 /L /2")  
m_spel.Jump("P1 :Z(-20)")  
m_spel.Jump("P1 C0")  
m_spel.Jump("P1 C0 LimZ -10")  
m_spel.Jump("P1 C0 Sense Sw(0)=On")  
  
' Using parallel processing  
m_spel.Jump("P1 \!D50; On 1; D90; Off 1\!")  
  
' Point specified using label  
m_spel.Jump("pick")  

C# Example:

// Point specified using point number  
m_spel.Tool(1);  
m_spel.Jump(100);  
  
// Point specified using SpelPoint  
SpelPoint pt;  
pt = m_spel.GetPoint("P0");  
pt.X = 125.5;  
m_spel.Jump(pt);  
  
// Point specified using expression  
m_spel.Jump("P0 /L /2");  
m_spel.Jump("P1 :Z(-20)");  
m_spel.Jump("P1 C0");  
m_spel.Jump("P1 C0 LimZ -10");  
m_spel.Jump("P1 C0 Sense Sw(0)=On");  
  
// Using parallel processing  
m_spel.Jump("P1 \!D50; On 1; D90; Off 1\!");  
  
// Point specified using label  
m_spel.Jump("pick");  

Jump3 Method, Spel Class

Description
Motion with 3D gate using a combination of two CP motions and one PTP motion. The robot moves to the depart point, then the approach point, and finally the destination point.

Syntax
Sub Jump3 (DepartPoint As Integer, ApproPoint As Integer, DestPoint As Integer)
Sub Jump3 (DepartPoint As SpelPoint, ApproPoint As SpelPoint, DestPoint As SpelPoint)
Sub Jump3 (DepartPoint As String, ApproPoint As String, DestPoint As String)

Parameters

  • DepartPoint
    Specifies the departure point above the current position using the point number or the character string indicating a point expression.
  • ApproPoint
    Specifies the approach start point above the target coordinates using the point number or the character string indicating a point expression.
  • DestPoint
    Specifies the target destination of the motion using the point number or the character string indicating a point expression.
    It can contain a C arch number, CP, LJM, SYNC, Sence, Till or Find search expression, and parallel processing statements.

See Also
Accel, AccelR, AccelS, Speed, SpeedR, SpeedS
Arc, Arc3, CVMove, Go, Jump, Jump3CP, Move
BGo, BMove, TGo, TMove
Arch, Find, Sense, Till

Jump3 Example
VB Example:

' Points specified using point numbers  
m_spel.Tool(1)  
m_spel.Jump3(1, 2, 3)  
  
' Points specified using SpelPoint  
Dim pd As SpelPoint  
Dim pa As SpelPoint  
Dim pt As SpelPoint  
pd = m_spel.GetPoint("P*")  
pd.Z = 125.5  
pa = m_spel.GetPoint("P2")  
pa.Z = 125.5  
pt = m_spel.GetPoint("P2")  
m_spel.Jump3(pd, pa, pt)  
  
' Points specified using expressions  
m_spel.Jump3("P1", "P2", "P3 C0")  
m_spel.Jump3("P1", "P2", "P3 C0 Sense Sw(0)=On")  
m_spel.Jump3("P0 -TLZ(10), P1 -TLZ(10), P1")  
  
' Using parallel processing  
m_spel.Jump3("P1", "P2", "P3 \!D50; On 1; D90; Off 1\!")  
  
' Point specified using label  
m_spel.Jump3("depart", "approach", "place")  

C# Example:

// Points specified using point numbers  
m_spel.Tool(1);  
m_spel.Jump3(1, 2, 3);  
  
// Points specified using SpelPoint  
SpelPoint pd, pa, pt;  
pd = m_spel.GetPoint("P1");  
pd.Z = 125.5;  
pa = m_spel.GetPoint("P2");  
pa.Z = 125.5;  
pt = m_spel.GetPoint("P2");  
m_spel.Jump3(pd, pa, pt);  
  
// Points specified using expressions  
m_spel.Jump3("P1", "P2", "P3 C0");  
m_spel.Jump3("P1", "P2", "P3 C0 Sense Sw(0)=On");  
m_spel.Jump3("P0 -TLZ(10), P1 -TLZ(10), P1");  
  
// Using parallel processing  
m_spel.Jump3("P1", "P2", "P3 \!D50; On 1; D90; Off 1\!");  
  
// Points specified using labels  
m_spel.Jump3("depart", "approach", "place");  

Jump3CP Method, Spel Class

Description
Motion with 3D gate using a combination of three CP motions.

Syntax
Sub Jump3CP (DepartPoint As Integer, ApproPoint As Integer, DestPoint As Integer)
Sub Jump3CP (DepartPoint As SpelPoint, ApproPoint As SpelPoint, DestPoint As SpelPoint)
Sub Jump3CP (DepartPoint As String, ApproPoint As String, DestPoint As String)

Parameters

  • DepartPoint
    Specifies the departure point above the current position using the point number or the character string indicating a point expression.
  • ApproPoint
    Specifies the approach start point above the target coordinates using the point number or the character string indicating a point expression.
  • DestPoint
    Specifies the target destination of the motion using the point number or the character string indicating a point expression.
    It can contain a C arch number, ROT, CP, LJM, SYNC, Sence, Till or Find search expression, and parallel processing statements.

See Also
AccelR, AccelS, SpeedR, SpeedS
Arc, Arc3, CVMove, Go, Jump, Jump3, Move
BGo, BMove, TGo, TMove
Arch, Find, Sense, Till

Jump3CP Example
VB Example:

' Points specified using point numbers  
m_spel.Tool(1)  
m_spel.Jump3CP(1, 2, 3)  
  
' Points specified using SpelPoint  
Dim pd As SpelPoint  
Dim pa As SpelPoint  
Dim pt As SpelPoint  
pd = m_spel.GetPoint("P*")  
pd.Z = 125.5  
pa = m_spel.GetPoint("P2")  
pa.Z = 125.5  
pt = m_spel.GetPoint("P2")  
m_spel.Jump3CP(pd, pa, pt)  
  
' Points specified using expressions  
m_spel.Jump3CP("P1", "P2", "P3 C0")  
m_spel.Jump3CP("P1", "P2", "P3 C0 Sense Sw(0)=On")  
m_spel.Jump3CP("P1", "P2", "P3 \!D50; On 1; D90; Off 1\!")  
  
' Using parallel processing  
m_spel.Jump3CP("P0 -TLZ(10), P1 -TLZ(10), P1")  
  
' Points specified using labels  
m_spel.Jump3CP("depart", "approch", "place")  

C# Example:

// Points specified using point numbers  
m_spel.Tool(1);  
m_spel.Jump3CP(1, 2, 3);  
  
// Points specified using SpelPoint  
SpelPoint pd, pa, pt;  
pd = m_spel.GetPoint("P0");  
pd.Z = 125.5;  
pa = m_spel.GetPoint("P2");  
pa.Z = 125.5;  
pt = m_spel.GetPoint("P2");  
m_spel. Jump3CP(pd, pa, pt);  
  
// Points specified using expressions  
m_spel.Jump3CP("P1", "P2", "P3 C0");  
m_spel.Jump3CP ("P1", "P2", "P3 C0 Sense Sw(0)=On");  
m_spel.Jump3CP("P0 -TLZ(10), P1 -TLZ(10), P1");  
  
// Using parallel processing  
m_spel.Jump3CP("P1", "P2", "P3 \!D50; On 1; D90; Off 1\!");  
  
// Points specified using labels  
m_spel.Jump3CP("depart", "approch", "place");  

LimitTorque Method, Spel Class

Description
Sets the upper limit torque in high power mode for the current robot.

Syntax
Sub LimitTorque (AllJointsMax As Integer)
Sub LimitTorque (J1Max As Integer, J2Max As Integer, J3Max As Integer, J4Max As Integer, J5Max As Integer, J6Max As Integer)

Parameters

  • AllJointsMax
    An integer expression indicating the upper torque limit for all joints in the high power state.
  • J1Max - J6Max
    An integer expression indicating the upper torque limit for each joint in the high power state.

Return Value
Integer value between 1 and 9 which represents the limit torque setting for the specified joint.

See Also
GetRealTorque, GetRobotPos

LimitTorque Example
VB Example:

Dim j1LimitTorque As Integer  
j1LimitTorque = m_spel.LimitTorque(1)  

C# Example:

int j1LimitTorquel  
j1LimitTorque = m_spel.LimitTorque(1);  

LimZ Method, Spel Class

Description
Sets the default value of the Z axis height for JUMP commands.

Syntax
Sub LimZ (ZLimit As Single)

Parameters

  • ZLimit
    A coordinate value within the movable range of the Z axis.

See Also
Jump

LimZ Example
VB Example:

saveLimZ = m_spel.GetLimZ()  
m_spel.LimZ(-22)  

C# Example:

saveLimZ = m_spel.GetLimZ();  
m_spel.LimZ(-22);  

LoadPoints Method, Spel Class

Description
Loads a SPEL+ point file into the Controller's point memory for the current robot.

Syntax
Sub LoadPoints (FileName As String [, Merge As Boolean])

Parameters

  • PointFileName
    Point file valid for the current project
  • Merge
    Optional. Set this to integrate the current point into the specified point file.

See Also
ImportPoints, SavePoints

LoadPoints Example
VB Example:

With m_spel  
    .LoadPoints("part1.pts")  
End With  

C# Example:

m_spel.LoadPoints("part1.pts");     

Local Method, Spel Class

Description
Defines local coordinate systems.

Syntax
Sub Local (LocalNumber As Integer, OriginPoint As SpelPoint, [XAxisPoint As SpelPoint], [YAxisPoint As SpelPoint])
Sub Local (LocalNumber As Integer, LocalPoint1 As Integer, BasePoint1 As Integer, LocalPoint2 As Integer, BasePoint2 As Integer)
Sub Local (LocalNumber As Integer, LocalPoint1 As String, BasePoint1 As String, LocalPoint2 As String, BasePoint2 As String)

Parameters

  • LocalNumbe
    The local coordinate system number. A total of 15 local coordinate systems (integer between 1 and 15) may be defined.
  • OriginPoint
    A SpelPoint variable indicating the origin of the local coordinate system.
  • XAxisPoint
    Optional. A SpelPoint variable indicating a point on the X axis in the local coordinate system.
  • YAxisPoint
    Optional. A SpelPoint variable indicating a point on the Y axis in the local coordinate system.
  • LocalPoint1, LocalPoint2
    Specifies the point data in the local coordinate system using an integer or character string.
  • BasePoint1,BasePoint2
    Specifies the point data in the base coordinate system using an integer or character string.

See Also
Base

Local Example
VB Example:

Dim originPoint As New SpelPoint  
originPoint.X = 100  
originPoint.Y = 50  
m_spel.Local(1, originPoint)  

C# Example:

SpelPoint originPoint = new SpelPoint();  
originPoint.X = 100;  
originPoint.Y = 50;  
m_spel.Local(1, originPoint);  

LocalClr Method, Spel Class

Description
Clears a Local defined for the current robot.

Syntax
Sub LocalClr (LocalNumber As Integer)

Parameters

  • LocalNumber
    The number of the coordinate system to clear (undefine) amongst the 15 local coordinate systems (integer between 1 and 15).

See Also
Local, LocalDef

LocalClr Example
VB Example:

m_spel.LocalClr(1)  

C# Example:

m_spel.LocalClr(1);  

LocalDef Method, Spel Class

Description
Returns local definition status.

Syntax
Function LocalDef (LocalNumber As Integer) As Boolean

Parameters

  • LocalNumber
    An integer (1 to 15) indicating the number of the local coordinate system for which to return the status.

Return Value
True if the specified local is defined, False if not.

See Also
Local, LocalClr

LocalDef Example
VB Example:

Dim localExists As Boolean  
localExists = m_spel.LocalDef(1)  

C# Example:

bool localExists;  
localExists = m_spel.LocalDef(1);  

Login Method, Spel Class

Description
Log into Epson RC+ 8.0 as another user.

Syntax
Sub Login (LoginID As String, Password As String)

Parameters

  • LoginID
    A string expression indicating the user’s login ID.
  • Password
    A string expression indicating the user’s password.

Remarks
You can utilize Epson RC+ 8.0 security in your application. For example, you can display a menu that allows different users to log into the system. Each type of user can have its own security rights. For more details on security, see Epson RC+ User's Guide.
If security is enabled and you do not execute LogIn, then your Visual Basic application will be logged in as the guest user. Or if Auto LogIn is enabled in Epson RC+ 8.0, your application will automatically be logged in as the current Windows user if such a user has been configured in Epson RC+ 8.0.

See Also
GetCurrentUser

Login Example
VB Example:

With m_spel  
    .Project = "c:\EpsonRC80\projects\myproject\myproject.sprj"  
    .LogIn("operator", "oprpass")  
End With  

C# Example:

m_spel.Project = @"c:\EpsonRC80\projects\myproject\myproject.sprj";  
m_spel.LogIn("operator", "oprpass");  

MCal Method, Spel Class

Description
Executes machine calibration for robots with incremental encoders.

Syntax
Sub MCal ()

See Also
MCalComplete, MotorsOn

MCal Example
VB Example:

If Not m_spel.MCalComplete() Then  
	m_spel.MCal()  
End If  

C# Example:

if (\!m_spel.MCalComplete())  
	m_spel.MCal();  

MCalComplete Method, Spel Class

Description
Returns True if MCal has been completed successfully.

Syntax
Function MCalComplete () As Boolean

Return Value
True if the MCal has completed, False if not.

See Also
MCal

MCalComplete Example
VB Example:

If m_spel.MCalComplete() Then  
    lblStatus.Text = "MCal Complete"  
Else  
    lblStatus.Text = "MCal Not Complete"  
End If  

C# Example:

if (m_spel.MCalComplete())  
    lblStatus.Text = "MCal Complete";  
else  
    lblStatus.Text = "MCal Not Complete";  

Mcordr Method, Spel Class

Description
Specifies the moving axis order for machine calibration MCal.

Syntax
Sub MCordr ( Step1 As Integer, Step2 As Integer, Step3 As Integer, Step4 As Integer, Step5 As Integer, Step6As Integer, [Step7 As Integer], [Step8 As Integer], [Step9 As Integer] )

Parameters

  • Step 1 - 9
    Bit pattern indicating which axes return to the home position during each step of the MCal process Any number of axes between 0 to all axes can return to the home position at the 1st step. Step 7 - 9 are optional and are used with robots that have more than 7 axes.

See Also
Home, HomeSet, Hordr, MCal

Mcordr Example
VB Example:

m_spel.Mcordr(2, 13, 0, 0, 0, 0)  

C# Example:

m_spel.Mcordr(2, 13, 0, 0, 0, 0);  

MemIn Method, Spel Class

Description
Returns the status of the specified memory I/O byte port. Each port contains 8 memory I/O bits.

Syntax
Function MemIn (PortNumber As Integer) As Integer
Function MemIn (Label As String) As Integer

Parameters

  • PortNumber
    An integer indicating the memory I/O port
  • Label
    A string expression indicating the memory I/O byte label.

Return Value
Integer containing the port value.

See Also
In, InBCD, MemOut, MemSw, Sw, Off, On, Oport

MemIn Example
VB Example:

data = m_spel.MemIn(1)  

C# Example:

data = m_spel.MemIn(1);  

MemInW Method, Spel Class

Description
Returns the status of the specified memory I/O word port. Each word port contains 16 memory I/O bits.

Syntax
Function MemInW (PortNumber As Integer) As Integer
Function MemInW (Label As String) As Integer

Parameters

  • PortNumber
    An integer indicating the memory I/O port.
  • Label
    A string expression indicating the memory I/O word label.

Return Value
Integer expression from 0 to 65535 representing the input port status.

See Also
In, InBCD, MemIn, MemSw, Sw, Off, On, Oport

MemInW Example
VB Example:

data = m_spel.MemInW(1)  

C# Example:

data = m_spel.MemInW(1);  

MemOff Method, Spel Class

Description
Turns off the specified bit of the S/W memory I/O.

Syntax
Sub MemOff (BitNumber As Integer)
Sub MemOff (Label As String)

Parameters

  • BitNumber
    An integer expression indicating the memory I/O bit
  • Label
    A string expression indicating the memory I/O bit label.

See Also
In, InBCD, MemOut, MemSw, Sw, Off, On, Oport

MemOff Example
VB Example:

m_spel.MemOff(500)  

C# Example:

m_spel.MemOff(500);  

MemOn Method, Spel Class

Description
Turns on the specified bit of memory I/O.

Syntax
Sub MemOn (BitNumber As Integer)
Sub MemOn (Label As String)

Parameters

  • BitNumber
    An integer expression indicating the memory I/O bit
  • Label
    A string expression indicating the memory I/O bit label.

See Also
In, InBCD, MemOut, MemSw, Sw, Off, On, Oport

MemOn Example
VB Example:

m_spel.MemOn(500)  

C# Example:

m_spel.MemOn(500);  

MemOut Method, Spel Class

Description
Simultaneously sets 8 memory I/O bits based on the 8 bit value specified by the user.

Syntax
Sub MemOut (PortNumber As Integer, Value As Integer)
Sub MemOut (Label As String, Value As Integer)

Parameters

  • PortNumber
    An integer expression indicating the memory I/O byte
  • Label
    A string expression indicating the memory I/O byte label.
  • Value
    An integer expression indicating the output pattern of the output group for the specified byte. Valid range: 0 to 255

See Also
In, InBCD, MemIn, MemSw, Sw, Off, On, Oport

MemOut Example
VB Example:

m_spel.MemOut(2, 25)  

C# Example:

m_spel.MemOut(2, 25);  

MemOutW Method, Spel Class

Description
Simultaneously sets 16 memory I/O bits based on the 16 bit value specified by the user.

Syntax
Sub MemOutW (PortNumber As Integer, Value As Integer)
Sub MemOutW (Label As String, Value As Integer)

Parameters

  • PortNumber
    An integer expression indicating the memory I/O word.
  • Label
    A string expression indicating the memory I/O word label.
  • Value
    Specifies the output data (integer from 0 to 65535) using an expression or number.

See Also
In, InBCD, MemIn, MemSw, Sw, Off, On, Oport

MemOutW Example
VB Example:

m_spel.MemOutW(2, 25)  

C# Example:

m_spel.MemOutW(2, 25);  

MemSw Method, Spel Class

Description
Returns the specified memory I/O bit status.

Syntax
Function MemSw (BitNumber As Integer) As Boolean
Function MemSw (Label As String) As Boolean

Parameters

  • BitNumber
    An integer expression indicating one memory I/O bit
  • Label
    A string expression indicating the memory I/O bit label.

Return Value
True if the specified memory I/O bit is on, False if not.

See Also
In, InBCD, MemIn, Sw, Off, On, Oport

MemSw Example
VB Example:

If m_spel.MemSw(10) Then  
    m_spel.On(2)  
End If  

C# Example:

if (m_spel.MemSw(10))  
m_spel.On(2);  

Move Method, Spel Class

Description
Moves the arm from the current position to the specified point using linear interpolation (i.e. moving in a straight line).

Syntax
Sub Move (PointNumber As Integer)
Sub Move (Point As SpelPoint)
Sub Move (Point As SpelPoint, AttribExpr As String)
Sub Move (PointExpr As String)

Parameters
Each syntax has one parameter that specifies the end point which the arm travels to during the Move motion. This is the final position at the end of the linear interpolated motion.
PointNumber
Specifies the target point using a previously taught point number from the current robot point memory stored in the controller

  • Point
    Specifies the target point using the SpelPoint data type
  • AttribExpr
    Specifies the end point attributes using a string expression.
    It can contain ROT, ECP, CP, SYNC, Till or Find search expressions, and parallel processing statements.
  • PointExpr
    Specifies the target point using a string expression
    It can contain ROT, ECP, CP, SYNC, Till or Find search expressions, and parallel processing statements.

See Also
AccelR, AccelS, SpeedR, SpeedS
Arc, Arc3, CVMove, Go, Jump, Jump3, Jump3CP
BGo, BMove, TGo, TMove
Arch, ECP, Find, Till

Move Example
VB Example:

' Point specified using point number  
m_spel.Tool(1)  
m_spel.Move(100)  
  
' Point specified using SpelPoint  
Dim pt As SpelPoint  
pt = m_spel.GetPoint("P*")  
pt.X = 125.5  
m_spel.Move(pt)  
  
' Point specified using expression  
m_spel.Move("P0 /L /2 ROT")  
m_spel.Move("P1 :Z(-20)")  
  
' Using parallel processing  
m_spel.Move("P1 \!D50; On 1; D90; Off 1\!")  
  
' Point specified using label  
m_spel.Move("pick")  

C# Example:

// Point specified using point number  
m_spel.Tool(1);  
m_spel.Move(100);  
  
// Point specified using SpelPoint  
SpelPoint pt;  
pt = m_spel.GetPoint("P0");  
pt.X = 125.5;  
m_spel.Move(pt);  
  
// Point specified using expression  
m_spel.Move("P0 /L /2 ROT");  
m_spel.Move("P1 :Z(-20)");  
  
// Using parallel processing  
m_spel.Move("P1 \!D50; On 1; D90; Off 1\!");  
  
// Point specified using label  
m_spel.Move("pick");  

Off Method, Spel Class

Description
Turns off the specified output.

Syntax
Sub Off (BitNumber As Integer)
Sub Off (Label As String)

Parameters

  • BitNumber
    An integer expression indicating the standard or extended output bits
  • Label
    A string expression indicating the output bit label.

See Also
On, Oport, Out, OutW

Off Example
VB Example:

m_spel.Off(1)  

C# Example:

m_spel.Off(1);  

OLRate Method, Spel Class

Description
Returns overload rating for one joint for the current robot.

Syntax
Function OLRate (JointNumber As Integer) As Single

Parameters

  • JointNumber
    An integer indicating the axis number (range: 1 to number of joints of the robot)

Return Value
Returns the OLRate for the specified joint. Values are between 0.0 and 2.0.

Remarks
OLRate can be used to check whether a cycle is causing stress on the servo system. Factors such as temperature and current can cause servo errors during applications with high duty cycles. OLRate can help to check if the robot system is close to having a servo error.

During a cycle, run another task to command OLRate. If OLRate exceeds 1.0 for any joint, then a servo error will occur.

Servo errors are more likely to occur with heavy payloads. By using OLRate during a test cycle, you can help insure that the speed and acceleration settings will not cause a servo error during production cycling.

To get valid readings, you must execute this method while the robot is moving.

This method will not be used in proper payloads state.

OLRate Example
VB Example:

Dim data As Single  
data = m_spel.OLRate(1)  

C# Example:

float data;  
data = m_spel.OLRate(1);  

On Method, Spel Class

Description
Turns on the specified output.

Syntax
Sub On (BitNumber As Integer)
Sub On (Label As String)

Parameters

  • BitNumber
    An integer expression indicating the standard or extended output bits
  • Label
    A string expression indicating the output bit label.

See Also
Off, Oport, Out, OutW

On Example
VB Example:

m_spel.On(1)  

C# Example:

m_spel.On(1);  

OpBCD Method, Spel Class

Description
Simultaneously sets 8 output bits using BCD (Binary Coded Decimal) format.

Syntax
OpBCD (PortNumber As Integer, Value As Integer)
OpBCD (Label As String, Value As Integer)

Parameters

  • PortNumber
    An integer indicating the I/O port Each port comprises 8 output bits (one byte).
  • Value
    An integer between 0 and 99 indicating the output pattern for the specified port. The 2nd digit (called the 1’s digit) represents the lower 4 output bits of the port and the 1st digit (called the 10’s digit) represents the upper 4 output bits of the port.

See Also
Off, Out, Sw

OpBCD Example
VB Example:

m_spel.OpBCD(1, 25)  

C# Example:

m_spel.OpBCD(1, 25);  

Oport Method, Spel Class

Description
Returns the state of the specified output bit.

Syntax
Function Oport (BitNumber As Integer) As Boolean
Function Oport (Label As String) As Boolean

Parameters

  • BitNumber
    An integer expression indicating the standard and extended output bits
  • Label
    A character string indicating the output bit label.

Return Value
True if the specified output bit is on, False if not.

See Also
Off, On, OpBCD, Out, Sw

Oport Example
VB Example:

If m_spel.Oport(1) Then  
    m_spel.On(2)  
End If  

C# Example:

if(m_spel.Oport(1))  
	m_spel.On(2);  

Out Method, Spel Class

Description
Simultaneously reads or sets 8 output bits (one byte).

Syntax
Sub Out (PortNumber As Integer, Value As Integer)
Sub Out (Label As String, Value As Integer)
Function Out (PortNumber As Integer) As Integer
Function Out (Label As String) As Integer

Parameters

  • PortNumber
    An integer indicating the output port.
  • Label
    A string expression indicating the output byte label.
  • Value
    An integer between 0 and 255 indicating the output pattern for the output port. If represented in hexadecimal form, the range is from &H0 to &HFF.

Return Value
Integer number between 0-255 containing the port value.

See Also
InBCD, OpBCD, Oport, OutW, Sw

Out Example
VB Example:

m_spel.Out(1, 240)  

C# Example:

m_spel.Out(1, 240);  

OutReal Method, Spel Class

Description
Gets or sets the output port status as the 32 bits floating-point data (IEEE754 compliant).

Syntax
Function OutReal (WordPortNumber As Integer) As Single
Sub OutReal (WordPortNumber As Integer, Value As Single)

Parameters

  • WordPortNumber
    An integer indicating the output port.
  • Value
    A real number indicating the output data.

Return Value
Returns the specified output port status in 32 bits floating-point data (IEEE754 compliant).

See Also
In, InBCD, InReaql, InW, Out, OutW

OutReal Example
VB Example:

Dim val As Single  
val = m_spel.OutReal(32)  

C# Example:

float val;  
val = m_spel.OutReal(32);  

OutW Method, Spel Class

Description
Simultaneously reads or sets 16 output bits (one word).

Syntax
Sub OutW (PortNumber As Integer, Value As Integer)
Sub OutW (Label As String, Value As Integer)
Function OutW (PortNumber As Integer) As Integer
Function OutW (Label As String) As Integer

Parameters

  • PortNumber
    An integer indicating the output port.
  • Label
    A string expression indicating the output word label.
  • Value
    An integer between 0 and 65535 indicating the output pattern for the output port. If represented in hexadecimal form, the range is from &H0 to &HFFFF.

Return Value
Integer number between 0-65535 containing the port value.

See Also
InBCD, OpBCD, Oport, Out, Sw

OutW Example
VB Example:

m_spel.OutW(1, 240)  

C# Example:

m_spel.OutW(1, 240);  

PAgl Method, Spel Class

Description
Returns the joint angle for the selected rotational axis, or position for the selected linear axis, of the specified point.

Syntax
Function PAgl (PointNumber As Integer, JointNumber As Integer) As Single
Function PAgl (Point As SpelPoint, JointNumber As Integer) As Single
Function PAgl (Label As String, JointNumber As Integer) As Single

Parameters

  • PointNumber
    An integer expression indicating the point number of a point in the current robot’s point memory.
  • Point
    A previously initialized SpelPoint
  • Label
    A string expression indicating the label of the point that will become the point memory of the current robot.
  • JointNumber
    An expression or number indicating the joint number (1 to 9).

Return Value
Single containing the angle for the specified joint in degrees or millimeters.

See Also
Agl, Pls, CX - CT

PAgl Example
VB Example:

Dim t1Angle As Single  
t1Angle = m_spel.PAgl(1, 1)  

C# Example:

float t1Angle;  
t1Angle = m_spel.PAgl(1, 1);  

Pallet Method, Spel Class

Description
Defines pallets.

Syntax
Sub Pallet ( PalletNumber As Integer, Point1 As String, Point2 As String, Point3 As String [, Point4 As String] , rows As Integer, columns As Integer )

Parameters

  • PalletNumber
    The pallet number indicated by an integer between 0 and 15
  • Point1
    A point variable which defines the first pallet position.
  • Point2
    A point variable which defines the second pallet position.
  • Point3
    A point variable which defines the third pallet position.
  • Point4
    Optional. A point variable which defines the fourth pallet position.
  • Rows
    The number of horizontal points on the palette (integer 1 to 32767)
  • Columns
    The number of vertical points on the palette (integer 1 to 32767)

See Also
Jump, Go, SetPoint

Pallet Example
VB Example:

m_spel.Pallet(1, 1, 2, 3, 4, 3, 4)  

C# Example:

m_spel.Pallet(1, 1, 2, 3, 4, 3, 4);  

Pass Method, Spel Class

Description
Specifies the PTP motion to pass a neighborhood of a specified point without stopping motion.

Syntax
Sub Pass(PointNumber As Integer)
Sub Pass(PassExpr As String )

Parameters

  • PointNumber
    Specifies a waypoint using the point number of a previously taught point in the Controller’s point memory for the current robot.
  • PassExpr
    Specifies the end point using a string expression.
    Point specification [, {On | Off | MemOn | MemOff} Bit number [,point specification ...]] [LJM [Orientation flag]]

Point specification Specifies a point number, P(expression), or point label. If the point data is complete and listed in ascending or descending order, two point numbers can be combined using a colon and specified like P(1:5).
Bit number Specifies I/O output bit or memory I/O bit to turn on/off using an integer or output label.
LJM Converts the departure coordinates, approach coordinates, and target coordinates using the LJM function. Optional.
Orientation flag Specifies the orientation flag parameter for the LJM function. Optional.

See Also
Accel, Go, Jump, Speed

Pass Example
VB Example:

m_spel.Jump(1)  
m_spel.Pass(2) 'Move the Arm #2 closer to P2 and execute the following 
	command before reaching P2  
m_spel.On(2)  
m_spel.Pass(3)  
m_spel.Pass(4)  
m_spel.Off(0)  
m_spel.Pass(5)  

C# Example:

m_spel.Jump(1);  
m_spel.Pass(2);// Move the Arm #2 closer to P2 and execute the following 
	command before reaching P2  
m_spel.On(2);  
m_spel.Pass(3);  
m_spel.Pass(4);  
m_spel.Off(0);  
m_spel.Pass(5);  

Pause Method, Spel Class

Description
Causes all normal SPEL+ tasks in the Controller to pause. If the robot is moving, it will immediately decelerate to a stop.

Syntax
Sub Pause ()

Note


The function executed by Call method cannot be paused by Pause method.
If you need to pause, use Xqt Method.

See Also
Continue, EventReceived, Stop

Pause Example
VB Example:

Sub btnPause_Click()_  
       ByVal sender As System.Object, _  
       ByVal e As System.EventArgs) _  
       Handles btnPause.Click  
  
    m_spel.Pause()  
    btnPause.Enabled = False  
    btnContinue.Enabled = True  
End Sub  

C# Example:

void btnPause_Click(object sender, EventArgs e)  
{  
    m_spel.Pause();  
    btnPause.Enabled = false;  
    btnContinue.Enabled = true;  
}  

PDef Method, Spel Class

Description
Returns the definition status of a specified point.

Syntax
Function PDef (PointNumber As Integer) As Boolean

Parameters

  • PointNumber
    An integer expression indicating the point number of a point in the current robot’s point memory.

Return Value
True if the specified point is defined, False if not.

See Also
PDel

PDef Example
VB Example:

Dim p1Defined As Boolean  
p1Defined = m_spel.PDef(1)  

C# Example:

bool p1Defined;  
p1Defined = m_spel.PDef(1);  

PDel Method, Spel Class

Description
Deletes specified position data.

Syntax
Sub PDel (FirstPointNumber As Integer [, LastPointNumber As Integer])

Parameters

  • FirstPointNumber
    An integer expression that specifies the first point in the range to delete.
  • LastPointNumber
    Optional. An integer expression that specifies the last point in range to delete. If omitted, only the point specified in FirstPointNumber is deleted.

See Also
PDef, LoadPoints, Clear, SavePoints

PDel Example
VB Example:

m_spel.PDel(1, 10)  
m_spel.SavePoints("model1.pts")  

C# Example:

m_spel.PDel(1, 10);  
m_spel.SavePoints("model1.pts");  

PeakSpeed Method, Spel Class

Description
Returns the peak speed values for the specified joint.

Syntax
Function PeakSpeed (JointNumber As Integer) As Single

Parameters

  • JointNumber
    An integer indicating the axis number (range: 1 to number of joints of the robot)

Return Value
Real value from -1 to 1.

Remarks
This method returns the value of the maximum absolute speed for the joint with a sign. The peak speed is a real number from -1 to 1 with 1 being the maximum speed.

Execute PeakSpeedClear method first, and then execute this method to display the peak speed value for the joint.

When using the virtual controller or conducting dry-run, the average of the absolute speed values is calculated from the commanded speed instead of the actual speed.
This method does not support the PG additional axes.

See Also
AvgSpeed, AvgSpeedClear, PeakSpeedClear

PeakSpeed Example
VB Example:

Dim val As Single  
val = m_spel.PeakSpeed(1)  

C# Example:

float val;  
val = m_spel.PeakSpeed(1);  

PeakSpeedClear Method, Spel Class

Description
Clears and initializes the peak speed for one or more joints.

Syntax
Sub PeakSpeedClear ()

Remarks
This method clears the peak speed values for the specified joints.
You must execute this method before executing PeakSpeed method.

This method does not support the PG additional axes.

See Also
AvgSpeed, AvgSpeedClear, PeakSpeed

PeakSpeedClear Example
VB Example:

m_spel.PeakSpeedClear()  

C# Example:

m_spel.PeakSpeedClear();  

PF_Abort Method, Spel Class

Description
Forces the Part Feeding process to stop for the specified part.

Syntax
Sub PF_Abort (PartID As Integer)

Parameters

  • PartID
    An integer indicating the part ID (1 to 16).

Remarks
Immediately aborts the Part Feeding process for the specified part.
Unlike PF_Stop method, this aborts the callback function in progress.
Nothing will occur when using this function when the Part Feeding process has not been started.

PF_Abort Example
VB Example:

m_spel.PF_Abort(1)  

C# Example:

m_spel.PF_Abort(1);  

PF_Backlight Method, Spel Class

Description
Turns the built-in backlight on or off.

Syntax
Sub PF_Backlight (FeederNumber As Integer, State As Boolean)

Parameters

  • FeederNumber
    An integer indicating the feeder number.
  • State
    Specifies On (True) or Off (False).

Remarks
When the system is controlling vision, the backlight is automatically turned on and off as needed.
Use this method to control the built-in backlight on status when the system is not controlling vision.

PF_Backlight Example
VB Example:

m_spel.PF_Backlight(1, True)  

C# Example:

m_spel.PF_Backlight(1, true);  

PF_BacklightBrightness Method, Spel Class

Description
Sets the brightness for the built-in backlight.

Syntax
Sub PF_Backlightness (FeederNumber As Integer, Brightness As Integer)

Parameters

  • FeederNumber
    An integer indicating the feeder number.
  • SBrightness
    Specifies the brightness as a value between 0 and 100.

Remarks
Normally, the built-in backlight brightness to be used for a part is set in the Part Feeding Configuration dialog. If changes to brightness are required at runtime, you can use this method to change it.

PF_BacklightBrightness Example
VB Example:

m_spel.PFBacklightness(1, 80)  

C# Example:

m_spel.PF_BacklightBrightness(1, 80);  

PF_Name Method, Spel Class

Description
Gets a part name from a part ID.

Syntax
Function PF_Name (PartID As Integer) As String

Parameters

  • PartID
    An integer indicating the part ID (1 to 16).

Return Value
Returns the name of the specified part ID as a character string.

Remarks
If the specified part ID is disabled, “ ” (empty character) is returned.

PF_Name Example
VB Example:

Dim part1Name As String  
Part1Name = m_spel.PF_Name(1)  

C# Example:

string part1Name;  
part1Name = m_spel.PF_Name(1);  

PF_Number Method, Spel Class

Description
Gets a part ID from a part name.

Syntax
Function PF_Number (PartName As String) As Integer

Parameters

  • PartName
    A character string indicating the part name.

Return Value
Returns the part ID (integer number from 1 to 16) for the specified part name.

Remarks
Returns −1 if the corresponding part name does not exist.
If multiple parts with the same name exist, the part with the smallest ID will be retrieved.

PF_Number Example
VB Example:

Dim part1ID As Integer  
Part1ID = m_spel.PF_Number("Part1")  

C# Example:

int part1ID;  
part1ID = m_spel.PF_Number("Part1");  

PF_Start Method, Spel Class

Description
Starts the Part Feeding process for a specified part.

Syntax
Sub PF_Start (PartID1 As Integer, [PartID2 As Integer], [PartID3 As Integer], [PartID4 As Integer])

Parameters

  • PartID1
    An integer indicating the master part ID (1 to 16).
  • PartID2
    An integer indicating the slave part ID (1 to 16). Optional.
  • PartID3
    An integer indicating the slave part ID (1 to 16). Optional.
  • PartID4
    An integer indicating the slave part ID (1 to 16). Optional.

Remarks
Perform the following before starting this method.
- - Select the robot in use
- - Turn the motors on
- - Run PF_InitLog when outputting a log

Running this method generates a new task and returns control to the caller.

When this occurs, the Status callback function will be run under the following conditions. The Part Feeding process will not start.

Condition Status callback function Status parameter value
The part ID is invalid PF_STATUS_BAD_ID

Part parameter settings are invalid

(Enabled check box not selected, etc.)

PF_STATUS_BAD_PARAMETER
Feeder calibration not complete PF_STATUS_CAL_NOT_COMPLETE
An error occurred PF_STATUS_ERROR

This method cannot be run multiple times at the same time. Once initiated, the processing already executed will continue. An error will not occur.
PF_Start should be run from a normal task. An error will occur when attempting to run PF_Task from a background task.

Caution If a part ID that does not exist is specified in this method, a 7600 error will occur.

PF_Start Example
VB Example:

m_spel.PF_Start(1)  

C# Example:

m_spel.PF_Start(1);  

PF_Stop Method, Spel Class

Description
Issues a Part Feeding process end request.
This will wait for running callback functions to finish.
Once complete, the PF_CycleStop callback function will run and the process will stop.

Syntax
Sub PF_Stop (PartID As Integer)

Parameters

  • PartID
    An integer indicating the part ID (1 to 16).

Remarks
Stops the Part Feeding process for the specified part.
Unlike the PF_Abort method, PF_Stop will wait for running callback functions to finish.
Once callback functions are complete, the PF_CycleStop callback function will run.
Nothing will occur when using this function when the Part Feeding process has not been started.

PF_Stop Example
VB Example:

m_spel.PF_Stop(1)  

C# Example:

m_spel.PF_Stop(1);  

PLabel Method, Spel Class

Description
Gets or sets the point label associated with a point number.

Syntax
Function PLabel (PointNumber As Integer) As String
Sub PLabel (PointNumber As Integer, PointName As String)

Parameters

  • PointNumber
    An integer indicating the point number.
  • PointName
    A character string that specifies the label to use for the designated pointer data.

Return Value
Returns the corresponding label to the specified point number.

See Also
PDef

PLabel Example
VB Example:

Dim pt1Label As String  
Pt1Label = m_spel.PLabel(1)  

C# Example:

string pt1Label;  
pt1Label = m_spel.PLabel(1);  

Plane Method, Spel Class

Description
Defines a Plane.

Syntax
Sub Plane (PlaneNumber As Integer, Point As SpelPoint)
Sub Plane (PlaneNumber As Integer, X As Single, Y As Single, Z As Single, U As Single, V As Single, W As Single)

Parameters

  • PlaneNumber
    An integer expression from 1 to 15 indicating which of 15 planes to define.
  • Point
    Point data indicating the coordinate data of the approach check plane
  • X
    The X coordinate of the point indicating the coordinate data of the approach check plane.
  • Y
    The Y coordinate of the point indicating the coordinate data of the approach check plane.
  • Z
    The Z coordinate of the point indicating the coordinate data of the approach check plane.
  • U
    The U coordinate of the point indicating the coordinate data of the approach check plane.
  • V
    The V coordinate of the point indicating the coordinate data of the approach check plane.
  • W
    The W coordinate of the point indicating the coordinate data of the approach check plane.

See Also
PlaneClr, PlaneDef

Plane Example
VB Example:

m_spel.Plane(1, -5, 5, -10, 10, -20, 20)  

C# Example:

m_spel.Plane(1, -5, 5, -10, 10, -20, 20);  

PlaneClr Method, Spel Class

Description
Clears (undefines) a Plane.

Syntax
Sub PlaneClr (PlaneNumber As Integer)

Parameters

  • PlaneNumber
    An integer indicating which of the 15 approach check planes to clear (1 to 15).

See Also
Plane, PlaneDef

PlaneClr Example
VB Example:

m_spel.PlaneClr(1)  

C# Example:

m_spel.PlaneClr(1);  

PlaneDef Method, Spel Class

Description
Returns whether a plane is defined.

Syntax
Function PlaneDef (PlaneNumber As Integer) As Boolean

Parameters

  • PlaneNumber
    An integer indicating the approach check plane number (1 to 15).

Return Value
True if the specified plane is defined, False if not.

See Also
Plane, PlaneClr

PlaneDef Example
VB Example:

x = m_spel.PlaneDef(1)  

C# Example:

x = m_spel.PlaneDef(1);  

Pls Method, Spel Class

Description
Returns the current encoder pulse count for each axis at the current position.

Syntax
Function Pls (JointNumber As Integer) As Integer

Parameters

  • JointNumber
    Specify the axis to acquire the current pulse count for (1 to 9).

Return Value
Integer containing the current pulse count for the specified joint.

See Also
Agl, Pulse

Pls Example
VB Example:

j1Pulses = m_spel.Pls(1)  

C# Example:

j1Pulses = m_spel.Pls(1);  

PTCLR Method, Spel Class

Description
Clears and initializes the peak torque for one or more joints.

Syntax
Sub PTCLR ()

Remarks
This method clears the peak torque values for the specified joints.
You must execute this method before executing PTRQ method.

See Also
ATCLR, ATRQ, PTRQ

PTCLR Example
VB Example:

m_spel.PTCLR ()  

C# Example:

m_spel.PTCLR();  

PTPBoost Method, Spel Class

Description
Sets the boost parameters for short distance PTP (point to point) motion.

Syntax
Sub PTPBoost (BoostValue As Integer [, DepartBoost As Integer] [, ApproBoost As Integer])

Parameters

  • BoostValue
    Integer from 0 to 100.
  • DepartBoost
    Optional. An integer (0 to 100) indicating the depart adjustment setting of the Z coordinate during a jump operation.
  • ApproBoost
    Optional. An integer (0 to 100) indicating the approach adjustment setting of the Z coordinate during a jump operation.

See Also
PTPBoostOK

PTPBoost Example
VB Example:

m_spel.PTPBoost(50)  
m_spel.PTPBoost(50, 30, 30)  

C# Example:

m_spel.PTPBoost(50);  
m_spel.PTPBoost(50, 30, 30);  

PTPBoostOK Method, Spel Class

Description
Returns whether or not the PTP (Point to Point) motion from a current position to a target position is a small travel distance.

Syntax
Function PTPBoostOK (PointNumber As Integer) As Boolean
Function PTPBoostOK (Point As SpelPoint) As Boolean
Function PTPBoostOK (PointExpr As String) As Boolean

Parameters
Each syntax has one parameter that specifies the target point to check.

  • PointNumber
    Specifies the target point using the point number of a previously taught point in the Controller’s point memory for the current robot.
  • Point
    Specifies the target point using the SpelPoint data type
  • PointExpr
    Specifies the target point using a string expression

Return Value
True if PTPBoost will be used, False if not.

See Also
PTPBoost

PTPBoostOK Example
VB Example:

If m_spel.PTPBoostOK(1) Then  
    m_spel.Go(1)  
End If  

C# Example:

if (m_spel.PTPBoostOK(1))  
	m_spel.Go(1);  

PTran Method, Spel Class

Description
Executes a relative joint move in pulses.

Syntax
Sub PTran (JointNumber As Integer, Pulses As Integer)

Parameters

  • JointNumber
    The joint to move
  • Pulses
    Pulse count for movement

See Also
JTran, Pulse

PTran Example
VB Example:

' Move joint 1 5000 pulses in the plus direction.  
m_spel.PTran(1, 5000)  

C# Example:

//Move joint 1 5000 pulses in the plus direction.  
m_spel.PTran(1, 5000);  

PTRQ Method, Spel Class

Description
Returns the peak torque for the specified joint.

Syntax
Function PTRQ (JointNumber As Integer) As Single

Parameters

  • JointNumber
    An integer indicating the axis number (range: 1 to number of joints of the robot)

Return Value
Real value from 0 to 1.

See Also
ATCLR, ATRQ, PTCLR

PTRQ Example
VB Example:

Dim peakTorque As Single  
peakTorque = m_spel.PTRQ(1)  

C# Example:

float peakTorque;  
peakTorque = m_spel.PTRQ(1);  

Pulse Method, Spel Class

Description
Moves the robot arm by Point to Point control to the point specified by the pulse values for all robot joints.

Syntax
Sub Pulse ( J1Pulses As Integer, J2Pulses As Integer, J3Pulses As Integer, J4Pulses As Integer [, J5Pulses As Integer ] [, J6Pulses As Integer] [, J7Pulses As Integer] [, J8Pulses As Integer] [, J9Pulses As Integer] )

Parameters

  • J1Pulses - J9Pulses
    An integer expression indicating the pulse values for Joints 1 to 9. J5Pulses to J9Pulses are optional.

KEY POINTS


The pulse values must be within the range specified each joint.

See Also
Go, Move, Jump

Pulse Example
VB Example:

m_spel.Pulse(5000, 1000, 0, 0)  

C# Example:

m_spel.Pulse(5000, 1000, 0, 0);  

Quit Method, Spel Class

Description
Terminates execution of the specified task.

Syntax
Sub Quit (TaskNumber As Integer)
Sub Quit (TaskName As String)

Parameters

  • TaskNumber
    The task number for the task to abort (1 to 32).
  • TaskName
    A string expression indicating the task name.

Note


To stop the function executed by Call Method, use Stop Method.

See Also
Halt, Resume, Xqt

Quit Example
VB Example:

m_spel.Quit(3)  

C# Example:

m_spel.Quit(3);  

RadToDeg Method, Spel Class

Description
Converts Radians into Degrees.

Syntax
Function RadToDeg (Radians As Double) As Double

Parameters

  • Radians
    A real number indicating the number of radians to convert to degrees.

Return Value

Double containing the converted value in degrees.
See Also

DegToRad

RadToDeg Example
VB Example:

Dim deg As Double  
  
deg = m_spel.RadToDeg(1)  

C# Example:

double deg;  
deg = m_spel.RadToDeg(1);  

RebootController Method, Spel Class

Description
Reboot the currently connected controller.

Syntax
Sub RebootController (ShowStatusDialog As Boolean)

Parameters

  • ShowStatusDialog
    Sets whether to display the status screen until the restart is complete.
    True = show a dialog False = do not show a dialog

Remarks
Use ShowStatusDialog to show a dialog with a progress bar. You can abort the operation from the status dialog or by executing the Abort method.

See Also
Abort

RebootController Example
VB Example:

m_spel.RebootController(True)  

C# Example:

m_spel.RebootController(true);  

RebuildProject Method, Spel Class

Description
Completely rebuilds the current project specified in the Project property.

Syntax
Sub RebuildProject ()

See Also
BuildProject, EnableEvent, EventReceived, Project, ProjectBuildComplete

RebuildProject Example
VB Example:

With m_spel  
    .Project = "c:\EpsonRC80\projects\myproject\myproject.sprj"  
    .RebuildProject()  
End With  

C# Example:

m_spel.Project = @"c:\EpsonRC80\projects\myproject\myproject.sprj";  
m_spel.RebuildProject();  

Recover Method, Spel Class

Description
Recover moves the robot back to the position is was in when the safeguard was open.

Syntax
Function Recover () As Boolean

Remarks
The Recover method can be used after the safeguard is closed to turn on the robot motors and slowly move the robot back to the position it was in when the safeguard was open. After Recover has completed successfully, you can execute the Cont method to continue the cycle. If Recover was completed successfully, it will return True. Recover will return False if a pause, abort, or safeguard open occurred during recover motion.

Return Value
True if the recover motion was completed, False if not.

See Also
Continue, Pause

Recover Example
VB Examples:
This example executes a recover, then continue

Sub btnCont_Click( _  
   ByVal sender As System.Object, _  
   ByVal e As System.EventArgs) Handles btnCont.Click  
  Dim sts As Boolean  
  Dim answer As Integer  
      
  sts = m_spel.Recover()  
If sts = False Then  
  Exit Sub  
End If  
answer = MsgBox("Ready to continue?", vbYesNo)  
If answer = vbYes Then  
  m_spel.Continue()  
EndIF  
End sub  

In the example below, the cycle continues after recover is run. This example shows how the recover action is run as long as the button is held down. If the button is released during the recover motion, a pause is issued and recover is aborted. If the button is held down until recover has completed, then a message is displayed.

Sub btnRecover_MouseDown( _  
    ByVal sender As System.Object, _  
    ByVal e As System.Windows.Forms.MouseEventArgs) _  
    Handles btnRecover.MouseDown  
Dim sts As Boolean  
  
sts = m_spel.Recover()  
If sts = True Then  
    MsgBox("Recover complete")  
EndIf  
End Sub  
  
Sub btnRecover_MouseUp( _  
    ByVal sender As System.Object, _  
    ByVal e As System.Windows.Forms.MouseEventArgs) _  
    Handles btnRecover.MouseUp  
   
m_spel.Pause()  
End Sub  

C# Example:
This example executes a recover, then continue

void btnCont_Click(object sender, EventArgs e)  
{  
    bool sts;  
    DialogResult answer;  
  
    sts = m_spel.Recover();  
    if (sts == true){  
            answer = MessageBox.Show("Continue?", "",  
            MessageBoxButtons.YesNo);  
        If (answer == DialogResult.Yes)  
            m_spel.Continue();  
    }  
}  

In the example below, the cycle continues after recover is run. This example shows how the recover action is run as long as the button is held down. If the button is released during recover motion, a pause is issued and recover is aborted. If the button is held down until recover has completed, then a message is displayed.

  void btnCont_Click(object sender, EventArgs e)  
  {  
    bool sts;  
  
    sts = m_spel.Recover();  
    if (sts == true)  
        MessageBox.Show("Recover complete");  
  }  
  
  void btnRecover_MouseUp(oject sender, EventArgs e)  
  {  
    m_spel.Pause();  
  }  

Reset Method, Spel Class

Description
Resets the Controller to the initialized state.

Syntax
Sub Reset ()
See Also

ResetAbort

Reset Example
VB Example:

m_spel.Reset  

C# Example:

m_spel.Reset();  

ResetAbort Method, Spel Class

Description
Resets the abort flag that is set with the Stop method.

Syntax
Sub ResetAbort ()

Remarks
When the Stop method is executed and no other Spel method is in cycle, then the next Spel method will generate a user abort error. This is done so that no matter when the Stop is issued, the routine that is executing Spel methods will receive the error. Use ResetAbort to clear this condition.

Note:


The ResetAbortEnabled property must be set to True for the ResetAbort feature to work.

See Also
Abort, Reset, ResetAbortEnabled

ResetAbort Example
VB Example:

Sub btnMcal_Click() Handles btnMcal.Click  
  m_spel.ResetAbort()  
  m_spel.MCal()  
End Sub  

C# Example:

void btnMCal_Click(object sender, EventArgs e)  
{  
 m_spel.ResetAbort();  
 m_spel.MCal();  
}  

Resume Method, Spel Class

Description
Resumes a task which was suspended by the Halt method.

Syntax
Sub Resume (TaskNumber As Integer)
Sub Resume (TaskName As String)

Parameters

  • TaskNumber
    The task number for the aborted task (1 to 32).
  • TaskName
    A character string indicating the task name.

See Also
Quit, Xqt

Resume Example
VB Example:

m_spel.Resume(2)  

C# Example:

m_spel.Resume(2);  

RunDialog Method, Spel Class

Description
Runs an Epson RC+ 8.0 dialog.

Syntax
Sub RunDialog (DialogID As SpelDialogs [, Parent As Form])

Parameters

  • DialogID
    The dialog ID of the Epson RC+ 8.0 to run.
  • Parent
    Optional. A .NET form that is the parent of the window.

See Also
ShowWindow

RunDialog Example
VB Example:

Sub btnRobotManager_Click( _  
       ByVal sender As System.Object, _  
       ByVal e As System.EventArgs) _  
       Handles btnRobotManager.Click  
  
    m_spel.RunDialog(SpelDialogs.RobotManager)  
End Sub  

C# Example:

void btnRobotManager_Click(object sender, EventArgs e)  
{  
	m_spel.RunDialog(SpelDialogs.RobotManager);  
}  

SavePoints Method, Spel Class

Description
Save points for the current robot into a file.

Syntax
Sub SavePoints (FileName As String)

Parameters

  • PointFileName
    The file name to save the points in the current project.

See Also
LoadPoints

SavePoints Example
VB Example:

With m_spel  
    .SavePoints("part1.pts")  
End With  

C# Example:

m_spel.SavePoints("part1.pts");  

Sense Method, Spel Class

Description
Specifies input condition that, if satisfied, completes the Jump in progress by stopping the robot above the target position.

Syntax
Sub Sense (Condition As String) As Boolean

Parameters

  • Condition
    For details about the setting the I/O conditions, see “Sense” in the SPEL+ Language Reference manual.

See Also
Jump, JS

Sense Example
VB Example:

With m_spel  
    .Sense("Sw(1) = On")  
    .Jump("P1 SENSE")  
    stoppedOnSense = .JS()  
End With  

C# Example:

m_spel.Sense("Sw(1) = On");  
m_spel.Jump("P1 SENSE");  
stoppedOnSense = m_spel.JS();  

SetIODef Method, Spel Class

Description
Sets the I/O label and description for an input, output, or memory I/O bit, byte, or word.

Syntax
Sub SetIODef (Type As SpelLabelTypes, Index As Integer, Label As String, Description As String)

Parameters

  • Type Specifies the I/O type as shown below: InputBit = 1 InputByte = 2 InputWord = 3 OutputBit = 4 OutputByte = 5 OutputWord = 6 MemoryBit = 7 MemoryByte = 8 MemoryWord = 9 InputReal = 10 OutputReal = 11
  • Index
    Specifies the bit or port number.
  • Label
    Specifies a new label.
  • Description
    Specifies a new comment.

Remarks
Use SetIODef to define the label and description for any I/O point.

See Also
GetIODef

SetIODef Example
VB Example:

Dim label, desc As String  
label = "StartCycle"  
desc = "Starts the robot cycle"  
m_spel.SetIODef(SpelLabelTypes.InputBit, 0, label, desc)  

C# Example:

string label, desc;  
label = "StartCycle";  
desc = "Starts the robot cycle";  
m_spel.SetIODef(SpelLabelTypes.InputBit, 0, label, desc);  

SetPoint Method, Spel Class

Description
Sets the coordinate data for a point for the current robot.

Syntax
Sub SetPoint(PointNumber As Integer, Point As SpelPoint)
Sub SetPoint(PointLabel As String, Point As SpelPoint)

Sub SetPoint(PointNumber As Integer, X As Single, Y As Single, Z As Single, U As Single)
Sub SetPoint(PointLabel As String, X As Single, Y As Single, Z As Single, U As Single)

Sub SetPoint(PointNumber As Integer, X As Single, Y As Single, Z As Single, U As Single,Local As Integer, Hand As SpelHand)
Sub SetPoint(PointLabel As String, X As Single, Y As Single, Z As Single, U As Single,Local As Integer, Hand As SpelHand)

Sub SetPoint(PointNumber As Integer, X As Single, Y As Single, Z As Single, U As Single,V As Single, W As Single)
Sub SetPoint(PointLabel As String, X As Single, Y As Single, Z As Single, U As Single,V As Single, W As Single)

Sub SetPoint(PointNumber As Integer, X As Single, Y As Single, Z As Single, U As Single,V As Single, W As Single, Local As Integer, Hand As SpelHand, Elbow As SpelElbow, Wrist As SpelWrist, J4Flag As Integer, J6Flag As Integer)
Sub SetPoint(PointLabel As String, X As Single, Y As Single, Z As Single, U As Single,V As Single, W As Single, Local As Integer, Hand As SpelHand, Elbow As SpelElbow, Wrist As SpelWrist, J4Flag As Integer, J6Flag As Integer)

Sub SetPoint(PointNumber As Integer, X As Single, Y As Single, Z As Single, U As Single,V As Single, W As Single, S As Single, T As Single)
Sub SetPoint(PointLabel As String, X As Single, Y As Single, Z As Single, U As Single,V As Single, W As Single, S As Single, T As Single)

Sub SetPoint(PointNumber As Integer, PointExpr As String)
Sub SetPoint(PointLabel As String, PointExpr As String)

Parameters

  • PointNumber
    An integer expression that specifies the point number of a point in the current robot’s point memory.
  • X
    The X coordinate for the specified point.
  • Y
    The Y coordinate for the specified point.
  • Z
    The Z coordinate for the specified point.
  • U
    The U coordinate for the specified point.
  • V
    The V coordinate for the specified point.
  • W
    The W coordinate for the specified point.
  • S
    The S coordinate for the specified point.
  • T
    The T coordinate for the specified point.
  • Local
    The Local Number for the specified point. Use 0 when there is no local.
  • Hand
    The hand orientation at the specified point.
  • Elbow
    The elbow orientation at the specified point.
  • Wrist
    The wrist orientation at the specified point.
  • PointExpr
    Specifies a point using a string expression.
    Note
    Do not enter integer values to X, Y, Z, U, V, W, S, and T parameters. Use Single variables or directly enter Single type values.

See Also
GetPoint, LoadPoints, SavePoints

SetPoint Example
Example of RC + project SPEL + program to run:

Global Integer P_WorkDetect  
Global Real offsetX, offsetY, heightZ, offsetU  
Function SetOffset  
   P_WorkDetect = 5  
   offsetX = 0.5  
   offsetY = 0.3  
   heightZ = 10.0  
   offsetU = 1.2  
Fend  

VB Example:

Dim pt As SpelPoint  
' Get coordinates of P1  
pt = m_spel.GetPoint(1)  
' Set it with changes  
pt.U = pt.U - 10.5  
’ Specify orientation flag  
pt.J1Flag = 1  
m_spel.SetPoint(1, pt)  
’ Run RC + project SPEL + function  
m_spel.Call("SetOffset")  
’ Set coordinates and orientation using string expressions  
m_spel.SetPoint(2, "P(P_WorkDetect) +X(offsetX) +Y(offsetY) :Z(heightZ) +U  (offsetU) /A /J1F1")  

C# Example:

SpelPoint pt;  
// Get coordinates of P1  
pt = m_spel.GetPoint(1);  
// Set it with changes  
pt.U = pt.U - 10.5;  
// Specify orientation flag  
pt.J1Flag = 1;  
m_spel.SetPoint(1, pt);  
// Run RC + project SPEL + function  
m_spel.Call("SetOffset")  
// Set coordinates and orientation using string expressions  
m_spel.SetPoint(2, "P(P_WorkDetect) +X(offsetX) +Y(offsetY) :Z(heightZ) +U  (offsetU) /A /J1F1");  

SetVar Method, Spel Class

Description
Sets the value of a SPEL+ global preserve variable in the Controller.

Syntax
Sub SetVar (VarName As String, Value As Object)

Parameters

  • VarName
    SPEL + backup variable name
  • Value
    Value to set

Remarks
You can use SetVar to set the values for single variables and array variables. See the examples below.

See Also
GetVar

SetVar Example
VB Example:

m_spel.SetVar("g_myIntVar", 123)  
  
Dim i, myArray(10) As Integer  
For i = 1 To 10  
  myArray(i) = i  
Next i  
m_spel.SetVar("g_myIntArray", myArray)  
  
m_spel.SetVar("g_myIntArray(1)", myArray(1))  

C# Example:

m_spel.SetVar("g_myIntVar", 123);  
  
int[] myArray = new int[10];  
for(int i = 1; i < 10; i++)  
	myArray[i] = i;  
  
m_spel.SetVar("g_myIntArray", myArray);  
  
m_spel.SetVar("g_myIntArray[1]", myArray[1]);  

SFree Method, Spel Class

Description
Free joint the specified robot axes.

Syntax
Sub SFree ()
Sub SFree (ParamArray Axes() As Integer)

Parameters

  • Axes
    An integer parameter array indicating the robot axis elements to free. You can specify axis numbers from 1 to 9.

See Also
SLock

SFree Example
VB Example:

' State J1 and J2 to free joint  
m_spel.SFree(1, 2)  

C# Example:

// State J1 and J2 to free joint  
m_spel.SFree(1, 2);  

ShowWindow Method, Spel Class

Description
Shows an Epson RC+ 8.0 window.

Syntax
Sub ShowWindow (WindowID As SpelWindows [, Parent As Form])

Parameters

  • WindowID
    The ID of the Epson RC+ 8.0 window to show.
  • Parent
    Optional. A .NET form that is the parent of the window.

Remarks
You can use the Parent parameter to specify the .NET parent form for the window. If you cannot use a .NET parent form, you must omit the Parent parameter and use the ParentWindowHandle property to set the handle of the parent.

See Also
HideWindow, ParentWindowHandle, RunDialog, ServerOutOfProcess

ShowWindow Example
VB Example:

Sub btnShowIOMonitor_Click( _  
       ByVal sender As System.Object, _  
       ByVal e As System.EventArgs) _  
       Handles btnShowIOMonitor.Click  
  
    m_spel.ShowWindow(RCAPINet.SpelWindows.IOMonitor, Me)  
End Sub  

C# Example:

void btnShowIOMonitor_Click(object sender, EventArgs e)  
{  
	m_spel.ShowWindow(RCAPINet.SpelWindows.IOMonitor, this);  
}  

SimGet Method, Spel Class

Description
Acquire the setting values of each object properties of simulator.

Syntax
Sub SimGet (Object As String, Property As SpelSimProps, ByRef Value As Boolean)
Sub SimGet (RobotName As String, HandName As String, Property As SpelSimProps, ByRef Value As Boolean)
Sub SimGet (Object As String, Property As SpelSimProps, ByRef Value As Double)
Sub SimGet (RobotName As String, HandName As String, Property As SpelSimProps, ByRef Value As Double)
Sub SimGet (Object As String, Property As SpelSimProps, ByRef Value As Integer)
Sub SimGet (RobotName As String, HandName As String, Property As SpelSimProps, ByRef Value As Integer)
Sub SimGet (Object As String, Property As SpelSimProps, ByRef Value As Boolean)
Sub SimGet (RobotName As String, HandName As String, Property As SpelSimProps, ByRef Value As String)

Parameters

  • Object
    String variable that indicates the object name to acquire the property values for.
  • RobotName
    Sting variable that indicates the robot name to which the hand specified in “Hand” is mounted.
  • HandName
    String variable that indicates the hand name to acquire the property values for.
  • Property
    The name of the property to acquire the values for.
  • Value
    Variable indicating the returned value.

Remarks
Use this method to acquire the property setting value of each object of the simulator.

For each property details, refer to the following manual.
"Epson RC+ Language Reference - SimGet"

See Also
SimSet

SimGet Example
VB Example:

Dim posX As Double  
m_spel.SimGet("SBox_1", SpelSimProps.PositionX, posX)  

C# Example:

double posX;  
SimGet("SBox_1", SpelSimProps.PositionX, out posX);  

SimResetCollision Method, Spel Class

Description
Resets collision detection.

Syntax
Sub SimResetCollision ()

Remarks
If there is no collision between the robot and the object after executing this method, the collision state is reset and the 3D display of simulator is updated. If there is collision between the robot and the object, the collision state will not be reset and the 3D display of simulator will not be updated.

For more details, refer to the following manual.
"Epson RC+ 8.0 SPEL+ Language Reference - SimSet"

See Also
SimSet

SimResetCollision Example
VB Example:

m_spel.SimResetCollision ()  

C# Example:

m_spel.SimResetCollision ();  

SimSet Method, Spel Class

Description
Set properties of each object of the simulator. Operate the robot motion, objects, and simulator settings.

Syntax
Sub SimSet (Object As String, Property As SpelSimProps, Value As Boolean)
Sub SimSet (RobotName As String, HandName As String, Property As SpelSimProps, Value As Boolean)
Sub SimSet (Object As String, Property As SpelSimProps, Value As Integer)
Sub SimSet (RobotName As String, HandName As String, Property As SpelSimProps, Value As Integer)
Sub SimSet (Object As String, Property As SpelSimProps, Value As Double)
Sub SimSet (RobotName As String, HandName As String, Property As SpelSimProps, Value As Double)
Sub SimSet (Object As String, Property As SpelSimProps, Value As String)
Sub SimSet (RobotName As String, HandName As String, Property As SpelSimProps, Value As String)

Parameters

  • Object
    String variable that indicates the object name to acquire the property values for.
  • RobotName
    Sting variable that indicates the robot name to which the hand specified in “Hand” is mounted.
  • HandName
    A string variable indicating the hand name for which to set the property value.
  • Property
    The name of the property to set the new value for.
  • Value
    Formula for new value

Remarks
Use this method to set properties of each object of the simulator. Also, use the command to change the robot motion, objects, and simulator settings.

You cannot specify SpelSimProps.Type for the property.

For details of each property, refer to the following manual.
"Epson RC+ 8.0 SPEL+ Language Reference - SimSet"

See Also
SimGet

SimSet Example
VB Example:

m_spel.SimSet ("SBox_1", SpelSimProps.PositionX, 100.0)  

C# Example:

m_spel.SimSet("SBox_1", SpelSimProps.PositionX, 100.0);  

SimSetParent Method, Spel Class

Description
Sets an object operation.

Syntax
Sub SimSetParent (Object As String)
Sub SimSetParent (Object As String, ParentObject As String)

Parameters

  • Object
    A string variable indicating the object name to set the parent object for.
  • ParentObject
    A string variable indicating the parent object name.

Remarks
Sets the object specified by “ParentObject” as parent object for the object specified by “Object”. “ParentObject” can be omitted. In this case, the object specified by “Object” will be parenet object. For example, if the object specified by “Object” is a child object of another object, the setting as a child object will be canceled.
If the object specified by “Object” is a part or an object set as an arm installation tool, you cannot specify parent object.
For the objects that can be specified as SetParent, refer to the following manual.
"Epson RC+ 8.0 SPEL+ Language Reference - SimSet"
For camera objects, SetParent can be used only for objects that are set as fixed cameras.

See Also
SimSet

SimSetParent Example
VB Example:

m_spel.SimSetParent ("SBox_1")  

C# Example:

m_spel.SimSetParent ("SBox_1");  

SimSetPick Method, Spel Class

Description
Picks an object using the specified robot.

Syntax
Sub SimSetPick (RobotName As String, Object As String)
Sub SimSetPick (RobotName As String, Object As String, ToolNumber As Integer)

Parameters

  • RobotName
    A string variable indicating the name of the robot to pick.
  • Object
    A string variable indicating the picked object name.
  • ToolNumber
    Expression indicating the tool number to use when picking

Remarks
The robot specified by RobotName grasps the object specified by Object. Grasped object is registered as the part of the robot. Also, if any tool number is specified by ToolNumber, you can operate grasped motion by using the specified tool number. If the ToolNumber is omitted, use Tool 0 to operate grasped motion.
You cannot grasp the object that is already registered as the part or set as an arm installation tool. Also, you cannot grasp the camera..

For more details, refer to the following manual.
"Epson RC+ 8.0 SPEL+ Language Reference - SimSet"

See Also
SimGet, SimSet, SimSetPlace

SimSetPick Example
VB Example:

m_spel.SimSetPick ("Robot1", "SBox_1", 1)  

C# Example:

m_spel.SimSetPick ("Robot1", "SBox_1", 1);  

SimSetPlace Method, Spel Class

Description
Places an object using the specified robot.

Syntax
Sub SimSetPlace (RobotName As String, Object As String)

Parameters

  • RobotName
    A string variable indicating the name of the robot to place.
  • Object
    A string variable indicating the placed object name.

Remarks
The robot specified by RobotName places the object specified by Object. The placed object is deregistered as part of the robot.
You cannot place an object that has already been deregistered as a part.

For more details, refer to the following manual and section.
"Epson RC+ 8.0 SPEL+ Language Reference - SimSet"

See Also
SimGet, SimSet, SimSetPick

SimSetPlace Example
VB Example:

m_spel.SimSetPlace ("Robot1", "SBox_1")  

C# Example:

m_spel.SimSetPlace ("Robot1", "SBox_1");  

Shutdown Method, Spel Class

Description
Shutdown or restart Windows.

Syntax
Sub Shutdown (Mode As SpelShutdownMode)

Parameters

  • Mode
    0 = Shutdown Windows. 1 = Restart Windows.

See Also
Reset

Shutdown Example
VB Example:

' Restart Windows  
m_spel.Shutdown(1)  

C# Example:

// Restart Windows  
m_spel.Shutdown(1);  

SLock Method, Spel Class

Description
Release the free joint state for the specified robot axes.

Syntax
Sub SLock ()
Sub SLock (ParamArray Axes() As Integer)

Parameters

  • Axes
    An integer parameter array indicating the robot axis elements to lock. You can specify axis numbers from 1 to 9.

See Also
SFree

SLock Example
VB Example:

' Release the free joint state of J1 and J2.  
m_spel.SLock(1, 2)  

C# Example:

// Release the free joint state of J1 and J2.  
m_spel.SLock(1, 2);  

Speed Method, Spel Class

Description
Specifies the arm speed for use with the point to point instructions Go, Jump and Pulse.

Syntax
Sub Speed ( PointToPointSpeed As Integer [, JumpDepartSpeed As Integer ] [, JumpApproSpeed As Integer] )

Parameters

  • PointToPointSpeed
    Specifies the arm speed for use with the PTP motion Go, Jump and Pulse.
  • JumpDepartSpeed
    An integer between 1 and 100 indicating the depart speed for the Jump instruction.
  • JumpApproSpeed
    An integer between 1 and 100 indicating the approach speed for the Jump instruction.

See Also
Accel, Jump, Go

Speed Example
VB Example:

m_spel.Speed(50)  

C# Example:

m_spel.Speed(50);  

SpeedR Method, Spel Class

Description
Specifies the tool rotation speed when ROT is used.

Syntax
Sub SpeedR (RotationSpeed As Single)

Parameters

  • RotationSpeed
    Specifies the tool posture change speed as a real number greater than or equal to 0.1 (unit: deg/sec)

See Also
Arc, Arc3, BMove, Jump3CP, Power, TMove

SpeedR Example
VB Example:

m_spel.SpeedR(100)  

C# Example:

m_spel.SpeedR(100);  

SpeedS Method, Spel Class

Description
Specifies the arm speed for use with the Continuous Path instructions Jump3CP, Move, Arc, and CVMove.

Syntax
Sub SpeedS ( LinearSpeed As Single [, JumpDepartSpeed As Single] [, JumpApproSpeed As Single] )

Parameters

  • LinearSpeed
    Specifies the arm speed to use with the Jump3CP, Move, Arc, and CVMove Continuous Path instructions.
  • JumpDepartSpeed
    A real number or formula indicating the depart speed for Jump and Jump3CP. (unit: mm/sec)
  • JumpApproSpeed
    A real number or formula defining the approach speed for Jump and Jump3CP. (unit: mm/sec)

See Also
AccelS, Jump3CP, Move, TMove

SpeedS Example
VB Example:

m_spel.SpeedS(500)  

C# Example:

m_spel.SpeedS(500);  

Start Method, Spel Class

Description
Start one SPEL+ program.

Syntax
Sub Start (ProgramNumber As Integer)

Parameters

  • ProgramNumber
    The program number to start. The correspondence with the 64 main functions incorporated in SPEL+ is shown in the table below. The range is 0 to 63.
Program Number SPEL+ Function Name
0 main
1 main1
2 main2
3 main3
4 main4
5 main5
... ...
63 main63

Remarks
When Start is executed, control will return immediately to the calling program. You cannot start a program that is already running. Note that Start causes global variables in the controller to be cleared and default robot points to be loaded.

See Also
Continue, Pause, Stop, Xqt

Start Example
VB Example:

Sub btnStart_Click( _  
       ByVal sender As System.Object, _  
       ByVal e As System.EventArgs) _  
       Handles btnStart.Click  
  
    m_spel.Start(0)  
End Sub  

C# Example:

void btnStart_Click(object sender, EventArgs e)  
{  
    m_spel.Start(0);  
}  

StartBGTask Method, Spel Class

Description
Start one SPEL+ task as a background task.

Syntax
Sub StartBGTask (FuncName As String)

Parameters

  • FuncName
    The name of the function to be executed.

Remarks
Use StartBGTask to start a Spel+ background task in the Controller. Background tasks must be enabled in the Controller.

Note that BGMain automatically starts when the Controller switches to auto mode, so normally StartBGTask is not required.
StartBGTask is provided in case you need to stop all tasks, then start background tasks again.

See Also
Call, Start, Stop, Xqt

StartBGTask Example
VB Example:

' Stop all tasks, including background tasks  
m_spel.Stop(SpelStopType.StopAllTasks)  
…  
m_spel.RebuildProject()  
  
’ Restart the main background task  
m_spel.StartBGTask("BGMain")  

C# Example:

// Stop all tasks, including background tasks  
m_spel.Stop(SpelStopType.StopAllTasks);  
…  
m_spel.RebuildProject();  
  
// Restart the main background task  
m_spel.StartBGTask("BGMain");  

Stat Method, Spel Class

Description
Returns the Controller status.

Syntax
Function Stat (Address As Integer) As Integer

Parameters

  • Address
    Specifies the address indicating the status of the Controller. (Integer from 0 to 2)

Return Value
Returns 4 byte value representing the status of the Controller. (See the table below.)

Address Bit The status of the Controller while the bit is on
0 0-15 &H1-&H8000 Task 1 to 16 are being executed (Xqt) or Halt state
16 &H10000 The task is being executed
17 &H20000 Pause state
18 &H40000 Error state
19 &H80000 TEACH mode
20 &H100000 Emergency stop state
21 &H200000 Power Low mode
22 &H400000 The safeguard is open
23 &H800000 Enable switch is open
24 &H1000000 Undefined
25 &H2000000 Undefined
26 &H4000000 Test mode
27 &H8000000 T2 mode state
28-31 Undefined
1 0 &H1

Log of Stop above target position upon satisfaction of condition in Jump...Sense statement.

(This log is erased when another Jump statement is executed).

1 &H2 Log of stop at intermediate travel position upon satisfaction of condition in Go/Jump/Move...Till statement. (This log is erased when another Go/Jump/Move...Till statement is executed)
2 &H4 Undefined
3 &H8 The log of motion stop in progress if Trap statement is detected.
4 &H10 Motor On state
5 &H20 Home position
6 &H40 Power Low mode
7 &H80 Undefined
8 &H100 Joint #4 is engaged.
9 &H200 Joint #3 is engaged.
10 &H400 Joint #2 is engaged.
11 &H800 Joint #1 is engaged.
12 &H1000 Joint #6 is engaged.
13 &H2000 Joint #5 is engaged.
14 &H4000 T axis is engaged.
15 &H8000 S axis is engaged.
16 &H10000 Joint #7 is engaged.
17-31 Undefined
2 0-15 &H1-&H8000 Task 17 to 32 are being executed (Xqt) or in Halt state

See Also
EStopOn, PauseOn, SafetyOn

Stat Example
VB Example:

Dim ctr_stat As Integer   
ctr_stat = m_spel.Stat(0)  

C# Example:

int ctr_stat;  
ctr_stat = m_spel.Stat(0);  

Stop Method, Spel Class

Description
Stops all normal SPEL+ tasks running in the Controller and optionally stop all background tasks.

Syntax
Sub Stop ()
Sub Stop (SpelStopType StopType)

Parameters

  • StopType
    Specifies whether to stop only normal tasks (StopNormalTasks) or all tasks (StopAllTasks). If omitted, StopNormalTasks is specified.

Note


If the Stop method is executed when ResetAbortEnabled is True, the error 10101 occurs when executing Start or Reset methods.

To release the error, execute ResetAbort method after executing Stop method.

See Also
Continue, Pause, ResetAbort, ResetAbortEnabled, Start, SpelStopType

Stop Example
VB Example:

Sub btnStop_Click( _  
       ByVal sender As System.Object, _  
       ByVal e As System.EventArgs) _  
       Handles btnStop.Click  
  
    m_spel.Stop()  
End Sub  

C# Example:

void btnStop_Click(object sender, EventArgs e)  
{  
    m_spel.Stop();  
}  

Sw Method, Spel Class

Description
Returns the selected input bit status.

Syntax
Function Sw (BitNumber As Integer) As Boolean
Function Sw (Label As String) As Boolean

Parameters

  • BitNumber
    An integer or formula indicating the I/O input bits.
  • Label
    A string expression indicating the input bit label.

Return Value
True if the specified input bit is on, False if not.

See Also
In, InBCD, MemSw, Off, On, Oport

Sw Example
VB Example:

If m_spel.Sw(1) Then  
    m_spel.On(2)  
End If  

C# Example:

if (m_spel.Sw(1))  
    m_spel.On(2);  

TargetOK Method, Spel Class

Description
Returns a status indicating whether or not the PTP (Point to Point) motion from the current position to a target position is possible.

Syntax
Function TargetOK (PointNumber As Integer) As Boolean
Function TargetOK (Point As SpelPoint) As Boolean
Function TargetOK (PointExpr As String) As Boolean

Parameters
Each syntax has one parameter that specifies the target point to check.

  • PointNumber
    Specifies the end point using the point number of a previously taught point in the Controller’s point memory for the current robot.
    Point Specifies the end point using the SpelPoint data type.
  • PointExpr
    Specifies the end point using a string expression.

Return Value
True if the target can be moved to from the current position, False if not.

See Also
Go, Jump, Move, TGo, TMove

TargetOK Example
VB Example:

If m_spel.TargetOK("P1 /F") Then  
    m_spel.Go("P1 /F")  
End If  

C# Example:

if (m_spel.TargetOK("P1 /F"))  
    m_spel.Go("P1 /F");  

TasksExecuting Method, Spel Class

Description
Returns True if any SPEL+ tasks are executing.

Syntax
Function TasksExecuting () As Boolean

Return Value
True if any SPEL+ tasks are executing, False if not.

See Also
TaskState, Xqt

TasksExecuting Example
VB Example:

tasksRunning = m_spel.TasksExecuting()  

C# Example:

tasksRunning = m_spel.TasksExecuting();  

TaskState Method, Spel Class

Description
Returns the status of a task.

Syntax
Function TaskState (TaskNumber As Integer) As SpelTaskState
Function TaskState (TaskName As String) As SpelTaskState

Parameters

  • TaskNumber
    Task number for which to return the execution status.
  • TaskName
    A string expression indicating the task name.

Return Value
A SpelTaskState value.

See Also
TasksExecuting, Xqt

TaskState Example
VB Example:

Dim taskState As SpelTaskState  
taskState = m_spel.TaskState(2)  

C# Example:

SpelTaskState taskState;  
taskState = m_spel.TaskState(2);  

TeachPoint Method, Spel Class

Description
Runs a dialog that allows an operator to jog and teach one point.

Syntax
Function TeachPoint ( PointFile As String, PointNumber As Integer, Prompt As String ) As Boolean
Function TeachPoint (PointFile As String, PointName As String, Prompt As String) As Boolean
Function TeachPoint (PointFile As String, PointNumber As Integer, Prompt As String, Parent As Form) As Boolean
Function TeachPoint (PointFile As String, PointName As String, Prompt As String, Parent As Form) As Boolean

Parameters

  • PointFile
    A character string indicating the point file name.
  • PointNumber
    Point number to be taught
  • PointName
    A character string indicating the point label
  • Prompt
    A character string indicating the instructional text that is displayed at the bottom of the teach dialog.
  • Parent
    Optional. A .NET form that is the parent of the window.

Return Value
Returns True if the operator clicked the Teach button, False if the operator clicked Cancel.

Remarks
Use TeachPoints to allow an operator to teach one robot point in the Controller. When TeachPoints is executed, the point file is loaded in the Controller. When the Teach button is clicked, the point is taught in the Controller and the point file is saved on the Controller.

TeachPoint Example
VB Example:

Sub btnTeachPick_Click( _  
       ByVal sender As System.Object, _  
       ByVal e As System.EventArgs) _  
       Handles btnTeachPick.Click  
  
    Dim sts As Boolean  
    Dim prompt As String  
  
    prompt = "Jog to Pick position and click Teach"  
    sts = m_spel.TeachPoint("points.pts", 1, prompt)  
End Sub  

C# Example:

void btnTeachPick_Click(object sender, EventArgs e){  
    bool sts;  
    string prompt;  
  
    prompt = "Jog to Pick position and click Teach";  
    sts = m_spel.TeachPoint("points.pts", 1, prompt);  
  
}  

Till Method, Spel Class

Description
Specifies event condition that, if satisfied, completes the motion command (Jump, Go, Move, etc.) in progress by decelerating and stopping the robot at an intermediate position.

Syntax
Sub Till (Condition As String) As Boolean

Parameters

  • Condition
    Specifies the I/O condition. For details see Till Statement in the SPEL+ Language Reference manual.

See Also
Go, Jump, JS, Sense, TillOn

Till Example
VB Example:

With m_spel  
    .Till("Sw(1) = On")  
    .Go("P1 TILL")  
End With    

C# Example:

m_spel.Till("Sw(1) = On");  
m_spel.Go("P1 TILL");  

TillOn Method, Spel Class

Description
Returns True if a stop has occurred from a till condition during the last Go/Jump/Move statement.

Syntax
Function TillOn () As Boolean
Return Value

True if the robot stopped due to a Till condition, False if not.

Remarks
Use TillOn to check if the Till condition turned on during the last motion command using Till.
TillOn is equivalent to
((Stat(1) And 2) <> 0)

See Also
Jump, Till

TillOn Example
VB Example:

If m_spel.TillOn() Then  
    m_spel.Jump(2)  
End If  

C# Example:

if (m_spel.TillOn())  
    m_spel.Jump(2);  

TGo Method, Spel Class

Description
Executes Point to Point relative motion, in the current tool coordinate system.

Syntax
Sub TGo (PointNumber As Integer)
Sub TGo (Point As SpelPoint)
Sub TGo (Point As SpelPoint, AttribExpr As String)
Sub TGo (PointExpr As String)

Parameters
Each syntax has one parameter that specifies the end point which the arm travels to during the TGo motion. This is the final position at the end of the point to point motion.

  • PointNumber
    Specifies the end point using the point number of a previously taught point in the Controller’s point memory for the current robot.
  • Point
    Specifies the end point using the SpelPoint data type.
  • AttribExpr
    Specifies the end point attributes using a string expression.
    It can contain CP, SYNC, Till or Find search expressions, and parallel processing statements.
  • PointExpr
    Specifies the end point using a string expression.
    It can contain CP, SYNC, Till or Find search expressions, and parallel processing statements.

See Also
Accel, Speed
Arc, Arc3, CVMove, Go, Jump, Jump3, Jump3CP, Move
BGo, BMove, TMove
Find, Till

TGo Example
VB Example:

' Point specified using point number  
m_spel.Tool(1)  
m_spel.TGo(100)  
  
' Point specified using SpelPoint  
Dim pt As SpelPoint  
pt = m_spel.GetPoint("P*")  
pt.X = 125.5  
m_spel.TGo(pt)  
  
' Point specified using expression  
m_spel.TGo("P0")  
m_spel.TGo("XY(0, 0, -20, 0)")  
  
' Using parallel processing  
m_spel.TGo("P1 \!D50; On 1; D90; Off 1\!")  
  
' Point specified using label  
m_spel.TGo("pick")  

C# Example:

// Point specified using point number  
m_spel.Tool(1);  
m_spel.TGo(100);  
  
// Point specified using SpelPoint  
SpelPoint pt;  
pt = m_spel.GetPoint("P0");  
pt.X = 125.5;  
m_spel.TGo(pt);  
  
// Point specified using expression  
m_spel.TGo("P0 /L /2");  
m_spel.TGo("P1 :Z(-20)");  
  
// Using parallel processing  
m_spel.TGo("P1 \!D50; On 1; D90; Off 1\!");  
  
// Point specified using label  
m_spel.TGo("pick");  

TLClr Method, Spel Class

Description
Clears (undefines) a tool coordinate system.

Syntax
Sub TLClr (ToolNumber As Integer)

Parameters

  • ToolNumber
    An integer indicating which of the tool coordinates to clear (undefine). (Tool 0 is the default tool and cannot be cleared.)

See Also
Tool, TLDef

TLClr Example
VB Example:

m_spel. TLClr(1)  

C# Example:

m_spel. TLClr(1);  

TLDef Method, Spel Class

Description
Returns tool definition status.

Syntax
Function TLDef (ToolNumber As Integer) As Boolean

Parameters

  • ToolNumber
    An integer indicating which tool status to return.

Return Value
True if the specified tool is defined, False if not.

See Also
Tool, TLClr

TLDef Example
VB Example:

m_spel.TLDef(1)  

C# Example:

m_spel.TLDef(1);  

TLSet Method, Spel Class

Description
Defines a tool coordinate system.

Syntax
Sub TLset (ToolNumber As Integer , Point As SpelPoint)
Sub TLset ( ToolNumber As Integer, XCoord As Single, YCoord As Single, ZCoord As Single, UCoord As Single, VCoord As Single, WCoord As Single )

Parameters

  • ToolNumber
    An integer expression (1 to 15) indicating which of the 15 tools to define. Tool 0 is the default tool. (Tool 0 is the default tool and cannot be modified.)
  • Point
    A SpelPoint indicating the point data.
  • XCoord
    The tool coordinate system origin X coordinate.
  • YCoord
    The tool coordinate system origin Y coordinate.
  • ZCoord
    The tool coordinate system origin Z coordinate.
  • UCoord
    The tool coordinate system rotation about the Z axis.
  • VCoord
    The tool coordinate system rotation about the Y axis.
  • WCoord
    The tool coordinate system rotation about the X axis.

See Also
Arm, Armset, GetTool, Tool

TLSet Example
VB Example:

m_spel.TLSet(1, .5, 4.3, 0, 0, 0, 0)  

C# Example:

m_spel.TLSet(1, .5, 4.3, 0, 0, 0, 0);  

TMove Method, Spel Class

Description
Executes linear interpolation relative motion, in the current tool coordinate system

Syntax
Sub TMove (PointNumber As Integer)
Sub TMove (Point As SpelPoint)
Sub TMove (Point As SpelPoint, AttribExpr As String)
Sub TMove (PointExpr As String)

Parameters
Each syntax has one parameter that specifies the end point which the arm travels to during the TMove motion. This is the final position at the end of the linear interpolated motion.

  • PointNumber
    Specifies the target point using a previously taught point number from the current robot point memory stored in the controller
  • Point
    Specifies the target point using the SpelPoint data type
  • AttribExpr
    Specifies the end point attributes using a string expression.
    It can contain ROT, CP, SYNC, Till or Find search expressions, and parallel processing statements.
  • PointExpr
    Specifies the target point using a string expression
    It can contain ROT, CP, SYNC, Till or Find search expressions, and parallel processing statements.

See Also
AccelR, AccelS, SpeedR, SpeedS
Arc, Arc3, CVMove, Go, Jump, Jump3, Jump3CP, Move
BGo, BMove, TGo
Find, Till

TMove Example
VB Example:

' Point specified using point number  
m_spel.Tool(1)  
m_spel.TMove(100)  
  
' Point specified using SpelPoint  
Dim pt As SpelPoint  
pt = m_spel.GetPoint("P*")  
pt.X = 125.5  
m_spel.TMove(pt)  
  
' Point specified using expression  
m_spel.TMove("P0")  
m_spel.TMove("XY(0, 0, -20, 0)")  
  
' Using parallel processing  
m_spel.TMove("P1 \!D50; On 1; D90; Off 1\!")  
  
' Point specified using label  
m_spel.TMove("pick")  

C# Example:

// Point specified using point number  
m_spel.Tool(1);  
m_spel.TMove(100);  
  
// Point specified using SpelPoint  
SpelPoint pt;  
pt = m_spel.GetPoint("P0");  
pt.X = 125.5;  
m_spel.TMove(pt);  
  
// Point specified using expression  
m_spel.TMove ("P0");  
m_spel.TMove ("XY(0, 0, -20, 0)");  
  
// Using parallel processing  
m_spel.TMove("P1 \!D50; On 1; D90; Off 1\!");  
  
// Point specified using label  
m_spel.TMove("pick");  

Tool Method, Spel Class

Description
Selects the current robot tool.

Syntax
Sub Tool (ToolNumber As Integer)

Parameters

  • ToolNumber
    Sixteen tool definitions (0 to 15) to be used for the next operation command

See Also
TLSet, Arm, TGo, TMove

Tool Example
VB Example:

m_spel.Tool(1)  
m_spel.TGo(100)  

C# Example:

m_spel.Tool(1);  
m_spel.TGo(100);  

TrapStop Method, Spel Class

Description
Returns True if the current robot was stopped by a trap during the previous motion command.

Syntax
Function TrapStop () As Boolean

Return Value
True if the robot was stopped by a trap, False if not.

See Also
EStopOn, ErrorOn

TrapStop Example
VB Example:

If m_spel.TrapStop() Then  
    MsgBox "Robot stopped by Trap"  
End If  

C# Example:

if (m_spel.TrapStop())  
    MessageBox.Show("Robot stopped by trap");  

TW Method, Spel Class

Description
Returns the status of the WAIT condition and WAIT timer interval.

Syntax
Function TW () As Boolean

Return Value
True if a timeout occurred, False if not.

See Also
WaitMem, WaitSw

TW Example
VB Example:

Const PartPresent = 1  
m_spel.WaitSw(PartPresent, True, 5)  
If m_spel.TW() Then  
    MsgBox "Part present time out occurred"  
End If  

C# Example:

const int PartPresent = 1;  
m_spel.WaitSw(PartPresent, True, 5);  
if (m_spel.TW())  
    MessageBox.Show("Part present time out occurred");  

UserHasRight Method, Spel Class

Description
Returns whether the currently logged in user has the specified right.

Syntax
Function UserHasRight (SpelUserRights Right) As Boolean

Parameters

  • Right
    The right you want to check for the currently logged-in user.

Return Value
True if the user has the specified right, False if not.

See Also
Login, GetCurrentUser

UserHasRight Example
VB Example:

Dim hasRight As Boolean  
hasRight = m_spel.UserHasRight(SpelUserRights.EditPoints)  

C# Example:

bool hasRight;  
hasRight = m_spel.UserHasRight(SpelUserRights.EditPoints);  

VCal Method, Spel Class

Description
This command allows you to execute a vision calibration cycle.

Syntax
Sub VCal (CalibName As String)
Sub VCal (CalibName As String, ByRef Status As Integer)
Sub VCal (CalibName As String, Parent As Form)
Sub VCal (CalibName As String, Parent As Form, ByRef Status As Integer)

Parameters

  • CalibName
    A string expression indicating the calibration scheme name for the current project.
  • Status
    Optional. An integer variable for which to return the calibration status. 0: Unsuccessful, 1: Successful
  • Parent
    Optional. A .NET form that is the parent of the window.

Remarks
When you execute the VCal method, the robot will move. You should verify that the operator is ready before executing VCal.

VCal only executes the calibration cycle. It does not allow you to teach points. Use VCalPoints to teach points. Also, you must first set up a calibration in Epson RC+ 8.0. See your Vision Guide manuals for details.

Use the Status parameter to check if the calibration was successful. If the calibration property ShowConfirmation is True, the confirmation dialog box is displayed. When the operator clicks the [OK] button, Status returns 1: Successful.

See Also
VCalPoints

VCal Example
VB Example:

Dim status As Integer  
m_spel.VCal("CAMCAL1", status)  

C# Example:

int status;  
m_spel.VCal("CAMCAL1", status);  

VCalPoints Method, Spel Class

Description
This command enables you to teach vision calibration points.

Syntax
Sub VCalPoints (CalibName As String)
Sub VCalPoints (CalibName As String, ByRef Status As Integer)
Sub VCalPoints (CalibName As String, Parent As Form)
Sub VCalPoints (CalibName As String, Parent As Form, ByRef Status As Integer)

Parameters

  • CalibName
    A string expression indicating the calibration scheme name for the current project.
  • Status
    Optional. An integer variable that receives the status of the point teaching. 0: Unsuccessful, 1: Successful
  • Parent
    Optional. A .NET form that is the parent of the window.

Remarks
When you execute the VCalPoints command, the Teach Calibration Points dialog is opened. When the [Finish] button is clicked, the calibration data is automatically saved.
You must have already created the calibration scheme from Epson RC+ 8.0.
Image
Use the Status parameter to check if the point teaching was successful. When all points are taught and the [Finish] button is clicked, Status returns 1: Successful.

See Also
VCal

VCalPoints Example
VB Example:

Dim status As Integer  
m_spel.VCalPoints("CAMCAL1", status)  

C# Example:

int status;  
m_spel.VCalPoints("CAMCAL1", out status);  

VCls Method, Spel Class

Description
Clears vision graphics.

Syntax
Sub VCls ()

Remarks
Use the VCls method to clear the vision screen.

See Also
VRun

VCls Example
VB Example:

m_spel.VCls()  

C# Example:

m_spel.VCls();  

VCreateCalibration Method, Spel Class

Description
Creates a new vision calibration in the current project.

Syntax
Sub VCreateCalibration (CameraNumber As Integer, CalibName As String)
Sub VCreateCalibration (CameraNumber As Integer, CalibName As String,CopyCalibName As String)

Parameters

  • CameraNumber
    An integer expression indicating the number of the camera to calibrate.
  • CalibName
    A string expression indicating the vision calibration name to be created.
  • CopyCalibName
    Optional. A string expression indicating the vision calibration name to be copied.

See Also
VCreateObject, VCreateSequence, VDeleteCalibration

VCreateCalibration Example
VB Example:

m_spel.VCreateCalibration(1, "mycal")  

C# Example:

m_spel.VCreateCalibration(1, "mycal");  

VCreateObject Method, Spel Class

Description
Creates a vision object in the current project.

Syntax
Sub VCreateObject ( Sequence As String, ObjectName As String, ObjectType As SpelVisionObjectTypes )

Parameters

  • Sequence
    A string expression indicating the vision sequence name in the current project.
  • ObjectName
    A string expression indicating the name of the object to be created in the sequence.
  • ObjectType
    A number indicating the vision object type (constants listed below can also be used)
Object Type Constant Value
Correlation Correlation 1
Blob Blob 2
Edge Edge 3
Polar Polar 4
Line Line 5
Point Point 6
Frame Frame 7
ImageOp ImageOp 8
Ocr Ocr 9
CodeReader CodeReader 10
Geometric Geometric 11
Color Match ColorMatch 14
Line Finder LineFinder 15
Arc Finder ArcFinder 16
Defect Finder DefectFinder 17
Line Inspector LineInspector 18
Arc Inspector ArcInspector 19
Box Finder BoxFinder 20
Corner Finder CornerFinder 21
Contour Contour 22
Text Text 23
Decision Decision 26
Coordinates Coordinates 27

See Also
VCreateSequence, VDeleteObject, VDeleteSequence

VCreateObject Example
VB Example:

m_spel.VCreateObject("myseq", "myblob", SpelVisionObjectTypes.Blob)  

C# Example:

m_spel.VCreateObject("myseq", "myblob", SpelVisionObjectTypes.Blob);  

VCreateSequence Method, Spel Class

Description
Creates a new vision sequence in the current project.

Syntax
Sub VCreateSequence (CameraNumber As Integer, SequenceName As String)
Sub VCreateSequence (CameraNumber As Integer, SequenceName As String,
CopySequenceName As String)

Parameters

  • CameraNumber
    An integer expression indicating the camera number to use.
  • SequenceName
    A string expression indicating the vision sequence name to be created.
  • CopySequenceName
    Optional. A string expression indicating the vision calibration name to be copied.

See Also
VCreateObject, VDeleteObject, VDeleteSequence

VCreateSequence Example
VB Example:

m_spel.VCreateSequence(1, "myseq")  

C# Example:

m_spel.VCreateSequence(1, "myseq");  

VDefArm Method, Spel Class

Description
Calculates an arm set value of a mobile camera using a feature point detectable by the vision system.
Note: Robot operates automatically based on the detection results of the target. Be careful of interference between the robot and peripherals. Also, use with avoiding singularity nearby posture that each axis extends to prevent an error during the arm set.

Syntax
Sub VDefArm (ArmNumber As Integer, ArmDefType As SpelArmDefType, ArmDefMode As SpelArmDefMode, Sequence As String, Rotation As Double, TargetTolerance As Double)
Sub VDefArm (ArmNumber As Integer, ArmDefType As SpelArmDefType, ArmDefMode As SpelArmDefMode, Sequence As String, Rotation As Double, TargetTolerance As Double, Parent As Form)
Sub VDefArm (ArmNumber As Integer, ArmDefType As SpelArmDefType, ArmDefMode As SpelArmDefMode, Sequence As String, Rotation As Double, TargetTolerance As Double, RobotSpeed As Integer, RobotAccel As Integer, ShowWarning As SpelVDefShowWarning
Sub VDefArm (ArmNumber As Integer, ArmDefType As SpelArmDefType, ArmDefMode As SpelArmDefMode, Sequence As String, Rotation As Double, TargetTolerance As Double, RobotSpeed As Integer, RobotAccel As Integer, ShowWarning As SpelVDefShowWarning,Parent As Form)

Parameters

  • ArmNumber
    An integer expression (1 to 15) indicating the arm number on which to perform arm set.
  • ArmDefType
    An integer expression indicating the arm type.
    J2Camera: Calculates a center of mobile J2 camera image.
  • ArmDefMode
    An integer expression indicating the arm set mode.
    Rough: A mode to run a rough arm set. Robot will move with setting accuracy of 1 mm as a target. Robot motion will be small.
    Fine: A mode to run a fine arm set. Robot will move largely with arm orientation change and provide arm set with more high accuracy.
  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • Rotation
    A real number expression that indicates the rotation angle (degrees) when using the coarse tool set.
    Value range: 0 to 45
  • TargetTolerance
    A real number expression indicating the pixel distance at which the vision detection result is considered to match the target position.
    Value range: 0 to 3 pixels
  • Parent
    Optional. A .NET form that is the parent of the window.
  • RobotSpeed
    Optional. Integer variable indicating the robot speed (%). Value range: 0 to 100 If omitted, set to “5”.
  • RobotAccel
    Optional. Integer variable indicating the robot acceleration (%). Value range: 0 to 99 If omitted, set to “5”.
  • ShowWarning
    Optional. An integer variable that sets whether to display a warning when ArmSetMode is Fine. Always : Always display DependsOnSpeed : Display when either RobotSpeed or RobotAccel is larger than 5 None : Do not display If omitted, set to “DependsOnSpeed”.

See Also
VDefGetMotionRange, VDefLocal, VDefSetMotionRange, VDefTool, VGoCenter

VDefArm Example
VB Example:

m_spel.VDefArm(1, SpelArmDefType.J2Camera, SpelArmDefMode.Rough, "myseq", 5, 1)  

C# Example:

m_spel.VDefArm(1, SpelArmDefType.J2Camera, SpelArmDefMode.Rough, "myseq", 5, 1);  

VDefGetMotionRange Method, Spel Class

Description
Acquires values of the motion range limited by VDefTool, VDefArm, VDefLocal, and VGoCenter.

Syntax
Sub VDefGetMotionRange(ByRef MaxMoveDist As Double, ByRef MaxPoseDiffAngle As Double, ByRef LjmMode As Integer)

Parameters

  • MaxMoveDist
    A real number variable indicating the maximum travel distance.
    If 0 is specified, the range is not limited. (0 to 500. Default: 200)
    VDefTool, VDefArm, VDefLocal, and VGoCenter are used to limit the range.
  • MaxPoseDiffAngle
    A real number variable indicating the maximum displacement angle (degrees) of the hand orientation (UVW).
    If 0 is specified, the range is not limited.
    It only affects VDefLocal. (0 to 180. Default: 45 degrees)
  • LjmMode
    A real number variable indicating the LJM mode.

See Also
VDefTool, VDefArm, VDefLocal, VGoCenter, VDefSetMotionRange

VDefGetMotionRange Example
VB Example:

Dim maxMoveDist As Double  
Dim maxPoseDiffAngle As Double  
Dim ljmMode As Integer  
m_spel.VDefGetMotionRange(maxMoveDist, maxPoseDiffAngle, ljmMode)  

C# Example:

double maxMoveDist, maxPoseDiffAngle;  
int ljmMode;  
m_spel.VDefGetMotionRange(out maxMoveDist, out maxPoseDiffAngle, out ljmMode);  

VDefLocal Method, Spel Class

Description
Detects a calibration plate placed on a work plane by a mobile camera, and defines local coordinates parallel to the work plane.
It also detects user’s workpiece at the tool end by a fixed camera and defines a local plane which is parallel to a fixed camera sensor.
Note: Robot operates automatically based on the detection results of the target. Be careful of interference between the robot and peripherals. Also, use with avoiding singularity nearby posture that each axis extends to prevent an error during the local coordinate setting.

Syntax
Sub VDefLocal(LocalNumber As Integer, LocalDefType As SpelLocalDefType, CalPlateType As SpelCalPlateType, Sequence As String, TargetTolerance As Double, CameraTool As Integer, RefPoint As SpelPoint)
Sub VDefLocal(LocalNumber As Integer, LocalDefType As SpelLocalDefType, CalPlateType As SpelCalPlateType, Sequence As String, TargetTolerance As Double, CameraTool As Integer, RefPoint As SpelPoint, Parent As Form)
Sub VDefLocal(LocalNumber As Integer, LocalDefType As SpelLocalDefType, CalPlateType As SpelCalPlateType, Sequence As String, TargetTolerance As Double, CameraTool As Integer, RefPoint As SpelPoint, RobotSpeed As Integer, RobotAccel As Integer)
Sub VDefLocal(LocalNumber As Integer, LocalDefType As SpelLocalDefType, CalPlateType As SpelCalPlateType, Sequence As String, TargetTolerance As Double, CameraTool As Integer, RefPoint As SpelPoint, RobotSpeed As Integer, RobotAccel As Integer, Parent As Form)

Parameters

  • LocalNumber
    An integer indicating the tool number to set the local coordinates for (1 to 15).
  • LocalDefType
    An integer indicating the local type.
  • J5Camera:
    Sets the local coordinates parallel to the calibration plate using the mobile J5 camera.
  • J6Camera:
    Sets the local coordinates parallel to the calibration plate using the mobile J6 camera.
  • FixedUpwardCamera:
    Sets the local coordinates parallel to the image sensor using a fixed upward-facing camera.
  • FixedDownwardCamera:
    Sets the local coordinates parallel to the image sensor using a fixed downward-facing camera.
  • CalPlateType
    An integer indicating the calibration plate type.
  • Large:
    Large calibration plate
  • Medium:
    Medium calibration plate
  • Small:
    Small calibration plate
  • XSmall:
    Extra small calibration plate
  • Sequence
    A string expression indicating the vision sequence name for the current project.
    When using the mobile camera, this is a vision sequence to take a picture of the calibration plate.
    When using the fixed camera, this is a vision sequence to detect a feature point at tool end, such as user’s workpiece.
  • TargetTolerance
    A real number indicating the threshold for determining the scale match.
  • CameraTool
    In the case of a fixed camera, this specifies the tool number that holds a tool offset of the detection target. To perform auto calibration, specify -1.
    Mobile J6 camera: If auto calibration has been executed, specify a tool number of mobile camera. To perform auto calibration, specify -1.
    Mobile J5 camera: Setting of this option is ignored.
  • RefPoint Point number which a local plane parallel to a work plane passes.
    This point is used to specify local plane height.
  • Parent
    Optional. A .NET form that is the parent of the window.
  • RobotSpeed
    Optional. Integer variable indicating the robot speed (%). Value range: 0 to 100 If omitted, set to “5”.
  • RobotAccel
    Optional. Integer variable indicating the robot acceleration (%). Value range: 0 to 99 If omitted, set to “5”.

See Also
VDefArm, VDefGetMotionRange,VDefSetMotionRange, VDefTool, VGoCenter

VDefLocal Example
VB Example:

Dim p2 = m_spel.GetPoint("P2")  
m_spel.VDefLocal(1, SpelLocalDefType.J6Camera, SpelCalPlateType.Large, "myseq", 1.0, 1, p2)  

C# Example:

SpelPoint p2;  
p2 = m_spel.GetPoint("P2");  
m_spel.VDefLocal(1, SpelLocalDefType.J6Camera,  
SpelCalPlateType.Large, "myseq", 1.0, 1, p2);  

VDefSetMotionRange Method, Spel Class

Description
Limits a motion range by VDefTool, VDefArm, VDefLocal, and VGoCenter.

Syntax
Sub VDefSetMotionRange(MaxMoveDist As Double, MaxPoseDiffAngle As Double, LjmMode As Integer)

Parameters

  • MaxMoveDist
    A real number indicating the maximum travel distance.
    If 0 is specified, the range is not limited. (0 to 500. Default: 200)
    VDefTool, VDefArm, VDefLocal, and VGoCenter are used to limit the range.
  • MaxPoseDiffAngle
    A real number indicating the maximum displacement angle (degrees) of the hand orientation (UVW).
    If 0 is specified, the range is not limited.
    It only affects VDefLocal. (0 to 180. Default: 45 degrees)
  • LjmMode
    An integer indicating the LJM mode.

See Also
VDefTool, VDefArm, VDefLocal, VGoCenter, VDefGetMotionRange

VDefSetMotionRange Example
VB Example:

m_spel.VDefSetMotionRange(100, 30, 1)  

C# Example:

m_spel.VDefSetMotionRange(100, 30, 1);  

VDefTool Method, Spel Class

Description
Using vision detection, calculates a tool offset value for TPC and mobile camera position.
Note: When the tool type is other than FixedCameraWithCal, the robot operates automatically based on the detection results of the target. Be careful of interference between the robot and peripherals. Also, use with avoiding singularity nearby posture that each axis extends to prevent an error during the tool set.

Syntax
Sub VDefTool(ToolNumber As Integer, ToolDefType As SpelToolDefType, Sequence As String, Object As String)
Sub VDefTool(ToolNumber As Integer, ToolDefType As SpelToolDefType, Sequence As String, Object As String, Parent As Form)
Sub VDefTool(ToolNumber As Integer, ToolDefType As SpelToolDefType, Sequence As String, FinalAngle As Double, InitAngle As Double, TargetTolerance As Double)
Sub VDefTool(ToolNumber As Integer, ToolDefType As SpelToolDefType, Sequence As String, FinalAngle As Double, InitAngle As Double, TargetTolerance As Double, Parent As Form)
Sub VDefTool(ToolNumber As Integer, ToolDefType As SpelToolDefType, Sequence As String, FinalAngle As Double, InitAngle As Double, TargetTolerance As Double, RobotSpeed As Integer, RobotAccel As Integer)
Sub VDefTool(ToolNumber As Integer, ToolDefType As SpelToolDefType, Sequence As String, FinalAngle As Double, InitAngle As Double, TargetTolerance As Double, RobotSpeed As Integer, RobotAccel As Integer, Parent As Form)

Parameters

  • ToolNumber
    An integer (1 to 15) indicating the tool number to set.
  • ToolDefType
    An integer indicating the tool type. FixedCamera: Tool set using a fixed camera which is not calibrated. J4Camera: Calculates image center of the mobile J4 camera. J6Camera: Calculates image center of the mobile J6 camera. FixedCameraWithCal: Tool set by using the fixed camera which is calibrated.
  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • Object
    A string expression indicating a vision object in the current project. This parameter is required when ToolDefType is FixedCameraWithCal. When ToolDefType is not FixedCameraWithCal, Object should be an empty string.
  • FinalAngle
    A real number indicating an angle (degrees) to rotate the tool or camera tool. Value range: 0, 5 to 180, −5 to −180 If omitted, set to “90”.
  • InitAngle
    A real value indicating an angle (degrees) to rotate the tool or camera tool when setting a temporary tool. This value must be smaller than FinalAngle. Value range: −10 to 10 If omitted, set to “5”.
  • TargetTolerance
    A real number indicating the pixel distance at which the vision detection result is considered to match the target position. Value range: 0 to 3 pixels. If omitted, set to “1”.
  • Parent
    Optional. A .NET form that is the parent of the window.
  • RobotSpeed
    Optional. Integer variable indicating the robot speed (%). Value range: 0 to 100 If omitted, set to “5”.
  • RobotAccel
    Optional. Integer variable indicating the robot acceleration (%). Value range: 0 to 99 If omitted, set to “5”.

See Also
VDefArm, VDefGetMotionRange, VDefLocal, VDefSetMotionRange, VGoCenter

VDefTool Example
VB Example:

m_spel.VDefTool(1, SpelToolDefType.J6Camera, "myseq", 45, 5, 3.0)  
m_spel.VDefTool(1, SpelToolDefType.FixedCameraWithCal, "myseq", "myobj")  

C# Example:

m_spel.VDefTool(1, SpelToolDefType.J6Camera, "myseq", 45, 5, 3.0);  
m_spel.VDefTool(1, SpelToolDefType.FixedCameraWithCal, "myseq", "myobj");  

VDefToolXYZ Method, Spel Class

Description
VDefToolXYZ uses vision detection to calculate tool XYZ offset values and define a tool.
Note:
The robot operates automatically based on the detection results of the target. Be careful of interference between the robot and peripherals. Also, be careful to avoid singularities for nearby postures to prevent an error during the tool

Syntax
Sub VDefToolXYZ(ToolNumber As Integer, LocalNumber As Integer, PointNumber1 As Integer, PointNumber2 As Integer, Sequence1 As String,Sequence2 As String, FinalAngle As Double, InitAngle As Double, TargetTolerance As Double, RobotSpeed As Integer, RobotAccel As Integer)

Sub VDefToolXYZ(ToolNumber As Integer, LocalNumber As Integer, PointNumber1 As Integer, PointNumber2 As Integer, Sequence1 As String,Sequence2 As String, FinalAngle As Double, InitAngle As Double, TargetTolerance As Double, RobotSpeed As Integer, RobotAccel As Integer, Parent As Form)

Parameters

  • ToolNumber
    An integer (1 to 15) indicating the tool number to set.
  • LocalNumber
    An integer indicating the local coordinate number to move the robot to. Tool is moved in the XY plane of the specified local coordinate.
  • PointNumber1
    An integer indicating the first pose of the point number.
  • PointNumber2
    An integer indicating the second pose of the point number.
  • Sequence1
    A string expression indicating the vision sequence name for the first pose in the current project.
  • Sequence2
    A string expression indicating the vision sequence name for the second pose in the current project.
  • FinalAngle
    A real number indicating the rotation angle (degrees) of the tool and camera tool. Value range: 5 to 180, −5 to −180
  • InitAngle
    A real number indicating the rotation angle (degrees) display when setting a temporary tool. This value must be smaller than FinalAngle. Value range: 0.01 to 10, -0.01 to -10
  • TargetTolerance
    A real number indicating the pixel distance at which the vision detection result is considered to match the target position. Value range: 0.1 to 3.0 pixels
  • RobotSpeed
    An integer variable indicating the robot speed (%). Value range: 1 to 100.
  • RobotAccel
    An integer variable indicating the robot acceleration (%). Value range: 1 to 99.
  • Parent
    Optional. A .NET form that is the parent of the window.

See Also
VDefTool, VDefToolXYZUVW

VDefToolXYZ Example
VB Example:

m_spel.VDefToolXYZ(1, 0, 1, 2, "seq01", "seq02", 5, 30, 1, 5, 5)  
m_spel.VDefToolXYZ(2, 0, 3, 4, "seq03", "seq04", 5, 30, 1, 5, 5)  
m_spel.VDefToolXYZ(3, 0, 5, 6, "seq05", "seq06", 5, 30, 1, 5, 5)  
m_spel.VDefToolXYZUVW(1, 2, 3, SpelToolDefType3D.Bar)  

C# Example:

m_spel.VDefToolXYZ(1, 0, 1, 2, "seq01", "seq02", 5, 30, 1, 5, 5);  
m_spel.VDefToolXYZ(2, 0, 3, 4, "seq03", "seq04", 5, 30, 1, 5, 5);  
m_spel.VDefToolXYZ(3, 0, 5, 6, "seq05", "seq06", 5, 30, 1, 5, 5);  
m_spel.VDefToolXYZUVW(1, 2, 3, SpelToolDefType3D.Bar);  

VDefToolXYZUVW Method, Spel Class

Description
VDefToolXYZUVW calculates tool UVW offset values using three tool definitions.
Note: The calculated U, V, W tool offset values are set in the specified ToolNumber1. The X, Y, Z offsets for ToolNumber1 are not changed.

Syntax
Sub VDefToolXYZUVW(ToolNumber1 As Integer, ToolNumber2 As Integer, ToolNumber3 As Integer, ToolDefType3D As SpelToolDefType3D )

Parameters

  • ToolNumber1
    An integer variable indicating the tool number for the 1st tool definition (1 to 15).
    When ToolDefType3D is Bar, specify the tool that defines the tip of the bar. When ToolDefType3D is Plane, specify the tool that defines the center of the plane.
  • ToolNumber2
    An integer variable indicating the tool number for the 1st tool definition (2 to 15).
    When ToolType is bar, specify the tool that defines the middle of the bar. When ToolType is plane, specify the tool that defines a position on the plane other than the center of the plane and other than the position defined by tool definition 3.
  • ToolNumber3
    An integer variable indicating the tool number for the 3rd tool definition (1 to 15).
    When ToolType is bar, specify the tool that defines the root of the bar. When ToolType is plane, specify the tool that defines a position other than the center of the plane and other than the position defined by tool definition 2.
  • ToolDefType3D
    An integer indicating the tool type in the tool definition. Bar: Bar type Plane: Plane type

See Also
VDefToolXYZ

VDefToolXYZUVW Example
VB Example:

m_spel.VDefToolXYZ(1, 0, 1, 2, "seq01", "seq02", 5, 30, 1, 5, 5)  
m_spel.VDefToolXYZ(2, 0, 3, 4, "seq03", "seq04", 5, 30, 1, 5, 5)  
m_spel.VDefToolXYZ(3, 0, 5, 6, "seq05", "seq06", 5, 30, 1, 5, 5)  
m_spel.VDefToolXYZUVW(1, 2, 3, SpelToolDefType3D.Bar)  

C# Example:

m_spel.VDefToolXYZ(1, 0, 1, 2, "seq01", "seq02", 5, 30, 1, 5, 5);  
m_spel.VDefToolXYZ(2, 0, 3, 4, "seq03", "seq04", 5, 30, 1, 5, 5);  
m_spel.VDefToolXYZ(3, 0, 5, 6, "seq05", "seq06", 5, 30, 1, 5, 5);  
m_spel.VDefToolXYZUVW(1, 2, 3, SpelToolDefType3D.Bar);  

VDeleteCalibration Method, Spel Class

Description
Deletes a vision calibration in the current project.

Syntax
Sub VDeleteCalibration (CalibName As String)

Parameters

  • CalibName
    A string expression indicating the vision calibration name for the current project.

See Also
VCreateCalibration, VDeleteObject, VDeleteSequence

VDeleteCalibration Example
VB Example:

m_spel.VDeleteCalibration("mycal")  

C# Example:

m_spel.VDeleteCalibration("mycal");  

VDeleteObject Method, Spel Class

Description
Deletes a vision object in the current project.

Syntax
Sub VDeleteObject (Sequence As String, ObjectName As String)

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • ObjectName
    A string expression indicating the vision object name for the current project.

See Also
VCreateObject, VCreateSequence, VDeleteSequence

VDeleteObject Example
VB Example:

m_spel.VDeleteObject("myseq", "myobj")  

C# Example:

m_spel.VDeleteObject("myseq", "myobj");  

VDeleteSequence Method, Spel Class

Description
Deletes a vision sequence in the current project.

Syntax
Sub VDeleteSequence (Sequence As String)

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.

See Also
VCreateObject, VCreateSequence, VDeleteObject

VDeleteSequence Example
VB Example:

m_spel.VDeleteSequence("myseq")  

C# Example:

m_spel.VDeleteSequence("myseq");  

VEditWindow Method, Spel Class

Description
Displays the editor for search window don't care pixels. For more details, see the EditWindow Property in the Vision Guide Properties reference.

Syntax
Sub VEditWindow (Sequence As String, Object As String, Parent As Form)

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • ObjectName
    A string expression indicating the vision object name for the current project.

Image
See Also
VSave

VEditWindow Example
VB Example:

m_spel.VEditWindow("myseq", "myobj")  

C# Example:

m_spel.VEditWindow("myseq", "myobj");  

VGet Method, Spel Class

Description
Gets the value of a vision sequence or object property or result.

Syntax
Sub VGet (Sequence As String, PropCode As SpelVisionProps, ByRef Value As Integer)
Sub VGet (Sequence As String, PropCode As SpelVisionProps, ByRef Value As Boolean)
Sub VGet (Sequence As String, PropCode As SpelVisionProps, ByRef Value As Double)
Sub VGet (Sequence As String, PropCode As SpelVisionProps, ByRef Value As Single)
Sub VGet (Sequence As String, PropCode As SpelVisionProps, ByRef Value As String)
Sub VGet (Sequence As String, Object As String, PropCode As SpelVisionProps, ByRef Value As Integer)
Sub VGet (Sequence As String, Object As String, PropCode As SpelVisionProps, ByRef Value As Boolean)
Sub VGet (Sequence As String, Object As String, PropCode As SpelVisionProps, ByRef Value As Color)
Sub VGet (Sequence As String, Object As String, PropCode As SpelVisionProps, ByRef Value As Double)
Sub VGet (Sequence As String, Object As String, PropCode As SpelVisionProps, ByRef Value As Single)
Sub VGet (Sequence As String, Object As String, PropCode As SpelVisionProps, ByRef Value As String)
Sub VGet (Sequence As String, Object As String, PropCode As SpelVisionProps, Result As Integer, ByRef Value As Integer)
Sub VGet (Sequence As String, Object As String, PropCode As SpelVisionProps, Result As Integer, ByRef Value As Boolean)
Sub VGet (Sequence As String, Object As String, PropCode As SpelVisionProps, Result As Integer, ByRef Value As Double)
Sub VGet (Sequence As String, Object As String, PropCode As SpelVisionProps, Result As Integer, ByRef Value As Single)
Sub VGet (Sequence As String, Object As String, PropCode As SpelVisionProps, Result As Integer, ByRef Value As String)

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • Object
    A string expression indicating the object name for the sequence.
  • PropCode
    A SpelVisionProps value that specifies the property code.
  • Result
    An integer expression indicating the result number.
  • Value
    A character string indicating the property or result value. The type of character string must match the property or result type.

See Also
VSet, VRun

VGet Example
VB Example:

Dim i As Integer  
Redim score(10) As Integer  
  
m_spel.VRun("testSeq")  
For i = 1 to 10  
    m_spel.VGet("testSeq", "corr" & Format$(i, "00"), _   
        SpelVisionProps.Score, score(i))  
Next i  

C# Example:

int[] score = new int[11];  
for(int i = 1; i <= 10; i++)  
{  
   m_spel.VGet("testSeq", string.Format("Corr 0{0}, i),  
           SpelVisionProps.Score, score(i));   
}  

VGetCameraXYU Method, Spel Class

Description
Retrieves camera X, Y, and U physical coordinates for any object.

Syntax
Sub VGetCameraXYU (Sequence As String, Object As String, Result As Integer, ByRef Found As Boolean, ByRef X As Single, ByRef Y As Single, ByRef U As Single)

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • Object
    A string expression indicating the object name for the sequence.
  • Result
    An integer expression indicating the result number.
  • Found
    A Boolean variable indicating whether the object was found.
  • X
    A real number variable indicating the X coordinate in millimeters.
  • Y
    A real number variable indicating the Y coordinate in millimeters.
  • U
    A real number variable indicating the angle in degrees.

See Also
VGetPixelXYU, VGetRobotXYU

VGetCameraXYU Example
VB Example:

Dim found As Boolean  
Dim x As Single, y As Single, u As Single  
Dim seq As String, blob As String  
  
seq = "testSeq"  
blob = "blob01"  
m_spel.VRun(seq)  
m_spel.VGetCameraXYU(seq, blob, 1, found, x, y, u)  

C# Example:

bool found;  
float x, y, u;  
string seq, blob;  
  
seq = "testSeq";  
blob = "blob01";  
m_spel.VRun(seq);  
m_spel.VGetCameraXYU(seq, blob, 1, out found, out x, out y, out u);  

VGetEdgeCameraXYU Method, Spel Class

Description
Retrieves camera X, Y, and U physical coordinates for each edge of a Line Finder, Arc Finder search.

Syntax
Sub VGetEdgeCameraXYU (Sequence As String, Object As String, EdgeResultIndex As Integer, ByRef Found As Boolean, ByRef X As Single, ByRef Y As Single, ByRef U As Single)

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • Object
    A string expression indicating the object name for the sequence.
  • EdgeResultIndex
    An integer expression indicating the edge result index.
  • Found
    A Boolean variable indicating whether the object was found.
  • X
    A real number variable indicating the X coordinate in millimeters.
  • Y
    A real number variable indicating the Y coordinate in millimeters.
  • U
    A real number variable indicating the angle in degrees.

See Also
VGetEdgePixelXYU, VGetEdgeRobotXYU, VGetPixelXYU, VGetRobotXYU

VGetEdgeCameraXYU Example
VB Example:

Dim found(10) As Boolean  
Dim x(10) As Single, y(10) As Single, u(10) As Single  
Dim seq As String, lineFinder As String  
  
seq = "testSeq"  
lineFinder = "LineFind01"  
m_spel.VRun(seq)  
' The NumberOfEdges for the LineFinder is 10  
For i = 1 To 10  
m_spel.VGetEdgeCameraXYU(seq, lineFinder, i, found(i), x(i),  
   y(i), u(i))  
Next i  

C# Example:

bool[] found = new bool[11];  
float[] x = new float[11];  
float[] y = new float[11];  
float[] u = new float[11];  
string seq, lineFinder;  
seq = "testSeq";  
lineFinder = "LineFind01";  
m_spel.VRun(seq);  
// The NumberOfEdges for the LineFinder is 10  
for(int i = 1; i <= 10; i++)  
m_spel.VGetEdgeCameraXYU(seq, lineFinder, i, out found[i],   
      out x[i], out y[i], out u[i]);  

VGetEdgePixelXYU Method, Spel Class

Description
Retrieves X, Y, and U pixel coordinates for each edge of a Line Finder, Arc Finder search.

Syntax
Sub VGetEdgePixelXYU (Sequence As String, Object As String, EdgeResultIndex As Integer, ByRef Found As Boolean, ByRef X As Single, ByRef Y As Single, ByRef U As Single)

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • Object
    A string expression indicating the object name for the sequence.
  • EdgeResultIndex
    An integer expression indicating the edge result index.
  • Found
    A Boolean variable indicating whether the object was found.
  • X
    A real number variable indicating the X coordinate in millimeters.
  • Y
    A real number variable indicating the Y coordinate in millimeters.
  • U
    A real number variable indicating the angle in degrees.

See Also
VGetEdgeCameraXYU, VGetEdgeRobotXYU, VGetPixelXYU, VGetRobotXYU

VGetEdgePixelXYU Example
VB Example:

Dim found(10) As Boolean  
Dim x(10) As Single, y(10) As Single, u(10) As Single  
Dim seq As String, lineFinder As String  
  
seq = "testSeq"  
lineFinder = "LineFind01"  
m_spel.VRun(seq)  
' The NumberOfEdges for the LineFinder is 10  
For i = 1 To 10  
m_spel.VGetEdgePixelXYU(seq, lineFinder, i, found(i), x(i),  
   y(i), u(i))  
Next i  

C# Example:

bool[] found = new bool[11];  
float[] x = new float[11];  
float[] y = new float[11];  
float[] u = new float[11];  
string seq, lineFinder;  
seq = "testSeq";  
lineFinder = "LineFind01";  
m_spel.VRun(seq);  
// The NumberOfEdges for the LineFinder is 10  
for(int i = 1; i <= 10; i++)  
m_spel.VGetEdgePixelXYU(seq, lineFinder, i, out found[i],  
      out x[i], out y[i], out u[i]);  

VGetEdgeRobotXYU Method, Spel Class

Description
Retrieves robot X, Y, and U physical coordinates for each edge of a Line Finder, Arc Finder search.

Syntax
Sub VGetEdgeRobotXYU (Sequence As String, Object As String, EdgeResultIndex As Integer, ByRef Found As Boolean, ByRef X As Single, ByRef Y As Single, ByRef U As Single)

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • Object
    A string expression indicating the object name for the sequence.
  • EdgeResultIndex
    An integer expression indicating the edge result index.
  • Found
    A Boolean variable indicating whether the object was found.
  • X
    A real number variable indicating the X coordinate in millimeters.
  • Y
    A real number variable indicating the Y coordinate in millimeters.
  • U
    A real number variable indicating the angle in degrees.

See Also
VGetEdgeCameraXYU, VGetEdgePixelXYU, VGetPixelXYU, VGetRobotXYU

VGetEdgeRobotXYU Example
VB Example:

Dim found(10) As Boolean  
Dim x(10) As Single, y(10) As Single, u(10) As Single  
Dim seq As String, lineFinder As String  
  
seq = "testSeq"  
lineFinder = "LineFind01"  
m_spel.VRun(seq)  
' The NumberOfEdges for the LineFinder is 10  
For i = 1 To 10  
m_spel.VGetEdgeRobotXYU(seq, lineFinder, i, found(i), x(i),  
   y(i), u(i))  
Next i  

C# Example:

bool[] found = new bool[11];  
float[] x = new float[11];  
float[] y = new float[11];  
float[] u = new float[11];  
string seq, lineFinder;  
seq = "testSeq";  
lineFinder = "LineFind01";  
m_spel.VRun(seq);  
// The NumberOfEdges for the LineFinder is 10  
for(int i = 1; i <= 10; i++)  
m_spel.VGetEdgeRobotXYU(seq, lineFinder, i, out found[i],  
      out x[i], out y[i], out u[i]);  

VGetExtrema Method, Spel Class

Description
Retrieves extrema coordinates of a blob object.

Syntax
Sub VGetExtrema (Sequence As String, Object As String, Result As Integer, ByRef MinX As Single, ByRef MaxX As Single, ByRef MinY As Single, ByRef MaxY As Single)

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • Object
    A string expression indicating the object name for the sequence.
  • Result
    An integer expression indicating the result number.
  • MinX
    A real number variable indicating the minimum X coordinate in pixels.
  • MaxX
    A real number variable indicating the maximum X coordinate in pixels.
  • MinY
    A real number variable indicating the minimum Y coordinate in pixels.
  • MaxY
    A real number variable indicating the maximum Y coordinate in pixels.

See Also
VGet

VGetExtrema Example
VB Example:

Dim xmin As Single, xmax As Single  
Dim ymin As Single, ymax As Single  
Dim seq As String, blob As String  
  
seq = "testSeq"  
blob = "blob01"  
m_spel.VRun(seq)  
m_spel.VGet(seq, blob, "found", found)  
If found <> 0 Then  
    m_spel.VGetExtrema(seq, blob, xmin, xmax, ymin, ymax)  
End If  

C# Example:

float xMin, xMax, yMin, yMax;  
bool found;  
string seq, blob;  
  
seq = "testSeq";  
blob = "blob01";  
m_spel.VRun(seq);  
m_spel.VGet(seq, blob, "found", found);  
  
if(found == true)  
    m_spel.VGetExtrema(seq, blob,out xMin,out xMax,out yMin,  
        out yMax);  

VGetModelWin Method, Spel Class

Description
Retrieves model window coordinates for objects.

Syntax
Sub VGetModelWin (Sequence As String, Object As String, ByRef Left As Integer, ByRef Top As Integer, ByRef Width As Integer, ByRef Height As Integer)

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • Object
    A string expression indicating the object name for the sequence.
  • Left
    An integer variable indicating the left coordinate in pixels.
  • Top
    An integer variable indicating the top coordinate in pixels.
  • Width
    An integer variable indicating the width in pixels.
  • Height
    An integer variable indicating the height in pixels.

See Also
VSetModelWin, VGetSearchWin, VSetSearchWin

VGetModelWin Example
VB Example:

Dim left As Integer, top As Integer  
Dim width As Integer, height As Integer  
  
With m_spel  
    .VGetModelWin("testSeq", "corr01", left, top, _   
       width, height)  
    .VSetModelWin("testSeq", "corr01", left + 20, top, _   
       width, height)  
    .VTeach("testSeq", "corr01")  
End With  

C# Example:

int left, top, width, height;  
  
m_spel.VGetModelWin("testSeq", "corr01", out left, out top,   
       out width, out height);  
m_spel.VSetModelWin("testSeq", "corr01", left + 20, top,   
       width, height);  
m_spel.VTeach("testSeq", "corr01");  

VGetPixelToCamera Method, Spel Class

Description
Retrieves the camera coordinates for the specified pixel coordinates.

Syntax
Sub VGetPixelToCamera (Calibration As String, PixelX As Single, PixelY As Single, Angle As Single, ByRef CameraX As Single, ByRef CameraY As Single, ByRef CameraU As Single)

Parameters

  • Calibration
    A string expression indicating the calibration name for the current project.
  • PixelX
    A real number variable indicating the X coordinate in pixels.
  • PixelY
    A real number variable indicating the Y coordinate in pixels.
  • Angle
    A real number variable indicating the angle in degrees.
  • CameraX
    A real number variable indicating the X coordinate in millimeters.
  • CameraY
    A real number variable indicating the Y coordinate in millimeters.
  • CameraU
    A real number variable indicating the angle in degrees.

See Also
VGetPixelXYU, VGetCameraXYU, VGetPixelToRobot

VGetPixelToCamera Example
VB Example:

Dim x As Single, y As Single, u As Single  
Dim cal As String, seq As String  
  
cal = "testCal"  
seq = "testSeq"  
m_spel.VRun(seq)  
m_spel.VGetPixelToCamera(cal, 400, 300, 0, x, y, u)  

C# Example:

float x, y, u  
string cal, seq;  
  
cal = "testCal";  
seq = "testSeq";  
m_spel.VRun(seq);  
m_spel.VGetPixelToCamera(cal, 400, 300, 0, out x, out y, out u);  

VGetPixelToRobot Method, Spel Class

Description
Retrieves robot world coordinates for the specified pixel coordinates.

Syntax
Sub VGetPixelToRobot (Calibration As String, PixelX As Single, PixelY As Single, Angle As Single, ByRef RobotX As Single, ByRef RobotY As Single, ByRef RobotU As Single)

Parameters

  • Calibration
    A string expression indicating the calibration name for the current project.
  • PixelX
    A real number variable indicating the X coordinate in pixels.
  • PixelY
    A real number variable indicating the Y coordinate in pixels.
  • Angle
    A real number variable indicating the angle in degrees.
  • RobotX
    A real number variable indicating the X coordinate in millimeters.
  • RobotY
    A real number variable indicating the Y coordinate in millimeters.
  • RobotU
    A real number variable indicating the angle in degrees.

See Also
VGetPixelXYU, VGetRobotXYU, VGetPixelToCamera

VGetPixelToRobot Example
VB Example:

Dim x As Single, y As Single, u As Single  
Dim cal As String, seq As String  
  
cal = "testCal"  
seq = "testSeq"  
m_spel.VRun(seq)  
m_spel.VGetPixelToRobot(cal, 400, 300, 0, x, y, u)  

C# Example:

float x, y, u  
string cal, seq;  
  
cal = "testCal";  
seq = "testSeq";  
m_spel.VRun(seq);  
m_spel.VGetPixelToRobot(cal, 400, 300, 0, out x, out y, out u);  

VGetPixelXYU Method, Spel Class

Description
Retrieves pixel X, Y, and U coordinates for any object.

Syntax
Sub VGetPixelXYU (Sequence As String, Object As String, Result As Integer, ByRef Found As Boolean, ByRef X As Single, ByRef Y As Single, ByRef U As Single)

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • Object
    A string expression indicating the object name for the sequence.
  • Result
    An integer expression indicating the result number.
  • Found
    A Boolean expression indicating whether the object was found.
  • X
    A real number variable indicating the X coordinate in pixels.
  • Y
    A real number variable indicating the Y coordinate in pixels.
  • U
    A real number variable indicating the angle in degrees.

See Also
VGetCameraXYU, VGetRobotXYU

VGetPixelXYU Example
VB Example:

Dim found As Integer  
Dim x As Single, y As Single, u As Single  
Dim seq As String, blob As String  
  
seq = "testSeq"  
blob = "blob01"  
m_spel.VRun(seq)  
m_spel.VGetPixelXYU(seq, blob, 1, found, x, y, u)  

C# Example:

int found;  
float x, y, u;  
string seq, blob;  
  
seq = "testSeq";  
blob = "blob01";  
m_spel.VRun(seq);  
m_spel.VGetPixelXYU(seq, blob,1, out found, out x, out y, out u);  

VGetRobotPlacePos Method, Spel Class

Description
Retrieves robot place position.

Syntax
Sub VGetRobotPlacePos (Sequence As String, Object As String, Result As Integer, ByRef Found As Boolean, ByRef PlacePointAs SpelPoint)

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • Object
    A string expression indicating the object name for the sequence.
  • Result
    An integer expression indicating the result number.
  • Found
    An integer variable indicating the Boolean found status. If found is false, then X, Y, and U are undefined.
  • PlacePoint
    A SpelPoint variable indicating the place position.

See Also
VGetRobotPlaceTargetPos, VSetRobotPlaceTargetPos

VGetRobotPlacePos Example
VB Example:

Dim found As Integer  
Dim x As Single, y As Single, u As Single  
Dim seq As String, blob As String  
Dim placePoint As SpelPoint  
  
seq = "testSeq"  
blob = "blob01"  
' Move part above upward camera  
m_spel.Jump("camPos")  
m_spel.VRun(seq)  
m_spel.VGetRobotPlacePos(seq, blob, 1, found, placePoint)  
' Using a SCARA, to use +TLZ for approach  
m_spel.Jump(placePoint, "+TLZ(10)")  
m_spel.Go(placePoint)  

C# Example:

bool found;  
float x, y, u;  
string seq, blob;  
SpelPoint placePoint = new SpelPoint();  
seq = "testSeq";  
blob = "blob01";  
  
// Move part above upward camera  
m_spel.Jump("camPos");  
m_spel.VRun(seq);  
m_spel.VGetRobotPlacePos(seq,blob,1,out found, out placePoint);  
// Using a SCARA, to use +TLZ for approach  
m_spel.Jump(placePoint, "+TLZ(10)");  
m_spel.Go(placePoint);  

VGetRobotPlaceTargetPos Method, Spel Class

Description
Retrieves part place position.

Syntax
Sub VGetRobotPlaceTargetPos (Sequence As String, Object As String, ByRef Point As SpelPoint)

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • Object
    A string expression indicating the object name for the sequence.
  • Point
    A SpelPoint variable indicating the place position.

See Also
VGetRobotPlacePos, VSetRobotPlaceTargetPos

VGetRobotPlaceTargetPos Example
VB Example:

Dim seq As String, blob As String  
Dim targetPoint As SpelPoint  
  
seq = "testSeq"  
blob = "blob01"  
m_spel.VGetRobotPlaceTargetPos(seq, blob, targetPoint)  
  
' Adjust the place position  
targetPoint.X = targetPoint.X + 10  
m_spel.VSetRobotPlaceTargetPos(seq, blob, targetPoint)  

C# Example:

Spe
lPoint targetPoint = new SpelPoint();  
  
seq = "testSeq";  
blob = "blob01";  
m_spel.VGetRobotPlaceTargetPos(seq, blob, out targetPoint);  
  
// Adjust the place position  
targetPoint.X = targetPoint.X + 10;  
m_spel.VSetRobotPlaceTargetPos(seq, blob, targetPoint);  

VGetRobotXYU Method, Spel Class

Description
Retrieves robot world X, Y, and U coordinates for any object.

Syntax
Sub VGetRobotXYU (Sequence As String, Object As String, Result As Integer, ByRef Found As Boolean, ByRef X As Single, ByRef Y As Single, ByRef U As Single)

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • Object
    A string expression indicating the object name for the sequence.
  • Result
    An integer expression indicating the result number.
  • Found
    An integer variable indicating the Boolean found status. If found is false, then X, Y, and U are undefined.
  • X
    A real number variable indicating the X coordinate in millimeters.
  • Y
    A real number variable indicating the Y coordinate in millimeters.
  • U
    A real number variable indicating the angle in degrees.

See Also
VGetCameraXYU, VGetPixelXYU

VGetRobotXYU Example
VB Example:

Dim found As Integer  
Dim x As Single, y As Single, u As Single  
Dim seq As String, blob As String  
  
seq = "testSeq"  
blob = "blob01"  
m_spel.VRun(seq)  
m_spel.VGetRobotXYU(seq, blob, 1, found, x, y, u)  

C# Example:

bool found;  
float x, y, u;  
string seq, blob;  
  
seq = "testSeq";  
blob = "blob01";  
m_spel.VRun(seq);  
m_spel.VGetRobotXYU(seq, blob, 1, out found, out x, out y, out u);  

VGetRobotToolXYU Method, Spel Class

Description
Retrieves robot world X, Y, and U values for tool definition.

Syntax
Sub VGetRobotToolXYU (Sequence As String, Object As String, Result As Integer, ByRef Found As Boolean, ByRef X As Single, ByRef Y As Single, ByRef U As Single)

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • Object
    A string expression indicating the object name for the sequence.
  • Result
    An integer expression indicating the result number.
  • Found
    An integer variable indicating the Boolean found status. If found is false, then X, Y, and U are undefined.
  • X
    A real number variable indicating the X coordinate in millimeters.
  • Y
    A real number variable indicating the Y coordinate in millimeters.
  • U
    A real number variable indicating the angle in degrees.

Remarks
Use VGetRobotToolXYU to easily define a tool for a part viewed by an upward camera. This allows you to pick up a part, search for it in the upward camera FOV, define a tool for the part, then place the part.

See Also
VGetCameraXYU, VGetPixelXYU, VGetRobotXYU

VGetRobotToolXYU Example
VB Example:

Dim found As Integer  
Dim x As Single, y As Single, u As Single  
Dim seq As String, blob As String  
  
seq = "testSeq"  
blob = "blob01"  
' Move part above upward camera  
m_spel.Jump("camPos")  
m_spel.VRun(seq)  
m_spel.VGetRobotToolXYU(seq, blob, 1, found, x, y, u)  
m_spel.TLSet(1, x, y, u)  

C# Example:

bool fnd;  
float x, y, u;  
string seq, blob;  
  
seq = "testSeq";  
blob = "blob01";  
// Move part above upward camera  
m_spel.Jump("camPos");  
m_spel.VRun(seq);  
m_spel.VGetRobotToolXYU(seq, blob, 1, out fnd, out x, out y, out u);  
m_spel.TLSet(1, x, y, u);  

VGetSearchWIn Method, Spel Class

Description
Retrieves search window coordinates.

Syntax
Sub VGetSearchWin (Sequence As String, Object As String, ByRef Left As Integer, ByRef Top As Integer, ByRef Width As Integer, ByRef Height As Integer)

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • Object
    A string expression indicating the object name for the sequence.
  • Left
    An integer variable indicating the left coordinate in pixels.
  • Top
    An integer variable indicating the top coordinate in pixels.
  • Width
    An integer variable indicating the width in pixels.
  • Height
    An integer variable indicating the height in pixels.

See Also
VGetModelWin, VSetModelWin, VSetSearchWin

VGetSearchWin Example
VB Example:

Dim left As Integer, top As Integer  
Dim width As Integer, height As Integer  
  
With m_spel  
    .VGetSearchWin("testSeq", "corr01", left, top, _   
       width, height)  
    .VSetSearchWin("testSeq", "corr01", newLeft, top, _  
       width, height)  
    .VRun("testSeq")  
End With  

C# Example:

int left, top, width, height;  
  
m_spel.VGetSearchWin("testSeq", "corr01", out left, out top,  
       out width, out height);  
m_spel.VSetSearchWin("testSeq", "corr01", newLeft, top,   
       width, height);  
m_spel.VRun("testSeq");  

VGoCenter Method, Spel Class

Description
Using a feature point that can be detected by the vision system, moves the robot to a position where the feature point is on the center of the camera image.

Syntax
Sub VGoCenter(Sequence As String, LocalNumber As Integer, TargetTolerance As Double)
Sub VGoCenter(Sequence As String, LocalNumber As Integer, TargetTolerance As Double, Parent As Form)
Sub VGoCenter(Sequence As String, LocalNumber As Integer, TargetTolerance As Double, RobotSpeed As Integer, RobotAccel As Integer)
Sub VGoCenter(Sequence As String, LocalNumber As Integer, TargetTolerance As Double, RobotSpeed As Integer, RobotAccel As Integer, Parent As Form)

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • LocalNumber
    An integer indicating the local coordinate number to move the robot to.
    If -1 is specified, the robot moves in the XY plane of the tool rotation
  • TargetTolerance
    A real number indicating the pixel distance at which the vision detection result is considered to match the target position.
    Value range: 0 to 3 pixels
  • Form
    Optional. A .NET form that is the parent of the window.
  • RobotSpeed
    Optional. Integer variable indicating the robot speed (%). Value range: 0 to 100 If omitted, set to “5”.
  • RobotAccel
    Optional. Integer variable indicating the robot acceleration (%). Value range: 0 to 99 If omitted, set to “5”.

See Also
VDefArm, VDefGetMotionRange, VDefLocal, VDefSetMotionRange, VDefTool

VGoCenter Example
VB Example:

m_spel.VGoCenter("myseq", 1, 1.0)  

C# Example:

m_spel.VGoCenter("myseq", 1, 1.0);  

VLoad Method, Spel Class

Description
Loads vision properties from the current project.

Syntax
Sub VLoad ()

Remarks
Use the VLoad method when you want to return the vision property settings, models, and fonts back to their original settings when the program was started.

See Also
VSave

VLoad Example
VB Example:

m_spel.VLoad()  

C# Example:

m_spel.VLoad();  

VLoadModel Method, Spel Class

Description
Load a vision model from a disk file.

Syntax
Sub VLoadModel (Sequence As String, Object As String, Path As String)

Parameters

  • Sequence
    A character string indicating the sequence name in the current project.
  • Object
    A character sting indicating the object name. The object must be a Correlation, Geometric, or Polar.
  • Path
    The full path name of the file to load the model from, excluding the extension.

Remarks
An error will occur if the model data in the file is the wrong type. For example, if you try to load a polar model into a correlation, an error will occur. If you supply a file extension, it is ignored. There are two files associated with fileName.
For correlation and geometric models, the ModelOrgX and ModelOrgY values are restored along with the model window width and height.
For polar models, the Radius, Thickness, and AngleOffset are restored.

See Also
VSaveModel

VLoadModel Example
VB Example:

m_spel.VLoadModel("seq01", "corr01", "d:\models\part1")  

C# Example:

m_spel.VLoadModel("seq01", "corr01", @"d:\models\part1");  

VRun Method, Spel Class

Description
Run a vision sequence in the current project.

Syntax
Sub VRun (Sequence As String)

Parameters

  • Sequence
    A character string indicating the sequence name in the current project.

Remarks
VRun works with sequences using any type of camera calibration or no calibration.
To display graphics, you need to use a SPELVideo control and set the SpelVideoControl property of the Spel class instance to the SPELVideo control.
After you execute VRun, use VGet to retrieve results.

See Also
VGet, VSet

VRun Example
VB Example:

Function FindPart(x As Single, y As Single, angle As Single)As Boolean  
  Dim found As Boolean  
  Dim x, y, angle As Single  
  With m_spel  
    .VRun("seq01")  
    .VGet("seq01", "corr01", "found", found)  
    If found Then  
      .VGet("seq01", "corr01", "cameraX", x)  
      .VGet("seq01", "corr01", "cameraY", y)  
      .VGet("seq01", "corr01", "angle", angle)  
      FindPart = True  
    End If  
  End With  
End Function  

C# Example:

bool FindPart(float x, float y, float angle)  
{  
  bool found;  
  m_spel.VRun("seq01");  
  m_spel.VGet("seq01", "corr01", "found", found);  
  if (found) {  
        m_spel.VGet("seq01", "corr01", "cameraX", out x);  
       m_spel.VGet("seq01", "corr01", "cameraY", out y);  
        m_spel.VGet("seq01", "corr01", "angle", out angle);  
}  
return found;  
}  

VSave Method, Spel Class

Description
Saves all vision data in the current project.

Syntax
Sub VSave ()

Remarks
Use VSave to make any changes to vision properties permanent.

See Also
VSet

VSave Example
VB Example:

With m_spel  
    .VSet("seq01", "blob01", "SearchWinLeft", 100)  
    .VSet("seq01", "corr01", "Accept", userAccept)  
    .VSave()  
End With  

C# Example:

m_spel.VSet("seq01", "blob01", "SearchWinLeft", 100);  
m_spel.VSet("seq01", "corr01", "Accept", userAccept);  
m_spel.VSave();  

VSaveImage Method, Spel Class

Description
Save a vision video window to a PC disk file.

Syntax
Sub VSaveImage (Sequence As String, Path As String)
Sub VSaveImage (Sequence As String, Path As String, WithGraphics As Boolean)

Parameters

  • Sequence
    A character string indicating the sequence name in the current project.
  • Path
    The full path name of the file to save the image to, including the extension.
  • WithGraphics
    A Boolean expression that determines whether to save the sequence result image to an image file.

Remarks
Use VSaveImage to save an image on the Video display to disk. The file extension must be
BMP,
TIF,
or JPG.
See Also
LoadImage (SPELVideo Control)

VSaveImage Example
VB Example:

Dim found As Boolean  
m_spel.VRun("Seq")  
m_spel.VGet("Seq", SpelVisionProps.AllFound, found)  
If Not found Then  
    m_spel.VSaveImage("Seq", "d:\reject.mim")  
End If  

C# Example:

bool found;  
m_spel.VRun("Seq");  
m_spel.VGet("Seq", SpelVisionProps.AllFound, out found);  
  
if (\!found)  
    m_spel.VSaveImage("Seq", @"d:\reject.mim");  

VSaveModel Method, Spel Class

Description
Save a vision object search model to a PC disk file.

Syntax
Sub VSaveModel (Sequence As String, Object As String, Path As String)

Parameters

  • Sequence
    A character string indicating the sequence name in the current project.
  • Object
    A character sting indicating the object name. The object must be a Correlation, Geometric, or Polar.
  • Path
    The full path name of the file to save the model to, excluding the extension.

Remarks
When VSaveModel is executed, Epson RC+ 8.0 creates two files (Path + extensions): Path.VOB, Path.MDL
For correlation and geometric models, the ModelOrgX and ModelOrgY values are saved along with the model window. For Polar models, the Radius, Thickness, and AngleOffset are saved.

See Also
VLoadModel

VSaveModel Example
VB Example:

m_spel.VSaveModel("seq01", "corr01", "d:\models\part1")  

C# Example:

m_spel.VSaveModel("seq01", "corr01", @"d:\models\part1");  

VSet Method, Spel Class

Description
Sets the value of a vision sequence or object property.

Syntax
Sub VSet ( Sequence As String, PropCode As SpelVisionProps, Value As Integer )
Sub VSet ( Sequence As String, PropCode As SpelVisionProps, Value As Boolean )
Sub VSet ( Sequence As String, PropCode As SpelVisionProps, Value As Double )
Sub VSet (Sequence As String, PropCode As SpelVisionProps, Value As Single)
Sub VSet ( Sequence As String, PropCode As SpelVisionProps, Value As String )
Sub VSet ( Sequence As String, Object As String, PropCode As SpelVisionProps, Value As Integer )
Sub VSet ( Sequence As String, Object As String, PropCode As SpelVisionProps, Value As Boolean )
Sub VSet (Sequence As String, Object As String, PropCode As SpelVisionProps, Value As Color)
Sub VSet ( Sequence As String, Object As String, PropCode As SpelVisionProps, Value As Double )
Sub VSet (Sequence As String, Object As String, PropCode As SpelVisionProps, Value As Single)
Sub VSet ( Sequence As String, Object As String, PropCode As SpelVisionProps, Value As String )

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • Object
    A string expression indicating the object name for the sequence.
  • propName
    A string expression indicating the property name you want to set the value for.
  • PropCode
    A SpelVisionProps value that specifies the property code.
  • value
    Expression indicating the new value The type of expression must match the property type.

See Also
VGet, VRun

VSet Example
VB Example:

m_spel.VSet("seq01", "corr01", SpelVisionProps.Accept, 250)  

C# Example:

m_spel.VSet("seq01", "corr01", SpelVisionProps.Accept, 250);  

VSetModelWin Method, Spel Class

Description
Sets model window coordinates.

Syntax
Sub VSetModelWin ( Sequence As String, Object As String, Left As Integer, Top As Integer, Width As Integer, Height As Integer )

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • Object
    A string expression indicating the object name for the sequence.
  • Left
    An integer expression indicating the left coordinate in pixels.
  • Top
    An integer expression indicating the top coordinate in pixels.
  • Width
    An integer expression indicating the width in pixels.
  • Height
    An integer expression indicating the height in pixels.

See Also
VGetModelWin, VGetSearchWin, VSetSearchWin

VSetModelWin Example
VB Example:

Dim left As Integer, top As Integer  
Dim width As Integer, height As Integer  
  
With m_spel  
    .VGetModelWin("testSeq", "corr01", left, top, _   
       width, height)  
    .VSetModelWin("testSeq", "corr01", left + 20, top, _   
       width, height)  
    .VTeach("testSeq", "corr01")  
End With  

C# Example:

int left, top, width, height;  
  
m_spel.VGetModelWin("testSeq", "corr01", out left, out top,   
       out width, out height);  
m_spel.VSetModelWin("testSeq", "corr01", left + 20, top,   
       width, height);  
m_spel.VTeach("testSeq", "corr01");  

VSetRobotPlaceTargetPos Method, Spel Class

Description
Sets part place position.

Syntax
Sub VSetRobotPlaceTargetPos (Sequence As String, Object As String, Point As SpelPoint)

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • Object
    A string expression indicating the object name for the sequence.
  • Point
    A SpelPoint variable indicating the place position.

See Also
VGetRobotPlacePos, VGetRobotPlaceTargetPos

VSetRobotPlaceTargetPos Example
VB Example:

Dim seq As String, blob As String  
Dim targetPoint As SpelPoint  
  
seq = "testSeq"  
blob = "blob01"  
m_spel.VGetRobotPlaceTargetPos(seq, blob, targetPoint)  
  
' Adjust the place position  
targetPoint.X = targetPoint.X + 10  
m_spel.VSetRobotPlaceTargetPos(seq, blob, targetPoint)  

C# Example:

string seq, blob;  
SpelPoint targetPoint = new SpelPoint();  
  
seq = "testSeq";  
blob = "blob01";  
m_spel.VGetRobotPlaceTargetPos(seq, blob, out targetPoint);  
  
// Adjust the place position  
targetPoint.X = targetPoint.X + 10;  
m_spel.VSetRobotPlaceTargetPos(seq, blob, targetPoint);  

VSetSearchWin Method, Spel Class

Description
Sets search window coordinates.

Syntax
Sub VSetSearchWin ( Sequence As String, Object As String, Left As Integer, Top As Integer, Width As Integer, Height As Integer )

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • Object
    A string expression indicating the object name for the sequence.
  • Left
    An integer expression indicating the left coordinate in pixels.
  • Top
    An integer expression indicating the top coordinate in pixels.
  • Width
    An integer expression indicating the width in pixels.
  • Height
    An integer expression indicating the height in pixels.

See Also
VGetModelWin, VSetModel, VGetSearchWin

VSetSearchWin Example
VB Example:

Dim left As Integer, top As Integer  
Dim width As Integer, height As Integer  
  
With m_spel  
  .VGetSearchWin("testSeq", "corr01", left, top, _   
    width, height)  
  .VSetSearchWin("testSeq", "corr01", newLeft, top, _   
    width, height)  
  .VRun("testSeq")  
End With  

C# Example:

int left, top, width, height;  
  
m_spel.VGetSearchWin("testSeq", "corr01", out left, out top,   
    out width, out height);  
m_spel. .VSetSearchWin("testSeq", "corr01", left + 50,  
    top, width, height);  
m_spel.VRun("testSeq");  

VShowModel Method, Spel Class

Description
Display the object model. For more details, see the ShowModel Property in the Vision Guide Properties reference.

Syntax
Sub VShowModel (Sequence As String, Object As String, Parent As Form)

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.
  • ObjectName
    A string expression indicating the vision object name for the current project.

Image

See Also
VShowSequence, VTrain

VShowModel Example
VB Example:

m_spel.VShowModel("myseq", "myobj")  

C# Example:

m_spel.VShowModel("myseq", "myobj");  

VShowSequence Method, Spel Class

Description
Displays all objects in a sequence.

Syntax
Sub VShowSequence (Sequence As String)

Parameters

  • Sequence
    A string expression indicating the vision sequence name to create.

Remarks
Use VShowSequence to display the objects in a sequence without running the sequence. The active object color (magenta) is used for all objects so that they can be seen easily.
One use is for when a robot camera is moved over a particular portion of a part being scanned with several sequences. After the robot is positioned, VShowSequence can be called to display the sequence.

See Also
VShowModel

VShowSequence Example
VB Example:

m_spel.VShowSequence("myseq")  

C# Example:

m_spel.VShowSequence("myseq");  

VStatsReset Method, Spel Class

Description
Resets vision statistics for a specified sequence in the current project.

Syntax
Sub VStatsReset (Sequence As String)

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.

Remarks
VStatsReset resets the statistics for the specified sequence in memory only for the current Epson RC+ 8.0 session. You should execute VStatsSave if you want changes to be permanent. Otherwise, if you restart Epson RC+ 8.0, the statistics are restored from disk.

See Also
VStatsResetAll, VStatsShow, VStatsSave

VStatsReset Example
VB Example:

Sub btnResetStats_Click()  
    m_spel.VStatsReset("seq01")  
End Sub  

C# Example:

void btnResetStats_Click(object sender, EventArgs e)  
{  
m_spel.VStatsReset("seq01");}  

VStatsResetAll Method, Spel Class

Description
Resets vision statistics for all sequences.

Syntax
Sub VStatsResetAll

Remarks
VStatsResetAll resets the statistics in memory only for the current Epson RC+ 8.0 session. You should execute VStatsSave if you want changes to be permanent.

See Also
VStatsReset, VStatsShow, VStatsSave

VStatsResetAll Example
VB Example:

Sub btnResetStats_Click()  
    m_spel.VStatsResetAll()  
End Sub  

C# Example:

void btnResetStats_Click(object sender, EventArgs e)  
{  
    m_spel.VStatsResetAll();  
}  

VStatsSave Method, Spel Class

Description
Saves vision statistics for all sequences in the current project.

Syntax
Sub VStatsSave ()

Remarks
VStatsSave must be executed before Epson RC+ 8.0 is shut down if you want to preserve changes made to vision statistics.

See Also
VStatsReset, VStatsResetAll, VStatsShow

VStatsSave Example
VB Example:

Sub btnResetStats_Click()  
    m_spel.VStatsSave()  
End Sub  

C# Example:

void btnResetStats_Click(object sender, EventArgs e)  
{  
    m_spel.VStatsSave();  
}  

VStatsShow Method, Spel Class

Description
Displays the vision statistics dialog for a specified sequence in the current project.

Syntax
Sub VStatsShow (Sequence As String, Parent As Form)

Parameters

  • Sequence
    A string expression indicating the vision sequence name for the current project.

See Also
VStatsReset, VStatsResetAll, VStatsSave

VStatsShow Example
VB Example:

Sub btnShowStats_Click()  
    m_spel.VStatsShow("seq01")  
End Sub  

C# Example:

void btnShowStats_Click(object sender, EventArgs e)  
{  
    m_spel.VStatsShow("seq01");  
}  

VTeach Method, Spel Class

Description
Teach a correlation, geometric, or polar model.

Syntax
Sub VTeach (Sequence As String, Object As String, ByRef Status as Integer)
Sub VTeach (Sequence As String, Object As String, AddSample as Boolean, KeepDontCares As Boolean, ByRef Status as Integer)

Parameters

  • Sequence
    The name of a vision sequence in the current project.
  • Object
    The object name. Correlation, Geometric, or Polar objects can be taught.
  • AddSample
    True to add a sample, False to add as a new model.
  • KeepDontCares
    True to use the existing detection mask, False to discard it.
  • Status
    Returns the status 0: Unsuccessful, 1: Successful

Remarks
Before you call VTeach, you must ensure that the model window is in the correct position.
For polar objects, the search window and thickness must be set properly. Set the search window location and thickness using VSet.
For correlation and geometric objects, the search window and the model window must be set properly. Set the search and model window locations using VSet for SearchWin and ModelWin. Or you can use the VTrain command so the operator can interactively change the windows.
After teaching the models, you can save them to a PC disk file using the VSaveModel method.

See Also
VTrain, VSaveModel

VTeach Example
VB Example:

Dim status As Integer  
  
' First let the operator change the window position  
m_spel.VTrain("seq01", "corr01", status)  
  
' Now teach the model  
m_spel.VTeach("seq01", "corr01", status)  

C# Example:

int status;  
  
// First let the operator change the window position  
m_spel.VTrain("seq01", "corr01", status);  
  
// Now teach the model  
m_spel.VTeach("seq01", "corr01", out status);  

VTrain Method, Spel Class

Description
This command allows you to train objects in an entire sequence or individual objects.

Syntax
Function VTrain (Sequence As String [, Object As String] [, Flags as Integer] [, Parent as Form]) As Boolean

Parameters

  • Sequence
    The name of a vision sequence in the current object.
  • Object
    The object name in Sequence. You can register any type of object. If Object is an empty string, then the entire sequence can be trained.
  • Flags
    VTrain dialog configuration. 1 - Show Teach button 2 1 - Don't show Model windows.
  • Parent
    Optional. A .NET form that is the parent of the window.

Return Value
If the operator clicks the OK button, VTrain returns True, otherwise it returns False.

Remarks
When VTrain is executed, a dialog is opened showing a live video image with the specified object displayed. The operator can size/move the search window, and train the model window (for correlation and geometric objects). When the operator is finished, he can click on OK to save the changes, or Cancel to ignore the changes. If OK is clicked, then the new information is automatically saved in the current project.

If flags bit 1 is set, a teach button will be displayed. For Correlation, Geometric, and Polar objects, the model will be taught if the teach button is clicked. You can retrieve the ModelOK property after running VTrain to check if a model was trained. For Blob objects, the button will open the Histogram dialog and the operator can adjust both high and low thresholds and then view the effects of changes.

If flags bit 2 is set, model windows will not be displayed. The operator can only change search windows.

For correlation and geometric objects, you can call VTeach after calling VTrain to teach the model if you are not displaying the teach button.

See Also
VTeach, VSaveModel

VTrain Example
VB Example:

Dim status As Integer  
Dim trainOK As Boolean  
  
' First let the operator change the window position  
trainOK = m_spel.VTrain("seq01", "corr01")  
  
' Now teach the model  
If trainOK Then  
    m_spel.VTeach("seq01", "corr01", status)  
EndIf  

C# Example:

int status;  
bool trainOK;  
  
// First let the operator change the window position  
trainOK = m_spel.VTrain("seq01", "corr01");  
  
// Now teach the model  
if (trainOK)  
    m_spel.VTeach("seq01", "corr01", out status);  

WaitCommandComplete Method, Spel Class

Description
This command waits for a command started with AsyncMode = True to complete.

Syntax
Sub WaitCommandComplete ()

See Also
AsyncMode

WaitCommandComplete Example
VB Example:

With m_spel  
  .AsyncMode = True  
  .Jump("pick")  
  .Delay(500)  
  .On(1)  
  .WaitCommandComplete()  
End With  

C# Example:

m_spel.AsyncMode = true;  
m_spel.Jump("pick");  
m_spel.Delay(500);  
m_spel.On(1);  
m_spel.WaitCommandComplete();  

WaitMem Method, Spel Class

Description
Waits for a memory bit status to change.

Syntax
Sub WaitMem (BitNumber As Integer, Condition As Boolean, Timeout As Single)
Sub WaitMem (Label As String, Condition As Boolean, Timeout As Single)

Parameters

  • BitNumber
    An integer expression indicating the memory bit number.
  • Label
    A character string indicating the memory bit label.
  • Condition
    A Boolean expression indicating the memory bit state.
  • Timeout
    Maximum wait time (s)

Remarks
You should always check if a time out occurred by using the TW method. See the example below.

See Also
WaitSw

WaitMem Example
VB Example:

' Wait for memory bit 1 to be 1 (True)  
' Max time is 5 seconds  
m_spel.WaitMem(1, True, 5)  
' Did WaitMem time out?  
If m_spel.TW() Then  
    MsgBox "memory bit time out occurred"  
End If  

C# Example:

// Wait for memory bit 1 to be 1 (True)  
// Max time is 5 seconds  
m_spel.WaitMem(1, True, 5);  
// Did WaitMem time out?  
if (m_spel.TW())  
    MessageBox.Show("memory bit time out occurred”);  

WaitSw Method, Spel Class

Description
Waits for input bit status to change.

Syntax
Sub WaitSw (BitNumber As Integer, Condition As Boolean, Timeout As Single)
Sub WaitSw (Label As String, Condition As Boolean, Timeoutl As Single)

Parameters

  • BitNumber
    An integer expression indicating the input bit number.
  • Label
    A character string indicating the input bit label.
  • Condition
    A Boolean expression indicating the input bit state.
  • Timeout
    Maximum wait time (s)

Remarks
You should always check if a time out occurred by using the TW method. See the example below.

See Also
WaitMem

WaitSw Example
VB Example:

Const PartPresent = 1  
m_spel.WaitSw(PartPresent, True, 5)  
If m_spel.TW() Then  
    MsgBox "Part present time out occurred"  
End If  

C# Example:

const int PartPresent = 1;  
m_spel.WaitSw(PartPresent, True, 5);  
if (m_spel.TW())  
    MessageBox.Show("Part Present time out occurred”);  

WaitTaskDone Method, Spel Class

Description
Waits for a task to finish and returns the status.

Syntax
Function WaitTaskDone (TaskNumber As Integer) As SpelTaskState
Function WaitTaskDone (TaskName As String) As SpelTaskState

Parameters

  • TaskNumber
    The task number for which to return the execution status
  • TaskName
    A string expression indicating the task name.

Return Value
A SpelTaskState value.

See Also
SpelTaskState, TasksExecuting, TaskState, Xqt

WaitTaskDone Example
VB Example:

Dim taskState As SpelTaskState  
m_spel.Xqt 2, "mytask"  
'  
' Some processing here  
'  
taskState = m_spel.WaitTaskDone(2)  

C# Example:

SpelTaskState taskState;  
m_spel.Xqt(2, "mytask");  
//  
// Some processing here  
//  
taskState = m_spel.WaitTaskDone(2);  

Weight Method, Spel Class

Description
Specifies the weight parameters for the current robot.

Syntax
Sub Weight (PayloadWeight As Single, ArmLength As Single)

Parameters

  • PayloadWeight
    The weight that the hand can carry in kilograms.
  • ArmLength
    The distance from the center of rotation of the second arm to the center of gravity of the hand in millimeters.
  • Axis
    Additional axis (S or T) to which the load is assigned

Note


Do not enter integer values to PayLoadWeight and ArmLength parameters. Use Single variables or directly enter Single type values.

See Also
Inertia, JRange, Tool

Weight Example
VB Example:

m_spel.Weight(2.0F, 2.5F)  

C# Example:

m_spel.Weight(2.0F, 2.5F);  

Xqt Method, Spel Class

Description
Start one SPEL+ task.

Syntax
Sub Xqt (FuncName As String [, TaskType As SpelTaskType])
Sub Xqt (TaskNumber As Integer, FuncName As String [, TaskType As SpelTaskType])

Parameters

  • TaskNumber
    Task number of the task to run (1 to 32)
  • FuncName
    The name of the function to be executed. It is possible to pass arguments to the function. Arguments must be in parenthesis, separated by commas. For details, see the SPEL+ - Xqt Statement and see the example.
  • TaskType
    Optional. Specifies the task type as Normal, NoPause, or NoEmgAbort.

Remarks
When Xqt is executed, control will return immediately to the calling program. Use the Call method to wait for a task to complete, or you can use EventReceived with the task state event to wait for a task to finish.

See Also
Call, EnableEvent, EventReceived

Xqt Example
VB Example:

m_spel.Xqt(2, "conveyor")  
  
' Supply an argument to the RunPart function  
m_spel.Xqt(3, "RunPart(3)")  
  
Dim funcToExec As String  
funcToExec = "RunPart(" & partNum & ")"  
m_spel.Xqt(3, funcCall)  

C# Example:

m_spel.Xqt(2, "conveyor");  
  
// Supply an argument to the RunPart function  
m_spel.Xqt(3, "RunPart(3)");  
  
string funcToExec;  
funcToExec = string.Format("RunPart({0})", partNum);  
m_spel.Xqt(3, funcToExec);  

XYLim Method, Spel Class

Description
Sets the permissible motion range limits for the Manipulator.

Syntax
Sub XYLim ( XLowerLimit As Single, XUpperLimit As Single, YLowerLimit As Single, YUpperLimit As Single [, ZLowerLimit As Single ] [, ZUpperLimit As Single] )

Parameters

  • XLowerLimit
    The minimum X coordinate position the robot can move to. (The robot cannot move to a position with an X coordinate less than this minimum X value.)
  • XUpperLimit
    The maximum X coordinate position the robot can move to. (The robot cannot move to a position with an X coordinate larger than this maximum X value.)
  • YLowerLimit
    The minimum Y coordinate position the robot can move to. (The robot cannot move to a position with a Y coordinate less than this minimum Y value.)
  • YUpperLimit
    The maximum Y coordinate position the robot can move to. (The robot cannot move to a position with a Y coordinate larger than this maximum Y value.)
  • ZLowerLimit
    The minimum Z coordinate position the robot can move to. (The robot cannot move to a position with a Z coordinate less than this minimum Z value.) Optional.
  • ZUpperLimit
    The maximum Z coordinate position the robot can move to. (The robot cannot move to a position with a Z coordinate larger than this maximum Z value.) Optional.

Remarks
XYLim is used to define motion range limits. Many robot systems allow users to define joint limits but the SPEL+ language allows both joint limits and motion range limits to be defined. In effect this allows users to create a work envelope for their application.
The motion range established with XYLim values applies to motion command target positions only, and not to motion paths from starting position to target position. Therefore, the arm may move outside the XYLim range during motion. (i.e. The XYLim range does not affect Pulse.)
To turn off motion range limits, specify 0 for the range limit parameters.

See Also
JRange

XYLim Example
VB Example:

m_spel.XYLim(0, 0, 0, 0)  

C# Example:

m_spel.XYLim(0, 0, 0, 0);  

XYLimClr Method, Spel Class

Description
Clears (undefines) the XYLim definition.

Syntax
Sub XYLimClr ()

See Also
XYLim, XYLimDef

XYLimClr Example
VB Example:

m_spel.XYLimClr()  

C# Example:

m_spel.XYLimClr();  

XYLimDef Method, Spel Class

Description
Returns whether XYLim has been defined or not.

Syntax
Function XYLimDef () As Boolean

Return Value
True if XYLim is defined, False if not.

See Also
XYLim, XYLimClr

XYLimDef Example
VB Example:

Dim xyLimDefined As Boolean  
xyLimDefined = m_spel.XYLimDef()  

C# Example:

bool xyLimDefined;  
xyLimDefined = m_spel.XYLimDef();