Station values outside of defined intervall of line P_X

Hello
I am trying to write a loop that creates 8 lanes, that i can step my load over.

When writing my code like this:

let#index 0
let#index1 0
let#index2 0

!Adding two new lanes corresponding to containers under the turning straddle carrier
! X koordinat når container kører til kanten: 67.98
! x koordinat når container står 2 m fra kanten: 69.85

let#start_x 67.98
let#step_x 0.7

!Amount of steps to step over the plate with container

if ($(plate) == 11)
let#step_sccon 13
else
let#step_sccon 8
endif

loop#i 8
sto#x_coor(#i) #start_x+#step_x*#i
endloop

let#stepcon 6.5
! value of 7.9 is 2 m between containers
!(value of 6.5 is minimum distance between containers = 600 mm center foot to center foot = 400 mm between containers)

let#index1 #index
let#counter 0

!First lane
GAX ‘P_1’ TYPE LANE X
#x_coor**(0) Y 318.5-15.5 NX 1 0 0 S 45
LANE ‘P_1’ ! Arbitrary text
loop#i** #step_sccon ! Loop over the number of containers in y-direction
let#LC_number 30501+#counter
LC
#LC_number TYPE ‘CO_1’ TITL ‘CON - lane P_1, loc #(#i+1)’
COPY 11 REF ‘P_1’ DX
#stepcon***#i DY 1
sto#LC_CON(
#index1
)** #LC_number **
let#index1 #index1+1
let#counter #counter+1
endloop**

!second lane
GAX ‘P_2’ TYPE LANE X
#x_coor**(1) Y 318.5-15.5 NX 1 0 0 S 45
LANE ‘P_2’ ! Arbitrary text
loop#i** #step_sccon ! Loop over the number of containers in y-direction
let#LC_number 30501+#counter
LC
#LC_number TYPE ‘CO_1’ TITL ‘CON - lane P_2, loc #(#i+1)’ ! Save all the container LCs in CO_1 type for MAXIMA
COPY 11 REF ‘P_2’ DX
#stepcon***#i DY 1
sto#LC_CON(
#index1
)** #LC_number ! Save the LCs in #LC_CON for ASE program
let#index1 #index1+1 ! go to next index to avoid overwriting in
#LC_CON**
let#counter #counter+1
endloop**

I have no issue.
But if i try to write it in a loop like this:

loop#j 8
GAX ‘P’#(#j+1) TYPE LANE X #x_coor(#j) Y 318.5-15.5 NX 1 0 0 S 45
LANE ‘P’#(#j+1) ! Arbitrary text

!*! Apply container loads to the P lanes (new container lanes)

loop#i #step_sccon ! Loop over the number of containers in y-direction
        let#LC_number 30501+#counter  
        LC #LC_number TYPE 'CO_1' TITL 'CON - lane P_#(#j+1), loc #(#i+1)'  ! Save all the container LCs in CO_1 type for MAXIMA
        COPY 11 REF 'P_#(#j+1)' DX #stepcon*#i DY 1
        sto#LC_CON(#index1) #LC_number            ! Save the LCs in #LC_CON for ASE program
        let#index1 #index1+1                       ! go to next index to avoid overwriting in #LC_CON
        let#counter #counter+1
endloop

endloop

I get the error about station values outside of defined line.
I cannot seem to find the error. Anyone have any idea?

Hi Morten,

could you share the teddy file?

Best regards, Nora