top of page

Python 13.16. Extended axis control code example

from fairino import Robot
import time
# Establish a connection with the robot controller and return a robot object if the connection is successful
robot = Robot.RPC('192.168.58.2')
retval = robot.AuxServoSetParam(111113107215.45)
print(f"AuxServoSetParam is: {retval}")
servoCompany = 0
servoModel = 0
servoSoftVersion = 0
servoResolution = 0
axisMechTransRatio = 0.0
retval, servoCompany, servoModel, servoSoftVersion, servoResolution, axisMechTransRatio = robot.AuxServoGetParam(1)
print(f"servoCompany {servoCompany}\n"
      f"servoModel {servoModel}\n"
      f"servoSoftVersion {servoSoftVersion}\n"
      f"servoResolution {servoResolution}\n"
      f"axisMechTransRatio {axisMechTransRatio}\n")
retval = robot.AuxServoSetParam(11011121314)
print(f"AuxServoSetParam is: {retval}")
retval, servoCompany, servoModel, servoSoftVersion, servoResolution, axisMechTransRatio = robot.AuxServoGetParam(1)
print(f"servoCompany {servoCompany}\n"
      f"servoModel {servoModel}\n"
      f"servoSoftVersion {servoSoftVersion}\n"
      f"servoResolution {servoResolution}\n"
      f"axisMechTransRatio {axisMechTransRatio}\n")
retval = robot.AuxServoSetParam(111113107236)
print(f"AuxServoSetParam is: {retval}")
time.sleep(3)
robot.AuxServoSetAcc(30003000)
robot.AuxServoSetEmergencyStopAcc(50005000)
time.sleep(1)
emagacc = 0.0
emagdec = 0.0
acc = 0.0
dec = 0.0
error,emagacc, emagdec = robot.AuxServoGetEmergencyStopAcc()
print(f"emergency acc is {emagacc}  dec is {emagdec}")
error,acc, dec = robot.AuxServoGetAcc()
print(f"acc is {acc}  dec is {dec}")
robot.AuxServoSetControlMode(10)
time.sleep(2)
retval = robot.AuxServoEnable(10)
print(f"AuxServoEnable disenable {retval}")
time.sleep(1)
servoErrCode = 0
servoState = 0
servoPos = 0.0
servoSpeed = 0.0
servoTorque = 0.0
retval, servoErrCode, servoState, servoPos, servoSpeed, servoTorque = robot.AuxServoGetStatus(1)
print(f"AuxServoGetStatus servoState {servoState}")
time.sleep(1)
retval = robot.AuxServoEnable(11)
print(f"AuxServoEnable enable {retval}")
time.sleep(1)
retval, servoErrCode, servoState, servoPos, servoSpeed, servoTorque = robot.AuxServoGetStatus(1)
print(f"AuxServoGetStatus servoState {servoState}")
time.sleep(1)
retval = robot.AuxServoHoming(1151,100)
print(f"AuxServoHoming {retval}")
time.sleep(3)
retval = robot.AuxServoSetTargetPos(120030,100)
print(f"AuxServoSetTargetPos {retval}")
time.sleep(1)
retval, servoErrCode, servoState, servoPos, servoSpeed, servoTorque = robot.AuxServoGetStatus(1)
print(f"AuxServoGetStatus servoSpeed {servoSpeed}")
time.sleep(8)
robot.AuxServoSetControlMode(11)
time.sleep(2)
robot.AuxServoEnable(10)
time.sleep(1)
robot.AuxServoEnable(11)
time.sleep(1)
robot.AuxServoSetTargetSpeed(110080)
time.sleep(5)
robot.AuxServoSetTargetSpeed(1080)
robot.CloseRPC()

13.17. Parameter configuration for UDP extended axis communication

New in version python: SDK-v2.1.2

prototype

ExtDevSetUDPComParam(ip, port, period, lossPkgTime, lossPkgNum, disconnectTime, reconnectEnable, reconnectPeriod, reconnectNum, selfConnect)

Description

UDP Extended Axis Communication Parameter Configuration

Mandatory parameters

  • ip: PLC IP address;

  • port: port number;

  • period: communication period (ms, not open yet);

  • lossPkgTime: packet loss detection time (ms);

  • lossPkgNum: number of packets lost;

  • disconnectTime: the length of the communication disconnect confirmation;

  • reconnectEnable: communication disconnection auto reconnect enable 0-not enable 1-enable;

  • reconnectPeriod: reconnect period interval (ms);

  • reconnectNum: number of reconnections

  • selfConnect: Whether the connection is automatically established upon power-off and restart; 0- No connection established; 1- Establish a connection

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.18. Get UDP extended axis communication parameters

New in version python: SDK-v2.0.4

Prototype

ExtDevGetUDPComParam()

Description

Get UDP extended axis communication parameters

Mandatory parameters

NULL

Default parameters

NULL

Return Value

  • Error Code Success-0 Failure- errcode;

  • ip: PLC IP address;

  • port: port number;

  • period: communication period (ms, not open yet);

  • lossPkgTime: packet loss detection time (ms);

  • lossPkgNum: number of packets lost;

  • disconnectTime: the length of the communication disconnect confirmation;

  • reconnectEnable: communication disconnection auto reconnect enable 0-not enable 1-enable;

  • reconnectPeriod: reconnect period interval (ms);

  • reconnectNum: number of reconnections

13.19. Load UDP communication

New in version python: SDK-v2.0.4

Prototype

ExtDevLoadUDPDriver()

Description

Load UDP communication

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.20. Offloading UDP communication

New in version python: SDK-v2.0.4

Prototype

ExtDevUnloadUDPDriver()

Description

Offloading UDP communication

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.21. UDP Extended Axis Communication Recovery after Abnormal Disconnection

New in version python: SDK-v2.0.4

prototype

ExtDevUDPClientComReset()

Description

UDP Extended Axis Communication Abnormally Disconnected After Restoring Connection

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.22. UDP extension axis communication is closed after abnormal disconnection.

New in version python: SDK-v2.0.4

Prototype

ExtDevUDPClientComClose()

Description

UDP Extended Axis Communication Abnormal Disconnect Closes Communication

Mandatory parameters

NULL

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.23. UDP Extended Axis Parameter Configuration

New in version python: SDK-v2.0.4

Prototype

ExtAxisParamConfig(axisId, axisType, axisDirection, axisMax, axisMin, axisVel, axisAcc,axisLead, encResolution, axisOffect. axisCompany, axisModel, axisEncType)

Description

UDP Extended Axis Parameter Configuration

Mandatory parameters

  • axisId: axis number [1-4];

  • axisType: extended axis type 0 - translation; 1 - rotation;

  • axisDirection: extended axis direction 0 - forward; 1 - reverse;

  • axisMax: Maximum position of the extended axis in mm;

  • axisMin: Extended axis minimum position in mm;

  • axisVel: speed mm/s;

  • axisAcc: acceleration mm/s2;

  • axisLead: lead in mm;

  • encResolution: encoder resolution;

  • axisOffect: Extended axis offset from the start of the weld;

  • axisCompany: drive manufacturers 1-Hochuan; 2-HuiChuan; 3-Panasonic;

  • axisModel: Drive Model 1-Hochuan-SV-XD3EA040L-E, 2-Hochuan-SV-X2EA150A-A, 1-HuiChuan-SV620PT5R4I, 1-Panasonic-MADLN15SG, 2-Panasonic-MSDLN25SG, 3-Panasonic-MCDLN35SG;

  • axisEncType: encoder type 0-incremental; 1-absolute;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.24. Setting the extended robot position relative to the extended axis

New in version python: SDK-v2.0.4

Prototype

SetRobotPosToAxis(installType)

Description

Set the position of the extended robot relative to the extended axis

Mandatory parameters

  • installType: 0 - robot mounted on external axis, 1 - robot mounted outside external axis;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.25. Setting the extended axis system DH parameter configuration

New in version python: SDK-v2.0.4

Prototype

SetAxisDHParaConfig(axisConfig,axisDHd1,axisDHd2,axisDHd3,axisDHd4,axisDHa1,axisDHa2,axisDHa3,axisDHa4)

Description

Sets the extended axis system DH parameter configuration

Mandatory parameters

  • axisConfig: external axis configuration, 0 - single degree of freedom linear slide, 1 - two degree of freedom L-type indexer, 2 - three degree of freedom, 3 - four degree of freedom, 4 - single degree of freedom indexer;

  • axisDHd1: external axis DH parameter d1 mm;

  • axisDHd2: external axis DH parameter d2 mm;

  • axisDHd3: external axis DH parameter d3 mm;

  • axisDHd4: external axis DH parameter d4 mm;

  • axisDHa1: external axis DH parameter a1 mm;

  • axisDHa2: external axis DH parameter a2 mm;

  • axisDHa3: external axis DH parameter a3 mm;

  • axisDHa4: external axis DH parameter a4 mm;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.26. UDP Extended Axis Enable

New in version python: SDK-v2.0.4

Prototype

ExtAxisServoOn(axisID, status)

description

UDP Extended Axis Enable

Mandatory parameters

  • axisID: axis number [1-4];

  • status: 0-de-enable; 1-enable;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.27. UDP Extended Axis Zero Return

New in version python: SDK-v2.0.4

Prototype

ExtAxisSetHoming(axisID, mode, searchVel, latchVel)

Description

UDP extended axis back to zero

Mandatory parameters

  • axisID: axis number [1-4];

  • mode: return to zero mode 0 current position return to zero, 1 negative limit return to zero, 2 - positive limit return to zero;

  • searchVel: search velocity (mm/s);

  • latchVel: zeroing hoop speed (mm/s);

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.28. UDP Extended Axis Tap Start

New in version python: SDK-v2.0.4

Prototype

ExtAxisStartJog( axisID, direction, vel, acc, maxDistance)

Description

UDP Extended Axis Tap Start

Mandatory parameters

  • axisID: axis number [1-4];

  • direction: direction of rotation 0 - reverse; 1 - forward;

  • vel: velocity (mm/s);

  • acc: acceleration (mm/s);

  • maxDistance: maximum pointing distance;

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode

13.29. UDP Extended Axis Tap Stop

New in version python: SDK-v2.0.4

Prototype

ExtAxisStopJog(axisID)

Description

UDP Extended Axis Tap Stop

Mandatory parameters

  • axisID: axis number [1-4];

Default parameters

NULL

Return Value

Error Code Success-0 Failure- errcode


robotic arm
FAIRINO ROBOTIC ARMS

Contact

Location: 10637 Scripps Summit Court,

San Diego, CA. 92131
Phone: (619) 333-FAIR
Email: hello@fairino.us

© 2023 Fairino US official site Proudly created By G2T

bottom of page