Trending with Chart component

I’ve implemented a driver for the Ignition OPC server which provides some OPC values to Ignition. Then I add a OPC tag and make it store history. I display the history in a Chart component.

For testing purposes I created a connect/disconnect button for simulation connection drops and reconnects. When connoction goes down the driver sets all OPC driver tags to a BAD quality state.

All looks fine except the trend, which I am displaying, drops to zero when the device is disconnected.

I am using the Chart component since it lets me ignore bad quality values.

Other observations:

  1. the database table where trends are stored does not contain any records with floatval=0 and dataquality=192.

  2. the dataset, which the Chart component uses, gets a record (the last one) with a value of 0 and thus the trend drop to 0 when the device is disconnected.

  3. When the device is back on the row with value 0 dissapears and the trend is correctly plotted as new values come in.

The question is: why am I getting this row with value 0 in the dataset? :scratch:

Any suggestions would be very appreciated.

Thanks