1} x |v – Advantech ADAM-5000 User Manual

Page 52

Advertising
background image

Chapter 4

4-29

Getting the Totalizer Value

If users want to get the actual counter value, a formula such as follows
can facilitate an easy calculation from the initial counter value, overflow
value and current counter value:

V

tol =

{|V

ini

- V

min (or

V

max)

|+ 1} x |V

vf

| + |V

ini

- V

cur

|

V

tol : totalizer value

V

ini : initial counter value

V

min : min. couner value = 0 (fixed value)

V

max : max. counter value = 2

32

= 4,294,967,295 (fixed value)

V

vf : overflow value

V

cur : current counter value


Example:

If the initial value =10, overflow value =4, min. value = 0, current
counter value = 3, the totalizer value could be calculated as

Totalizer value = {|10 - 0| + 1} x| 4 |+ |10 -3| = 51















Advertising