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

3.3.8.34 Touch Screen Calibration − VA_StartTouchCal<br />

The VA_StartTouchCal function provides touch calibration since different tolerances arise when touch screens<br />

are manufactured.<br />

3.3.8.34.1 Operation<br />

Touch the crosses in the order that they appear on the screen.<br />

This function only needs to be called once.<br />

The status can also be queried with the VA_GetCalStatus function.<br />

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

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

3.3.8.34.3 Example for Automation Basic<br />

(* cyclic program *)<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 />

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

VA_StartTouchCal (1,VC_HANDLE)<br />

VA_Srelease(1,VC_HANDLE)<br />

endif<br />

endif<br />

3.3.8.34.4 Example for C Programming<br />

#include <br />

#include <br />

#include <br />

UINT _GLOBAL ready;<br />

unsigned long VC_HANDLE;<br />

_CYCLIC void Initialization (void)<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 />

VA_StartTouchCal (1,VC_HANDLE);<br />

VA_Srelease(1,VC_HANDLE);<br />

}<br />

}<br />

}<br />

3.3.8.35 Manual Project Control − VA_StopProject<br />

A project can be halted with the VA_StopProject function. This seldom needs to be done unless parameters<br />

need to be changed for used drivers with the VA_SetUserParam function, for example.<br />

3.3.8.34 Touch Screen Calibration − VA_StartTouchCal 169

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

Saved successfully!

Ooh no, something went wrong!