SolarEncoderCD522 (FB)

FUNCTION_BLOCK SolarEncoderCD522 EXTENDS AbbLConCA

Function Block to easily integrate, with the CD522 card, incremental encoders (A, B, Z) as positioning sensors for solar trackers. Configuration -> Devices -> IO Bus -> CD522 -> CD522 IO Mapping -> Map variable for position sensors

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

CounterNum

WORD

0

2: counter 0 or counter 1 is to be used

EnableCounter

BOOL

FALSE

3: enabling counter function of the CD522 module

SetStart

BOOL

FALSE

4: Set current counter value

SetStartValue

REAL

0

5: 32 bit start counter value

EnableCalib

BOOL

FALSE

6: enabling calibrating process

EnableSync

BOOL

FALSE

7: enabling synchronizing process

MeasuringStep

REAL

0

8: measuring step

Inout

CounterIn

ARRAY [0..11] OF WORD

9: array of WORD for input of Configuration fast counter

CounterOut

ARRAY [0..15] OF WORD

10: array of WORD for output of Configuration fast counter

PosAct

REAL

11: 32 bit current position value

ZValue

REAL

12: position value of the encoder’s reference point (Z).

Output

ErrorID

ERROR_ID

NO_ERROR

3: error number

RdySet

BOOL

FALSE

4: ready message of calibrating process

RdyCalib

BOOL

FALSE

5: ready message of calibrating process

RdySync

BOOL

FALSE

6: ready message of synchronizing process

ZPulse

BOOL

FALSE

7: encoder’s reference position Z reached

Methods:

D_AbortAction

A_StartAction

B_CyclicAction

C_CleaningAction

E_ResetAction

Structure: