poovs

Function Block symbol - arrays

2 posts in this topic

Is it possible to create a symbol as an array of function blocks?

I can create arrays in the Global and Local Symbols of various types (INT, BOOL, user defined Data Types with members), but a Global Symbol of Function Block data type does not allow for the Advanced option which is where array configuration is performed.

Why? I have a need to call a function block from within a for loop in a ST program and I do not want to have to create individual symbols of type FB [FuntionBlockName] for each call of the function block within the for loop. Without this function, the behavior between subsequent calls of the function block within the loop is not as intended (perhaps because the LD FB contains keeps, timers, and DIFU/DIFD logic).

 

Share this post


Link to post
Share on other sites

You can't do an array of Function Block data type no. You could as an alternative make a structure that a function block uses and make an array of the structure datatype which would allow for loop operations in ST. You would need declarations and mapping for each instance but it should simplify logic quite a bit still.

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