Chapter 16 PLC Function Applications│CP2000 
 
16-105
 
API   
 
TCMP 
 
         
Comparison of calendar data 
160 
 
 
P 
 
  
 
 
Bit device    Word device   
16-bit command    (11 STEP) 
TCMP  Continuous 
execution type 
TCMPP  Pulse 
execution type 
 
32-bit command   
-  -  -  - 
 
Flag signal: none   
X  Y  M  K  H  KnX  KnY  KnM  T  C  D 
S1       
*  *  *  *  *  *  *  * 
S2       
*  *  *  *  *  *  *  * 
S3       
*  *  *  *  *  *  *  * 
S     
*  *  * 
D   
*  * 
 
Notes on operand usage:   
Please refer to the function specifications table for each device in 
series for the scope of device usage   
 
  S
1
: Sets the hours of the comparison time, setting range is "K0–K23." S
2
: Sets the 
minutes of the comparison time, setting range is "K0–K59." S
3
: Sets the seconds of 
the  comparison  time,  setting  range  is  "K0–K59."  S:  current  calendar  time.  D: 
Results of comparison.   
  Compares the time in hours, minutes, and seconds set in S
1
–S
3
 with the current 
calendar  time  in  hours,  minutes,  and  seconds,  with  the  results  of  comparison 
expressed in D.   
  S The hour content of the current calendar time is "K0–K23." S +1 comprises the 
minutes of the current calendar time, and consists of "K0–K59." S +2 comprises the 
seconds of the current calendar time, and consists of "K0–K59." 
  The current calendar time designated by S is usually compared using the TCMP 
command after using the TRD command to read the current calendar time. If the 
content value of S exceeds the range, this is considered an operating error, the 
command will not execute, and M1068=On.   
 
  When  X10=On,  the  command  will  execute,  and  the  current  calendar  time  in 
D20–D22 will be compared with the preset value of 12:20:45; the results will be 
displayed in M10–M12. When X10 On→Off, the command will not be executed, but 
the On/Off status prior to M10–M12 will be maintained.   
 
  If results in the form of ≥, ≤, or ≠ are needed, they can be obtained by series and 
parallel connection of M10–M12.