beautypg.com

B&B Electronics VFG3000 - Manual User Manual

Page 161

background image

C

ONFIGURING

P

ROGRAMS

A

DDING

C

OMMENTS

R

EVISION

1

P

AGE

145

M

ODE

B

EHAVIOR

referenced by the program.

Read When Executed

External data used within the program will be read only
when the program is invoked. The program will wait for
the period defined in the timeout property for such data to
be available. If the data cannot be read—perhaps because
a device is offline—the program will not execute. This
mode is typically used with globally-referenced programs
that consume large amounts of data that would otherwise
slow down the communications scan.

Read But Run Anyway

External data will be treated as described for Read Always
mode, but the program will execute whether or not the
data has been read successfully. The operator will
therefore never see the “NOT READY” message, but if a
device is offline, there is no guarantee that the program’s
data items contain valid data.

The Arguments property is used to specify up to five arguments that can be

passed into the program. Each argument has a name and a data type, as specified
by the dialog box that is displayed when the Edit button is pressed...

Passing arguments to programs is described in more detail below.

A

DDING

C

OMMENTS

You can add comments to your programs in two ways. Firstly, you can use the

//

sequence to

introduce a comment which will continue for the rest of the current line. Secondly, you can
use the

/*

sequence to introduce a single- or multi-line comment. This comment will continue

until the

*/

sequence appears. The sample below shows both commenting styles…

// This is a single-line comment

/* This is line 1 of the comment

This is line 2 of the comment

This is line 3 of the comment */

A single-line comment may also be placed at the end of a line that contains code.