ETEL Doc. - Operation & Software Manual # DSC2P 903 / Ver. F / 3/6/05
Chapter D: Programming
Operation & Software Manual
Direct Drives & Systems
223
14.3 Accumulator functions
The accumulator functions allow mathematical operations, tests and jumps, depending on the XAC value.
14.3.1 Set the accumulator: XAC
The
accumulator
is a particular variable which makes extra operations with respect to those that can be made
on the other registers. The accumulator also accepts arithmetical and logical
dyadic
operations. Moreover, the
value contained in the accumulator is retrieved at the output of a routine, even if this routine uses also the
accumulator.
The
XAC
command enables the access to the accumulator. This command allows the user to store or to read
the accumulator value, but also to make arithmetical and logical operations.
Examples:
XAC.1=1029
;The accumulator is equal to 1029.
XAC.1=K2:2.1
;Attributes the value contained at the depth 2 of parameter K2 to the accumulator.
XAC.1=SPD.1-X12.1
;The accumulator is equal to the difference between the programmed v
max
maximum
value (contained in parameter K211) and the X12 user variable value.
Remark:
Accumulator max. value: XAC < (2
31
- 1), and min. value: XAC > - 2
31
Values in <P1> and <P2> may be immediate values or registers.
Caution:
XAC
is pointing on the user variable X511; thus,
never use the register X511!
Monadic operation
Dyadic operation
Arithmetical operations
Addition
Subtraction
Multiplication
Division
XAC.1 + = <P1>
XAC.1 - = <P1>
XAC.1 * = <P1>
XAC.1 / = <P1>
XAC.1 = <P1> + <P2>
XAC.1 = <P1> - <P2>
XAC.1 = <P1> * <P2>
XAC.1 = <P1> / <P2>
Logical operations
Not
And
Or
Not and
Not or
Shift to the right
Shift to the left
XAC.1 ~ = <P1>
XAC.1 & = <P1>
XAC.1 I = <P1>
XAC.1 & ~ = <P1>
XAC.1 I ~ = <P1>
XAC.1 >> = <P1>
XAC.1 << = <P1>
XAC.1 = <P1> & <P2>
XAC.1 = <P1> I <P2>
XAC.1 = <P1> & ~ <P2>
XAC.1 = <P1> I ~ <P2>
XAC.1 = <P1> >> <P2>
XAC.1 = <P1> << <P2>
Содержание DSC Series
Страница 2: ...THIS PAGE IS INTENTIONALLY LEFT BLANK ...