It is my first time using RoboDK to simulate the Robot arm's motions.
When I used the "KUKA PRC program" (a Rhino Grasshopper plugin), the simulation went smoothly with no error.
THE PROBLEM IS
the "Joint 5" is rotated 180 degrees when I import the ".src" file and run the script using RoboDK.
I'm pretty sure that it is because of the turn flags setup.
It looks like you are importing SRC files. If you do so, make sure the tool ($TOOL) and reference frame ($BASE) are the same as defined in your program. If the base and tool are inlined in your SRC file they will be automatically extracted by RoboDK. Otherwise, you can manually enter the tool and reference frame.
Assuming this is correct, RoboDK has some tolerances to help you stay away from robot singularities. You can change this tolerance here:
Tools-Options-Motion-Tolerance to avoid wrist singularity (deg)
The turn flags are not the same as the configuration flags which is something that would provoke such error.
Can you share the RDK file and SRC files? We can better look into it.