21
Also, for any given coil, the targeted bit in the holding register in which that coil
resides can be determined by:
16
%
)
1
(
−
=
coil
bit
…Equation 2
Where “coil”
∈
[1…65535], “bit”
∈
[0…15], and “%” is the modulus operator,
which means that any fractional result (or “remainder”) is to be retained, with
the integer value being discarded (i.e. it is the opposite of the “floor” function).
From these equations, it can be seen that the largest holding register number
that can be accessed via this coil-to-register mapping method is 4096 (which
contains coil 65535).
For clarity, let’s use Equation 1 and Equation 2 in a calculation example. Say,
for instance, that we are going to write to coil #41019. Using Equation 1, we
can determine that coil #41019 resides in holding register #2564, as
2564.625
= 2564. Then, using Equation 2, we can determine that the bit
within holding register #2564 that coil #41019 targets is (41019-1)%16 = 10, as
41018%16 = mod(2563 r10) = 10. Therefore, writing to coil #41019 will write to
holding register #2564, bit #10.
As a side note to this example, if we convert holding register #2564 to its
hexadecimal equivalent, we obtain 0A04
16
. Applying our knowledge of register
remapping discussed in section 8.5, we know that this holding register
accesses ASD parameter FA04, which is the drive’s RS485 command word.
Bit #10 of this command word is the “run/stop” bit, and writing to coil #41019,
therefore, will allow us to command the drive to run and stop.
8.7
Data Mirroring
By using a technique called “data mirroring”, certain drive parameters are
handled by the interface with special processing that allows network accesses
to these parameters to have priority handling. This priority handling minimizes
the access latency incurred when reading a parameter from or writing a
parameter to the drive by maintaining copies of the parameter values within the
interface itself. By default, the following ASD parameters are always mirrored:
FA04 (RS-485 command word)
FA05 (RS-485 frequency command)
FD00 (output frequency)
FE01 (status 1)
In addition to the above parameters, up to 4 additional drive parameters can
be designated by the user to be mirrored. This can be beneficial by improving
network response time when an application regularly accesses parameters
other than the four mirrored parameters indicated above.
Buy: www.ValinOnline.com | Phone 844-385-3099 | Email: [email protected]