SolarEncoderOnboardIO (FB)
FUNCTION_BLOCK SolarEncoderOnboardIO EXTENDS AbbLConC3
Function block to easily integrate with eCo AC500 V3 Onboard IO, incremental encoders (A, B) as positioning sensors for solar trackers.
To Configure: Configuration -> Devices -> Onboard IO -> IO Mapping -> Map variable for position sensors
Note
Please refer to Automation Builder help for eCo V3 module configuration and parameter details.
Example configuration of the module is described in the example project and example documentation.
- 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. Execution will continue forever until 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
EnableCounterBOOLFALSE
- 2: Enable the counter function of the module
If EnableCounter = TRUE, pulse counting of counter is enabled.
If EnableCounter = FALSE, no pulse counting is performed and pulses are not stored even the encoder device changes its position.
If counting has already started and if EnableCounter = FALSE, the pulse counting stops and counter value PosAct is stored. If EnableCounter = TRUE again, the pulse counting will start again and counter value PosAct will continue since previous value.
SetStartBOOLFALSE
4: If TRUE, counter takes values from input SetStartValue to transfer it to PosAct. After that, RdySet = TRUE. As long as input SetStart = TRUE, no pulses are counted because the counter is always overwritten by the input SetStart
SetStartValueREAL0
5: 32 bit start counter value
EnableCalibBOOLFALSE
- 6: Enabling calibrating process
If EnableCalib = TRUE, when a rising edge is detected at the encoder´s reference point(Z) signal, output ZValue will take the stored value in PosAct and output RdyCalib is set to TRUE. If this input is continuously TRUE, only one calibrating process will be done even system reaches encoder´s reference point(Z) once again. In order to enable another calibrating process, input EnableCalib has to be set to FALSE and set to TRUE again.
Calibrating process is executed out of CPU cycle, and it is able to detect the multiple rising edges that appear when a simple limit switch is used. Due to that, it is recommended to use devices assembled especially for this purpose (high accuracy limit switch). Inputs used as reference point Z in the calibrating process are: Counter0 -> I3, Counter1 -> I11
EnableSyncBOOLFALSE
- 7: Enabling synchronizing process
If input EnableSync = TRUE, when a rising edge is detected at the encoder´s reference point(Z) signal, output PosAct will take the value stored at ZValue, output RdySync is set to TRUE only during a program cycle. While EnableSync is set to TRUE, PosAct output will take the value stored at ZValue every time that a rising edge is detected at the encoder´s reference point(Z) signal.
Inputs used as reference point Z in the synchronisation process are: Counter0 -> Z0, Counter1 -> Z1.
MeasuringStepREAL0
- 8: Indicates the resolution of the encoder device (see technical data from manufacturer). Format: Degrees
For example, using an incremental encoder with resolution of 10000 pulses each 360° and x4 counting mode (software configuration), measuring step will use the following value: 360 / (4 x 10000) = 0,009.
ZPulseBOOLFALSE
9: Encoder’s reference position Z reached. This signal is only visible if programs execution time is slower than the signal of encoder’s reference point (Z).
ChannelBYTE0
10: Channel number, for encoder 0 or 1.
Inout
PosActREAL- 11: The current position (actual position) can be retrieved at any time using the output PosAct.
Note
If a shutdown occurs, value of actual position will be lost. Hence, parameter must be declared as a retain variable.
If communications problem occurs between CPU and IO module, position value stored in PosAct will be lost.
ZValueREAL12: Indicates the position of the encoders reference point (Z). The user is able to configure where the Z position is, Format: Degrees
Output
ErrorIDNO_ERROR
3: Error number
RdySetBOOLFALSE
4: When the action of SetStart finishes, RdySet is set to TRUE for only one cycle
RdyCalibBOOLFALSE
5: The output RdyCalib displays ready message of calibrating process. While input EnableCalib is set to TRUE, RdyCalib = TRUE. If EnableCalib = TRUE and rising edge is detected at ZPulse signal, RdyCalib will be TRUE until EnableCalib = FALSE.
RdySyncBOOLFALSE
6: Displays the ready message of the synchronisation process. It is set to TRUE only for one cycle
Methods:
A_StartAction
B_CyclicAction
C_CleaningAction
D_AbortAction
E_ResetAction
Structure: