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.

VA_Srelease(1,VC_HANDLE);<br />

}<br />

}<br />

}<br />

3.3.8.12 Reading Alarm Lists − VA_GetExAlarmList<br />

Two functions can be used to read the alarm history VA_GetAlarmList and VA_GetExAlarmList. Both<br />

functions return a result string which then must be evaluated.<br />

It is important to call VA_Setup once before alarm system functions are called and to execute VA_Saccess<br />

before each use of Visapi alarm functions.<br />

3.3.8.12.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 pcAlarmLine DINT Text array to be used as the alarm line<br />

IN plLen DINT<br />

IN iFunction UINT<br />

Address of a DINT variable which contains the length of the text field.<br />

After the function is called, this variable is set to the actual length.<br />

1 ..... Read first alarm<br />

2 ..... Read next alarm<br />

4 ..... Read previous alarm<br />

8 ..... Read last alarm<br />

IN cSeperator USINT Separation character to be inserted into the alarm line<br />

IN cDateTimeFormat USINT<br />

Desired format for date and time output in the alarm list<br />

0 ... DD.MM.YY_HH:MM:SS<br />

1 ... DD.MM.YY_HH:MM:SSa<br />

2 ... HH_MM_SS<br />

3 ... HH_MM_SSa<br />

4 ... HH_MM<br />

5 ... HH_MMa<br />

6 ... NO_TIME_NO_DATE<br />

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

3.3.8.12.2 Example for Automation Basic<br />

if ready = 0 then<br />

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

VC_HANDLE if 0 then<br />

ready = 1<br />

endif<br />

else<br />

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

if Access_Status = 0 then<br />

endif<br />

endif<br />

Alarmlen = 80<br />

Seperator = ;Hyphen 45<br />

;Read Alarmtype first alarm = 1<br />

TimeDateForm ;DD.MM.YY = 0 HH.MM.SS<br />

3.3.8.12.3 Example for C Programming<br />

#include <br />

#include <br />

#include <br />

GetExAL_Status = VA_GetExAlarmList UDINT(ADR(Alarmstring)),UDINT(ADR(Alarmlen)),Alarmtype,Seperato<br />

(1,VC_HANDLE,<br />

VA_Srelease (1,VC_HANDLE)<br />

UINT _GLOBAL ready;<br />

STRING _GLOBAL pcAlarmline[80];<br />

DINT _GLOBAL lLen;<br />

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

148 3.3.8.12 Reading Alarm Lists − VA_GetExAlarmList

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

Saved successfully!

Ooh no, something went wrong!