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

if (ready)<br />

{<br />

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

{<br />

x_position = touch.x;<br />

}<br />

}<br />

}<br />

3.3.8.17 VA_Invblnk<br />

VA_GetTouchAction (1,VC_HANDLE, 0, &touch);<br />

VA_Srelease(1,VC_HANDLE);<br />

y_position = touch.y;<br />

touch_status = touch.status;<br />

The VA_Invblnk function is only used internally.<br />

3.3.8.18 Graphics and Text Output − VA_Line<br />

Drawing a line takes place with the VA_Line command.<br />

3.3.8.18.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 edge of the line<br />

IN x2/y2 UINT Coordinates of the lower right edge of the line<br />

IN color UINT Color of the line<br />

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

3.3.8.18.2 Example for Automation Basic<br />

(* cyclic program *)<br />

x1 = 100<br />

y1 = 150<br />

x2 = 300<br />

y2 = 350<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_Line (1,VC_HANDLE,x1,y1,x2,y2,color)<br />

endif<br />

endif<br />

VA_Srelease(1,VC_HANDLE)<br />

3.3.8.18.3 Example for C Programming<br />

#include <br />

#include <br />

#include <br />

UINT _GLOBAL ready;<br />

UINT _GLOBAL x1;<br />

UINT _GLOBAL x2;<br />

UINT _GLOBAL y1;<br />

UINT _GLOBAL y2;<br />

3.3.8.17 VA_Invblnk 153

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

Saved successfully!

Ooh no, something went wrong!