Readfile – Echelon OpenLNS User Manual

Page 353

Advertising
background image

OpenLNS Programmer's Reference

316

Availability

Local, full, and lightweight clients.

Syntax

ftObject.ClearTargets

Element

Description

ftObject

The

FileTransfer

object.

Added to API

Prior to LNS Release 3.0.

ReadFile

Summary

Reads a file from an

AppDevice

in the file transfer target list

.

You must first add the selected application device to the file

transfer target list with the AddTarget method.
You can use this method to read from one device at a time. As

a result, the file transfer target list must contain one only

device when the ReadFile method is invoked. If it contains

more than one device, an exception will be thrown.
You can set the desired file transfer parameters (including

file index of the file to be read on the app device, and the

buffer read count) using the FileIndex and ReadBufferLength

properties of the FileTransfer object.

Availability

Local, full, and lightweight clients.

Syntax

fileBuffer = ftObject.

ReadFile

Element

Description

fileBuffer

A

Variant

containing the returned

buffer.

The returned value is a Variant

containing a one dimensional byte

array (MFC type VT_UI1 |

VT_ARRAY).
The number of elements in the array

is equal to the ReadBufferLength

property multiplied by the number of

targets.
In Visual Basic, the individual

elements may be retrieved from the

variable by appending an array index

to the name of the Variant. For

example:
Dim fileBuffer as Variant
Dim byte1 as Byte
fileBuffer = ftObject.ReadFile
byte1 = fileBuffer(1)

ftObject

The

FileTransfer

object.

Added to API

Prior to LNS Release 3.0.

Advertising