element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Sci Fi Your Pi
  • Challenges & Projects
  • Design Challenges
  • Sci Fi Your Pi
  • More
  • Cancel
Sci Fi Your Pi
Blog Meditech: Control panel LCD templates
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: balearicdynamics
  • Date Created: 16 Jul 2015 10:45 AM Date Created
  • Views 662 views
  • Likes 4 likes
  • Comments 2 comments
  • control_panel
  • meditech_project
  • alphanumeric_lcd
  • lcd_display
  • cpp_class
  • template
  • display_templates
  • raspberry-pi
  • sci_fi_your_pi
  • c++
Related
Recommended

Meditech: Control panel LCD templates

balearicdynamics
balearicdynamics
16 Jul 2015

Introduction

One of the main characteristics of the control panel features - controlled by the ChipKit PI board - is that it supervise all the Meditech status changes, manages the alarms and does not need a control menu. Despite what is shown on the LCD color screen display - controlled by the RPI master Raspberry PI - the control panel is autonomous supporting a bidirectional communication meta-language with the RPI master. In this scenario the LCD display will constantly show the most updated useful information reflecting the current status of the probes and the entire Meditech device.

 

The control panel LCD display

The control panel LCD alphanumeric display receives the strings to be shown in the various conditions directly from the RPI master device; this has the advantage to reduce the code size of the micro controller board and in the meantime can be easily localized for different countries.

 

To reach this goal in a fast and reliable way, every different status to be shown should follow a specific architecture taking in account of the size limits of the hardware: 20 characters x 2 lines only. These are sufficient for spot information and dome frequently updated data i.e. the internal temperature of the Meditech device. In addition depending on the probe that is currently selected, when needed the control panel analog potentiometer can be used for some signal / level calibration with an immediate feedback.

 

To make possible this behavior with a reasonably small amount of code on the ChipKit board I have introduced the use of a templates for every composite display setting that should be presented on the LCD display.

 

How LCD templates are coded

LCD Templates are defined as a series of different objects in the LCDTemplates class. This reduces the LCD definition of a template to a simple case switch. Depending on the selected template, all the fields positions are defined as shown in the following scriptlet:

 

case TID_HEARTBEAT:
      fields.row[HEARTBEAT_TITLE] = 0;
      fields.col[HEARTBEAT_TITLE] = 0;
      fields.row[HEARTBEAT_SPOT] = 1;
      fields.col[HEARTBEAT_SPOT] = 0;
      fields.row[HEARTBEAT_SPOTVAL] = 1;
      fields.col[HEARTBEAT_SPOTVAL] = 5;
      fields.row[HEARTBEAT_AVERAGE] = 1;
      fields.col[HEARTBEAT_AVERAGE] = 10;
      fields.row[HEARTBEAT_AVERAGEVAL] = 1;
      fields.col[HEARTBEAT_AVERAGEVAL] = 15;
      numFields = HEARTBEAT_FIELDS;
    break;

 

As you can see, the advantage is that while the entire LCD screen content is described, only few integers are used. For the better readability every name is defined with a symbolic constant in the corresponding LCDTemplates.h header file (see below).

 

//! Heartbeat frequency template
#define TID_HEARTBEAT 2
#define HEARTBEAT_FIELDS 5
#define HEARTBEAT_TITLE 0
#define HEARTBEAT_SPOT 1
#define HEARTBEAT_SPOTVAL 2
#define HEARTBEAT_AVERAGE 3
#define HEARTBEAT_AVERAGEVAL 4

 

The variable number of fields in every template is represented by an array of the simple field structure as shown in the following scriptlet

 

typedef struct LCDTemplateField {
  int row[6];       ///< Field row
  int col[6];       ///< Field column
} field;

 

Thus every LCD template is encoded with its own ID (in the example above we have used the TID_HEARBEAT ID) there are two further simplifications in the mechanism, improving the response of the system and simplifying the communication.

 

  1. Accordingly with this case example, the RPI master send the 'L' command with the sequence including the Template ID to be used and only the fields content in the same order as they are defined in the class template: @L;02;"Heart Beat";"Spot";"110";"Avg.";"107"
  2. The class and header can be used specular in the RPI master communication process to create the commands. The only difference is that the master also includes the strings definitions sent to the control panel board for visualisation.

 

Template examples

The following images shows a gallery of templates generated by the commands sent to the control panel by the RPI master.

{gallery:width=640,height=480} Control Panel LCD Template
imageimageimageimageimage

 

Reference

 

  • The code repository of the code can be accessed on GitHub at the following address: https://github.com/alicemirror/chipkit_serial_pi
  • The updated version of the documentation can be found on the documentation site at the following address: Meditech control panel software: Main Page

 

A preview copy of the documentation is attached below (PDF format)

Attachments:
imagerefman.pdf
  • Sign in to reply

Top Comments

  • amgalbu
    amgalbu over 10 years ago +1
    nice post! May I ask you a question: in the older posts I see the Meditech has a big LCD monitor display. Why did you add a small 16x2 chars display? Wasn't it more appealing to make a good gui on the…
  • balearicdynamics
    balearicdynamics over 10 years ago in reply to amgalbu +1
    Hi Ambrogio, maybe I have already wrote something about this, but it is a good question anyway; The concept is that the control panel is something independent by the rest of the system respect alarms and…
Parents
  • amgalbu
    amgalbu over 10 years ago

    nice post!

    May I ask you a question: in the older posts I see the Meditech has a big LCD monitor display. Why did you add a small 16x2 chars display? Wasn't it more appealing to make a good gui on the LCD monitor?

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • balearicdynamics
    balearicdynamics over 10 years ago in reply to amgalbu

    Hi Ambrogio,

     

    maybe I have already wrote something about this, but it is a good question anyway; The concept is that the control panel is something independent by the rest of the system respect alarms and alerts. So, the LID open and overheat warning should start anyway, also if all the other devices hangs. The same is when the system boots. There are different boot times due many factors influencing the components behavior (different speed, different components to load by the kernel etc.) So when the system boots the first hing you should see is that all is ok, the system is booting and as a component goes in its place (virtually, don't worry, no servos are provided for now! image ) the LCD is the only information you get before any other.

    Then there is a specific vision I have of biomedical. I have used many, recently and in past; one of the most confusing things for the operator is to see on the same display (the LCD I mean) different quality of information. The display should be ONLY the formal output of the probes, except if you are not administering the system with a keyboard and mouse. The common user never see the desktop at all.

     

    Then there is a part that is under development and will be the subject of the next post that complete the answer to your question: while you are seeing data on the monitor, for example the hearbeat and body temperature, or the ECG, in the meantime you can change and setup another probe simply using the IR transmitter and the menu answers you see on the small LCD.

     

    Enrico

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • balearicdynamics
    balearicdynamics over 10 years ago in reply to amgalbu

    Hi Ambrogio,

     

    maybe I have already wrote something about this, but it is a good question anyway; The concept is that the control panel is something independent by the rest of the system respect alarms and alerts. So, the LID open and overheat warning should start anyway, also if all the other devices hangs. The same is when the system boots. There are different boot times due many factors influencing the components behavior (different speed, different components to load by the kernel etc.) So when the system boots the first hing you should see is that all is ok, the system is booting and as a component goes in its place (virtually, don't worry, no servos are provided for now! image ) the LCD is the only information you get before any other.

    Then there is a specific vision I have of biomedical. I have used many, recently and in past; one of the most confusing things for the operator is to see on the same display (the LCD I mean) different quality of information. The display should be ONLY the formal output of the probes, except if you are not administering the system with a keyboard and mouse. The common user never see the desktop at all.

     

    Then there is a part that is under development and will be the subject of the next post that complete the answer to your question: while you are seeing data on the monitor, for example the hearbeat and body temperature, or the ECG, in the meantime you can change and setup another probe simply using the IR transmitter and the menu answers you see on the small LCD.

     

    Enrico

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube