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 />

BOOL _GLOBAL del;<br />

unsigned long VC_HANDLE;<br />

_CYCLIC void Cyclic(void)<br />

{<br />

if (!ready)<br />

{<br />

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

if (VC_HANDLE)<br />

ready = 1;<br />

}<br />

if (ready)<br />

{<br />

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

{<br />

if (del)<br />

{<br />

status = VA_DelAlarmHistory(1,VC_HANDLE);<br />

del = 0;<br />

}<br />

VA_Srelease(1,VC_HANDLE);<br />

}<br />

}<br />

}<br />

3.3.8.4 Graphics and Text Output − VA_Ellipse<br />

Draws an ellipse or circle.<br />

Note:<br />

This function is not supported on the PP41.<br />

3.3.8.4.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 x/y UINT Coordinates for the center of the ellipse<br />

IN height UINT Height of the ellipse in pixels<br />

IN width UINT Width of the ellipse in pixels<br />

IN fill UINT Ellipse fill color<br />

IN color UINT Ellipse border color<br />

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

3.3.8.4.2 Example for Automation Basic<br />

(* cyclic program *)<br />

x = 100<br />

y = 150<br />

height = 30<br />

width = 60<br />

fill = 255<br />

color = 0<br />

; Transparent<br />

; Black<br />

if ready 1 then<br />

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

if VC_HANDLE 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_Ellipse (1,VC_HANDLE,x,y,heigth,width,fill,color)<br />

endif<br />

VA_Srelease(1,VC_HANDLE)<br />

3.3.8.4 Graphics and Text Output − VA_Ellipse 139

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

Saved successfully!

Ooh no, something went wrong!