How Can We Help?

Print

How to use array in a Copy, Calculator, Subroutines,…

 

You can use tags in the form of an array.

Array tags in PLCs provide an elegant way to structure and share data. Instead of creating dozens of individual variables, similar data (recipe parameters, axis statuses, sensor values) is grouped together in a single indexed array.

When used in conjunction with a loop, they allow N identical channels to be processed using a single block of code, which drastically reduces duplication. They are also used to implement standard mechanisms such as FIFO queues, circular buffers for data logging, or lookup tables for sensor linearisation.

Arrays make the code more compact, generic and maintainable, particularly on machines with numerous axes or similar zones.

Arrays in vBuilder

This is defined in the “Tags” section of vBuilder. You set the size of the array—in this case, 10—ranging from MyArrayUI16[0] to MyArrayUI16[9]

 

Arrays with tools

If you wish to use them in various tools such as “Copy”, “Calculator”, etc., be sure to set the pointer to UI16.