Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Some programming problems are best solved using arrays. For instance, if the application needs to manage many identical or similar devices at once, an array is the natural way to reduce programming time and complexity. Arrays can be leveraged in multiple ways in WebVisualization as well. One way is by using the multiply visu element tool. This tool takes a single element in WebVis, like a button, box or frame, and creates copies of it that can all be referenced to the same array. In this way, it is possible to create a large grid of tools referenced to an array in just a few minutes. Steps for using the tool are shown here.

  1. Create an array in a GVL. This example uses a two-dimensional array of integers, but other data types are supported as well (including structures, enumerations, unions and function blocks). The multiply visu element tool supports one-dimensional and two-dimensional arrays.

    image-20240213-220325.png
  2. Create an element in WebVis that uses the array. This example uses a simple rounded box to show the value of an integer element from the array. The %i shown in the text is a formatting string that will be replaced with the value of the integer when the application runs.

    image-20240213-220332.png
  3. Select the element created in the previous step and open its properties. Most tools have a variable associated with them. In the case of rounded boxes, this is a Text Variable field. To link the variable to an element of the array, use the array's name and replace the index fields with $FIRSTDIM$ and $SECONDDIM$. These markers are used by the multiply visu element tool to know where to insert array indices.

    image-20240213-220341.png
  4. Select the WebVis element. Then, right-click it and click multiply visu element.

    image-20240213-220435.png
  5. The dialog that appears provides the user with options for how the new elements need to be arranged and spaced. In this example, 10 pixels of horizontal and vertical offset were added to keep the screen from looking cluttered.

    image-20240213-220455.png

    The Advanced settings tab provides the user with options for skipping rows and columns (for example, to only show every third row).

    image-20240213-220505.png

    When finished selecting options, click OK.

  6. The process is complete. There should now be an array of elements on the screen. These items are not grouped and can be altered or deleted individually if needed.

    image-20240213-220524.png

    The Text Variable has been modified for each element in the array and should now be referencing an array element at a particular index.

    image-20240213-220532.png

The final result should look similar to this when viewing the WebVis application in a browser.

image-20240213-220539.png

[Quick link: PAC product page (North America)]

29APR2019 DCLIFFE

  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.