Hello Sazna,
if I understood your application case correctly, your device provides several values (pH, voltage, temperature, status) in a data structure.The question now, what should happen with the data in your application?
Option 1: The values are displayed (or processed) directly In the GUI application. For example, there is one Gauge to display the voltage and another Gauge to display the temperature. If this is your application case, see the section Implementing a Device Interface: Property. As explained in this section, you implement in your Device Interface as many properties as values you want to receive from the device. For example, one property for pH, one property for voltage, etc. Then you can connect the Gauge (or other widgets) to the properties. When new value is reported from the the device, the Gauge is automatically updated.
Option 2: The values are collected and several preceding values are displayed together. For example as a continuous curve. All data values are stored in the device within an array of size N. There are thus N x pH, N x voltage, etc. values stored in the device. In such case, the simplest approach would be to implement in the Device Interface a set methods to query the values stored at particular position. The following could be the corresponding methods. The parameter aEntryNo identifies which of the item within the array to query the value:
method int32 GetValuepH( int32 aEntryNo )
method int32 GetTemperature( int32 aEntryNo )
method int32 GetVoltage( int32 aEntryNo )
method int32 GetStatus( int32 aEntryNo )
The missing feature is the notification for the GUI that there is new data available (new item in the array). For this purpose I would use the System Event. When new data arrive, the device triggers the event. The GUI application receives the event and queries the new data using the above described Get methods. The GUI application could, for example, reload all values into a graph. If the number items in the array is dynamic, I would enhance the interface by a further method to query the actual number of values:
method int32 GetNoOfValues( void )
I hope it answers your question.
Best regards
Paul Banach