07-05-2018 03:28 AM
Hello all,
Apologies if this is a repeat question, I've searched for this exact issue but haven't found anything that matches, or at least has a solution that works for my particular case.
I'm trying to update a multi-plot XY graph by data binding it using the shared variable engine (data is written from a RT and the chart is on the Host)
However, no matter what data types I wire in to the write node, I get the error:
"FrontPanelDataController : Type does not coerce"
I understand this in principle, but I cannot for the life of me find a format that it will accept. I have tried:
- Cluster of 1D array of points (where each point is a cluster of an X and a Y numeric)
- 2D array of points (where each row of the array is a different plot)
- A 1D array of plots (where each plot is a cluster of a 1D X array and a 1D Y array)
I've only been able to get a single plot on the XY graph using an array of points (where each point is a cluster of an X and a Y numeric)
Any help would be much appreciated!
Many thanks.
Solved! Go to Solution.
07-05-2018 04:14 AM - edited 07-05-2018 04:15 AM
Hi Kieran
If you look at the terminal of the XY graph it is probably brown indicating that it is set for a single plot. For multi plots it should be pink. This happens when a suitable data type is wired to the terminal.
From the help ...
The XY graph accepts three data types for displaying multiple plots. The XY graph accepts an array of plots, where a plot is a cluster that contains an x array and a y array.
The XY graph also accepts an array of clusters of plots, where a plot is an array of points. A point is a cluster that contains an x value and a y value. The XY graph also accepts an array of clusters of plots, where a plot is an array of complex data, in which the real part is plotted on the x-axis and the imaginary part is plotted on the y-axis."
07-05-2018 04:19 AM - edited 07-05-2018 04:31 AM
Hi Neil,
Thank you for that but that isn't terribly helpful. I want to update the front panel indicator, in this case the XY graph, using the shared variable engine so there is nothing wired into the indicator terminal.
I've seen and tried the data types and formats suggested in that help article already, some of which I typed in my original comment but to no avail.
EDIT:
I think I misunderstood you - will having the empty constant wired into the terminal not overwrite the indicator to zero's constantly?
07-05-2018 05:23 AM - edited 07-05-2018 05:31 AM
Hi Kieran
Yes sorry that didn't help too much. I think what you need to do is ..
Create a type def control that is a multiplot XY graph and save to .ctl file. Then using the Shared Variable Properties dialog select the Data Type .. Custom Control ...at the very bottom of the list and select your multiplot XY control file. The data type should now be correct.
BTW The snippet was just showing what the multiplot XY terminal looks like. I should have made that clear. I wasn't suggesting you wire in an empty array.
07-05-2018 05:32 AM
@NeilRCreate a type def control that is a multiplot XY graph. Then using the Shared Varaible Properties dialog select the Data Type .. Custom Control ...at the very bottom of the list and select your multiplot XY control. The data type should now be correct.
I have been doing this step - the problem was that by then selecting that shared variable in the data binding tab of the indicator properties I got the error I posted originally.
Is there a way to change the graph to expect a multi-plot from within the properties?
07-05-2018 05:40 AM
Once you have connected the empty array as I showed originally and changed the terminal to pink (multiplot) you can then erase the array and the connecting wires and the multiplot status will remain.
07-05-2018 05:44 AM
That actually worked - thanks for your help!
Of all the things I tried I can't believe that I didn't think of initialing it then deleting it.
07-05-2018 05:45 AM
Great stuff.