LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

OO concepts

Hi,

I am in process of writing a test program to run a experiment for chemical parameter monitoring

I am using Producer consumer model with queue message handler.

I have main VI which calls Acquisition VI and Logging VI, each of these talk to each other based on scenarios.

 

Acquisition VI talks to Unit under test and also to external instruments in the test setup.

The external instruments I use are same in nature, single instrument can measure multiple chemical parameters. Each communicate using different serial ports. 

Our setup has these instruments for monitoring very specific single parameter. Instrument A measures "param x" and Instrument B measures "param y" and so on. (Instrument A has capability to measure param x, param y and so on)

Now I am planning to use Object oriented concept to this kind of requirement, 

Should I create separate class for each instrument ? If yes why ? If no how can make it to communicate to 2 instruments and monitor different parameters?

By Any chance we can use re-entrant option while adopting Object oriented method of programming ?

 

I am newbie to Object oriented programming, your inputs would definitely help

Thanks

0 Kudos
Message 1 of 2
(2,269 Views)

Typically you want to emulate real life with your OOD, so having each instrument as a separate class is good (if it's a multifunction device you often use e.g. AI as the top object and view each function as a separate instrument)

Children to AI can e.g. be DAQ and Keithley which will both have a Open, Configure, Read and Close functions.

Why? The class design allows easy expansion and dynamic change if you e.g. add a 3rd manufacturer.

Reentrancy is common in class functions, but not a must.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 2 of 2
(2,240 Views)