From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get simulation waveform history into an array for data dashboard

I am at my wits end, this problem is out of my abilities and I have been trawling forums and posts for hours on how to do it but no luck.

 

So I have a running PID simulation which is working, I am displaying the setpoint and the step response on a waveform chart (these have history right, I think this is the problem)

 

I want to send this data off to a data dashboard on my ipad, but the problem is it won't accept a shared network variable of type waveform.


From googling it appears that I will need to create a 2D array network variable with 2 rows, first row is the set point and its values and the 2nd row will be the response.

 

I tried this but the problem is it is only showing the most current values as I am losing all of the waveform chart history by making a double array. What I need is some way to buffer values maybe 25 or so values and then send them off to the data dashboard so that it gets a little bit of history not just the latest values.

 

There is no way to put a for loop and create an array of values inside a simulation though.. Please someone help I am really stuck right now.

 

I've highlighted what I am trying to recreate in red, this shared variable isn't seen by data dashboard though so I need to somehow go down the array with history route. My project is attached.

Waveform Data Dashboard Error.png

 

0 Kudos
Message 1 of 4
(2,977 Views)

Hi funcooker, 

 

It seems that your buffer is getting full? Because when the buffer gets full in a waveform chart, it overwrites the previous data with new data values. 

Note:
You can set the length of the Chart History buffer (the number of points the chart will remember and display) by right-clicking the on the chart and selecting Chart History Length from the shortcut menu.

 

What data dashboard version are you using. Data Type "waveform" is not supported by data dashboard but you can use 2D array of supported numeric values. I reckon you should try converting the datatype before sending it to the shared variable.
(http://digital.ni.com/public.nsf/allkb/D9B247551BE7F46A8625795000552CDE)

 

Let me know how you're getting along with this.

 

 

Shazil M.
CLAD
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 2 of 4
(2,914 Views)

Hi Shazil

 

Not going well! Ive tried to buffer the 10 most current values using a queue (I'm sure this is probably the wrong way to do it but I didn't know what else to try)

 

So now whenever the data dashboard comes it sees an array of 10 values. This is still not working though the data seen from the data dashboard is all garbled. I've given up on the 2D array for now and I just want to get the output channel in a 1D array.

 

What I want to display is like the graph shown here on a waveform chart on data dashboard. The red line all smooth with no missing points.

Step response encoder position.PNG


What I am getting on Data dashboard looks nothing like that though, Please help there are no examples of waveform charts for data dashboard anywhere in fact the documentation is lacking to say the best. If I increase the buffer past 10 then it goes wild, I need a way to synchronise the data with data dashboard.

 

Step Response Data Dashboard.PNG

 

I've attached my program if that helps

 

Thanks for any help.

 

 

0 Kudos
Message 3 of 4
(2,884 Views)

Hi funcooker, 

As we previously mentioned, 2D array shared variable is not possible to create however this is a possible work around it. Have you looked into creating a 2D custom control?

The following Knowledge Base outlines the details on how to go about doing this
http://digital.ni.com/public.nsf/allkb/2206804A09D79A298625763800551E43

 

Perhaps this helps.

 

Regards

Shazil M.
CLAD
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 4 of 4
(2,846 Views)