10-09-2020 03:45 AM
Hi all
I want use "To More Generic Class"function convert XY Graph data to Waveform chart as attached and snapshot ,please help me check it what is wrong with this code,thanks!!
Solved! Go to Solution.
10-09-2020 03:54 AM
10-09-2020 04:19 AM
Thanks a lot for your help,it's work ,but how to insert time array to waveform chart as XY graph,thanks!!
10-09-2020 04:37 AM
Please insert images (not attach them)! This saves us a download, open, close and delete.
10-09-2020 04:43 AM
Only XYGraphs have time values.
Other graphs\charts have a regular time interval.
If you know the dT (you can get it from the 1D array data, but it has to be 1 value), you can set it the X Scale with the Offset and Multiplier properties:
(using
)
The multiplier would be dT, the offset T0.
Additionally, you can change the formatting of the X Scale, either with a property node or by configuring it. This is particularly useful if you want the X Scale to represent time.
10-09-2020 01:58 PM - edited 10-09-2020 02:04 PM
Your code makes no sense, because xy graphs can take a variety of datatypes (cluster of x and y arrays, cluster of xy points, complex arrays, etc.) and doing a class conversion of the reference seems illogical. You need to operate on the data.
If you know the datatype (1D array of xy points in this case), just get it out as follows (we need to assume that the x-values are spaced equally)..
10-09-2020 03:03 PM
Right click on the graph, select Properties: Display Format and change X-axis to Absolute or Relative time.
Then be sure to feed it a starting time (offset) and a dt.
10-09-2020 10:45 PM
It's appreciated for your help,the purposed for the case is want convert XY graph to waveform graph as dynamic x data and y data,occactional regular or irregular,you method in regular is right and irregular is wrong,which way can cover both issue,thanks!!
10-09-2020 11:10 PM
Waveform graphs assume equal x spacing. For uneven spacing, you should leave it as an xy graph.
There are ways around, you could resample all data by interpolation of make the dx=1, for example.
We can't really troubleshoot images. Attach your new VI. Can you tell us the purpose of this exercise?
10-10-2020 03:11 AM
My purposed is convert XY graph(data is random fill in) to waveform graph keep in original x data and y data and check if in limited,attached it for you refer,thanks!!