F28_DSUB2

Redundant instruction

NOTE

This is a redundant instruction. It is replaced by: SUB

Subtracts the 32-bit data or 32-bit equivalent constant specified by s2 from the 32-bit data or 32-bit equivalent constant specified by s1 if the trigger EN is in the ON-state. The result is stored in d. All 32-bit values are treated as double integer values.

Parameters

Input

s1 (DWORD, DINT, UDINT, DATE, TOD, DT)

Minuend

s2 (DWORD, DINT, UDINT, DATE, TOD, DT)

Subtrahend

Output

d (DWORD, DINT, UDINT, DATE, TOD, DT)

Result

Example

  1.  (1) Example value16809984
  2.  (2) Example value 525312
  3.  (3) Result value 16284672 if trigger is ON
  4.  (4) 32-bit area

Remarks

Error flags

sys_bIsEqual (turns to TRUE for one scan)

if the calculated result is 0.

sys_bIsCarry (turns to TRUE for one scan)

if the result exceeds the range of 32-bit data (overflow or underflow).

Related topics:

Modified on: 2019-01-24Feedback on this pagePanasonic hotline