If you are going to deal with even more than one device type, then controller + device interface seperation, which communicates using Name vlaue pairs would be a good solution
DECOUPLING
Using name value pairs allows you to seperate your code into a device + controller + application code structure
Sample Code
class DeviceInterface
{
void Initialize(IController & Controller);
void Close();
bool ChangeParameter(const string & Name, const string & Value);
bool GetParam(string & Name, string &Value );
}
Each device implementation, when created should be created with the identification of the controller that can accept its commands and translate them into the actual device commands
interface IController
{
Initialize(DeviceSpecific & Params);
Close();
bool ChangeParameter(string & Name, string & Value);
bool ChangeParams(string & Name[], string &Value []);
}
Your user code would look something like this
IController objController = new MeasurementDevice(MeasureParram);
DeviceInterface MeasureDevice = new DeviceInterface(objController);
string Value;
MeasureDevice.GetParam("Temperature", Value);
if (ConvertStringToInt(Value) > 80)
{
MeasureDevice.ChangeParameter("Shutdown", "True");
RaiseAlert();
}
All that the DeviceInterface class should do is take care of passing the commands to the controller. The controller should take care of the device communication.
Advantages of the interface seperation
Protect againt changes
This sort of decoupling will allow you to isolate your app code from the controller. Changes in the device does not affect your user code
Maintainability of Appliction Code
Addtionally the user code is always clean and you need bother only with the application logic. But had you defined multiple interfaces / created templates or generics with multiple types of parameter structs specific to controller, your code would have lots of device dependent junk in it which might hurt readability and create maintenance issues whenever your device / its parameters changes.
Implementation ease
You can also hive off different controller implementations into its own projects. Plus your application can also configure commands and responses in a more dynamic naure using XML files etc that can ship along with the controller classes such that your entire application becomes more dynamic in nature.
Real Life
One of the latest production controller projects from the leader in that domain works in the same manner. But they use LON for the device communication.
LON ?
LON protocol used in controllers (think air-conditioner / boiler / fans etc) networks use this concept to talk to various devices
So all that you would need to have is a single interface that can talk to your device and then sends the name value pair to it using LON. he use of a standard protocol will also allow you to talk to other devices besides your measurement instrument. There are open source implementations of LON available if your device uses LON.
If your device does not support LON then you might have to design something where the user code still works on name value pairs and an opposite interface translates your name value pairs into an equivalet corresponding cotroller struct+ and communicates to the individua device in the way the device understands .
Hope this comes useful.