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.

CASE selection OF<br />

ACTION 1:<br />

ENDACTION<br />

Status = VA_StopProject(1,VC_HANDLE)<br />

ACTION 2:<br />

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

IF AccessStatus = 0 THEN<br />

VA_Line(1,VC_HANDLE, 10,10,100,100,1)<br />

VA_Srelease(1,VC_HANDLE)<br />

ENDIF<br />

ENDACTION<br />

ACTION 3:<br />

ENDACTION<br />

ELSEACTION :<br />

ENDACTION<br />

ENDCASE<br />

ENDIF<br />

selection = 0<br />

3.3.8.33.3 Example for C Programming<br />

#include <br />

#include <br />

#include <br />

_GLOBAL UINT ready;<br />

_GLOBAL USINT Type;<br />

_GLOBAL UINT selection;<br />

_GLOBAL UDINT Status;<br />

_GLOBAL UDINT VC_HANDLE;<br />

_GLOBAL UDINT AccessStatus;<br />

_INIT void InitSp(void)<br />

{<br />

ready=0;<br />

selection=0;<br />

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

switch(selection)<br />

Status = VA_StartProject(1,VC_HANDLE)<br />

{<br />

case 1:Status=VA_StopProject(1,VC_HANDLE);break; /* Project is stopped */<br />

case 2: AccessStatus=VA_Saccess(1,VC_HANDLE);<br />

if (AccessStatus==0)<br />

{<br />

VA_Line(1,VC_HANDLE,10,10,100,100,1);<br />

VA_Srelease(1,VC_HANDLE);<br />

}<br />

break;<br />

case 3:Status=VA_StartProject(1,VC_HANDLE);break; /* Project is started */<br />

default: break;<br />

}<br />

selection = 0;<br />

}<br />

}<br />

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

168 3.3.8.33 Manual Project Control − VA_StartProject

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

Saved successfully!

Ooh no, something went wrong!