The ultimate guide to configuring multidimensional arrays in SCADA systems

Multidimensional arrays provide versatility in handling various types of data structures to analyze and optimize process systems using supervisory control and data acquisition (SCADA) systems, programmable logic controllers (PLCs) and human machine interface (HMI) systems.

Vinoth Upendra Janardhanan, CDM Smith Inc.

Configure multidimensional SCADA arrays insights

  • Learn how to efficiently configure multidimensional arrays in PLC and HMI systems.
  • Understand how multidimensional arrays can be used to analyze large datasets.
  • Explore ways to visualize these complex system variables in animation and scripting.

Multidimensional arrays can help with process control system data handling and programming. The process control industry has evolved from manual-based plant control to using industrial internet of things (IIOT) devices and sensors for gathering immense amounts of data for real-time monitoring, optimizing business operations, foreseeing maintenance requirements and enhancing overall performance through data analysis. Various analytical tools are used to analyze such large amounts of data from the plant floor to perform data analytics, modeling, creating interactive dashboards, reports, and historization.

Multidimensional arrays are essential for handling and examining such huge amounts of data in real time, as they enable effective collection, analysis and storage of diverse and large data sets from sensors spread over the plant floor. A detailed examination of such large volumes of data enables process control improvement for critical processes using advanced process control methods and artificial intelligence (AI) and machine learning (ML) technologies. This can lead to considerable enhancement in efficiency, quality, safety, and optimization of plant operations.

Four key benefits of multidimensional arrays for process control optimization

The use of multidimensional arrays offers benefits such as:

Handling complex data structure: Multidimensional arrays are useful for managing and operating with intricate data structures in fields like ML and computer graphics. This flexibility makes them a powerful tool for working with complex data structures.

Data organization: They provide a structured approach for easy data organization and manipulation of data elements. Selective datasets can be collected from multidimensional arrays, enabling straightforward extraction of data subsets based on specified conditions or ranges, which can simplify data manipulation tasks.

Improved performance: Accessing elements in a multidimensional array is typically faster due to contiguous memory allocation. This makes it suitable for performance-intensive operations, such as scientific calculations and data analysis.

Simplifying iteration: Iterating through multidimensional arrays is straightforward using nested loops, allowing easy access to each element in the array, enabling efficient processing and manipulation of data.

Learning how the supervisory control and data acquisition (SCADA) system uses multidimensional arrays to handle such big datasets can offer insights to end-users or system integrators for the analysis and improvement of plant processes.

Defining arrays for PLC, HMI, SCADA data transfer

It is helpful to create a dataset that contains data of the same kind when transferring information from PLC to HMI or between PLCs over the SCADA network. These sets of elements with the same data type are called arrays. These array elements can have any similar data type, such as floating point (REAL), Integers (INT), Double Integers (DINT), Boolean (BOOL), and so on.

These arrays store multiple values in one single variable, called a “tag” in PLC, and each element in the array can be referenced by its index number as shown.

SimpleTag[10]àSimpleTag[5, 6, 8, 2, 1,….4]

Array variable SimpleTag[10] has 10 values stored in its memory and each value in the array has an index number from 0 to 9 that can be used to access it. In the example shown above, to access “5” use SimpleTag[0], where 0 is an index number; to access “8”, use SimpleTag[2], and so on.

We call these arrays one-dimensional array. If we put another array together with them, they become an array of arrays and these become two-dimensional array. An array of arrays of arrays is called a three-dimensional array and so on. Using pump curve as an example, seen in Figure 1, we will explore how to configure such multidimensional arrays (up to three dimensions) in PLCs, open platform communications (OPC) servers and HMI systems.

Figure 1: Plot of head versus flow, and a set of performance curves at various speeds. Courtesy: CDM Smith

How to configure arrays in PLC

Note: This section is based on Rockwell Automation Studio 5000 Logix Designer PLC programming software, but the concept can be applied to other programming software packages.

One-dimensional (1-D) arrays are useful when trying to pass a group of similar data elements as one packet of information across the network such as the “head” information from this pump performance curve for 100% speed. It is simpler to create an array tag instead of creating separate tags for each head value. Defining 1-D array tags is similar to creating any individual REAL, BOOL, INT, DINT tags, but when assigning the data type, it should be suffixed with length of array.

Figure 2: One-dimensional REAL array tag in the PLC with array elements. Courtesy: CDM Smith

P1_Hraw can store 51 values in its memory and each element in the array can be accessed by its index number ranging from 0 to 50. To access 88.85 use P1_Hraw[0], where 0 is an index number; to access 40.677, use P1_Hraw[50], and so on.

Two-dimensional (2-D) arrays are the representation of values in an array within another array. In 1-D array we had head values for 100% speed curve, but if head values for multiple speed curves (100%, 95%, 90%, etc.) need to be used, then it is easier to create a 2-D array tag instead of creating multiple 1-D array tags for each speed value. Defining 2-D array tags is similar to creating 1-D array tags, but when assigning the data type, it should be suffixed with two indexes each with same or different array lengths as shown in Figure 3.

Figure 3: Two-dimensional REAL array tag in the PLC with array elements. Courtesy: CDM Smith

Accessing each element of the P1_Hfitn 2-D array tag is shown in Table 1.

Table 1: Value stored in each element of two-dimensional REAL array tag for four pump speed curves. Courtesy: CDM Smith

Example for 3D arrays, simplified

Three-dimensional (3-D) arrays are complex in nature, and they add a Z-axis to existing X and Y axis (2-D arrays) data. For example, in 2-D arrays, we had one pump with head values for different speed curves (100%, 95%, 90%, etc.), but if we need to use head values for multiple pumps, then it is simpler to make a 3-D array tag rather than creating multiple 2-D array tags for each pump.

Since 3-D arrays are complex, the following array is defined to store only head values of 100% pump speed curve and 30% pump speed curve (minimum speed) for up to 15 pumps in a system. Defining 3-D array tags is similar to creating 2-D array tags, but when assigning the data type, it should be suffixed with three indexes each with same or different array lengths as shown in Figure 4.

Figure 4: Three-dimensional REAL array tag in the PLC with array elements. Courtesy: CDM Smith

Accessing each element of the System_Hfitn 3-D array tag is shown in Table 1.

Table 2: Value stored in each element of three-dimensional REAL array tag. Courtesy: CDM Smith

A 3-D array tag is defined as System_Hfitn[Index 1,Index 2,Array Length], where

  • Index 1 varies from 0à1 where, 0 representing values of 100% pump speed curve and 1 representing 30% pump speed curve;
  • Index 2 varies from 0à14 representing number of pumps in a system;
  • Array length stores 270 values in each of index 2 element.

Four factors to consider when configuring array tags in a PLC

The following four factors should be considered while configuring array tags in a PLC.

  • Tag creation: Only up to 3-D array tags can be created. 4-D and higher order array tags cannot be created.
  • Tag memory: If the size of a new array tag is more than 1.5MB, a warning message will show up, but the tag will still be made. However, if the size is more than 2MB, the tag cannot be made in the database, and an error message will appear.
  • Add-on instructions (AOI): 1-D, 2-D and 3-D array tags can be created only as an InOut parameter, and not as an Input or Output parameter. If an array tag needs to be created as a Local tag, it can only be a 1-D tag and not 2-D or 3-D tags.
  • User-defined data type (UDT): When creating array tags in UDT, only 1-D array tags can be created as a part UDT. UDTs do not support 2-D and 3-D array tags.

Configuring arrays in OPC server

The OPC server is a software server interface that allows interoperability and data exchange between software programs (OPC client), such as HMI/SCADA software, and industrial hardware devices, such as PLCs. OPC server is configured by adding “channel” under the Project folder. Each channel is then configured for any number of “devices.” Let’s say there are multiple remote stations, each with one or more PLCs, then these remote stations become the channel and PLCs in those remote stations are devices configured under these channels as shown in Figure 5.

Figure 5: Illustration of OPC server software configured with a channel and device. Courtesy: CDM Smith

PLC tags can be automatically populated under each of these devices (PLC node), but such tag creation does not populate the array tags properly and needs to be manually created and configured to be used in the HMI/SCADA system. Creation of a 1-D array tag is depicted in Figure 6.

Figure 6: Creation of one-dimensional REAL array tag in OPC server. Courtesy: CDM Smith

Where,

Name: User defined array tag name, this field becomes the “I/O Address” in the HMI/SCADA system database.

Address: Same as array tag name created in the PLC but uses “square & curly brackets” for representing the indices.

Data Type: This is selected based on the array data type created in the PLC. If the PLC array tag is REAL[], then choose “Float Array”; for  DINT[], choose “Long Array”, for INT[] choose “Short Array”, for BOOL[] choose “Boolean Array”, etc.

A 1-D array tag created in the OPC server can be exported to a comma-separated values (CSV) file, which can then be used to easily create 2-D and 3-D array tags and be imported back into the OPC server.

Figure 7: Two and three-dimensional REAL array tags creation in CSV export file. Courtesy: CDM Smith

Addressing the format of array tags shown in Figure 7 is detailed using Table 2.

Table 3: HMI system tag structure format. Courtesy: CDM Smith

Configuring arrays in HMI/SCADA Systems

Note: The below section is based on iFIX HMI/SCADA automation software from GE Vernova, but can be applied in other HMI software packages with minimal variations.

HMI system database manager provides mechanism of data storage and retrieval of stored data for analysis, visualization, reporting and historization. It is configured to establish communication with the OPC server and populate array tags in the HMI database. Creation of 1-D array tags in the HMI database is shown in Figure 8.

Figure 8: Creation of one-dimensional REAL array tag in HMI database. Courtesy: CDM Smith

A_TAG: User defined tag to be used inside the HMI system.

A_IOAD: I/O address field that directly maps to the OPC server array tag created earlier.

Similar to 1-D array tags, 2-D and 3-D array tags need to be created in the HMI database each with 15 and 31 tags respectively as shown in Figure 9.

Figure 9: Two and three-dimensional REAL array tags creation in HMI database. Courtesy: CDM Smith

Once the database is updated and imported into the HMI system, these array tags can be used for graphic object animation and scripting. Table 3 depicts the HMI tag structure format to be used for array tags when animating graphic objects and inside scripting interface.

Table 4: OPC server tag addressing scheme. Courtesy: CDM Smith

Any non-array tag used in the HMI system is represented as: Fix32.FIX.Real_Tag.F_CV, where “Real_Tag” is a non-array floating variable tag. But for an array tag, field name “F_CV” is replaced with “F_Indexnumber”. The “Indexnumber” is representative of the number of elements (0 to n-1) depicted in OPC server address tag within curly brackets {n}.

Scripting also uses a similar tag format, but each element in the array tag can be extracted by defining reference variables and object definitions. An example of VBA implementation of array is shown in Figure 10.

Figure 10: Illustration of VBA implementation of array tags in HMI system. Courtesy: CDM Smith

Multidimensional arrays for manipulating complex data

Spanning from one-dimensional arrays, which are simple and easy to manage, to multidimensional arrays, they serve as versatile data structures that offer efficient storage and retrieval of information to enable representation and manipulation of complex data. Additionally, arrays are fundamental to algorithms and computational methods used in various advanced analytical tools such as predictive analysis, pattern recognition, image processing and numerical simulations, demonstrating their significance beyond basic data storage.

Arrays are essential tools in engineering that can organize and manipulate data efficiently. Knowing the basic concepts of arrays, examining their structure and related operations help with understanding multidimensional arrays’ significant role in process controls systems. Actual tags and their implementation vary among different SCADA system software.

Edited by Mark T. Hoske, editor-in-chief, Control Engineering, WTWH Media, [email protected].

CONSIDER THIS

How are you analyzing large datasets?

ONLINE

For more CDM Smith information about SCADA, see:

Written by

Puja Mitra

Puja Mitra holds an MBA in marketing and human resources and a master’s degree in economics. She is a managing editor with more than 12 years of editing experience and has worked on content related to CAD, CAM, CAE, aerospace, 3D printing, BIM, manufacturing, digital transformation and computing. She has a particular interest in content development and technical writing.