ProSoft Technology MVI69-ADM User Manual

Page 319

Advertising
background image

MVI-ADM ♦ 'C' Programmable

Side-Connect API Library Functions

'C' Programmable Application Development Module

Developer's Guide

ProSoft Technology, Inc.

Page 319 of 342

February 20, 2013

MVIsc_PLCBTWrite

Syntax

int MVIsc_PLCBTWrite(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 of data to be written to I/O module

rack

Rack number of the I/O module to be written

group

I/O group number of the I/O module

slot

Slot number within the I/O group

size

Number of words to write

Description
MVIsc_PLCBTWrite requests the PLC-5 to perform a block transfer write to 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;
/* Write 8 words of data to I/O module in rack 1, I/O group 1, slot 2 */
rc = MVIsc_PLCBTWrite(Handle, buf, 1, 1, 2, 8);
if (rc != MVISC_SUCCESS)
printf("ERROR: MVIsc_PLCBTWrite failed");

Advertising