Pixel Map

This function block assigns a LONG Matrix to a Pixel Map HMI object. The HMI object interprets the LONG values as colors of the pixels and draws the matrix.

The input bShow is used to show or hide the HMI object. If the signal at the input bUpdate is HIGH, the Matrix on the input MX is transferred to the HMI object. Otherwise, the display remains unchanged. If no matrix is applied or the input bUpdate was not set HIGH yet, the field is displayed with the background color.

HMI object

The HMI object displays the given LONG matrix. Each cell is assigned exactly one pixel. The values are interpreted as palette colors or RGB colors. The display of the matrix is aligned to the top left corner of the HMI object.

The width and the height of the HMI object determine the maximum visible size of the matrix. At smaller matrices the rest is filled with the background color. Larger matrices will be cut at the edges of the object.

Parameters

In the parameter dialog a HMI object of the type “Pixel Map” is assigned to the function block.

Using the context menu of the function block, the mask designer is opened as parameter dialog. The mask designer is used to assign the HMI object. And the preferences of the HMI object can be set as well.

The background color of the object can be configured in the parameter dialog. Furthermore, it is possible to switch between RGB values (checked) and palette colors (unchecked).

At RGB values the red part is encoded in the least significant byte of the LONG. The following byte contains the green part. And the third byte is for the blue part. The palette colors can be most easily accessed with help of the HMI parameter blocks.

Signals

Name I/O Type(s) Function
MX I LONG Input matrix with the color values
bShow I BIT Show/hide object
bUpdate I BIT Update the display

Note: If inputs are not connected the object appears with the corresponding default parameters. Otherwise the input signals from the function block overwrite the according settings from the parameter dialog.

Visualization

The colored highlight in the function block indicates, whether a HMI object is assigned or not.

Comments

Before displaying the LONG matrix the values have to be converted into palette colors. Therefore, to display RGB values (see parameter dialog) a considerable higher computational cost is required.

Generally the computational cost of the pixel map function block is quite high, so make sure while programming to update only if it is really necessary.