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

}<br />

{<br />

}<br />

Contrast 1,VC_HANDLE); = VA_GetContrast(<br />

VA_Srelease(1,VC_HANDLE);<br />

3.3.8.11 Reading Display Information − VA_GetDisplayInfo<br />

This function can be used to query information such as: max. X pixel, max. Y pixel, and the number of bits per<br />

pixel.<br />

Note:<br />

This function can only be used on IPCs and is not supported on SG3 targets.<br />

3.3.8.11.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 InfoType UDINT<br />

Index of the value to be queried<br />

1 − Number of pixels in the X direction<br />

2 − Number of pixels in the Y direction<br />

3 − Number of bits per pixel<br />

IN Value UDINT Return value of the queried info type<br />

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

endif<br />

VA_GetDisplayInfo (1,VC_HANDLE,InfoType,<br />

UDINT(adr(Value)))<br />

VA_Srelease(1,VC_HANDLE)<br />

endif<br />

3.3.8.11.3 Example for C Programming<br />

#include <br />

#include <br />

#include <br />

UINT _GLOBAL ready;<br />

UDINT _GLOBAL InfoType;<br />

UDINT _GLOBAL Value<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 />

VA_GetDisplayInfo(1,VC_HANDLE,InfoType,&Value<br />

);<br />

3.3.8.11 Reading Display Information − VA_GetDisplayInfo 147

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

Saved successfully!

Ooh no, something went wrong!