Function block
FB_Pixel_LED
 Fig.157: FB_Pixel_LED
Fig.157: FB_Pixel_LEDInputs
| Name | Type | Description | 
|---|---|---|
| tTimeout | TIME | Timout for the transmission process to the terminal | 
| bShow | BOOL | Rising edge starts the transmission and display of data | 
Outputs
| Name | Type | Description | 
|---|---|---|
| bBusy | BOOL | Is TRUE if the FB transmits data to the terminal. Data cannot be changed during this time | 
Definition of constants
The following constants must be defined in the function block before the program is started:
 Fig.158: Definition of constants
Fig.158: Definition of constants| Name | Type | Description | 
|---|---|---|
| nWidth | INT | Width of the entire matrix | 
| nHeigth | INT | Height of the entire matrix | 
| XTiles | INT | Number of individual matrices in X direction (width) | 
| YTiles | INT | Number of individual matrices in Y-direction (height) | 
| bMatrixSerpentineLayout | INT(0..1) | Layout type (see M_CursorToIndex) | 
| bMatrixVertical | INT(0..1) | Layout of the LED lines is vertical (see M_CursorToIndex) | 
| nNumberofChannels | INT | Number of EL2574 channels used | 
Methods
• M_ClearAll
This method can be used to set all elements of the array to the value 0.
• M_Clear
This method can be used to set all elements of the array in a given rectangle to the value 0.
 Fig.159: M_Clear
Fig.159: M_ClearInputs
| Name | Type | Description | 
|---|---|---|
| nX1 | INT | Start position of the pixels to be deleted in X direction | 
| nY1 | INT | Start position of the pixels to be deleted in Y direction | 
| nX2 | INT | End position of the pixels to be deleted in X direction | 
| nY2 | INT | End position of the pixels to be deleted in Y direction | 
• M_DrawImage
This method can be used to display an image statically on a matrix.
 Fig.160: M_DrawImage
Fig.160: M_DrawImageInputs
| Name | Type | Description | 
|---|---|---|
| nXPosition | INT | Start position for displaying the image in X direction | 
| nYPosition | INT | Start position for displaying the image in Y direction | 
| pImageArray | POINTER TO ARRAY [0..0] OF DWORD | Pointer to the array containing the image data | 
| pImageWidth | POINTER TO INT | Pointer to the width of the image | 
| pImageHeight | POINTER TO INT | Pointer to the height of the image | 
The supplied HTML page ImageConverter.html (see chapter "ImageConverter.html") can be used to display images. The image uploaded there should not exceed the resolution of the pixel matrix; smaller images can be used without restriction. After uploading an image file, the web page will download a text file. This file contains PLC variable definitions that must be included in the PLC project. This can be done, for example, by copying the content into a GVL. The "M_DrawImage" method can be used to display the image on the matrix by assigning the addresses of the copied variables to the input pointers of the method.
• M_DrawText
This method can be used to display a string statically on a matrix.
 Fig.161: M_DrawText
Fig.161: M_DrawTextInputs
| Name | Type | Description | 
|---|---|---|
| nXPosition | INT | Start position for displaying the text in X direction | 
| nYPosition | INT | Start position for displaying the text in Y direction | 
| nColor | DWORD | Text color (0xWWBBGGRR) | 
| sText | STRING | Display text | 
A basic font is stored in the declaration section of the constants in the function block. To use a different font and / or font size, the supplied HTML page FontConverter.html (see chapter "FontConverter.html") can be used.
 Fig.162: PLC variable definitions
Fig.162: PLC variable definitions• M_ScrollText
This method can be used to display a string from right to left on a matrix.
 Fig.163: M_ScrollText
Fig.163: M_ScrollTextInputs
| Name | Type | Description | 
|---|---|---|
| nXPosition | INT | Start position for displaying the text in X direction | 
| nYPosition | INT | Start position for displaying the text in Y direction | 
| nXEndPosition | INT | End position to display the text in X direction Note: If nXEndPosition = -1, the text is output from the start position across the entire width of the matrix | 
| nScrollPosition | POINTER TO INT | Pointer to auxiliary variable to track the scroll position (an auxiliary variable is required for each text) | 
| nColor | DWORD | Text color (0xWWBBGGRR) | 
| sText | STRING | Display text | 
A basic font is stored in the declaration section of the constants in the function block. To use a different font and / or font size, the supplied HTML page FontConverter.html (see section 6.3.2) can be used.
• M_RotateAll
This method rotates the entire content of the matrix in a given direction.
 Fig.164: M_RotateAll
Fig.164: M_RotateAllInputs
| Name | Type | Description | 
|---|---|---|
| nDirection | INT(0…3) | Direction preset 0: Left, 1: Right, 2: Up, 3: Down | 
• M_Rotate
This method rotates the contents of the matrix in a given rectangle in a given direction.
 Fig.165: M_Rotate
Fig.165: M_RotateInputs
| Name | Type | Description | 
|---|---|---|
| nDirection | INT(0…3) | Direction preset 0: Left, 1: Right, 2: Up, 3: Down | 
| nX1 | INT | Start position of the pixels to be rotated in X direction | 
| nY1 | INT | Start position of the pixels to be rotated in Y direction | 
| nX2 | INT | End position of the pixels to be rotated in X direction Note: If nX2 = -1, the entire matrix width is rotated from nX1 | 
| nY2 | INT | End position of the pixels to be rotated in Y direction Note: If nY2 = -1, the entire matrix height is rotated from nY1 | 
• M_SetPixel
This method allows individual pixels to be switched on in a specific color.
 Fig.166: M_SetPixel
Fig.166: M_SetPixelInputs
| Name | Type | Description | 
|---|---|---|
| nXPosition | INT | Pixel position in X direction | 
| nYPosition | INT | Pixel position in Y direction | 
| nColor | DWORD | Color of the pixel (0xWWBBGGRR) | 
• M_GetPixel
This method reads the color of a pixel at a specified position from the buffer.
 Fig.167: M_GetPixel
Fig.167: M_GetPixelInputs
| Name | Type | Description | 
|---|---|---|
| nXPosition | INT | Pixel position in X direction | 
| nYPosition | INT | Pixel position in Y direction | 
| nColor | DWORD | Color of the pixel (0xWWBBGGRR) | 
Outputs
| Name | Type | Description | 
|---|---|---|
| M_GetPixel | DWORD | Color of the pixel (0xWWBBGGRR) |