Ob (output bit), This command also works for modbus outputs, Arguments: ob n, expression where – Yaskawa LEGEND-MC User Manual

Page 185: Bitnum is the i/o point in the module from 1 to 4

Advertising
background image

175

LEGEND-MC User’s Manual

OB (Output Bit)

[I/O]

DESCRIPTION:

The OB n, logical expression command defines output bit n = 1 through 4 as either 0 or 1 depending on the
result from the logical expression. Any non-zero value of the expression results in a one on the output.

When using this command to access I/O on a slave controller in distributed control mode, use it with the
handle for outbound master commands. Do not use the handle which is for incoming slave update packets.
For example, if a slave is connected on handles E and F, reference the I/O for the slave on handle E.

This command also works for Modbus outputs.

ARGUMENTS: OB n, expression

where

n is 1 to 4 for the local controller. However, remote local outputs can be used (i.e. Offset 100 per handle for
SMC outputs; Offset 1000 per handle for Modbus outputs)

expression is any valid logical expression, variable or array element.

USAGE:

MODBUS:

NOTE: When using Modbus devices, the I/O points of the modbus devices are calculated
using the following formula:

n = (SlaveAddress*1000) + (HandleNum*1000) + ((Module-1)*4) + (Bitnum-1)

Slave Address is used when the ModBus device has slave devices connected to it and specified as
Addresses 0 to 255. The use of slave devices for modbus are very rare and this number will usually be 0.

HandleNum is the handle specifier from A to P (1 - 16).

Module is the position of the module in the rack from 1 to 16.

BitNum is the I/O point in the module from 1 to 4.

EXAMPLES:

While Moving

Yes

Default Value

---

In a Program

Yes

Default Format

---

Command Line

Yes

Can be Interrogated

No

Used as an Operand

No

Distributed Control

Offset 100

OB 1, POS 1

If POS1 is non-zero, Bit 1 is high. If POS1 is zero, Bit 1 is low

OB 2, (@IN[1]&@IN[2])

If Input 1 and Input 2 are both high, then Output 2 is set high

OB 3, COUNT[1]

If the element 1 in the array is zero, clear bit 3, otherwise set bit 3

OB N, COUNT[1]

If element 1 in the array is zero, clear bit N

OB 3003,(X<5)

Set output 3 on Modbus device at handle "C" if X is less than 5,
otherwise turn off the output

Advertising