Applies To:
  • CitectSCADA 6.10 Service Pack A
  • CitectHMI 6.10 Service Pack A

Summary:
Using CitectSCADA 6.10 Service pack A, the WinPrint() cicode command gives Compile error "Invalid argument error", although it is used as documented in the Help for Citect SCADA. This issue doesn't occur when you use the first three or four arguments as mentioned in the Help.
 

Solution:
The reason for the above error is that the number of arguments in the WinPrint() function has been changed and this has not been updated in the Help file. The previous arguments used in Citect SCADA version 6.0 and 6.1 are

WinPrint(sPort, xScale, yScale, bSwapBlackWhite, fromColour, toColour)

With CitectSCADA Version 6.1 SPK A the arguments fromColour and toColour have been replaced with sMap . Therefore arguments for the WinPrint function in CitectSCADA 6.10 Service Pack A are as follows:

WinPrint(sPort, xScale, yScale, bSwapBlackWhite, sMap)

sMap is the Map file name which describes the details of the colours that need to be swapped. By default Citect will look in the BIN directory for the map file. You can also create it in any other folder and specify the path with the file name. The format for the map file (which is a text file) is as follows:

<Line 1:> RRR GGG BBB RRR GGG BBB [HHH] [SSS] [LLL] //comment
<Line 2:> RRR GGG BBB RRR GGG BBB [HHH] [SSS] [LLL] //comment

Where:
RRR is a decimal red intensity value between 000 and 255.
GGG is a decimal green intensity value between 000 and 255.
BBB is a decimal blue intensity value between 000 and 255.
HHH SSS and LLL are optional tolerance values to enable swapping a range of colors.
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.
LLL is a decimal value representing the Luminance tolerance. Valid range is 0 to 255. Default = 2.
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.

Example:

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.

 

Keywords:
winprint, compile error, Invalid argument error  

Attachments