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

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

3.3.8.7.2 Example for Automation Basic<br />

if ready = 0 then<br />

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

if VC_HANDLE 0 then<br />

ready = 1<br />

endif<br />

else<br />

Access_Status = VA_Saccess (1,VC_HANDLE)<br />

if Access_Status = 0 then<br />

;Alarm Alarmlen string = 80 length<br />

Alarmtype = 1 ;Read first alarm<br />

endif<br />

endif<br />

3.3.8.7.3 Example for C Programming<br />

#include <br />

#include <br />

#include <br />

GetAL_Status = VA_GetAlarmList UDINT(ADR(Alarmstring)),UDINT(ADR(Alarmlen)),Alarmtype)<br />

(1,VC_HANDLE,<br />

VA_Srelease (1,VC_HANDLE)<br />

UINT _GLOBAL ready;<br />

STRING _GLOBAL pcAlarmline[80];<br />

DINT _GLOBAL lLen;<br />

UINT _GLOBAL iFunction;<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 />

iFunction = 1;<br />

VA_GetAlarmList(<br />

1,VC_HANDLE, (DINT) pcAlarmline, (DINT) &lLen,iFunction);<br />

VA_Srelease(1,VC_HANDLE);<br />

}<br />

}<br />

}<br />

3.3.8.8 Alarm Information at the Cursor Position − VA_GetAlCurPos<br />

The VA_GetAlCurPos ascertains the group and alarm numbers of an alarm entry at the current cursor position<br />

in an alarm list.<br />

3.3.8.8.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 pGroupNumber USINT Group number of the alarm entry at the current cursor position.<br />

IN pAlarmNumber USINT Alarm number of the alarm entry at the current cursor position.<br />

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

3.3.8.7 Reading Alarm Lists − VA_GetAlarmList 143

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

Saved successfully!

Ooh no, something went wrong!