Description
The "Motor control-timer alarm" instruction is used to accumulate the time from the point at which one of the command inputs (opening or closing) is switched on. The time is accumulated until the preset time is exceeded or the relevant feedback input indicates that the device has executed the requested operation within the specified time. If the preset time is exceeded before the feedback is received, the corresponding alarm is triggered.
The "Motor control-timer alarm" instruction returns no error information.
Parameters
The following table shows the parameters of the "Motor control-timer alarm" instruction:
|
Parameters |
Declaration |
Data type |
Memory space |
Description |
|---|---|---|---|---|
|
EN |
Input |
BOOL |
I, Q, M, D, L, T, C or constant |
Enable input |
|
ENO |
Output |
BOOL |
I, Q, M, D, L |
Enable output |
|
O_CMD |
Input |
BOOL |
I, Q, M, D, L or constant |
"Open" command input |
|
C_CMD |
Input |
BOOL |
I, Q, M, D, L or constant |
"Close" command input |
|
S_CMD |
Input |
BOOL |
I, Q, M, D, L or constant |
"Stop" command input |
|
O_FB |
Input |
BOOL |
I, Q, M, D, L or constant |
Feedback input when opening |
|
C_FB |
Input |
BOOL |
I, Q, M, D, L or constant |
Feedback input when closing |
|
OO |
Output |
BOOL |
I, Q, M, D, L |
"Open" output |
|
CO |
Output |
BOOL |
I, Q, M, D, L |
"Close" output |
|
OA |
Output |
BOOL |
I, Q, M, D, L |
Alarm output when opening |
|
CA |
Output |
BOOL |
I, Q, M, D, L |
Alarm output when closing |
|
Q |
Output |
BOOL |
I, Q, M, D, L |
A signal state of "0" indicates an error condition. |
|
ET |
Static |
DINT |
D, L or constant |
Currently elapsed time, where one count = 1 ms |
|
PT |
Static |
DINT |
D, L or constant |
Preset timer value, where one clock pulse = 1 ms |
|
PREV_TIME |
Static |
DWORD |
D, L or constant |
Previous system time |
|
O_HIS |
Static |
BOOL |
D, L or constant |
"Open" history bit |
|
C_HIS |
Static |
BOOL |
D, L or constant |
"Close" history bit |
Execution of the "Motor control-timer alarm" instruction
The following table shows the reactions of the "Motor control-timer alarm" instruction to the various input conditions:
|
Input parameters |
Output parameters |
||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
ET |
O_HIS |
C_HIS |
O_CMD |
C_CMD |
S_CMD |
O_FB |
C_FB |
OO |
CO |
OA |
CA |
ET |
O_HIS |
C_HIS |
Q |
Status |
|
|
X |
1 |
1 |
X |
X |
X |
X |
X |
0 |
0 |
1 |
1 |
PT |
0 |
0 |
0 |
Alarm |
|
|
X |
X |
X |
X |
X |
X |
1 |
1 |
0 |
0 |
1 |
1 |
PT |
0 |
0 |
0 |
Alarm |
|
|
X |
X |
X |
X |
X |
1 |
X |
X |
0 |
0 |
0 |
0 |
X |
0 |
0 |
1 |
Stop |
|
|
X |
X |
X |
1 |
1 |
X |
X |
X |
0 |
0 |
0 |
0 |
X |
0 |
0 |
1 |
Stop |
|
|
X |
0 |
X |
1 |
0 |
0 |
X |
X |
1 |
0 |
0 |
0 |
0 |
1 |
0 |
1 |
Start opening |
|
|
<PT |
1 |
0 |
X |
0 |
0 |
0 |
X |
1 |
0 |
0 |
0 |
INC |
1 |
0 |
1 |
Open |
|
|
X |
1 |
0 |
X |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
PT |
1 |
0 |
1 |
Opened |
|
|
>=PT |
1 |
0 |
X |
0 |
0 |
0 |
X |
0 |
0 |
1 |
0 |
PT |
1 |
0 |
0 |
Opening alarm |
|
|
X |
X |
0 |
0 |
1 |
0 |
X |
X |
0 |
1 |
0 |
0 |
0 |
0 |
1 |
1 |
Start closing |
|
|
<PT |
0 |
1 |
0 |
X |
0 |
X |
0 |
0 |
1 |
0 |
0 |
INC |
0 |
1 |
1 |
Close |
|
|
X |
0 |
1 |
0 |
X |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
PT |
0 |
1 |
1 |
Closed |
|
|
>=PT |
0 |
1 |
0 |
X |
0 |
X |
0 |
0 |
0 |
0 |
1 |
PT |
0 |
1 |
0 |
Closing alarm |
|
|
X |
0 |
0 |
0 |
0 |
0 |
X |
X |
0 |
0 |
0 |
0 |
X |
0 |
0 |
1 |
Stopped |
|
|
Legend: |
|||||||||||||||||
|
INC |
Add the time difference (ms) since the last processing of the FB to ET |
||||||||||||||||
|
PT |
PT is set to the same value as ET |
||||||||||||||||
|
X |
Cannot be used |
||||||||||||||||
|
<PT |
ET < PT |
||||||||||||||||
|
>=PT |
ET >= PT |
||||||||||||||||
|
If the input parameters O_HIS and C_HIS both have the signal state "1", they are immediately set to signal state "0". In this case, the last row in the table (X) mentioned above is valid. Because it is therefore no longer possible to check whether the input parameters O_HIS and C_HIS have the signal state "1", the output parameters are set as follows in this case: OO = FALSE CO = FALSE OA = FALSE CA = FALSE ET = PT Q = TRUE |
|||||||||||||||||
Example
The following example shows how the instruction works:
|
Note You can initialize static parameters in the data block. |
The following tables show how the instruction works using specific values.
Before processing
In this example, the following values are used for the input and output parameters:
|
Parameters |
Operand |
Value |
|---|---|---|
|
O_CMD |
Tag_Input_O_CMD |
TRUE |
|
C_CMD |
Tag_Input_C_CMD |
FALSE |
|
S_CMD |
Tag_Input_S_CMD |
FALSE |
|
O_FB |
Tag_Input_O_FB |
FALSE |
|
C_FB |
Tag_Input_C_FB |
FALSE |
|
OO |
Tag_OutputOpen |
FALSE |
|
CO |
Tag_OutputClosed |
FALSE |
|
OA |
Tag_Output_OA |
FALSE |
|
CA |
Tag_Output_CA |
FALSE |
|
Q |
Tag_Output_Q |
FALSE |
The following values are saved in the instance data block "MCAT_DB" of the instruction:
|
Parameters |
Address |
Value |
|---|---|---|
|
ET |
DBD4 |
L#2 |
|
PT |
DBD8 |
L#22 |
|
O_HIS |
DBX16.0 |
TRUE |
|
C_HIS |
DBX16.1 |
FALSE |
After processing
The following values are written to the output parameters after the instruction has been executed:
|
Parameters |
Operand |
Value |
|---|---|---|
|
OO |
Tag_OutputOpen |
TRUE |
|
CO |
Tag_OutputClosed |
FALSE |
|
OA |
Tag_Output_OA |
FALSE |
|
CA |
Tag_Output_CA |
FALSE |
|
Q |
Tag_Output_Q |
TRUE |
The following values are saved in the instance data block "MCAT_DB" of the instruction:
|
Parameters |
Address |
Value |
|---|---|---|
|
ET |
DBD4 |
L#0 |
|
O_HIS |
DBX16.0 |
TRUE |
|
CMD_HIS |
DBX16.1 |
FALSE |