This simple couple of rungs of logic should work to index through all 30 TIMER[X].PRE elements in just 30 scans.
I haven't tested it live as I just threw it together rather quickly, but fundamentally I think it should do the trick...
Note: this just writes to the .PRE elements of each TIMER in the array and is not how I would normally do it.
Moving on...
You will also notice from the Tag window how the TIMER[X].PRE elements are not contiguous, as is being explained and this is why the COP instruction will not work when defining the Destination as TIMER[0].PRE.
But also note that even though the predefined TIMER data type is not made up of 3 x DINT elements, but instead 2 x DINT and 3 x BOOL, it is still a Structured data type.
NB: A COP instruction will operate on Structured data types, but you must be careful.
The COP instruction simply copies the Source data type to the Destination data type in a byte-wise fashion until the Length of the Destination data type is satisfied. So if the starting element defined for the Destination is part of a Structured data type, and is a DINT, the COP instruction will continue writing to consecutive bytes until the Length in DINTs is reached.
Example1:
COP
Source NEW_TIMER_PRE
Dest TIMER[0].PRE
Length 2
The Source is a DINT.
The Destination is a DINT or 4 x bytes.
So the Length is 2 x DINT or 8 x bytes to be copied.
The second element of the TIMER[0] structure is TIMER[0].ACC, which is also a DINT or 4 x bytes.
So the COP instruction will copy the Source DINT's 4 x bytes into TIMER[0].PRE until its DINT's 4 x bytes are written and Length count 1 is done.
Then the Source DINT's 4 x bytes are copied again to the next contiguous 4 x bytes after TIMER[0].PRE, which happens to be TIMER[0].ACC, until its DINT's 4 x bytes are written and Length count 2 is done.
So in this example both TIMER[0].PRE and TIMER[0].ACC have been copied the same value as the Source DINT with no overwriting in bytes to further elements of the structure.
Example2:
COP
Source NEW_TIMER_PRE
Dest TIMER[0].PRE
Length 3
The Source is a DINT.
The Destination is a DINT or 4 x bytes.
So the Length is 3 x DINT or 12 x bytes to be copied.
The second element of the TIMER[0] structure is TIMER[0].ACC, which is also a DINT or 4 x bytes.
The third member of the TIMER[0] structure is TIMER[0].EN which is a BOOL. As are members four and five - TIMER[0].TT and TIMER[0].DN.
As BOOL members are packed into data types using an 8 bit boundary or single byte, these three subsequent members are part of the ninth byte deep into this structure...
TIMER structure = 12 bytes:
Byte 01 = .PRE bits 0-7
Byte 02 = .PRE bits 8-15
Byte 03 = .PRE bits 16-23
Byte 04 = .PRE bits 24-31
Byte 05 = .ACC bits 0-7
Byte 06 = .ACC bits 8-15
Byte 07 = .ACC bits 16-23
Byte 08 = .ACC bits 24-31
Byte 09 = .EN bit 0, .TT bit 1, .DN bit 2 (bits 3-7 not used)
Byte 10 = Reserved for TIMER functions
Byte 11 = Reserved for TIMER functions
Byte 12 = Reserved for TIMER functions
So...
The COP instruction will likewise copy the Source DINT's 4 x bytes to both TIMER[0].PRE and TIMER[0].ACC and the Length count will be 2. For Length count 3 the Source DINT's 4 x bytes will continue to write to the next 4 available bytes...
Source DINT byte 1 > TIMER[0] byte 09 (.EN, .TT, .DN)
Source DINT byte 2 > TIMER[0] byte 10 (Reserved)
Source DINT byte 3 > TIMER[0] byte 11 (Reserved)
Source DINT byte 4 > TIMER[0] byte 12 (Reserved)
So with a Length of 3 the Source DINT has now been copied 12 x bytes deep into the entire TIMER[0] structure. If we set a Length of 4 the Source will now carry on and copy into the next 4 x bytes which happens to be the TIMER[1].PRE DINT in the next array member.
So a COP instruction, with a Length of 30 and Destination of TIMER[0].PRE in an array of 30 TIMER structures, would overwrite 120 bytes of contiguous data from TIMER[0].PRE to the second byte in TIMER[2].ACC.
Now that we have that out of the way, let's get back to what JeremyM is proposing...
Remember, the COP instruction can write to a structured data type. But it can also write from them as well.
If you really want to prime or initialize an array of TIMER data types to all be the same in every way i.e. all members identical, then you can simply use an initialized TIMER data type tag as the Source and copy it for the Length of your array, while specifying the Destination as the first TIMER[0] member itself within the array, as opposed to the first element TIMER[0].PRE within the first member...
Example3:
COP
Source INITIALIZED_TIMER (TIMER data type)
Dest TIMER[0] (First TIMER data type member in array)
Length 30
Now the Destination is defined as a TIMER data type which dictates that the Length will be defined as the number of bytes in the Destination data type i.e. 12 bytes to be copied.
So...
INITIALIZED_TIMER x 12 bytes will be copied to TIMER[0] x 12 bytes for Length count 1.
INITIALIZED_TIMER x 12 bytes will be copied to TIMER[1] x 12 bytes for Length count 2.
.
.
.
INITIALIZED_TIMER x 12 bytes will be copied to TIMER[29] x 12 bytes for Length count 30.
Because the Source and Destination are a matching structured data type it performs perfectly fine and there is no writing short of or outside of the boundaries of the array.
You could also initialize TIMER[0] instead of my INITIALIZED_TIMER and then copy to TIMER[1], etc. instead, as JeremyM has demonstrated, but I prefer to have a separate timer for priming first.
Regards,
George