OBIOTouchProbe (FB)
FUNCTION_BLOCK OBIOTouchProbe EXTENDS AbbLConC3
A binary input can be used to save a counter value at rising edge.
- precondition
the respective channel is configured as touch trigger, and also a counter channel has to be configured.
Up to 4 touch trigger are possible.
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
EnableBOOLFALSE
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.
AbbLConC3
Output
BusyBOOLFALSE
Operation is running (while output Error is FALSE)
AbbLConC3
ErrorBOOLFALSE
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.
AbbLConC3
Input
ChannelBYTE0..3
InvertBOOLby default, use rising edge. With Invert=TRUE, falling edge is used
EnableTouchBOOLEnables the touch trigger mode. A rising edge at touch-input will then capture the actual value as CounterTouchValue
Inout
CounterOBIOBaseCounterlink the block to the counter which will be used to trigger the output
Output
ErrorIDError_ID.NO_Error
Error code
ReadyTouchBOOLFALSE
Indicates CounterTouchValue is ready (=EnableTouch). Will be TRUE as long as EnableTouch is TRUE
CounterTouchValueUDINT0
captured counter value, valid with ReadyTouch