C example, Basic example, References – Rockwell Automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User Manual User Manual

Page 153

Advertising
background image

API Library of Routines

Appendix B

CC_ERRSTR

B-22

C Example

unsigned status, mach1, iostat;

unsigned short part1;

char err_txt[80];

.

.

.

status = DTL_READ_W (mach1, &part1, &iostat);

if (status != DTL_SUCCESS || iostat != DTL_SUCCESS)

{

CC_ERRSTR (status, err_text);

printf (“Read error %d: %s\n”, status, err_text);

CC_ERRSTR (iostat, err_text);

printf (“I/O status %d: %s\n”, iostat, err_text);

}

else

printf (“Read: SUCCESS!\n”);

BASIC Example

The BASIC function code is 101.

DIM buffer : STRING[81]

DIM status : INTEGER

DIM iostat : INTEGER

.

.

.

rem * CC_ERRSTR - Get the string for the iostat value - display on terminal

RUN AB_BAS (101,status,iostat,ADDR(buffer))

print buffer

.

.

.

References

CC_ERROR();

Advertising