ProSoft Technology MVI69-ADM User Manual

Page 307

Advertising
background image

MVI-ADM ♦ 'C' Programmable

Side-Connect API Library Functions

'C' Programmable Application Development Module

Developer's Guide

ProSoft Technology, Inc.

Page 307 of 342

February 20, 2013

Data Type Definition

Value

Description

MVISC_PLCTYPE_A

14

ASCII Display

MVISC_PLCTYPE_D

15

BCD Display

MVISC_PLCTYPE_NOEXIST

9998

File does not exist

MVISC_PLCTYPE_UNKNOWN

9999

Unknown data type

Return Value

MVISC_SUCCESS

No errors were encountered

MVISC_ERR_NOACCESS

handle does not have access

MVISC_ERR_PLCTIMEOUT

PLC-5 did not respond

MVISC_ERR_PCCCFAIL

PCCC error occurred

Example

HANDLE Handle;
MVISCFILEINFO fileinfo;
int rc;
/* Query the PLC to check file number 7. In this example, */
/* file 7 is expected to be an Integer file. If it is not, */
/* a configuration error message is displayed. */
rc = MVIsc_GetPLCFileInfo(Handle, 7, &fileinfo);
if (rc != MVISC_SUCCESS)
printf("ERROR: MVIsc_GetPLCFileInfo failed");
if (fileinfo.filetype != MVISC_PLCTYPE_N)
printf("Configuration Error: File 7 is not Integer or does not exist");
else
printf("File Size is %d elements and %ld words",
fileinfo.num_elements, fileinfo.num_words);

Advertising