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.

3.3.8.8.2 Example for Automation Basic<br />

(* cyclic program *)<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_GetAlCurPos(1,VC_HANDLE,<br />

adr(Groupnumber),adr(Alarmnumber))<br />

VA_Srelease(1,VC_HANDLE)<br />

endif<br />

endif<br />

3.3.8.8.3 Example for C Programming<br />

#include <br />

#include <br />

#include <br />

UINT _GLOBAL ready;<br />

DINT _GLOBAL Groupnumber;<br />

DINT _GLOBAL Alarmnumber;<br />

unsigned long VC_HANDLE;<br />

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

1,VC_HANDLE, VA_GetAlCurPos(<br />

(DINT) &Groupnumber, (DINT) &Alarmnumber);<br />

VA_Srelease (1,VC_HANDLE);<br />

}<br />

}<br />

}<br />

3.3.8.9 Touch Screen Calibration − VA_GetCalStatus<br />

VA_GetCalStatus can be used to inquire whether calibration already took place with the VA_StartTouchCal<br />

function and whether it was completed successfully.<br />

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

OUT Return Value UINT<br />

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

0 ................. Touch screen was successfully calibrated<br />

0xFFFF ......... A general error occurred<br />

All others ...... Calibration still active.<br />

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

144 3.3.8.8 Alarm Information at the Cursor Position − VA_GetAlCurPos

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

Saved successfully!

Ooh no, something went wrong!