LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying 2 XY Graphs in the Front panel make the graphs start lagging

Hi everyone,

I am using a controller that sends data to LabView in the form of strings of data. These strings of data contain various parameters at different timepoints, which I can separate by the commas.

After that, I put this data in a sliding buffer that feed the array to two different graphs.

The array is then feeded back to the sliding buffer by a shift register and new data keeps being added.

I adjust the X axis using property nodes to define the minimum and maximum range.

IcyVolcan_0-1714067981897.png

While troubleshooting, I deleted one of the graphs, and the lagging of the data disappears completely. 

The array in the sliding buffer can have 5000 points. I tried decreasing this and it did not help.

0 Kudos
Message 1 of 8
(182 Views)

Hi Icy,

 


@IcyVolcan wrote:

While troubleshooting, I deleted one of the graphs, and the lagging of the data disappears completely. 

The array in the sliding buffer can have 5000 points. I tried decreasing this and it did not help.


Did you also delete the ExpressVIs before that graph?

Plotting 5000 points in a XYgraph might need some processing time…

 

  • Do you need to update the graphs in each iteration?
  • Do you really need to use ExpressVIs for this task?
  • Why don't you create those plots inside your "Sliding buffer" subVI? (Using NO ExpressVIs…)
  • Do you need to fiddle with graph properties in each iteration?
  • Why don't you use autoscaling?
  • How fast does your loop iterate?
  • Why don't you attach code, but just an image of code?
  • Why don't you separate DAQ (aka VISARead) from UI handling (aka graph updates), using a producer-consumer scheme?

So many questions…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(169 Views)

I've been told writing to property nodes is a slow operation. See if you get back some performance by only writing to them when "Human gait cycle control" or "Graph Width" are changed.

 

Are you limiting loop speed by using the 'Wait (ms)' or similar VI? That might be helpful to add if you're not currently doing this.

"Computer Emergency"
0 Kudos
Message 3 of 8
(163 Views)
  • Do you need to update the graphs in each iteration? No
  • Do you really need to use ExpressVIs for this task? Also no.
  • Why don't you create those plots inside your "Sliding buffer" subVI? (Using NO ExpressVIs…) I will try that.
  • Do you need to fiddle with graph properties in each iteration? No, I only need to make sure that the X and Y axis accompany 5 seconds at each time.
  • Why don't you use autoscaling? I tried that but the data was not getting displayed for some reason.
  • How fast does your loop iterate? I do not know.
  • Why don't you attach code, but just an image of code? I work in a company and I am afraid to breach confidenciality.
  • Why don't you separate DAQ (aka VISARead) from UI handling (aka graph updates), using a producer-consumer scheme? Will look into that.
0 Kudos
Message 4 of 8
(124 Views)

How can I make it so that it only writes to the property nodes if some value is change?

 

And about the wait, I added a basic wait time for the whole loop and it helped a bit but it did not fix it completely.

0 Kudos
Message 5 of 8
(121 Views)

Hi Icy,

 


@IcyVolcan wrote:

How can I make it so that it only writes to the property nodes if some value is change?


Use a case structure to execute code based on a condition…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(115 Views)

You could also use an event structure in a separate loop to set the property nodes. For instance, add the "Value Change" event on "Human gait cycle control" and "Graph Width", and move the code updating the property nodes inside it.

"Computer Emergency"
0 Kudos
Message 7 of 8
(101 Views)

Hi,

I took out the property nodes and I am trying to autoscale the X and Y.

The problem is that the X scale starts at -1million everytime even though my first timepoint is always 0, making the graph not display my data in a visible way:

 

IcyVolcan_0-1714137016154.png

What can I do to fix this?

 

Thanks.

0 Kudos
Message 8 of 8
(90 Views)