23.11.2012 Views

2 Visual Components Manuals

2 Visual Components Manuals

2 Visual Components Manuals

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

UINT _GLOBAL iFunction;<br />

USINT _GLOBAL cSeperator;<br />

USINT _GLOBAL cDateTimeFormat;<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 />

lLen = 80;<br />

cSeperator = ' ';<br />

cDateTimeFormat = 0;<br />

iFunction = 1;<br />

}<br />

}<br />

}<br />

1,VC_HANDLE, VA_GetExAlarmList(<br />

(DINT) pcAlarmline, (DINT) &lLen, iFunction, cSeperator, cDateTimeFormat);<br />

VA_Srelease(1,VC_HANDLE);<br />

3.3.8.13 Reading the Key Matrix − VA_GetKeyMatrix<br />

The VA_GetKeyMatrix function returns information about whether and which keys on a target system are<br />

currently being pressed.<br />

3.3.8.13.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 KeyMatrix UDINT Start address of the key address array<br />

IN KeysToRead UDINT Number of keys to be read<br />

IN KeysRead UDINT Number of keys read<br />

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

3.3.8.13.2 Example for C Programming<br />

See also Reading the Matrix<br />

3.3.8.14 Querying the Palette Color − VA_GetPaletteColor<br />

Using VA_GetPaletteColor, it is possible to dynamically query each individual color value. Naturally, this is only<br />

possible on an IPC (color or black/white display).<br />

3.3.8.14.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 index UINT Index of the color which should be retrieved (0−255).<br />

OUT Return Value UDINT<br />

Color. The color value is arranged as follows:<br />

Bits 0 .. 8 Red value (0−255)<br />

Bits 8 .. 16 Green value (0−255)<br />

Bits 16 .. 24 Blue value (0−255)<br />

Bits 24 .. 32 0<br />

3.3.8.13 Reading the Key Matrix − VA_GetKeyMatrix 149

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

Saved successfully!

Ooh no, something went wrong!