OBIOLimitSwitch (FB)

FUNCTION_BLOCK OBIOLimitSwitch EXTENDS AbbLConCA

A binary output can be switched on/off with respect to a counter value.

It is possible to use the OBIOLimitSwitch with respect to CounterValue from: OBIOEncoderCounter (FB), OBIOForwardCounter (FB) or OBIOPulseTrainOutput (FB)
precondition

the respective channel is configured as limit switch, and also a counter channel has to be configured.

Up to 8 limit-switches are possible.

The respective counter is linked to the block by “Counter” input. The counter can be of type OBIOEncoderCounter, OBIOForwardCounter or OBIOPulseTrainOutput
The binary output is switched on when LowerLimitOn<=CounterValue<=UpperLimitValue
The binary output is switched on/off independently from PLC cycle with a delay of <10 microseconds.

Note

This block should just be called once per cycle otherwise inconsistent values could be send to PRU, if send twice in short time.

InOut:

Scope

Name

Type

Initial

Comment

Inherited from

Input

Enable

BOOL

FALSE

A rising edge (Enable = TRUE) starts the operation, the output Busy goes to TRUE. All other inputs are read and considered continuously. A falling edge (Enable = FALSE) aborts the operation. During Aborting the Busy is still TRUE. Afterward all outputs are reset.

AbbLConCA

Output

Busy

BOOL

FALSE

Operation is running (while output Error is FALSE)

AbbLConCA

Error

BOOL

FALSE

Operation is stopped with error (while output Busy is FALSE). This output is TRUE for at least one cycle or until Enable is set to FALSE. The output ErrorID gives more details about the error.

AbbLConCA

Input

Channel

BYTE

0..7

Signal

BOOL

Selects whether corresponding output should be high or low when counter is between UpperLimitOn and LowerLimitOn

UpperLimitOn

UDINT

Upper limit UpperLimitOn > LowerLimitOn

LowerLimitOn

UDINT

Lower limit LowerLimitOn < UpperLimitOn

Inout

Counter

OBIOBaseCounter

link the block to the counter which will be used to trigger the output

Output

ErrorID

Error_ID

Error Code

State

BOOL

reflects the state of the binary output related to LimitSwitch