4 MLX200 Programming Guide
4.1 Developing a Simple Application
4-4
168542-1CD
168542-1CD
MLX200 Software and
Operations
4.1.3 OPERATING A USER APPLICATION FROM HMI
After writing an application, it is often desirable to start and stop the
application from the provided MLX HMI. To do this, the Main Screen has a
“Start” button that is tied to the MLX[].UserStartProgram variable which
can be used to initialize the application. The “Start” button will only appear
on the screen in Idle mode, but it is generally good practice to double-
check that the state is correct before starting as shown in Fig.4-4
"Application Initialization from the MLX HMI".
Fig. 4-4: Application Initialization from the MLX HMI
After pressing the Start button from the HMI, this button will be replaced by
the “Step Pause” button (left on Fig.4-5 "Step Pause and Step Continue
Buttons") and the value of MLX[0].UserStepAndContinue will be set to 1.
When the “Step Pause” button is pressed, the “Step Continue” button will
take its place and the value of MLX[0].UserStepAndContinue will be set to
0 (right on Fig.4-5 "Step Pause and Step Continue Buttons").
Fig. 4-5: Step Pause and Step Continue Buttons
It is also useful to have some logic to reset the program
step; however, this logic will vary from application to
application. For example, the program step could be reset
to 0 whenever the system was aborted (MLX[].SystemState
== 8) or whenever the system was reset to ServosOffReady
(MLX[].SystemState == 12). Alternatively, the program step
could be reset whenever the MLX200 Control Module was
not connected, so that the program would only reset when
the MLX200 Control Module was restarted.