Panasonic FP Series Programming Manual page 871

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

Date and time instructions
F158_SUB_DTBCD
_TIMEBCD
Subtracts time data (2 words) specified by s2_TIMEBCD from the date/clock data (3 words)
Description
specified by s1_DTBCD if the trigger EN is in the ON-state. The result is stored in the area (3
words, same format than s1_DTBCD) specified by d_DTBCD. All the data used in this instruction
are handled in form of BCD.
Example:
You cannot specify special data registers DT9054 to DT9056 (DT90054 to DT90056
for FP2/2SH and FP10/10S/10SH) for the operand d_DTBCD. These registers are
factory built-in calendar timer values. To change the built-in calendar timer value,
first store the subtraction result in other memory areas and transfer them to the
special data registers using SET_RTC_DTBCD (see page 874) instruction.
This instruction also exists as a P instruction (for FP2/2SH, FP3/5, FP10/10SH PLC types), which
is only executed at the rising edge of the EN trigger. Select [Insert P instruction] from the
"Instructions" pane if you require a P instruction. To facilitate reuse, the instruction then appears
under "Recently used" in the pop-up menu. Press <Ctrl>+<Shift>+<v> within the programming
area to open the list of recently used elements.
Example 1: clock/calendar data in
DTBCD format
August 1, 1992, Time: 14:23:31
(hour:minutes:seconds)
Example 2: time data in TIMEBCD
format
32 hours; 50 minutes; and 45 seconds
Availability of F158_SUB_DTBCD_TIMEBCD (see page 1321)
PLC types
Data types
Variable
s1_DTBCD
s2_TIMEBCD
d_DTBCD
870
Time subtraction
DUT
Member
MinSec
DayHour
YearMon
Data type
Function
DTBCD
minuend, time and date, values in BCD format
DWORD
subtrahend, 32-bit area for storing time data in BCD format
DTBCD
result in BCD format
Result
16#2331 (minutes/seconds)
16#0114 (day/hour)
16#9208 (year/month)
16#00325045 hex
(hours/minutes/seconds)

Advertisement

Table of Contents
loading

Table of Contents