15.07.2013 Views

Automatic control function programming manual ladder language

Automatic control function programming manual ladder language

Automatic control function programming manual ladder language

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.

16.4.9 Library Functions<br />

Programming in C Language<br />

An application written in C is generated on a separate system. The NUM.OBJ <strong>function</strong> library gives access to the<br />

monitor primitives. This library is used during link editing.<br />

All these <strong>function</strong>s are prototyped in the NUM.H header file.<br />

16.4.9.1 System Functions<br />

Export an Object EXPORT<br />

Syntax<br />

symbol: Character string.<br />

symbol_addr: Symbol address.<br />

SINT32 EXPORT(SINT8 *symbol, void *symbol_addr)<br />

This <strong>function</strong> makes a C object visible to all the other modules (total visibility) or associates a <strong>function</strong> with a PLC task.<br />

Report:<br />

- 0 = OK<br />

- -1 = task already defined or too many export symbols.<br />

Example 1<br />

This export instruction associates ts01_in_C with task TS01.<br />

main()<br />

{<br />

EXPORT(«TS01»,ts01_in_C);<br />

}<br />

void ts01_in_C()<br />

{<br />

<strong>function</strong> body<br />

}<br />

Example 2<br />

This export instruction makes «table» completely visible.<br />

SINT16 table[100];<br />

main()<br />

{<br />

EXPORT(«LABEL»,table);<br />

}<br />

en-938846/7 16 - 9<br />

16

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

Saved successfully!

Ooh no, something went wrong!