F27_SUB2

Redundant instruction

NOTE

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

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

Parameters

Input

s1 (WORD, INT, UINT)

Minuend

s2 (WORD, INT, UINT)

Subtrahend

Output

d (WORD, INT, UINT)

Result

Example

  1.  (1) Example value 27
  2.  (2) Example value 16
  3.  (3) Result value 11 if trigger ist ON

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 16-bit data (overflow or underflow).

Related topics:

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