4 MLX200 Programming Guide
4.4 Programming Pitfalls and Best Practices
4-18
168542-1CD
168542-1CD
MLX200 Software and
Operations
4.4 Programming Pitfalls and Best Practices
This section will describe some potential problems and issues that can be
encountered by incorrect use of the MLX200 instructions.
4.4.1 Incomplete AOI Executions
To understand the potential pitfalls and problems that can come from
programming in MLX200, a good understanding of the basic life-cycle of a
motion instruction (AOI) is necessary. The basic steps of the AOI are:
1. When an AOI's ladder rung becomes Enabled, the EN and IP bit will
become active and all other bits will turn off. At this stage, the AOI will
secure an unused internal Buffer Index (up to 25 buffered motions
allowed) to hold the specific motion instruction parameters as well as
status information.
2. Once the hand-shaking with the MLX200 Control Module is completed
and the motion has been queued, the DN bit become active. At this
point, the internal Buffer Index is released and the instruction has
finished processing and can become disabled. However, the AC/PC
bits will only keep updating if the rung stays enabled.
3. When the motion begins executing, AC bit goes high.
4. Once the motion has finished executing, the AC bit goes low, and the
PC bit goes high.
5. When the AOI becomes disabled, the DN bit will also go low.
The caveat in this process is that the rung must be enabled until step 2
has completed and the AOI has had a chance to release its Buffer Index. If
the rung becomes disabled before the hand-shaking is complete, the
instruction will be left in an indeterminate state. A common programming
mistake that can lead to this issue is to trigger a motion instruction directly
off of an I/O signal as shown in Fig.4-24 "Motion Instruction Trigger from
an I/O Signal Correct". In this case, the application logic says to issue the
motion command as soon as the I/O signal linked to Local:1:I.Data.0 is
turned on. However, if this I/O signal only turns on for an instant or flickers
off temporarily, the motion instruction could be left in an indeterminate
state. One potential work around for this is shown in
Fig.4-23 "Motion Instruction Triggered from an I/O Signal Incorrectly".
Here, a variable called “issueMotion” is latched when the I/O signal is
turned on and then unlatched after the motion is complete. This ensures
that the instruction stays enabled throughout its execution.