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.

}<br />

3.3.8.24 Disable − enable backlight − VA_SetBacklight<br />

The backlight can be enable and disable by the function VA_SetBacklight.<br />

3.3.8.24.1 Parameter<br />

I/O Parameter Type Bedeutung<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 blnState BOOL<br />

Disable − enable backlight<br />

000disable<br />

10 enabel<br />

OUT Rückgabewert UINT Not equal to 0 if error occursl<br />

3.3.8.24.2 Example for Automation Basic<br />

(* cyclic program *)<br />

if ready 1 then<br />

VC_HANDLE = VA_Setup(1,"visu")<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_SetBacklight(1,VC_HANDLE,blnState)<br />

VA_Srelease(1,VC_HANDLE)<br />

endif<br />

endif<br />

3.3.8.24.3 Example for C Programming<br />

#include <br />

#include <br />

#include <br />

UINT _GLOBAL ready;<br />

BOOL _GLOBAL blnState;<br />

unsigned long VC_HANDLE;<br />

_CYCLIC void Zyklisch(void)<br />

{<br />

if (!ready)<br />

{<br />

VC_HANDLE = VA_Setup(1 "visu"); ,<br />

if (VC_HANDLE)<br />

ready = 1;<br />

}<br />

if (ready)<br />

{<br />

if (!VA_Saccess(1,VC_HANDLE))<br />

{<br />

Backlight(1,VC_HANDLE,blnState);<br />

VA_Set<br />

VA_Srelease(1,VC_HANDLE);<br />

}<br />

}<br />

}<br />

3.3.8.25 Setting Contrast and Brightness − VA_SetBrightness<br />

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

The brightness of a PP can be set with the VA_SetBrightness function. This function is available on TFT and<br />

LCD displays.<br />

160 3.3.8.24 Disable − enable backlight − VA_SetBacklight

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

Saved successfully!

Ooh no, something went wrong!