Rockwell Automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User Manual User Manual

Page 75

Advertising
background image

Chapter 5

Developing Programs

5-15

Link API Functions to Programs

In C and assembler programs, ABLIB.L provides the interface (link) to the
library of control-coprocessor API functions.

In BASIC programs, AB_BAS provides the interface (link) to the library
of control-coprocessor API functions.

In C, BASIC, and assembler programs, use the CC_INIT function—use
AB_BAS(0) for BASIC programs—to initialize the control coprocessor.
The CC_INIT function must be called first and once only in every
application program that uses CC_ or DTL_ functions.

Sample C Program

The following is a C programming example. This example program uses
DTL_WRITE_W and DTL_READ_W functions to write data to a PLC-5
integer file, read the data, and display the data on the ASCII fault
display—on the optional serial expander module. The program continues
to write and read, incrementing the fault display value, while continuously
checking for errors.

Important: The CC_INIT function must be used in the following
program. Call the CC_INIT function first and once only in your program.

Advertising