Class Adelay
|
| Version |
1.0 |
|
| Modified |
08-MAR-2026 11:05:32.00 |
|
| Code |
rt_plc_arithm.c |
|
Time delay of an analog signal.

The time delay Tim can vary within the interval:
{ 0 - 100 * MaxCount * ScanTime }
The delay is implemented in a 100-step shift register.
The time resolution per step is MaxCount * ScanTime and
maximum time delay is 100 * MaxCount * ScanTime.
Several Adelay objects can be connected in series when
a higher resolution is needed.
If the time resolution per step is worse than the
program cycle time (i.e. MaxCount > 1) a mean value is
formed and stored in shift register 1.
The very first sample is stored in every shift
register. At sample number 2 a mean value is calculated
from the value in shift register ( position) 1 and the
input signal, thereafter the mean value is restored in
shift register 1. This is repeated up to sample
MaxCount - 1. At sample number MaxCount a shift of the
register contents takes place and the input signal is
stored direct into the shift register 1. During the
time up to the next shift the mean value of the input
signal is stored in shift register position 1.
The output signal is fetched from the register
representing the actual delay.
Example
1. With MaxCount = 1 and ScanTime = 20 ms the maximum delay time
is 100 * 1 * 1 / 50 seconds.
if the delay Tim = 1, ActVal(t) will be = In(t-50), i.e. the input
signal is delayed by 50 execution cycles.
2. If MaxCount = 1 and ScanTime = 1 second represent each register the
delay of one second. Tim specifies from which register to get ActVal.

|
RtBody attributes pwr_sClass_adelay |
| Float32 |
In |
IN |
Value of the input signal. |
| Float32 |
Tim |
TIM |
Actual time delay ( in seconds ) in the interval
{ 0, 100 * MaxCount * ScanTime }. |
| Float32 |
ActVal |
VAL |
Delayed signal according to Tim. |
| Pointer to Float32 |
ScanTime |
ScanTime |
Program cycle period in seconds. |
| Array of Float32 |
TimVect |
TimVect |
A cyclic register. |
| Int32 |
StoInd |
StoInd |
Storage index, which points to the next store location. |
| Int32 |
MaxCount |
MaxCount |
Number of cycles per shift register step; i.e. register
shift is done at every MaxCount:e program cycle
execution. |
| Int32 |
StoredNumbers |
StoredNumbers |
Counter; used at the initial phase. |
| Int32 |
Count |
Count |
Loop counter for shift. |
| Int32 |
AccTim |
AccTim |
The operator's authorities regarding to Tim.
0 -- Changes not allowed.
!=0 -- Changes allowed. |
| Float32 |
MinTim |
MinTim |
The minimum allowed value of Tim at changes made by an operator.
|
| Float32 |
MaxTim |
MaxTim |
The maximum allowed value of Tim at changes made by an operator. |
| GraphPlcNode |
| object_type |
131 |
| parameters[0] |
2 |
| parameters[1] |
0 |
| parameters[2] |
1 |
| parameters[3] |
0 |
| subwindows |
0 |
| graphmethod |
0 (standard, individual attributes) |
| graphindex |
0 |
| default_mask[0] |
1 |
| default_mask[1] |
1 |
| segname_annotation |
1 |
| compmethod |
4 |
| compindex |
0 |
| tracemethod |
0 |
| traceindex |
0 |
| executeordermethod |
2 |
| objname |
Adelay |
| graphname |
Adelay |
| debugpar |
|
| Template Object |
| MaxCount |
1 |
Attributes detail
Value of the input signal.
Actual time delay ( in seconds ) in the interval
{ 0, 100 * MaxCount * ScanTime }.
Delayed signal according to Tim.
Program cycle period in seconds.
Storage index, which points to the next store location.
Number of cycles per shift register step; i.e. register
shift is done at every MaxCount:e program cycle
execution.
Counter; used at the initial phase.
The operator's authorities regarding to Tim.
0 -- Changes not allowed.
!=0 -- Changes allowed.
The minimum and maximum allowed value of Tim at changes
made by an operator.
Example
1 With MaxCount = 1 and ScanTime = 20 milliseconds the
maximum time delay is 100 * 1 * 1 / 50 = 2 seconds.
If the delay Tim = 1, ActValt will be = In ,
t-50, i.e. the input signal is delayed by 50 execution
cycles.
2 If MaxCount = 1 and ScanTime = 1 second represent
each register the delay of one second. Tim specifies
from which register to get ActVal.
The maximum allowed value of Tim at changes made by an operator.