Sending Commands for Signal Generation at pwm pins

Hello Guys,
I am trying to send command to my pixhawk using pymavlink to generate pwm signals at 16 channels of the pixhawk.

def test_send(self, i):
        self.fc.mav.command_long_send(
            self.fc.target_system, self.fc.target_component,
            311,
            0,            
            4,  
            0, 
            0,
            0,
            i,
           0,
           0)
        response = self.fc.recv_match(type='COMMAND_ACK', blocking=True)
        print(i, ": ", response)
for i in range(1,17):
    fcobj.test_send(i) #class object calling the above function

Output:

1 :  COMMAND_ACK {command : 311, result : 3, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
2 :  COMMAND_ACK {command : 311, result : 3, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
3 :  COMMAND_ACK {command : 311, result : 3, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
4 :  COMMAND_ACK {command : 311, result : 3, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
5 :  COMMAND_ACK {command : 311, result : 3, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
6 :  COMMAND_ACK {command : 311, result : 3, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
7 :  COMMAND_ACK {command : 311, result : 3, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
8 :  COMMAND_ACK {command : 311, result : 3, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
9 :  COMMAND_ACK {command : 311, result : 3, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
10 :  COMMAND_ACK {command : 311, result : 3, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
11 :  COMMAND_ACK {command : 311, result : 3, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
12 :  COMMAND_ACK {command : 311, result : 3, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
13 :  COMMAND_ACK {command : 311, result : 3, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
14 :  COMMAND_ACK {command : 311, result : 3, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
15 :  COMMAND_ACK {command : 311, result : 3, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
16 :  COMMAND_ACK {command : 311, result : 3, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}

is there any other command than this to generated signals to run motors?
Or I have not written the send commnad in proper format?
Already referred this MAV_CMD_ACTUATOR_TEST and MAV_CMD_CONFIGURE_ACTUATOR

I have also tried this, where result 4 is

Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc.
The Code:

def motor_test(self, i):
        self.fc.mav.command_long_send(
            self.fc.target_system, self.fc.target_component,
            209,    #MAV_CMD_DO_MOTOR_TEST
            0,      #first transmission of this command
            i,      #Motor instance number
            1,      #Throttle Type - MOTOR_TEST_THROTTLE_PERCENT, MOTOR_TEST_THROTTLE_PWM, MOTOR_TEST_THROTTLE_PILOT, MOTOR_TEST_COMPASS_CAL
            1500,   #Throttle value
            0,      #Timeout - Timeout between tests that are run in sequence.
            16,      #Motor Count - Motor count. Number of motors to test in sequence: 0/1=one motor, 2= two motors, etc. The Timeout (param4) is used between tests.
            1,      #Test Order - MOTOR_TEST_ORDER_DEFAULT, MOTOR_TEST_ORDER_SEQUENCE, MOTOR_TEST_ORDER_BOARD
            0       #unused
            )
        response = self.fc.recv_match(type='COMMAND_ACK', blocking=True)
        print(i, ": ", response)
for i in range(1,17):
    fcobj.motor_test(i)

Output:

1 :  COMMAND_ACK {command : 209, result : 4, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
2 :  COMMAND_ACK {command : 209, result : 4, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
3 :  COMMAND_ACK {command : 209, result : 4, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
4 :  COMMAND_ACK {command : 209, result : 4, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
5 :  COMMAND_ACK {command : 209, result : 4, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
6 :  COMMAND_ACK {command : 209, result : 4, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
7 :  COMMAND_ACK {command : 209, result : 4, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
8 :  COMMAND_ACK {command : 209, result : 4, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
9 :  COMMAND_ACK {command : 209, result : 4, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
10 :  COMMAND_ACK {command : 209, result : 4, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
11 :  COMMAND_ACK {command : 209, result : 4, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
12 :  COMMAND_ACK {command : 209, result : 4, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
13 :  COMMAND_ACK {command : 209, result : 4, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
14 :  COMMAND_ACK {command : 209, result : 4, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
15 :  COMMAND_ACK {command : 209, result : 4, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}
16 :  COMMAND_ACK {command : 209, result : 4, progress : 0, result_param2 : 0, target_system : 255, target_component : 0}

Reference - MAV_CMD_DO_MOTOR_TEST

Greetings of the Day, I would like to know if anyone know answer related to my query.