Shift Left
ActionStep Reference » Programming » Number Operation » Logic » Shift Left
The ActionStep Shift Left moves the bits to the left based on a specified number and stores the number in Result of the result list. The trailing bit or bits after moving to the left are filled with zero ("0"). The following number types are allowed: Signed and Unsigned.
- Open the Programming node in the Workspace Explorer.
- Open the Number Operation node.
- In the Logic node, select the Shift Left ActionStep.
Parameters:
The ActionStep has the following input parameters:
NAME |
DESCRIPTION
|
---|---|
Number Type
|
Specifies the data type to be used for a number.
Allowed Context Scopes [Fixed, Local, Global] Allowed Values [Signed Number, Unsigned Number] |
Pattern 1
|
The number whose bits are to be moved towards the left.
Allowed Context Scopes [Fixed, Local, Global] Allowed Context Types [Variable, Parameter, Enum] |
Pattern 2
|
The number of places the bits have to move towards the left.
Allowed Context Scopes [Fixed, Local, Global] Allowed Context Types [Variable, Parameter, Enum] |
Results:
The ActionStep returns the following results:
NAME
|
DESCRIPTION
|
---|---|
Result |
Contains the shifted number.
Allowed Context Scopes [Fixed, Local, Global] Allowed Number System [Binary, Decimal, Hexadecimal] |
The number type set in the ActionStep Shift Left determines the data type of its Result even if the variables and/or parameters that were set for patterns 1 and 2 are of different data types.
|
Example 1 (Display a variable's hex value after shifting to the left):
This example moves the bits to the left for the local Hash variable with an Unsigned Number data type. The result is changed from Decimal to Hexadecimal value with the conversion operation and is then output via Write Text.