beautypg.com

B&B Electronics VFG3000 - Manual User Manual

Page 191

background image

W

RITING

E

XPRESSIONS

D

ATA

V

ALUES

R

EVISION

1

P

AGE

175

The ‘U’ and ‘L’ suffixes supported by earlier versions of software are not used.

C

HARACTER

C

ONSTANTS

Character constants represent a single ASCII character, encoded in the lower 8 bits of a 32-bit
signed number. A character constant comprises a single character enclosed in single quotation
marks, such that

'A'

can be used to represent a value of 65. Certain otherwise unprintable or

unrepresentable characters can be encoded using what are called escape sequences, each of
which is introduced with a single backslash…

S

EQUENCE

V

ALUE

ASCII

\a

Hex 0x07, Decimal 7

BEL

\t

Hex 0x09, Decimal 9

TAB

\n

Hex 0x0A, Decimal 10

LF

\f

Hex 0x0C, Decimal 12

FF

\r

Hex 0x0D, Decimal 13

CR

\e

Hex 0x1B, Decimal 27

ESC

\xnn

The hex value represented by nn.

-

\nnn

The octal value represented by nnn.

-

\\

A single backslash character.

-

\'

A single quotation mark character.

-

\"

A double quotation mark character.

-

L

OGICAL

C

ONSTANTS

Logical constants represent a 1 or 0 value that is used to indicate the truth or otherwise of a
yes-or-no expression. An example of something that can be assigned to be equal to a logical
constant is a tag that represents a digital output in a PLC. Logical constants can either be
entered simply as

1

or

0

, or by use of the keywords

true

or

false

.

F

LOATING

-P

OINT

C

ONSTANTS

Floating-point constants represent a 32-bit single-precision floating-point value. They are
represented as you might expect—by the integer portion, followed by a single decimal point,
followed by the fractional portion. Exponential notation is not supported.

S

TRING

C

ONSTANTS

String constants represent sequences of characters. They comprise the characters to be
represented, enclosed in double quotation marks. For example, the string

"ABCD"

represents a

four-character string, comprising the values 65, 66, 67 and 68. (Actually, five bytes are used
to store the string, with a null value being appended to indicate the end of the string.) The
various escape sequences discussed above may also be used within strings.