Skip to content

Display Builder Plot Compatibility

Kay Kasemir edited this page Jun 6, 2023 · 6 revisions

Plots are complex widgets and likely require manual adjustments to auto-converted *.opi files.

The Display Builder provides several plot widgets:

  • XYPlot for waveforms, either a Y waveform over its array indices, or a Y waveform for values over an X waveform for positions, where both waveforms need to have the same element count
  • Stripchart and Data Browser for scalar PVs over time

The BOY XYGraph widget implemented both functionalities, but which one it actually performed would often depend on the data type of the PV, which is only known at runtime.

When opening a display, or when bulk-converting displays offline, the PV data type is unknown. The Display Builder thus converts most BOY plots into XYPlot widgets. Such displays likely require manual editing to adjust details, and/or to replace the plot with a Stripchart or Data Browser widget.

Waveform Data

While a scalar value in EPICS comes with units, display precision and other metadata, a waveform on its own does generally not provide enough information for a display. The elements of a waveform might represent samples taken by a fast ADC, where the overall timestamp of the data indicates the sample start or end time. A display would further need to know the inter-sample distance or sample rate to determine the timestamp for each sample. Other waveform data might represent counts of a histogram, where a display needs the position of each sample to generate a meaningful representation.

Probe or a Text Update widget will simply show the array elements as text like "[ 1, 2, 3, 4 ]".

The XYPlot can show a waveform as described above. If the waveform for example represents histogram counts, a separate X waveform can provide the histogram bin positions.

The Data Browser plots scalar data over time. When given a waveform, it will plot the first array element, unless the "Index" column in the "Traces" settings selects a different array element.

buffer_size

The legacy XYGraph widget traces had a buffer size property. To display waveform PVs, it needed to be set to the waveform size, often done via scripts. This is no longer necessary because the XYPlot automatically uses the actual waveform data. Legacy scripts that try to set the buffer size will fail, but such failures can usually be ignored.

'Scatter' plot?

In addition to the XYPlot for X, Y waveforms, or the Stripchart for scalars over time, there is often the need for a 'scatter' plot. In practice, there are several approaches to merge updates from X and Y PVs for such a 'scatter' plot:

  • Have 'Y' update trigger a data point, using the then-current value of X
  • Have 'X' update ... of Y
  • Have a third 'Trigger' PV
  • Pick values where the time stamp matches with 0.01 seconds
  • Something entirely different

Trying to implement this in the scatter plot widget runtime will always end up missing some desired option. The display builder thus leaves this logic to an IOC, i.e. you need to use for example compress or histogram records to collect the X and Y data into waveforms, which can then easily be shown in the XYPlot.