How to get feedback sensor on XL430 motor

I have XL430 motor which connected to my raspberry pi 4 using U2D2 hub. Currently running on python script and I need to get feedback such as current sensor and load acting on the joint.
but i am not able to find code for that…

Hi @Thelegend47

Here’s a perfect quick start video for you.
The example shows how to read the Present Position and write the Goal Position, but you can easily modify the code to read the Present Load(126) of XL430-W250.

You can modify the read_write example code line 168 as below

while 1:
    # Read present position
    if (MY_DXL == 'XL320'): # XL320 uses 2 byte Position Data, Check the size of data in your DYNAMIXEL's control table
    dxl_present_position, dxl_comm_result, dxl_error = packetHandler.read2ByteTxRx(portHandler, DXL_ID, ADDR_PRESENT_POSITION)
    else:
        dxl_present_position, dxl_comm_result, dxl_error = packetHandler.read4ByteTxRx(portHandler, DXL_ID, ADDR_PRESENT_POSITION)
    if dxl_comm_result != COMM_SUCCESS:
        print("%s" % packetHandler.getTxRxResult(dxl_comm_result))
    elif dxl_error != 0:
        print("%s" % packetHandler.getRxPacketError(dxl_error))
    # Read present load
    dxl_present_load, dxl_comm_result, dxl_error = packetHandler.read2ByteTxRx(portHandler, DXL_ID, 126)
    if dxl_comm_result != COMM_SUCCESS:
        print("%s" % packetHandler.getTxRxResult(dxl_comm_result))
    elif dxl_error != 0:
        print("%s" % packetHandler.getRxPacketError(dxl_error))