User guide

Configuring an Application www.controltechniques.com 63
box.
7.3.15 User Bits View
User Bits act just like User Variables except that they allow
the user to store bit level parameters rather than 32-bit
parameters. The user may customize each User Bit by
giving it a Name and an Initial Value.
The Name for each bit may be up to 12 characters in
length, and must start with a alpha character (non-numeric
character). Spaces are not available in the Name for a User
Bit, however the underscore character ("_") may be used.
The Initial Value for each user bit is configured using a
checkbox for the specific bit. To make the Initial Value "On"
or "Active", simply select the checkbox for that bit. The
default value for each User Bit will be "Off" or "Inactive", the
checkbox will be clear.
Figure 87 shows an example of the User Bits view.
Figure 87: User Bits View
The following parameters are part of the User Variable
definition:
Name
This is a twelve-character string that allows the user to
assign a descriptive name to the bit. Spaces are not
allowed in the name of a user bit.
Initial Value
This is the initial value of the user bit that will be used on
power up. If the user bit has been configured as a Save to
NVM parameter, then the value in NVM will overwrite the
initial value on power up.
Using User Bits in a Program
User Bits may be accessed in a User Program. Bits are
turned on by setting them equal to ON, TRUE, YES, SET,
or ENABLE (not case sensitive), and can be deactivated by
setting them equal to OFF, FALSE, NO, CLEAR, or
DISABLE.
Setting an individual bit equal to 1 or 0 in a user program
will cause a red dot error. The Boolean values listed above
must be used.
Adding and Deleting User Bits
User Bits can be added or deleted in groups of 32-bits.
Individual bits cannot be added or deleted. The default
number of User Bits available is 32. To add an additional
32 bits, simply click on the "Up Arrow" on the spinner box
at the top of the User Bits view (see Figure 47).
To decrease the number of User Bits by 32, click the "Down
Arrow" on the spinner box. When decreasing the number
of User Bits, it is always the last 32 bits in the list that will
be eliminated.
User 32-bit Bit Register and User Bit Masking
When using different communications protocols (i.e.
DeviceNet, Profibus, Modbus), it is often desirable to
access groups of User Bits in a single parameter, rather
than having to access them individually. In the
SM-EZMotion module it is possible to access 32 User Bits
in a single parameter. This parameter is named
BitRegister.#.Value. Because some of the 32 User Bits
may be used by the program, and should not be modified
from the network communications, it is possible to "Mask
Off" certain bits. Masking bits prevents them from being
modified in the program when the 32-bit parameter is
written to.
When a User Bit Register (group of 32 User Bits) is written
to, the value is then logic-AND'ed with the mask to
determine the resulting state of each of the 32 individual
bits. If the individual bit value of the 32-bit mask is "1", then
the corresponding bit from the written 32-bit parameter is
passed through, and the resulting value stored in the
specific bit will be the written bit value. If the bit value of the
32-bit mask is "0", then that particular bit is blocked (or
masked), and the resulting bit value does not change,
(Original Value AND NOT 32-Bit Mask) or (Value Written
over Network AND 32-Bit Mask). An example of this is
shown in Figure 88.
Figure 88: Writing to the User Bit Register
The Mask is only used when WRITING to the 32-bit
parameter, BitRegister.#.Value. When reading the 32-bit
0101010101010101010101010
1
0
1
0
1
0
1
1000000101000000100000100
0
0
0
0
0
0
0
0
15
Bit #31
0
1
1
0
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
1
1
1
0
1
0
1
0
1
1
0
1
1
0
0
0
0
0
0
0
1
0
1
0
0
0
0
1
1
0
1
0
1
1
1
0
1
0
1
0
1
0
0
Original
Value
Value written
over network
32-bit Mask
Result stored
in each bit