Chapter 2 Syntax
2-40
TC (0) to
TC (7)
Variable name
Range of values
Default
Unit
Data size
Attribute
Timer counters
0 to 2
31
-1
0
10 ms
Unsigned
2-word data
Readable
and writable
- Explanation
These variables can be used to monitor the counts of the timer counters. The timer counters “TC (0)” to “TC (7)” usually
operate as 31-bit free-running timer counters that start simultaneously with user program startup and are incremented in a
10-ms cycle.
When a timer-start instruction (timer set) or delay operation instruction (delay on or delay off) is executed, the timer counter
corresponding to the instruction operates as the counter for output to a specified timer contact. In this case, the counter is
cleared to zero when the instruction is executed, starts counting, and then stops counting upon reaching the specified count.
When a timer-stop instruction (timer off) is executed, the timer counter corresponding to the instruction is cleared to zero and
operates as a 31-bit free-running timer counter that is incremented in a 10-ms cycle.
- Sample program :
Program to accelerate the motor step-by-step by using a free-running timer
(Code area [Code Window])
Label
Mnemonic
parameter1
parameter2
parameter3
parameter4
parameter5
㩷
㩷
㩷 䋺
㩷
㩷
㩷
㩷
㩷
㩷
㩷
ACCEL=
㩷
㩷
1000
㩷
㩷
: Set the acceleration time to 10 seconds.
㩷
DECEL=
㩷
㩷
1000
㩷
㩷
: Set the deceleration time to 10 seconds.
㩷
SET-Freq=
㩷
㩷
0
㩷
㩷
: Set the output frequency to 0 Hz.
LOOP FW=
1
㩷
㩷
㩷
: Start forward rotation of the motor.
㩷
if
TC(5)
<
U(00)
then
LBL1
: When TC (5) indicates less than 10 seconds
㩷
if
TC(5)
<
U(01)
then
LBL2
: When TC (5) indicates less than 20 seconds
㩷
if
TC(5)
<
U(02)
then
LBL3
: When TC (5) indicates less than 30 seconds
㩷
if
TC(5)
>=
U(03)
then
LBL4
: When TC (5) indicates 40 seconds or more
LBL1 SET-Freq=
㩷
㩷
1000
㩷
㩷
: When TC (5) is less than 10 seconds,
increase the output frequency to 10 Hz.
㩷
goto LBL5
㩷
㩷
㩷
㩷
LBL2 SET-Freq=
㩷
㩷
3000
㩷
㩷
: When TC (5) is less than 20 seconds,
increase the output frequency to 30 Hz.
㩷
goto LBL5
㩷
㩷
㩷
㩷
LBL3 SET-Freq=
㩷
㩷
6000
㩷
㩷
: When TC (5) is less than 30 seconds,
increase the output frequency to 60 Hz.
㩷
goto LBL5
㩷
㩷
㩷
㩷
LBL4 FW=
0
㩷
㩷
㩷
㩷
: When TC (5) is 40 seconds or more,
decelerate and stop the motor.
㩷
wait RUN
= 0
㩷
㩷
: Wait until the motor stops.
㩷
SET-Freq=
㩷
㩷
0
㩷
㩷
: Set the output frequency to 0 Hz.
㩷
TC(5)=
㩷
㩷
0
㩷
㩷
: Clear TC (5) to zero.
LBL5 goto
LOOP
㩷
㩷
㩷
㩷
㩷
㩷
㩷 䋺
㩷
㩷
㩷
㩷
㩷
㩷
(Data area [Data Window])
U (00) = 1000
: Set 10 seconds in variable “U (00)”.
U (01) = 2000
: Set 20 seconds in variable “U (01)”.
U (02) = 3000
: Set 30 seconds in variable “U (02)”.
U (03) = 4000
: Set 40 seconds in variable “U (03)”.
Summary of Contents for NT2021XA
Page 4: ... Safety Instructions ...
Page 8: ... Contents ...
Page 10: ...Chapter 1 Outline of EzSQ ...
Page 14: ...1 4 Chapter 1 Outline of EzSQ ...
Page 16: ...Chapter 2 Syntax ...
Page 68: ...2 52 Chapter 2 Syntax ...
Page 70: ...Chapter 3 Interface with the Inverter ...
Page 80: ...3 10 Chapter 3 Interface with the Inverter ...