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.14.2 Example for Automation Basic<br />

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

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

color = VA_GetPaletteColor(1,VC_HANDLE,0)<br />

VA_Srelease(1,VC_HANDLE)<br />

endif<br />

endif<br />

3.3.8.14.3 Example for C Programming<br />

#include <br />

#include <br />

#include <br />

UINT _GLOBAL ready;<br />

UINT _GLOBAL fill;<br />

UDINT _GLOBAL color;<br />

unsigned long VC_HANDLE;<br />

_CYCLIC void Cyclic(void)<br />

{<br />

color /* = Black 0; */<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 />

color = VA_GetPaletteColor(1,VC_HANDLE,0);<br />

VA_Srelease(1,VC_HANDLE);<br />

}<br />

}<br />

}<br />

3.3.8.15 Graphics and Text Output − VA_GetTextByTextGroup<br />

An individual line can be read from text groups with the VA_GetTextByTextGroup command.<br />

3.3.8.15.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 TG_id USINT ID number of the text group to be read.<br />

IN TGT_id USINT ID number of the line to be read in the text group.<br />

IN pcText UDINT Text which is read (STRING)<br />

IN pcTextlength UDINT Length of the STRING to be read<br />

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

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

150 3.3.8.14 Querying the Palette Color − VA_GetPaletteColor

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

Saved successfully!

Ooh no, something went wrong!