beautypg.com

B&B Electronics VFG3000 - Manual User Manual

Page 317

background image

F

UNCTION

R

EFERENCE

O

PEN

F

ILE

(

NAME

,

MODE

)

R

EVISION

1

P

AGE

301

O

PEN

F

ILE

(

NAME

,

MODE

)

A

RGUMENT

T

YPE

D

ESCRIPTION

name

cstring

The file to be opened.

mode

int

The mode in which the file is to be opened…
0 = Read Only
1 = Read/Write at Start of File
2 = Read/Write at End of File

D

ESCRIPTION

Returns a handle to the file

name

located on the CompactFlash card. This function is restricted

to a maximum of four open files at any given time. The CompactFlash card cannot be
unmounted while a file is open. Note that the filing system used on the card does not support
long filenames, and that if backslashes are included in the pathname to separate path
elements, they must be doubled-up per Fieldbus Gateway Manager’s rules for string constants
as described in the chapter on Writing Expressions. To avoid this complication, forward
slashes can be used in place of backslashes without the need for such doubling. Note also that
this function will not create a file that does not exist. To do this, call

CreateFile()

before

calling this function.

F

UNCTION

T

YPE

This function is active.

R

ETURN

T

YPE

int.

E

XAMPLE

hFile := OpenFile(“/LOGS/LOG1/01010101.csv”, 0)