LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Architecture for Simulation and Hardware Options

What are the favorite architectures/design methods for running programs that have simulation and real hardware capabilities?  My first thought is to use objects to ensure that simulation and hardware are not mixed.  What architectures/design do you guys use?

----------------------------------------------------
Studying for CLA.
LabVIEW, inherit from social media habits!
0 Kudos
Message 1 of 2
(778 Views)

Except in the simplest of applications I think it's almost always worth abstracting your hardware with classes. The second decision you need to make is figuring out how you want to switch between your real and simulated hardware.

 

Personally if there were only two options, simulated and some specific hardware, I would probably just put the two options in a case structure and have the selector based on some INI token (default to real hardware if the token doesn't exist). This doesn't take too much effort but still enables you to switch between real and simulated components even after deployment which can be handy. Also, this can be easily replaced with a more complicated dynamic loading process if the need arises in the future as you already have the skeleton of INI string token input results in some abstract class output.

Matt J | National Instruments | CLA
Message 2 of 2
(726 Views)