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.

}<br />

}<br />

}<br />

3.3.8.28 Requirements and Initialization − VA_Setup<br />

Sets up a connection to Runtime. Runtime, including all drivers, must be on the target system, and the panel<br />

project must have been started already.<br />

If the function is successful, then a handle is returned. This handle must be transferred when any other VISAPI<br />

functions are used.<br />

If VA_Setup fails (returns 0), then the function must be called cyclically until a valid handle is returned.<br />

3.3.8.28.1 Parameter<br />

I/O Parameter Type Meaning<br />

IN enable BOOL This function is only executed if enable is TRUE.<br />

IN interpreter STRING[80]<br />

OUT Return<br />

Value<br />

UDINT<br />

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

('Visu' is the name of the panel object)<br />

3.3.8.28.3 Example for C Programming<br />

#include <br />

#include <br />

#include <br />

UINT _GLOBAL ready;<br />

unsigned long VC_HANDLE;<br />

_CYCLIC void Cyclic(void)<br />

{<br />

if (!ready)<br />

{<br />

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

if (VC_HANDLE)<br />

ready = 1;<br />

}<br />

The name of the project runnning must be specified here.<br />

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

The handle which must be specified for all further VISAPI functions.<br />

0 is returned if an error occurs.<br />

164 3.3.8.28 Requirements and Initialization − VA_Setup

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

Saved successfully!

Ooh no, something went wrong!