Pixel Map

This function block assigns a LONG-Matrix to a Pixel Map HMI object. The 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 read from the HMI object. Otherwise, the display remains unchanged. If no matrix is applied or the input bUpdate was not yet set HIGH, 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 indices or RGB or BGR colors. The display of the matrix is aligned to the top left corner of the object.

The width and the height of the 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.

Parameter

The mask designer is called as the parameter dialog via the context menu of the block. An HMI object of the type "Pixel Map" is assigned to the block by creating or selecting it. With the checkbox in the lower left corner you can switch between global and instanceable assignment.

Default settings for the HMI object are made in the corresponding dialog, which appears after "Additional settings …". The background color of the object is configured here. Furthermore, the interpretation of the LONG-matrix-values is selected. Palette indices (0-255) or RGB or BGR values can be choose.

At BGR values the blue 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 red part. RGB values are reverse encoded. At 8-bit color depth, the closest palette color is determined and displayed for BGR and RGB values. At 24-bit color depth, all colors can be displayed.

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 assignment of the HMI object is displayed in the block by the color of the text boxes. A yellowish background indicates a global assignment. If the assignment is instanceable, the background is white. And at missing or incorrect assignment it is red.

Comment

At 8-bit color depth, the values have to be converted into palette colors before displaying the LONG matrix. Therefore, to display BGR or RGB values a considerable higher computational effort is required.

In general, the computational cost of the pixel map HMI object is quite high, so the update should be called only if it is really necessary.