Design and Summary

Design

The project was designed to be a conventional dispensary coffee machine. The machine allows the user to select and customize their beverage selection then displays a total price. The user then has the choice to either pay by coins; where an HMI coin selection screen will display the coins, the total, total payed and balance, or have the option to use their student card to pay via an eftpos machine, or allowing the user to pay a portion by coins and then complete their purchase by eftpos. When using the efpos the HMI screen shows an animation of a student card being tapped on an eftpos machine. Once the order was paid in full the program calculates the change due based on the available coins available in the machine. If change is due then an HMI screen shows the exact coins returned to the user then proceed to showing an animation of a coffee cup being filled with coffee to the desired level. Once the coffee cup is filled a new window from the HMI displays an order receipt and provides an option for the user to provide feedback in the form of a 5-star rating.

The design of this machine was not specified by our project leader. We were not asked to use the Siemens TP177 Touch Panel but felt it was well suited for this project.

All the programming  for the machine was done using the SCL and GRAPH language.

User interactions:

  • The size of the beverage
  • The type of beverage
  • Additions to the beverage (extra shot, skim milk, etc.)
  • Payment option
  • Satisfaction rating system

The program was achieved by implementing 3 Organisational blocks (OB100, OB35, and OB1) all of which would be written in SCL. Within each of the Organisational Blocks are functions that allows each part of the program to be independent from the other.

As the Step7 GRAPH is a tool used to code State Machine Designs, it was decided to create a State Macine Design for the coffee making/ordering process. The coffee ordering process was split into individual states/step made up of transitions and actions. The preliminary code written using the Step7 Graph language consequently facilitated the sequencing of the HMI screens. Having the HMI screen sequence following the State Machine sequences allowed our group to work simultaneously increasing productivity and communication.  This  also made it easier to debugging when monitoring the project through the TIA portals watch and force tables.

The S7 GRAPH language and in built functions allowed for multiple transitions in or out of particular states. For example the jump function were used for creating back buttons on the HMI panel to allow the user to return to the previously display.

Capture

GRAPH Functions used:

  • Jumps
  • Alternative branch
  • Delay timers
  • SCL statements and condition
  • Counters

 

Step 7 SCL is a higher level text based language and thus inherently more flexible then Ladder logic, FBD, and Graph. It has many functions that are commonly used in other computer programming languages such as IF, ELSE, While and For loop. SCL is well suited for performing complex mathematical driven operations and it allows the use of system built and user made functions written in the S7  Languages.

The features and the flexibility found in the S7 makes it easy to create individual functions for performing specific tasks for the coffee machine program. These individual functions were then used outside or in the S7 GRAPH codes. An example of this is the  calculation of the order total and coin calculator. SCL was much easier to use then the other software as various amounts of data can be written into arrays. Later a FOR loop was use to access and manipulate the data.

Example SCL Code:

To the right is some of the code used to process the amount of each change denomination to be refunded to the user based on the value and availability of change denominations. All calculations are done using integer division which discards any modulus of the division.

change_arrays

Stepping through the code, the value owed in cents is first stored as change due. Then, from highest to lowest, each denomination is checked for availability (Change_Avail[]) and if available the required amount of that denomination is stored in another array (Change_Given[]) before updating the amount of Change_Due. This continues until all denominations are checked and any unallocated amount is forfeited (less than the smallest available denomination).

SCL Specific Function used

  • If state statements
  • CASE statements
  • On delay timer
  • Array of Boolean and integers
  • For Loop

Summary

This project gave a good outline of the capabilities, advantages and disadvantages of Siemens GRAPH and SCL environments. Our group strive to test and implement all aspects of the 2 languages. We explored and utilized their full potential, and their beneficial uses for future programs. This project exposed us to the benefits of having the ability to use both into on platform but also exposed us to some of the problems associated with the connectivity and limitations of the software.