Skip to content

4.10 BasScript Script Program Class

Method NameBasScript( name )
DescriptionBasScript script program class constructor, corresponds to program instructions in teaching pendant program writing.
Request Parametersname : string Script program name
Compatible robot software versionCollaborative (Copper): v7.5.2.0+
Industrial (Bronze): Not supported
Industrial Robot: v7.6.0.0+
NoteAll methods in the BasScript script program class have the same compatible robot software version requirements as this class.

4.10.1 Motion to Point Instruction

Method NameBasScript.BasMotion.MoveJoint(poseType, poseIndex, speedType, speedValue, smoothType, smoothDistance, extraParam)
DescriptionExecutes joint motion instruction, corresponds to MoveJoint instruction in teaching pendant program writing.
Request ParametersposeType : Pose type
poseIndex : Pose index
speedType : Speed type
speedValue : Speed value
smoothType : Smooth type
smoothDistance : Smooth distance
extraParam : Extra parameter
Return ValueStatusCode: Motion instruction execution result

4.10.2 Linear Motion to Point Instruction

Method NameBasScript.BasMotion.MoveLine(poseType, poseIndex, speedType, speedValue, smoothType, smoothDistance, extraParam)
DescriptionExecutes linear motion instruction, corresponds to MoveLine instruction in teaching pendant program writing.
Request ParametersposeType : Pose type
poseIndex : Pose index
speedType : Speed type
speedValue : Speed value
smoothType : Smooth type
smoothDistance : Smooth distance
extraParam : Extra parameter
Return ValueStatusCode: Motion instruction execution result

4.10.3 Arc Motion to Point Instruction

Method NameBasScript.BasMotion.MoveCircle(poseType1, poseIndex1, poseType2, poseIndex2, speedType, speedValue, smoothType, smoothDistance, extraParam)
DescriptionExecutes arc motion instruction, corresponds to MoveCircle instruction in teaching pendant program writing.
Request ParametersposeType1 : Intermediate point pose type
poseIndex1 : Intermediate point pose index
poseType2 : End point pose type
poseIndex2 : End point pose index
speedType : Speed type
speedValue : Speed value
smoothType : Smooth type
smoothDistance : Smooth distance
extraParam : Extra parameter
Return ValueStatusCode: Motion instruction execution result

4.10.4 Jump Point-to-Point Motion Instruction

Method NameBasScript.BasMotion.Jump(poseType, poseIndex, speedValue, speedRatio, limZType, limZValue, smoothType, smoothDistance, extraParam)
DescriptionJUMP instruction, robot point-to-point motion to specified position
Request ParametersposeType : Target pose storage type
poseIndex : Target position index
speedValue : Motion speed value
speedRatio : Motion speed ratio
limZType : Z-axis limit type
limZValue : Z-axis limit value
smoothType : Smooth type
smoothDistance : Smooth distance
extraParam : Extra parameter
Return ValueStatusCode: Motion instruction execution result

4.10.5 Jump3 Three-Point Jump Instruction

Method NameBasScript.BasMotion.Jump3(poseType, poseIndex, speedValue, speedRatio, smoothType, smoothDistance, extraParam)
DescriptionJUMP3 instruction, robot point-to-point motion to specified position
Request ParametersposeType : Target pose storage type
poseIndex : 3 target position indices
speedValue : Motion speed value
speedRatio : Motion speed ratio
smoothType : Smooth type
smoothDistance : Smooth distance
extraParam : Extra parameter
Return ValueStatusCode: Motion instruction execution result

4.10.6 Jump3CP Three-Point Jump CP Instruction

Method NameBasScript.BasMotion.Jump3CP(poseType, poseIndex, speedValue, smoothType, smoothDistance, extraParam)
DescriptionJUMP3CP instruction, robot point-to-point motion to specified position
Request ParametersposeType : Target pose storage type
poseIndex : 3 target position indices
speedValue : Motion speed value
smoothType : Smooth type
smoothDistance : Smooth distance
extraParam : Extra parameter
Return ValueStatusCode: Motion instruction execution result

4.10.7 Extra Parameter Class

Method NameExtraParam.Acceleration(value)
DescriptionSets additional acceleration parameter
Request Parametersvalue : double Acceleration value, range 1~120
Return ValueStatusCode: Parameter setting execution result
Method NameExtraParam.RTCP()
DescriptionSets RTCP (Real-Time Control Protocol) parameter
Request ParametersNone
Return ValueStatusCode: Parameter setting execution result
Method NameExtraParam.Offset(index)
DescriptionSets coordinate offset parameter
Request Parametersindex : int PR index for offset
Return ValueStatusCode: Parameter setting execution result
Method NameExtraParam.TB(second, type, name)
DescriptionSets delay parameter to execute program instruction after current instruction runs
Request Parameterssecond : double Delay in seconds
type : string Instruction type
name : string Program name
Return ValueStatusCode: Parameter setting execution result
Method NameExtraParam.TB(second, type, index, status)
DescriptionSets delay parameter to assign value to specified IO after current instruction runs
Request Parameterssecond : double Delay in seconds
type : string IO type
index : int IO index
status : int Status to assign
Return ValueStatusCode: Parameter setting execution result
Method NameExtraParam.SKIP(index)
DescriptionSets jump instruction parameter
Request Parametersindex : int Jump to the specified LABEL index
Return ValueStatusCode: Parameter setting execution result

4.10.8 AssignValue Assignment Instruction

Method NameBasScript.AssignValue(param1, index, param2, value, optIndex, optValue)
DescriptionAssignment instruction
Request Parametersparam1: Type of parameter 1
index: Index of parameter 1
param2: Type of parameter 2
value: Value of parameter 2
optIndex: Additional index for parameter 1
optValue: Additional value for parameter 2
Return ValueStatusCode: Result of function execution

4.10.9 AssignValue Assignment Instruction

Method NameBasScript.AssignValue(param, index, value)
DescriptionAssign a value to a variable
Request Parametersparam: Parameter type (AssignType)
index: Index (integer)
value: Value (IOStatus, double, or string)
Return ValueStatusCode: Result of function execution

4.10.10 IF Conditional Instruction

Method NameBasScript.BasLogical.IF(param1, index, param2, value, operatorType)
DescriptionAdds a logical IF statement to the script
Request Parametersparam1: First parameter, type RegisterType or IOType
index: Index (integer)
param2: Second parameter, type RegisterType, IOType, or OtherType
value: Value, type index, number, string, or IOStatus
operatorType: Boolean operator, default is equal
Return ValueStatusCode: Result of function execution

4.10.11 ELSE_IF Conditional Branch Instruction

Method NameBasScript.BasLogical.ELSE_IF(param1, index, param2, value, operatorType)
DescriptionAdds a logical ELSE IF statement to the script
Request Parametersparam1: First parameter, type RegisterType or IOType
index: Index (integer)
param2: Second parameter, type RegisterType, IOType, or OtherType
value: Value, type index, number, string, or IOStatus
operatorType: Boolean operator, default is equal
Return ValueStatusCode: Result of function execution

4.10.12 ELSE Instruction

Method NameBasScript.BasLogical.ELSE()
DescriptionAdds a logical ELSE statement to the script
Request ParametersNone
Return ValueStatusCode: Result of function execution

4.10.13 END_IF End Conditional Instruction

Method NameBasScript.BasLogical.END_IF()
DescriptionEnds the logical IF statement
Request ParametersNone
Return ValueStatusCode: Result of function execution

4.10.14 WHILE Loop Instruction

Method NameBasScript.BasLogical.WHILE(param1, index, param2, value, operatorType)
DescriptionAdds a logical WHILE statement to the script
Request Parametersparam1: First parameter, type RegisterType or IOType
index: Index (integer)
param2: Second parameter, type RegisterType, IOType, or OtherType
value: Value, type index, number, string, or IOStatus
operatorType: Boolean operator, default is equal
Return ValueStatusCode: Result of function execution

4.10.15 END_WHILE End Loop Instruction

Method NameBasScript.BasLogical.END_WHILE()
DescriptionEnds the logical While statement
Request ParametersNone
Return ValueStatusCode: Result of function execution

4.10.16 SWITCH Multi-Branch Selection Instruction

Method NameBasScript.BasLogical.SWITCH(param, index)
DescriptionAdds a logical SWITCH statement to the script
Request Parametersparam: Parameter, type RegisterType or IOType
index: Index of the parameter
Return ValueStatusCode: Result of function execution

4.10.17 CASE Branch Instruction

Method NameBasScript.BasLogical.CASE(param, value)
DescriptionAdds a logical CASE statement to the script
Request Parametersparam: Parameter, type RegisterType, IOType, or OtherType
value: Value, type index, number, string
Return ValueStatusCode: Result of function execution

4.10.18 DEFAULT Branch Instruction

Method NameBasScript.BasLogical.DEFAULT()
DescriptionAdds a logical DEFAULT statement to the script
Request ParametersNone
Return ValueStatusCode: Result of function execution

4.10.19 END_SWITCH End Multi-Branch Selection Instruction

Method NameBasScript.BasLogical.END_SWITCH()
DescriptionEnds the logical SWITCH statement
Request ParametersNone
Return ValueStatusCode: Result of function execution

4.10.20 SKIP_CONDITION Skip Condition Instruction

Method NameBasScript.BasLogical.SKIP_CONDITION(param1, index, param2, value, operatorType)
DescriptionAdds a logical SKIP CONDITION statement to the script
Request Parametersparam1: First parameter, type RegisterType or IOType
index: Index of parameter 1
param2: Second parameter, type RegisterType, IOType, or OtherType
value: Value, type index, number, string, or IOStatus
operatorType: Boolean operator, default is equal
Return ValueStatusCode: Result of function execution

4.10.21 WAIT Wait Condition Instruction

Method NameBasScript.BasStructure.WAIT(param1, index, param2, value, operatorType)
DescriptionAdds a logical WAIT COND statement to the script
Request Parametersparam1: First parameter, type RegisterType or IOType
index: Index of parameter 1
param2: Second parameter, type ValuesType, IOType, or OtherType
value: Value, type index, number, string, or IOStatus
operatorType: Boolean operator, default is equal
Return ValueStatusCode: Result of function execution

4.10.22 WAIT_TIME Wait Time Instruction

Method NameBasScript.BasStructure.WAIT_TIME(param, value)
DescriptionWAIT TIME waits for a certain amount of time
Request Parametersparam: Parameter type
value: Time value to wait
Return ValueStatusCode: Result of function execution

4.10.23 GOTO Jump Instruction

Method NameBasScript.BasLogical.GOTO(index)
DescriptionGOTO jump statement
Request Parametersindex: Index of the target label
Return ValueStatusCode: Result of function execution

4.10.24 LABEL Instruction

Method NameBasScript.BasLogical.LABEL(index)
DescriptionLABEL statement
Request Parametersindex: Index of the label
Return ValueStatusCode: Result of function execution

4.10.25 BREAK Break Out of Loop Instruction

Method NameBasScript.BasLogical.BREAK()
DescriptionBREAK statement
Request ParametersNone
Return ValueStatusCode: Result of function execution

4.10.26 CONTINUE Skip Loop Instruction

Method NameBasScript.BasLogical.CONTINUE()
DescriptionCONTINUE statement
Request ParametersNone
Return ValueStatusCode: Result of function execution

4.10.27 PAUSE Instruction

Method NameBasScript.BasStructure.PAUSE()
DescriptionPAUSE statement
Request ParametersNone
Return ValueStatusCode: Result of function execution

4.10.28 ABORT Instruction

Method NameBasScript.BasStructure.ABORT()
DescriptionABORT statement
Request ParametersNone
Return ValueStatusCode: Result of function execution

4.10.29 CALL Synchronous Program Call Instruction

Method NameBasScript.BasStructure.CALL(name)
DescriptionCALL synchronous program call
Request Parametersname: Program name
Return ValueStatusCode: Result of function execution

4.10.30 RUN Asynchronous Program Call Instruction

Method NameBasScript.BasStructure.RUN(name)
DescriptionRUN asynchronous program call
Request Parametersname: Program name
Return ValueStatusCode: Result of function execution

4.10.31 LOAD Load Program Instruction

Method NameBasScript.BasStructure.LOAD(param, value)
DescriptionLOAD load program
Request Parametersparam: Parameter, R register, SR register, number, or string
value: Value of the parameter, number or string
Return ValueStatusCode: Result of function execution

4.10.32 UNLOAD Unload Program Instruction

Method NameBasScript.BasStructure.UNLOAD(param, value)
DescriptionUNLOAD unload program
Request Parametersparam: Parameter, R register, SR register, number, or string
value: Value of the parameter, number or string
Return ValueStatusCode: Result of function execution

4.10.33 EXEC Execute Program Instruction

Method NameBasScript.BasStructure.EXEC(param, value)
DescriptionEXEC execute program
Request Parametersparam: Parameter, R register, SR register, number, or string
value: Value of the parameter, number or string
Return ValueStatusCode: Result of function execution

4.10.34 OPEN Open Socket Connection Instruction

Method NameBasScript.BasSocket.OPEN(index)
DescriptionSOCKET OPEN open socket connection
Request Parametersindex: SK register index
Return ValueStatusCode: Result of function execution

4.10.35 CLOSE Close Socket Connection Instruction

Method NameBasScript.BasSocket.CLOSE(index)
DescriptionSOCKET CLOSE close socket connection
Request Parametersindex: SK register index
Return ValueStatusCode: Result of function execution

4.10.36 CONNECT Socket Connection Instruction

Method NameBasScript.BasSocket.CONNECT(index)
DescriptionSOCKET CONNECT connect socket
Request Parametersindex: SK register index
Return ValueStatusCode: Result of function execution

4.10.37 SEND Send Socket Data Instruction

Method NameBasScript.BasSocket.SEND(index, msgType, value)
DescriptionSOCKET SEND send data via socket
Request Parametersindex: SK register index
msgType: Message type
value: Message content or index
Return ValueStatusCode: Result of function execution

4.10.38 RECV Receive Socket Data Instruction

Method NameBasScript.BasSocket.RECV(index, msgLength, msgType, value)
DescriptionSOCKET RECV receive socket data
Request Parametersindex: SK register index
msgLength: Message length
msgType: Message type
value: Message content or index
Return ValueStatusCode: Result of function execution

4.10.39 READ_MH Read Modbus Holding Register Instruction

Method NameBasScript.BasModbus.READ_MH(index, id, address, length, rIndex)
DescriptionReadMH read Modbus holding register
Request Parametersindex: Channel index
id: Modbus ID
address: Register address
length: Register length
rIndex: R register index to write to
Return ValueStatusCode: Result of function execution

4.10.40 READ_MI Read Modbus Input Register Instruction

Method NameBasScript.BasModbus.READ_MI(index, id, address, length, rIndex)
DescriptionReadMI read Modbus input register
Request Parametersindex: Channel index
id: Modbus ID
address: Register address
length: Register length
rIndex: R register index to write to
Return ValueStatusCode: Result of function execution

4.10.41 WRITE_MH Write Modbus Holding Register Instruction

Method NameBasScript.BasModbus.WRITE_MH(index, id, address, length, valueType, value)
DescriptionModbusWriteMH write to Modbus holding register
Request Parametersindex: Channel index
id: Modbus ID
address: Register address
length: Register length
valueType: Value type
value: Value or index
Return ValueStatusCode: Result of function execution

4.10.42 FIND Find Vision Program Instruction

Method NameBasScript.BasVision.FIND(name)
DescriptionVISION FIND find vision program
Request Parametersname: Vision program name
Return ValueStatusCode: Result of function execution

4.10.43 GET_OFFSET Get Vision Program Offset Instruction

Method NameBasScript.BasVision.GET_OFFSET(name, index, labelIndex)
DescriptionVISION GET OFFSET get vision program offset
Request Parametersname: Vision program name
index: Vision register index
labelIndex: Label index
Return ValueStatusCode: Result of function execution

4.10.44 GET_QUANTITY Get Vision Program Result Instruction

Method NameBasScript.BasVision.GET_QUANTITY(name, index)
DescriptionVISION GET QUANTITY get vision program result
Request Parametersname: Vision program name
index: R register index
Return ValueStatusCode: Result of function execution

4.10.45 SetParam Set Parameter Instruction

Method NameBasScript.SetParam(type, valueType, value)
DescriptionSET PARAM set parameter
Request Parameterstype: Parameter type
valueType: Value type
value: Value
Return ValueStatusCode: Result of function execution