You are on page 1of 3

If the value is equal to -1, the BELT function returns the

last latched encoder position in encoder counts of the

belt specified by the belt variable. This value equivalent

to the value returned by DEVICE(0, enc, stt, 4) except it

is not bounded to 8,388,607.

If the value of the expression is greater than zero, the

encoder velocity is returned in units of encoder counts

per V+ cycle. For Standard Control systems, the V+

Chapter 3: Keyword Details

cycle time is approximately 4 ms. For Robot Integrated

Control systems, the cycle time is approximately 2 or 4

ms.

Examples

The following example will set the point of interest on the referenced conveyor

to be that corresponding to the current reading of the belt encoder.

SETBELT %main.belt = BELT(%main.belt)

The folowing example will save the current speed of the belt associated with the

belt variable "%b".

belt.speed = BELT(%b, 1)

Related Keywords

DEFBELT

DEVICE

SETBELT

28319-000 Rev. A V+ Keyword Reference Manual 51

52 V+ Keyword Reference Manual 28319-000 Rev. A

3.1 Function Keywords

BITS

Real-valued function that reads multiple digital signals and returns the value corresponding to the
binary bit pattern.
Syntax

BITS (first_sig, num_sigs)

Usage Considerations

External digital input or output signals or internal software signals can be referenced.

A maximum of 32 signals can be read at one time.

Any group of up to 32 signals can be read provided that all the signals in the

group are configured for use by the system.

Parameters

first_sig Real-valued expression defining the lowest-numbered signal to be read.

num_sigs Optional real-valued expression specifying the number of

signals to be affected. A value of 1 is assumed if none is

specified. The maximum valid value is 32.

Details

This function returns a value that corresponds to the binary bit pattern present

on 1 to 32 digital signals.

The binary representation of the value returned by the function has its least-significant bit
determined by signal numbered first_sig and its higher-order bits

determined by the next num_sigs -1 signals.

Example

The example below assumes that the following input signal states are present.

Signal: 1008 1007 1006 1005 1004 1003 1002 1001

State: 1 1 0 1 0 1 1 0

The following statement will return a value of 5 for variable "x" because the four

signals 1003, 1004, 1005, and 1006 can be interpreted as a binary representation

of that value.

x = BITS(1003, 4)

Related Keywords

BITS (program command)

IO
Chapter 3: Keyword Details

RESET

SIG

SIG.INS

SIGNAL (monitor command)

SIGNAL (program command)

You might also like