Hi, I'm working on an Ignition Report that will hopefully utilize the Timeseries chart to display multiple digital trends at once. For example: the On/Off 1 or 0 trends of multiple devices.
The problem is that if more than one devices have the same value at times, you can only really see one layer of the trend at a time. See picture below:
I was wondering if someone knew a way to add a digital offset between the trends? As in, make the trends spaced apart vertically so you could see each line individually.
If my data was a regular sql query, I would just add 0.5 to the output of each separate trended set of data. However, I'm not sure how I'd do this with a Historian Query.
There's an option in the trend options to use a digital offset. You'll also want to mess with the data representation settings in the chart properties.
Alternatively, make an expression tag to apply an operator-supplied multiplier to each digital tag and trend that instead.
What trend options are you referring to?
I can try to get some expression tags working, but if there is a setting in the timeseries chart or data source side I'm not seeing, that would be great.
No worries! The solution then for now is, like you said, to create some expression tags that add an offset.
For example:
Bool Tag1 = {[.]../Devices/device_tag_1} + 0.25
Bool Tag2 = {[.]../Devices/device_tag_2} + 0.5
Then as long as those expression tags have History enabled and a location to store to, the Historian Query datasource in the report can pull from that.
Having the "Digital" Style in the Timeseries Chart settings include a digital offset automatically is definitely on my wish list then!
I would not historize expression tags that have an offset. That makes them not booleans any more. And hard-codes what trends can be used with what other trends.
Consider using a script data source to reprocess your historian results to include the desired offsets at point of use.
Why does it matter if they're not "boolean" any more? I'd even go so far as to argue that anything non-zero (and non-null) is boolean True (see Python).
Or, is your point more that the pen type should no longer be "digital" ?
A script would also be hard-coding, no?
My suggestion was to use an operator-set multiplier as well, so far from hard-coded, imo. Although I do see the added benefit of applying the multiplier to the history after it's retrieved because in the event that the offset is changed it would apply the offset to all the data, not just data from this point forward.
The issue is that if we apply the offset as illustrated in OP's image, the 0s also become non-zero. I guess that issue can be entirely side-stepped by also historizing the raw value and using that for any boolean evaluations, but that's getting wasteful of storage.
If you script it in the Timeseries Chart's configureChart method (or as a script data source) you could dynamically loop over the pens and add the required offset at time of report generation. Then you can add, remove, or reorder pens and the changes would apply to the next report without any further effort.