I created 1 array with code: CreateArray( Array := MyArray,
FirstIndex := 0,
LastIndex := 31,
ArrayElement := MyArrayElement,
Status := ArrayStatus );
My arrayelement, i putted 40.0 value.
But ArrayStatus return the result was -1. Can you tell me what wrong in my code, and how to test array work correctly?
Voted best answer
CreateArray function is normally used in the First scan code, I mean either we use it inside 'Start_' code tab (executes first in the application, executes once at application startup) or we write if statement to execute in the first scan.
if firstscan then
CreateArray( Array => Array1,
FirstIndex := FirstIndex,
LastIndex := LastIndex,
ArrayElement := ArrayElement,
Status => Status );
firstscan := false;
If it is not used in the first scan then it throws an error in status as -1. I guess, you are missing that point. So please as suggested, use the array function accordingly, online help of array would help you further.