AC500 Runtime error #81 (Access violation task = new task)
Hello i am testing my program on the PM592 and I frequently get runtime error #81 (Access violation task = new task) and the PLC goes to stop state.The Control builder tells :
E2: IEC task 0 'Index of the faulty IEC task, Task index = x - 4. Comp 9, Dev 0 , Mod 4, Ch 2, Err 38, Error number 0151003302.
All i know is because of the following code - i get this error, which if i do not use there is no such problem. This code helps me to store the LREAL data into the array aDataOut[1..10].There is only one task in the program which is configured as cyclic task with 100 ms. (but with freewheeling also the result is the same)
Please refer to the declaration and the code below.
(*This is declaration of varables*)
aData_Out: ARRAY[1..10] OF LREAL;
Y_Out: POINTER TO LREAL;
xAssign: BOOL := FALSE;
(*This is the code - causing the issue*)
IF NOT xAssign THEN
Y_Out := Signal_Output.Y;
FOR i :=1 TO 10 BY 1 DO
aData_Out[i] := Y_OUT^;
Y_Out := Y_Out +8; (*increment of 8 bytes means i want to read the next lreal data*)
I am also making sure to call this for-loop only once (using bool xAssign) in the runtime.
Sorry i cannot attach the test program as it contains some yet to be released stuff .