CNC machine semaphore application, using expressions (Expr.txt) – Part 3

At this step of the process we pretty much defined everything needed for semaphore application and we can begin writing the program.

Diagram of program

First we will illustrate simple program diagram(flowchart). Diagram is very helpful, because it visually  illustrates the program flow(in this case state machine) which we can use as a reference when designing program structure.

Diagram for state machine of our semaphore application:

 

Each state is able to transition to other state, which was defined earlier in the process. All transitions are conditioned, meaning in order for transition to happen, condition needs to be fulfilled.

So we will now describe each states possible transitions as also transition conditions.

 

IDLE state:

It can transition to:

  • Run state:
    • Condition:
      • Start program
  • Estop state:
    • Condition:
      • Estop activated

RUN state:

It can transition to:

  • Idle state
    • Condition:
      • Stop program
  • Pause state
    • Condition:
      • Pause program
  • Estop state
    • Condition:
      • Estop activated
  • Alarm state
    • Condition:
      • Door Open

 

PAUSE state:

It can transition to:

  • Run state
    • Condition:
      • Pause released
  • Idle state
    • Condition:
      • Stop program
  • Estop state
    • Condition:
      • Estop activated
  • Alarm state
    • Condition:
      • Open door

ALARM state:

It can transition to:

  • Estop state
    • Condition:
      • Estop activated
  • Idle state
    • Condition:
      • Error reset

 

ESTOP state:

It can transition to:

  • Idle state
    • Condition:
      • Estop released
  • Alarm state:
    • Condition:
      • Alarm not cleared
      • Estop released