How to write a script(using servoj) in teachpendant?

I finished a admittance algorithm in my pc. I acquire FT sensor data though 30003 port, and calculate the desired position, then send the position to UR though script servoj. But if the program was run in PC, there was a TCP/IP communication between PC and UR controller, it is not good for the real-time control system. So I want write this admittance algorithm in teach pendant, if the admittance algorithm is run in UR controller, without TCP/IP communication, it is good for the real-time control system.


I try to write script in teachpendant(the same as script in PC) , but it seems doesn’t work.

The fig show some parts of my program. Now I want to write this program in teach pandant.
Thanks!