7.1.1 - Tablet Custom Control

Instructions:

Create a new ’Custom Control’:

  • Create a cluster containing the parameters we specify for our tablet machine:
    • Expiration date (Time stamp)
    • Tablets Volume (numeric control)
    • Price per unit (numeric control)
    • Cluster ‘Temperature Range’ with Temperature Minimum and Maximum (numeric control)
    • Tablet label
  • Change type from ‘Control’ to ‘TypDef.’
  • UntitledMake it look nice with customize mode
  • Save it as ‘TabletTypDef.ctl’

Create the VI:

  • Open a new VI ‘Tablet Machine’.
  • Place a ‘Tab Control’ with two pages – ‘Drugs’ and ‘Maintenance’.
  • Place a ‘Radio Button’ control to choose between the two tabs. Place it within a while loop and make 20 ms idle time with ‘wait ms’.
  • Import your ‘TabletTypDef.ctl’ to the front panel. Initialize an array with length three(three types of tablets) and ‘TabletTypDef.ctl’ as data. Make it available as a shift register in your while loop. 

Maintenance mode:

  • Make a ‘Menu Ring’ control to choose and display which tablet you are editing. Extract all Tablet labels to an array using a for loop. This will be input values for the ‘Menu Ring’ control. Hint: right-click/Create/Property Node/…?
  • Make a case to show data from your tablet array and a case to save new data. Use ‘Unbundle by Name’ and ‘Bundle by Name’ to make this happen. Display new values to be saved and the current values from your array. Should look similar to this:


The Drug Machine mode:

  • Make a menu ring ‘Drug Type’ like the one in ‘Maintenance Mode’ and reuse the for loop.
  • Make a button for ‘Giving drugs’.
  • Make a ‘progress bar’ to show the current volume of the chosen tablet.
  • Make an alert Boolean indicator to show if current tablet volume is zero.
  • Use a Boolean AND gate to make sure that you cannot extract tablets if the volume is zero or below.
  • Use this as inspiration:

Finish the interface. Make a ‘Property Node’ for making ‘TabletTypDef.ctl’ not visible. Hide the tabs.

 

* Make a temperature alert for highest minimum temperature and lowest maximum temperature.

* Make “out of date” alert and show which tablet is expired.

Created by Samuel Thrysøe © 2013