LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The search for a perfect design pattern

The search for a perfect design pattern


I am searching tip to upgrade a labview program used. I am looking for the best approach to make
my program more robust and scalable.Software and hardware. 

 

Today the system consists of :
GPS, weather station, ultrasound wind sensor, echosounder  and a  webcamera,  all connected to a computer.

The computer OS is XP pro with Labview version 2009 installed. Except for the webcamera all peripherals have serial communication interface. 

The webcamera  interface is ethernet.

 

Device                           Data type                 Interval                    Interface
GPS                                NMEA string                1 second                   Serial  rs232
Ultrasound wind sensor   NMEA string                1 second                   Serial rs232
Weather, temp,humid     NMEA string               35 seconds                 Serial rs232
Echosounder                  NMEA string               500ms-5 seconds       Serial rs232
                                                                      (depending of depth)

Webcamera                    Jpg                           Snapshot on demand  Ethernet

 

 

The tasks to be solved
All the data have to be stored.
All the data have to be displayed in real time.
Weather history data must be buffered to be plotted in a graph (pop-up windows).
Absolute wind speed and direction have to be calculated.
Option to send navigation data attached to email at desired time intervals.
Image snapshot at desired time intervals.

 


The data wich streams into the serial ports are not synchronized and vary in intervals . Would it be a good idea to put all the serial peripherals into a serial device server. Is it possible to let the server place a event in my software, to  trigger reading of the data, from the the server.  Or how could that be done in other ways?


The perfect design pattern
In version one of the software I use 4 parallel loops to read data at the serial ports, inside these loops the data was separated and outputted to a datasocket server.  I used datasocked read in other loops to present and store data. But it did not look good, and yes it was a mess, a really rat nest. I am looking for a better design pattern.
 Could some kind of producer/ consumer pattern be the way to go?
Comments and tips are wanted.

TIK
0 Kudos
Message 1 of 3
(2,811 Views)

Take a look into my

Event Nugget

You will use a module for each device that sends the data on the bus and several modules for the other tasks (email, logging, display). Most of these modules might be state machines.

 

Felix 

0 Kudos
Message 2 of 3
(2,788 Views)

Nice Project! Congratulations 😉

I am not an expert for large applications. But your project looks nice and manageable. Here my straightforward ideas:

I would build a GUI, with menu bar, pop-up graph display thing.

THen low level tasks with each one handling a RS232 device and feeding queues or fireing notifications.

Maybe handle the snapshots in an event structure on the GUI blockdiagramm.

When GUI and producer tasks are running, close the gap with a middle layer which captures the data and actualizes GUI by reference. For instance the graph-thing-dialogue triggers a "flush queue" and displays the last 200 entries of the array of data.

 

I often run into issues when having defined too many userevent structures. I guess i am too stupid for that. Thats why i rather use queues (when i dont want to loose data) or notifiers (data is up-to-date). Nevertheless I like a "stop-all-tasks" user event...traditionally.

 

My team is actually developing a large application. We are using LabVIEW classes and objects.

 

So have fun!

Yours

RZM

 

0 Kudos
Message 3 of 3
(2,745 Views)