IoCnt (FB)
FUNCTION_BLOCK IoCnt EXTENDS AbbLConCA
Handle fast counters on S500 IO-modules
- 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.
AbbLConCA
Output
BusyBOOLFALSE
Operation is running (while output Error is FALSE)
AbbLConCA
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.
AbbLConCA
Input
BusTypeBYTE0
BUS : 0 = default , 1 = CAN
ModeBYTE0
FC Mode
AdrInputsPOINTER TO BYTE
0
Pointer to Inputs
AdrOutputsPOINTER TO BYTE
0
Pointer to Outputs
EnVisuBOOLFALSE
Enable settings in visu
Inout
En1BOOLEnable counting counter 1
UD1BOOLUp / down counter 1
EnOut1BOOLEnable output counter 1 in user program
Set1BOOLSet start value counter 1
Start1DWORDStart value counter 1
End1DWORDEnd value counter 1
En2BOOLEnable counting counter 2
UD2BOOLUp / down counter 2
EnOut2BOOLEnable output counter 2 in user program
Set2BOOLSet start value counter 2
Start2DWORDStart value counter 2
End2DWORDEnd value counter 2
Output
ErrorIDERROR_ID.NO_ERROR
Error code describing error condition
CntStateWORD0
Counter mode
CF1BOOLFALSE
Carry Flag 1 := TRUE -> end value reached
Act1DWORD0
Actual value counter 1
CF2BOOLFALSE
Carry Flag 2 := TRUE -> end value reached
Act2DWORD0
Actual value counter 2