Using Image Pools

An image pool is a table of image files. CODESYS references image files for use in the project (for example, in a visualization) uniquely by the ID and name of the image pool. A project can include several image pools. You can create Image pools in the device tree below the application or in the POU pool. In a library project, you can use the object properties of an image pool to turn it into a symbol library for the visualization.

Note

We recommend that you reduce the size of image files as much as possible integrating them. This will optimize the loading time of the visualization in every visualization type: TargetVisu, WebVisu and development system.

If you insert an image element into a visualization and enter an ID (Static ID) in the element properties, then CODESYS automatically creates a global image pool. CODESYS uses the default name GlobalImagePool for this.

Please note the following when the ID of an image file appears in several image pools.

  • Search order: If you selected an image managed in GlobalImagePool, then you do not have to enter the name of the image pool. The search order for image files is as follows:
    • 1. GlobalImagePool
    • 2. Image pools assigned to the currently active application
    • 3. Image pools next to the GlobalImagePool in the POU window
    • 4. Image pools in libraries
  • Unique access: You can reference a selected image directly and uniquely by appending the image ID to the name of the image pool in the following syntax “<pool name>.<image ID>.

See also

Creating image pools

  1. Select the Application object in the device tree.

    Click Project ‣ Add Object ‣ Image Pool.

    The Add Image Pool dialog box opens.

  2. Type a name for the image pool (for example, “Images1”) and click Add.

    The image pool is added to the device tree.

  3. Select the image pool object and open by choosing the command Project ‣ Edit Object.

  4. Double-click the field in the ID column and assign an appropriate ID (for example, “Icon1”).

    You can also add new images to the list by clicking Imagepool ‣ Add Image File.

  5. Double-click the field in the File name column. Click for more settings ( 9278c6e43f083f90c0a8640e01033ce4_5a931ddb1e8e78d6c0a8640e01947982 ).

    The Select Image dialog box opens.

  6. Click for more settings ( 9278c6e43f083f90c0a8640e01033ce4_5a931ddb1e8e78d6c0a8640e01947982 ) and select the image file.

    A thumbnail of the image file is displayed in the field of the column Image. The name of the file is displayed in the field of the column File name.

The image file can be references only by the name Images1.Icon1.

See also

Using image files in the ‘Image’ visualization element

When you insert an image element into a visualization, you can define the image type.

  • Static image: Enter the image ID of the image file or the name of the image pool plus the image ID into the element configuration (property Static ID). Please note the comments for the search order and access.
  • Dynamic image: Type the variable for defining the image file ID (for example, PLC_PRG.imagevar) in the element configuration (Bitmap ID variable property). You can exchange a dynamic element in online mode depending on a variable.

See also

Using image files for the visualization background

You can set an image in the background definition of a visualization. You can define the image by the name of the image pool plus the filename, as described above for a visualization element.

See also

  • Command ‘Background’: visu_cmd_background