Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

WinFile

  • Last UpdatedFeb 02, 2024
  • 3 minute read

Writes the graphics image of the active window to a file. The file is saved in the Plant SCADA compressed .bmp format.

This function is a blocking function. It blocks the calling Cicode task until the operation is complete.

Note:
• This function might not work as expected if called directly from the Kernel; instead, this function should be called from a graphics page.
• This function is not supported in the server process in a multiprocessor environment. Calling this function from the server process results in a hardware alarm being raised.

Syntax

WinFile(sFile [, xScale] [, yScale] [, bSwapBlackWhite] [, sMap] )

sFile:

The name of the file to be created. If no path information is specified, the function will try to create the file in the bin directory (the current directory of the runtime process). Write permission is required.

Path operators such as [data] and [run] are also supported. For example to save the file in the [data] directory, you can specify:

[data]:screendump.bmp

The specified path needs to point to a writable folder.

xScale:

The x scaling factor for the item being printed. This argument is optional, as a default setting of 1 is used to maintain the horizontal scaling of the image. The outcome is proportional to 1; for example, 0.5 halves the width of the image .

yScale:

The y scaling factor for the item being printed. This argument is optional, as a default setting of 1 is used to maintain the current vertical scaling of the image. The outcome is proportional to 1; for example, 0.5 halves the height of the image.

bSwapBlackWhite:

Swaps the colors black and white for the purpose of printing pages with a lot of black content. Use the default value of 1 to swap black and white (optional).

sMap:

The file name or path of a text based map file used to specify colors to swap when printing. By default Plant SCADAwill look in the bin directory for the map file. The format for the map file is:

RRR GGG BBB RRR GGG BBB [HHH] [SSS] [LLL]//
RRR GGG BBB RRR GGG BBB [HHH] [SSS] [LLL]//

Where:

RRR is a decimal red intensity value between 000 and 255.

GGG is a decimal green intensity value between 000 to 255.

BBB is a decimal blue intensity value between 000 to 255.

HHH, SSS and LLL are optional tolerance values to enable swapping a range of colors. Default values are shown below.

HHH is a decimal value representing the Hue tolerance. Valid range is 0 to 360. Default = 0.

SSS is a decimal value representing the Saturation tolerance. Valid range is 0 to 255. Default = 2 * Hue tolerance.

LLL is a decimal value representing the Luminance tolerance. Valid range is 0 to 255. Default = 2 * Hue tolerance.

Leading zeros are not required, however they aid readability.

The first three RGB values specify the FROM color, and the second three RGB values specify the TO color. The tolerance values are applied to the FROM color when replacing individual pixels in the image.

Comments may be placed at the end of each line, or on individual lines, and needs to be proceeded with // or !.

Example map file:

043 043 255 155 205 255 025 000 025
//Change dark blue to light blue using Hue and Luminance tolerance of 25.
000 000 000 255 255 255 //Swap black to white with no tolerance

Note: If swap color ranges overlap, the behavior is undefined. This means a color that falls in both ranges may end up as either color.

Return Value

0 (zero) if successful, otherwise an error code is returned.

WinPrint

Example

WinFile("DUMP");

/* Writes the active window to a file named DUMP in the current
directory. */

See Also

Window Functions

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in