Side-connect api block transfer functions – ProSoft Technology MVI69-ADM User Manual

Page 318

Advertising
background image

Side-Connect API Library Functions

MVI-ADM ♦ 'C' Programmable

Developer's Guide

'C' Programmable Application Development Module

Page 318 of 342

ProSoft Technology, Inc.

February 20, 2013

11.7 Side-connect API Block Transfer Functions

MVIsc_PLCBTRead

Syntax

int MVIsc_PLCBTRead(HANDLE handle, WORD *buf, BYTE rack, BYTE group, BYTE slot,
BYTE size );

Parameters

handle

Handle returned by previous call to MVIsc_Open

buf

Pointer to buffer to receive data from I/O module

rack

Rack number of the I/O module to be read

group

I/O group number of the I/O module

slot

Slot number within the I/O group

size

Number of words to read

Description
MVIsc_PLCBTRead requests the PLC-5 to perform a block transfer read from an
intelligent I/O module.

handle must be a valid handle returned from MVIsc_Open.

buf must point to a buffer of at least size words in size.

Return Value

MVISC_SUCCESS

The block transfer was completed successfully.

MVISC_ERR_NOACCESS

handle does not have access

MVISC_ERR_BADPARAM

Parameter contains invalid value

MVISC_ERR_PLCTIMEOUT

PLC-5 did not respond

MVISC_ERR_XFERFAIL

PLC-5 returned an error

MVISC_ERR_PCCCFAIL

PCCC error occurred

Example

HANDLE Handle;
WORD buf[8];
int rc;
/* Read 8 words of data from I/O module in rack 1, I/O group 1, slot 2 */
rc = MVIsc_PLCBTRead(Handle, buf, 1, 1, 2, 8);
if (rc != MVISC_SUCCESS)
printf("ERROR: MVIsc_PLCBTRead failed");

Advertising