Passing arrays to FUN/FB

1 post in this topic


I am trying to develop some structured text POUs in Gx Works3 (function or function block) which are to do some calculations over array.
Say it will be crc32.

So I need to pass an array to such POU.
It would be very nice if POU could work with array of arbitrary size.

I have found some built-in functions which take arrays and their respective arguments have type of ANY16.
But when try to declare an input variable of type ANY16 and use it with indexer I get the compile error that it is not an array.

Also I tried to declare input variable as an array of the size of one element.
It compiles but does not work. 

As I understand, there is an index register that can help solving such problem but I have no idea of how to apply it to arbitrary input parameter.

Does anybody know how to iterate over an array input parameter and how to declare it properly?

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now