4.10 BasScript Script Program Class
| Method Name | BasScript( name ) |
|---|---|
| Description | BasScript script program class constructor, corresponds to program instructions in teaching pendant program writing. |
| Request Parameters | name : string Script program name |
| Compatible robot software version | Collaborative (Copper): v7.5.2.0+ Industrial (Bronze): Not supported Industrial Robot: v7.6.0.0+ |
| Note | All 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 Name | BasScript.BasMotion.MoveJoint(poseType, poseIndex, speedType, speedValue, smoothType, smoothDistance, extraParam) |
|---|---|
| Description | Executes joint motion instruction, corresponds to MoveJoint instruction in teaching pendant program writing. |
| Request Parameters | poseType : Pose type poseIndex : Pose index speedType : Speed type speedValue : Speed value smoothType : Smooth type smoothDistance : Smooth distance extraParam : Extra parameter |
| Return Value | StatusCode: Motion instruction execution result |
4.10.2 Linear Motion to Point Instruction
| Method Name | BasScript.BasMotion.MoveLine(poseType, poseIndex, speedType, speedValue, smoothType, smoothDistance, extraParam) |
|---|---|
| Description | Executes linear motion instruction, corresponds to MoveLine instruction in teaching pendant program writing. |
| Request Parameters | poseType : Pose type poseIndex : Pose index speedType : Speed type speedValue : Speed value smoothType : Smooth type smoothDistance : Smooth distance extraParam : Extra parameter |
| Return Value | StatusCode: Motion instruction execution result |
4.10.3 Arc Motion to Point Instruction
| Method Name | BasScript.BasMotion.MoveCircle(poseType1, poseIndex1, poseType2, poseIndex2, speedType, speedValue, smoothType, smoothDistance, extraParam) |
|---|---|
| Description | Executes arc motion instruction, corresponds to MoveCircle instruction in teaching pendant program writing. |
| Request Parameters | poseType1 : 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 Value | StatusCode: Motion instruction execution result |
4.10.4 Jump Point-to-Point Motion Instruction
| Method Name | BasScript.BasMotion.Jump(poseType, poseIndex, speedValue, speedRatio, limZType, limZValue, smoothType, smoothDistance, extraParam) |
|---|---|
| Description | JUMP instruction, robot point-to-point motion to specified position |
| Request Parameters | poseType : 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 Value | StatusCode: Motion instruction execution result |
4.10.5 Jump3 Three-Point Jump Instruction
| Method Name | BasScript.BasMotion.Jump3(poseType, poseIndex, speedValue, speedRatio, smoothType, smoothDistance, extraParam) |
|---|---|
| Description | JUMP3 instruction, robot point-to-point motion to specified position |
| Request Parameters | poseType : 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 Value | StatusCode: Motion instruction execution result |
4.10.6 Jump3CP Three-Point Jump CP Instruction
| Method Name | BasScript.BasMotion.Jump3CP(poseType, poseIndex, speedValue, smoothType, smoothDistance, extraParam) |
|---|---|
| Description | JUMP3CP instruction, robot point-to-point motion to specified position |
| Request Parameters | poseType : Target pose storage type poseIndex : 3 target position indices speedValue : Motion speed value smoothType : Smooth type smoothDistance : Smooth distance extraParam : Extra parameter |
| Return Value | StatusCode: Motion instruction execution result |
4.10.7 Extra Parameter Class
| Method Name | ExtraParam.Acceleration(value) |
|---|---|
| Description | Sets additional acceleration parameter |
| Request Parameters | value : double Acceleration value, range 1~120 |
| Return Value | StatusCode: Parameter setting execution result |
| Method Name | ExtraParam.RTCP() |
|---|---|
| Description | Sets RTCP (Real-Time Control Protocol) parameter |
| Request Parameters | None |
| Return Value | StatusCode: Parameter setting execution result |
| Method Name | ExtraParam.Offset(index) |
|---|---|
| Description | Sets coordinate offset parameter |
| Request Parameters | index : int PR index for offset |
| Return Value | StatusCode: Parameter setting execution result |
| Method Name | ExtraParam.TB(second, type, name) |
|---|---|
| Description | Sets delay parameter to execute program instruction after current instruction runs |
| Request Parameters | second : double Delay in seconds type : string Instruction type name : string Program name |
| Return Value | StatusCode: Parameter setting execution result |
| Method Name | ExtraParam.TB(second, type, index, status) |
|---|---|
| Description | Sets delay parameter to assign value to specified IO after current instruction runs |
| Request Parameters | second : double Delay in seconds type : string IO type index : int IO index status : int Status to assign |
| Return Value | StatusCode: Parameter setting execution result |
| Method Name | ExtraParam.SKIP(index) |
|---|---|
| Description | Sets jump instruction parameter |
| Request Parameters | index : int Jump to the specified LABEL index |
| Return Value | StatusCode: Parameter setting execution result |
4.10.8 AssignValue Assignment Instruction
| Method Name | BasScript.AssignValue(param1, index, param2, value, optIndex, optValue) |
|---|---|
| Description | Assignment instruction |
| Request Parameters | param1: 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 Value | StatusCode: Result of function execution |
4.10.9 AssignValue Assignment Instruction
| Method Name | BasScript.AssignValue(param, index, value) |
|---|---|
| Description | Assign a value to a variable |
| Request Parameters | param: Parameter type (AssignType) index: Index (integer) value: Value (IOStatus, double, or string) |
| Return Value | StatusCode: Result of function execution |
4.10.10 IF Conditional Instruction
| Method Name | BasScript.BasLogical.IF(param1, index, param2, value, operatorType) |
|---|---|
| Description | Adds a logical IF statement to the script |
| Request Parameters | param1: 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 Value | StatusCode: Result of function execution |
4.10.11 ELSE_IF Conditional Branch Instruction
| Method Name | BasScript.BasLogical.ELSE_IF(param1, index, param2, value, operatorType) |
|---|---|
| Description | Adds a logical ELSE IF statement to the script |
| Request Parameters | param1: 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 Value | StatusCode: Result of function execution |
4.10.12 ELSE Instruction
| Method Name | BasScript.BasLogical.ELSE() |
|---|---|
| Description | Adds a logical ELSE statement to the script |
| Request Parameters | None |
| Return Value | StatusCode: Result of function execution |
4.10.13 END_IF End Conditional Instruction
| Method Name | BasScript.BasLogical.END_IF() |
|---|---|
| Description | Ends the logical IF statement |
| Request Parameters | None |
| Return Value | StatusCode: Result of function execution |
4.10.14 WHILE Loop Instruction
| Method Name | BasScript.BasLogical.WHILE(param1, index, param2, value, operatorType) |
|---|---|
| Description | Adds a logical WHILE statement to the script |
| Request Parameters | param1: 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 Value | StatusCode: Result of function execution |
4.10.15 END_WHILE End Loop Instruction
| Method Name | BasScript.BasLogical.END_WHILE() |
|---|---|
| Description | Ends the logical While statement |
| Request Parameters | None |
| Return Value | StatusCode: Result of function execution |
4.10.16 SWITCH Multi-Branch Selection Instruction
| Method Name | BasScript.BasLogical.SWITCH(param, index) |
|---|---|
| Description | Adds a logical SWITCH statement to the script |
| Request Parameters | param: Parameter, type RegisterType or IOType index: Index of the parameter |
| Return Value | StatusCode: Result of function execution |
4.10.17 CASE Branch Instruction
| Method Name | BasScript.BasLogical.CASE(param, value) |
|---|---|
| Description | Adds a logical CASE statement to the script |
| Request Parameters | param: Parameter, type RegisterType, IOType, or OtherType value: Value, type index, number, string |
| Return Value | StatusCode: Result of function execution |
4.10.18 DEFAULT Branch Instruction
| Method Name | BasScript.BasLogical.DEFAULT() |
|---|---|
| Description | Adds a logical DEFAULT statement to the script |
| Request Parameters | None |
| Return Value | StatusCode: Result of function execution |
4.10.19 END_SWITCH End Multi-Branch Selection Instruction
| Method Name | BasScript.BasLogical.END_SWITCH() |
|---|---|
| Description | Ends the logical SWITCH statement |
| Request Parameters | None |
| Return Value | StatusCode: Result of function execution |
4.10.20 SKIP_CONDITION Skip Condition Instruction
| Method Name | BasScript.BasLogical.SKIP_CONDITION(param1, index, param2, value, operatorType) |
|---|---|
| Description | Adds a logical SKIP CONDITION statement to the script |
| Request Parameters | param1: 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 Value | StatusCode: Result of function execution |
4.10.21 WAIT Wait Condition Instruction
| Method Name | BasScript.BasStructure.WAIT(param1, index, param2, value, operatorType) |
|---|---|
| Description | Adds a logical WAIT COND statement to the script |
| Request Parameters | param1: 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 Value | StatusCode: Result of function execution |
4.10.22 WAIT_TIME Wait Time Instruction
| Method Name | BasScript.BasStructure.WAIT_TIME(param, value) |
|---|---|
| Description | WAIT TIME waits for a certain amount of time |
| Request Parameters | param: Parameter type value: Time value to wait |
| Return Value | StatusCode: Result of function execution |
4.10.23 GOTO Jump Instruction
| Method Name | BasScript.BasLogical.GOTO(index) |
|---|---|
| Description | GOTO jump statement |
| Request Parameters | index: Index of the target label |
| Return Value | StatusCode: Result of function execution |
4.10.24 LABEL Instruction
| Method Name | BasScript.BasLogical.LABEL(index) |
|---|---|
| Description | LABEL statement |
| Request Parameters | index: Index of the label |
| Return Value | StatusCode: Result of function execution |
4.10.25 BREAK Break Out of Loop Instruction
| Method Name | BasScript.BasLogical.BREAK() |
|---|---|
| Description | BREAK statement |
| Request Parameters | None |
| Return Value | StatusCode: Result of function execution |
4.10.26 CONTINUE Skip Loop Instruction
| Method Name | BasScript.BasLogical.CONTINUE() |
|---|---|
| Description | CONTINUE statement |
| Request Parameters | None |
| Return Value | StatusCode: Result of function execution |
4.10.27 PAUSE Instruction
| Method Name | BasScript.BasStructure.PAUSE() |
|---|---|
| Description | PAUSE statement |
| Request Parameters | None |
| Return Value | StatusCode: Result of function execution |
4.10.28 ABORT Instruction
| Method Name | BasScript.BasStructure.ABORT() |
|---|---|
| Description | ABORT statement |
| Request Parameters | None |
| Return Value | StatusCode: Result of function execution |
4.10.29 CALL Synchronous Program Call Instruction
| Method Name | BasScript.BasStructure.CALL(name) |
|---|---|
| Description | CALL synchronous program call |
| Request Parameters | name: Program name |
| Return Value | StatusCode: Result of function execution |
4.10.30 RUN Asynchronous Program Call Instruction
| Method Name | BasScript.BasStructure.RUN(name) |
|---|---|
| Description | RUN asynchronous program call |
| Request Parameters | name: Program name |
| Return Value | StatusCode: Result of function execution |
4.10.31 LOAD Load Program Instruction
| Method Name | BasScript.BasStructure.LOAD(param, value) |
|---|---|
| Description | LOAD load program |
| Request Parameters | param: Parameter, R register, SR register, number, or string value: Value of the parameter, number or string |
| Return Value | StatusCode: Result of function execution |
4.10.32 UNLOAD Unload Program Instruction
| Method Name | BasScript.BasStructure.UNLOAD(param, value) |
|---|---|
| Description | UNLOAD unload program |
| Request Parameters | param: Parameter, R register, SR register, number, or string value: Value of the parameter, number or string |
| Return Value | StatusCode: Result of function execution |
4.10.33 EXEC Execute Program Instruction
| Method Name | BasScript.BasStructure.EXEC(param, value) |
|---|---|
| Description | EXEC execute program |
| Request Parameters | param: Parameter, R register, SR register, number, or string value: Value of the parameter, number or string |
| Return Value | StatusCode: Result of function execution |
4.10.34 OPEN Open Socket Connection Instruction
| Method Name | BasScript.BasSocket.OPEN(index) |
|---|---|
| Description | SOCKET OPEN open socket connection |
| Request Parameters | index: SK register index |
| Return Value | StatusCode: Result of function execution |
4.10.35 CLOSE Close Socket Connection Instruction
| Method Name | BasScript.BasSocket.CLOSE(index) |
|---|---|
| Description | SOCKET CLOSE close socket connection |
| Request Parameters | index: SK register index |
| Return Value | StatusCode: Result of function execution |
4.10.36 CONNECT Socket Connection Instruction
| Method Name | BasScript.BasSocket.CONNECT(index) |
|---|---|
| Description | SOCKET CONNECT connect socket |
| Request Parameters | index: SK register index |
| Return Value | StatusCode: Result of function execution |
4.10.37 SEND Send Socket Data Instruction
| Method Name | BasScript.BasSocket.SEND(index, msgType, value) |
|---|---|
| Description | SOCKET SEND send data via socket |
| Request Parameters | index: SK register index msgType: Message type value: Message content or index |
| Return Value | StatusCode: Result of function execution |
4.10.38 RECV Receive Socket Data Instruction
| Method Name | BasScript.BasSocket.RECV(index, msgLength, msgType, value) |
|---|---|
| Description | SOCKET RECV receive socket data |
| Request Parameters | index: SK register index msgLength: Message length msgType: Message type value: Message content or index |
| Return Value | StatusCode: Result of function execution |
4.10.39 READ_MH Read Modbus Holding Register Instruction
| Method Name | BasScript.BasModbus.READ_MH(index, id, address, length, rIndex) |
|---|---|
| Description | ReadMH read Modbus holding register |
| Request Parameters | index: Channel index id: Modbus ID address: Register address length: Register length rIndex: R register index to write to |
| Return Value | StatusCode: Result of function execution |
4.10.40 READ_MI Read Modbus Input Register Instruction
| Method Name | BasScript.BasModbus.READ_MI(index, id, address, length, rIndex) |
|---|---|
| Description | ReadMI read Modbus input register |
| Request Parameters | index: Channel index id: Modbus ID address: Register address length: Register length rIndex: R register index to write to |
| Return Value | StatusCode: Result of function execution |
4.10.41 WRITE_MH Write Modbus Holding Register Instruction
| Method Name | BasScript.BasModbus.WRITE_MH(index, id, address, length, valueType, value) |
|---|---|
| Description | ModbusWriteMH write to Modbus holding register |
| Request Parameters | index: Channel index id: Modbus ID address: Register address length: Register length valueType: Value type value: Value or index |
| Return Value | StatusCode: Result of function execution |
4.10.42 FIND Find Vision Program Instruction
| Method Name | BasScript.BasVision.FIND(name) |
|---|---|
| Description | VISION FIND find vision program |
| Request Parameters | name: Vision program name |
| Return Value | StatusCode: Result of function execution |
4.10.43 GET_OFFSET Get Vision Program Offset Instruction
| Method Name | BasScript.BasVision.GET_OFFSET(name, index, labelIndex) |
|---|---|
| Description | VISION GET OFFSET get vision program offset |
| Request Parameters | name: Vision program name index: Vision register index labelIndex: Label index |
| Return Value | StatusCode: Result of function execution |
4.10.44 GET_QUANTITY Get Vision Program Result Instruction
| Method Name | BasScript.BasVision.GET_QUANTITY(name, index) |
|---|---|
| Description | VISION GET QUANTITY get vision program result |
| Request Parameters | name: Vision program name index: R register index |
| Return Value | StatusCode: Result of function execution |
4.10.45 SetParam Set Parameter Instruction
| Method Name | BasScript.SetParam(type, valueType, value) |
|---|---|
| Description | SET PARAM set parameter |
| Request Parameters | type: Parameter type valueType: Value type value: Value |
| Return Value | StatusCode: Result of function execution |