F103_DSHL

Redundant instruction

NOTE

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

The function shifts the value at output d to the left. The number of bits at output d to be shifted to the left is specified by the value assigned at input n. This shift can lie between 0 and 255 (only the lower value byte of n is effective). Bits cleared because of the shift become 0. When input n = 0, no shift takes place. A shifting distance larger than 32 does not make sense, since when n = 32 the value at output d is already filled with zeros. The bit at position 31 - n (the last bit shifted out to the left) is simultaneously stored in the system variable sys_bIsCarry (carry flag) so that it can be evaluated accordingly. When n = 0 the content of the carry flag does not change.

  1.  (1) Data
  2.  (2) [n bits]2
  3.  (3) The data in the nth bit is transferred to R9009 (carry flag).
  4.  (4) [n bits] starting from bit position 0 are filled with 0s.

Parameters

Input

n (INT)

Number of bits to be shifted (range: 16#0 to 16#FF)

Output

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

32-bit area to be shifted to the left

Error flags

sys_bIsCarry (turns to TRUE for one scan)

if the bit at position 31-n has the value 1.

Related topics:

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