Rol function, Ror function, Ror( a, n ) – Delta RMC151 User Manual
Page 377: Rol( a, n )
5 Programming
REG_DWORD: DWORD
Remarks
This function is not intended for common use. All RMC registers can be addressed
directly, making this function unnecessary in most applications. This function is intended
for the rare cases in which it is necessary to calculate an address mathematically or
address a register regardless of the data type or tag name.
The data type of the specified IEC address will be the external data type as specified in
the RMC register map. This data type need not match the returned data type. The bits of
the register will be preserved. That is, the data will not be converted.
Examples
MyReal := REG_REAL(num1 + 10,num2 + 8);
REG_REAL(10,8) := 20.0;
Accessing the axis' Scale parameter on an RMC70, given the axis number:
REG_REAL(12+MyAxis, 0) := 0.003;
5.14.2.33. ROL Function
ROL(a, n)
Rolls the bits in a to the left n times.
Parameters
a (DINT or DWORD)
The value to shift.
n (DINT)
The number of times to shift a. n must be between 0 and 31.
Return Value
Returns the same data type as a.
Remarks
The result of an invalid n is undefined.
Examples
ROL(16#8000000F, 2) returns 16#000003C2
5.14.2.34. ROR Function
ROR(a, n)
Rolls the bits in a to the right n times.
Parameters
a (DINT or DWORD)
The value to shift.
n (DINT)
The number of times to shift a. n must be between 0 and 31.
deltamotion.com
357