23.11.2012 Views

2 Visual Components Manuals

2 Visual Components Manuals

2 Visual Components Manuals

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Introduction to <strong>Visual</strong> <strong>Components</strong> 2.3<br />

{<br />

if (!ready)<br />

{<br />

VC_HANDLE = VA_Setup(1 "vga"); ,<br />

if (VC_HANDLE)<br />

ready = 1;<br />

}<br />

if (ready)<br />

{<br />

if (!VA_Saccess(1,VC_HANDLE))<br />

{<br />

1, VC_HANDLE, VA_QuitAlarms(<br />

Groupnumber);<br />

VA_Srelease (1,VC_HANDLE);<br />

}<br />

}<br />

}<br />

3.3.8.20 Graphics and Text Output − VA_Rect<br />

A rectangle is drawn with the VA_Rect command.<br />

3.3.8.20.1 Parameter<br />

I/O Parameter Type Meaning<br />

IN enable BOOL This function is only executed if enable is TRUE.<br />

IN VCHandle UDINT The handle returned by VA_Setup<br />

IN x1/y1 UINT Coordinates of the upper left corner of the rectangle<br />

IN width/height UINT Width and height of the rectangle<br />

IN fill UINT Filling color of the rectangle<br />

IN color UINT Border color of the rectangle<br />

OUT Return Value UINT Not equal to 0 if error occurs<br />

VGA:<br />

If fill == 255, then an empty rectangle is drawn. Otherwise, it is filled with the color in fill.<br />

PP41:<br />

If fill == 0, then an empty rectangle is drawn. Otherwise, it is filled with the color in fill.<br />

On the PP41, a rectangle can be deleted by setting color and fill to 0.<br />

3.3.8.20.2<br />

Example for Automation Basic<br />

(* cyclic program *)<br />

x1 = 100<br />

y1 = 150<br />

x2 = 250<br />

y2 = 150<br />

fill = 255 ; Transparent<br />

color = 0 ; Black<br />

if ready 1 then<br />

VC_HANDLE = VA_Setup(1 "vga") ,<br />

VC_HANDLE if 0 then<br />

ready = 1<br />

endif<br />

endif<br />

if ready = 1 then<br />

VA_Saccess(1,VC_HANDLE)= if<br />

0 then<br />

VA_Rect (1,VC_HANDLE,x1,y1,x2,y2,fill,color)<br />

VA_Srelease(1,VC_HANDLE)<br />

endif<br />

endif<br />

3.3.8.20 Graphics and Text Output − VA_Rect 155

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!