User guide

62 www.controltechniques.com SM-EZMotion Module User Guide
more room in the queue to store data. The maximum
number of pieces of data is determined by the Queue Size
parameter.
Destinations
Queue Clear - This destination automatically clears all of
the data out of the queue. The cleared data is not saved
and there is no way to recover the cleared data. This is
typically activated on power-up of the system to make sure
no old data remains in the queue.
Queue Compare Enable - The Compare Enable causes
the comparator internal to the queue to function. If the
Compare Enable is inactive, then the Queue Exit source
will never activate.
If activated, then the Queue Exit source will activate when
the Queue Data plus the Queue Offset is greater than or
equal to the Comparator Select parameter.
To fully understand the operation of the queue, Figure 85
has a more detailed view of the Queue object.
Figure 85: Queue Object and Components Diagram
7.3.14 User Variables View
User variables allow the user to store data related to their
application into a parameter, which the user can name.
The user must define each user variable by giving it a
Name, Resolution (number of decimal places), and Initial
Value. All user variables are signed 32-bit parameters.
Figure 86 shows an example of the User Variables view.
Figure 86: User Variables 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 parameter. Spaces are
not allowed in the name of a user variable.
Decimal
This parameter defines the number of digits (up to 6) to be
used after the decimal point for the specific variable. This
is the maximum resolution that the parameter will have.
Initial Value
This is the initial value of the user variable that will be used
on power up. If the user variable has been configured as a
Save to NVM parameter, then the value in NVM will
overwrite the initial value on power up.
Adding and Deleting Variables
The default number of variables is ten. To add more user
variables, click on the up arrow next to the "Number of User
Variables" spinner box on the User Variables view. The
maximum number of user variables is 256.
Only the last variable in the list can be deleted. To delete
the last variable, simply click on the down arrow next to the
"Number of User Variables" spinner box.
User variables are all Global variables. A Global variable
means that it can be accessed from any program.
Using User Variables in a Program
Once setup, User Variables can be used inside a program
for calculations, motion profile setup, or any other
user-desired function. To access User Variables, click
Drag In Variables button in the user program toolbar. User
Variables is a branch in the Drag In Variables selection
Data[ ]
Size
Offset
Full Level
Comparitor Select
Name
Queue Object
C
lear
C
ompare
E
nable
Exit
Empty
Full
Overflo
w
Data In
Queue Data = X
Data Out
Y = Queue Data