//ID 81, SetPTPCoordinateParams
        static void SetPTPCoordinateParams(PTPCoordinateParams ptpCoordinateParams)
        {
            Program AllFunctions = new Program();

            AllFunctions.ConnectToServer();
            byte[] DATA_TO_SEND = new byte[22];
            //info of the functon
            Message message = new Message();

            // set ID 81 INFO
            message.id        = 81;
            message.rw        = 1;
            message.isQueued  = 0;
            message.paramsLen = 18;

            //Start set functions
            //Header
            DATA_TO_SEND[0] = 170; //0xAA
            DATA_TO_SEND[1] = 170; //0xAA

            // // Params
            DATA_TO_SEND[2] = message.paramsLen; //Len
            DATA_TO_SEND[3] = message.id;        //ID
            DATA_TO_SEND[4] = 0;                 //Ctrl

            byte[] tempByte = new byte[16];

            ////////////////////
            // CHECK IF NULL
            ///////////////////

            float[] tempFloat = new float[4];
            tempFloat[0] = ptpCoordinateParams.xyzVelocity;
            tempFloat[1] = ptpCoordinateParams.rVelocity;
            tempFloat[2] = ptpCoordinateParams.xyzAcceleration;
            tempFloat[3] = ptpCoordinateParams.rAccleration;

            Buffer.BlockCopy(tempFloat, 0, tempByte, 0, tempByte.Length);//all parameters
            for (int i = 0; i <= 15; i++)
            {
                DATA_TO_SEND[5 + i] = tempByte[i];
            }

            DATA_TO_SEND[21] = message.paramsLen;

            //Send instruction
            string hexString = string.Empty;

            hexString = ToHexString(DATA_TO_SEND);

            AllFunctions.Send(hexString);
        }
        static void Main(string[] args)
        {
            Program AllFunctions = new Program();

            //connect to server
            AllFunctions.ConnectToServer();

            /* ********************************************************** */
            //Please Write Code Below
            /* ********************************************************** */

            PTPJointParams      ptpJointParams      = new PTPJointParams();
            JOGCmd              jogCmd              = new JOGCmd();
            PTPCoordinateParams ptpCoordinateParams = new PTPCoordinateParams();
            PTPCmd              ptpCmd              = new PTPCmd();

            //Set up the velocity of inverse kinematics
            ptpCoordinateParams.xyzVelocity = 100;
            SetPTPCoordinateParams(ptpCoordinateParams);

            //Set up the velocity of forward kinematics
            ptpJointParams.velocity[0] = 50F;
            ptpJointParams.velocity[1] = 50F;
            ptpJointParams.velocity[2] = 50F;
            SetPTPJointParams(ptpJointParams);

            //Use inverse kinematics, move to coordinate(-270, 140, 95)
            ptpCmd.ptpMode = 1;
            ptpCmd.x       = -270F;
            ptpCmd.y       = 140F;
            ptpCmd.z       = 95F;
            SetPTPCmd(ptpCmd);

            //Turn on the suction cup
            SetEndEffectorSuctionCup(true);

            //Use forward kinematics, move to coordinate(130, 45, 56.9)
            ptpCmd.ptpMode = 3;
            ptpCmd.x       = 130F;
            ptpCmd.y       = 45F;
            ptpCmd.z       = 56.9F;
            SetPTPCmd(ptpCmd);

            //Turn off the suction cup and release the object
            SetEndEffectorSuctionCup(false);

            /* ********************************************************** */
            //Please Write Code Above
            /* ********************************************************** */

            Console.WriteLine("Program End");
        }