I ran your code demo_discrete_DMP_UR5.py but I seem to have some problems, it gets stuck in the loop. Here is what the console outputs.
Python interpreter:
Program started
Connect to remote API server.
Connected to remote API server
get object joint handle 1 ok.
get object joint handle 2 ok.
get object joint handle 3 ok.
get object joint handle 4 ok.
get object joint handle 5 ok.
get object joint handle 6 ok.
Main loop is begining ...
coppeliaSIM:
[sandboxScript:info] Simulation started.
[CoppeliaSim:warning] Detected non-default settings (time steps and/or dyn. engine global settings).