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.

UINT _GLOBAL ready;<br />

unsigned long VC_HANDLE;<br />

UINT _GLOBAL x;<br />

UINT _GLOBAL y;<br />

UINT _GLOBAL index;<br />

_CYCLIC void Cyclic (void)<br />

{<br />

x = 150;<br />

y = 100;<br />

index = 1;<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_DrawBitmap (1,VC_HANDLE,index,x,y);<br />

VA_Srelease(1,VC_HANDLE);<br />

}<br />

}<br />

}<br />

3.3.8.3 Deleting the Alarm History − VA_DelAlarmHistory<br />

The VA_DelAlarmHistory function deletes both the data object alarm as<br />

well as all alarms in the runtime history.<br />

3.3.8.3.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 Not equal to 0 if error occurs<br />

3.3.8.3.2 Example for Automation Basic<br />

(* cyclic program *)<br />

if ready 1 then<br />

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

if del = 1 then<br />

status = VA_DelAlarmHistory(1,VC_HANDLE)<br />

del = 0;<br />

endif<br />

VA_Srelease(1,VC_HANDLE)<br />

endif<br />

endif<br />

3.3.8.3.3 Example for C Programming<br />

#include <br />

#include <br />

#include <br />

UINT _GLOBAL ready;<br />

UINT _GLOBAL status;<br />

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

138 3.3.8.3 Deleting the Alarm History − VA_DelAlarmHistory

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

Saved successfully!

Ooh no, something went wrong!