Hi
I want to control two revolute joints
1. one joint will be moved (control ) by using the trajectory motion but
2. the second i want to move (control) it by using the force sensor that it is used to record the data position of first joint and send it to the second joint as a feedback .
Hence:
is there any way can help me to control the second motor by using recorded data of force sensor ?
.........................................................................................................................................................
The second problem is related to PID controller ;
i have tried to use custom PID controller but i didn't get any changing in the joint position ?
can i get help for the aforementioned both problem ?
.........................................................................................................................................................

the first thing is to make sure that both joints are dynamically enabled- I.e. is there a jumping ball icon next to them in the scene hierarchy while simulation is running? Or is there a warning icon instead?
Then, as far as I have understood your problem, you want to have your first joint not actuated, but move according to forces/torques acting on it. That joint should then be in force/torque mode, and the motor disabled.
If you want to copy or mimic the position of the first joint to the second joint, then the second joint should be in a kind of position control. So you can use the built-in PID controller (joint in force/torque mode, motor enabled, control looop enabled, PID control selected), or write your own controller via a joint control callback script.

first of all , i would like to thank you for cooperation ...
and exactly that what i mean and i got the point that you suggested , but there is a warning icon with one joint that connected with PID controller while simulation is running .At the same time , i have tried to change the PID parameters "P,I,D" but i did not get any changes in the performance of the joint , and i dont know how to recognize the effect of the changing PID parameters on the joint in vrep ?

If there is a warning icon, then it will not work, whatever PID parameters you select. Your joint needs to be dynamically enabled. Make sure you carefully read this page and this section in particular.