Update on Conventions

advertisement

26 February 2009

Update on Conventions

• Why (not) Using Conventions

• LabVIEW Style Guide

• CS Coding Conventions

• CS Color Schemes

Dietrich Beck

Why not Using Conventions

• conventions might contradict personal preferences

• "I use my own conventions"

• it is very hard to agree on and to accept common conventions

• sticking to conventions slows down development

• checking conventions and "refactoring of code" takes time

• ...

26 February 2009 Dietrich Beck

Why Using Conventions?

• ideal: everybody should stick to the same conventions

• code is easier to maintain

• others might be able to read your code

• reduce bugs

• improve re-usability

• save time (later!)

• avoid re-implementation of the same functionality (if code needs to be thrown away)

• ...

• of course: exceptions in specific cases

26 February 2009 Dietrich Beck

LabVIEW Style Guide

• LabVIEW development guidelines:

– http://www.ni.com/pdf/manuals/321393d.pdf

• LabVIEW Style Checklist

– LabVIEW 

Help

Search the LabVIEW Help ...

 search for

LabVIEW Style Checklist

– http://www.ni.com

 search for LabVIEW Style Checklist

 select LabVIEW version

– google for LabVIEW Style Checklist

• examples

– use and wire Error in and Error out

– wiring: from left to right, no hidden wires, no backward wires

– document code via descriptions of VIs, controls and indicators

– ...

26 February 2009 Dietrich Beck

VI-Analyzer

• LabVIEW 

Tools

VI Analyzer.

• quotes from NI-Website

– "...Use the LabVIEW VI Analyzer Toolkit to improve code quality and catch potential problems earlier during development. The

VI Analyzer automates code reviews and enables more exhaustive code analysis...

"

– "... avoid overlooking improper coding techniques that could impact an application’s performance, functionality, or maintainability. Enforce good programming practices and coding styles within teams of developers in order to ensure the readability and functionality of code. Overall, use the VI Analyzer

Toolkit regularly to develop high-quality, robust LabVIEW applications..."

26 February 2009 Dietrich Beck

How to Use the VI Analyzer

• makes sense, if developer agree to coding conventions

• check VIs, using a prepared configuration file

• aim for less then 

2% of failed tests

– improving VIs takes about one day per library 

– you might even find a few bugs 

26 February 2009 Dietrich Beck

CS (Coding) Conventions

• http://wiki.gsi.de/cgi-bin/view/CSframework/CsCodingConventions

• specific for CS framework

• depends on LabVIEW Style Guide (LSG)

• further refines LSG

• defines exceptions from LSG

• defines data types for communication

• some features might be checked using VI Analyzer

• some features require a real code review

• ...

26 February 2009 Dietrich Beck

SCADA GUI Design and Colors

• common look and feel within an application

• indicate safety relevant information intuitively and unambiguously red: danger yellow: warnin green: o.k.

26 February 2009 blue: you should do something

Dietrich Beck

SCADA GUI Design and Colors

• example: PHELIX' "FiveColor.vi" defines colors for states

• user Interface

– DIN EN ISO 9241 -110

– SCADA: IEC/EN 60073 (VDE 0199), IEC/EN 60204-1

• the above is not accessible via the web. Therefore:

– US Army TM 5-601: "SCADA Systems ..." http://www.army.mil/usapa/eng/DR_pubs/dr_a/pdf/tm5_601.pdf

– http://de.wikipedia.org/wiki/Mensch-Maschine-Schnittstelle

– ...

• color blind people: use rate of blinking

– fast: error/fatal

– slow: warning

– none: o.k. (more or less)

– problem: individual blink rate for indicators with LabVIEW

26 February 2009 Dietrich Beck

Definition of Colors

(by UtilityLib)

26 February 2009 color of Boolean control/indicator background color text color (use with background color) text color (use with white background)

Dietrich Beck

How to Use

• need reference of control or indicator

• set status of value

• different VIs

– Boolean

– String or Numeric

– Listbox

– general: just set color of label and caption

26 February 2009 Dietrich Beck

Semi-Automated Coloring

"UtilityLib.set color of panel to default.vi":

26 February 2009 Dietrich Beck

GUI Conventions...

26 February 2009 Dietrich Beck

Download