PIDAT is a function block. Each time that you create a new instance of a FB, a chunk of memory is carved out that is specific to that instance of the FB. It is necessary to create a separate instance of the PIDAT FB for each of your loops. Function blocks (as a general statement) require a unique instance each time that you add a function block in order for the function block to work properly. Functions on the other hand reuse the same memory over and over and do not have instance names.
In the toolbox in Sysmac Studio, Functions are indicated by a small icon with an 'F' in it and Function blocks say 'FB'.