beautypg.com

B&B Electronics VFG3000 - Manual User Manual

Page 323

background image

F

UNCTION

R

EFERENCE

P

ORT

I

NPUT

(

PORT

,

START

,

END

,

TIMEOUT

,

LENGTH

)

R

EVISION

1

P

AGE

307

P

ORT

I

NPUT

(

PORT

,

START

,

END

,

TIMEOUT

,

LENGTH

)

A

RGUMENT

T

YPE

D

ESCRIPTION

port

int

The raw port to be read.

start

int

The start character to match, if any.

end

int

The end character to match, if any.

timeout

int

The inter-character timeout in milliseconds, if any.

length

int

The maximum number of characters to read, if any.

D

ESCRIPTION

Reads a string of characters from the

port

indicated by port, using the various other

parameters to control the input process. If

start

is non-zero, the process begins by waiting

until the character indicated by this parameter is received. If

start

is zero, the receive

process begins immediately. The process then continues until one of the following conditions
has been met…

end

is non-zero and a character matching

end

is received.

timeout

is non-zero, and that period passes without a character being received.

length

is non-zero, and that many characters have been received.

The function then returns the characters received, not including the

start

or

end

byte. This

function is used together with Raw Port drivers to implement custom protocols using Fieldbus
Gateway Manager’s programming language.

F

UNCTION

T

YPE

This function is active.

R

ETURN

T

YPE

cstring.

E

XAMPLE

Frame := PortInput(1, '*', 13, 100, 200)