LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cursors flickering in XY graph

Hello NI community.
I have a problem.
There are several cursors in the program (they set the boundaries for calculating the area under the curve). (See front panel)
After some time, they begin to flicker randomly (the graph does not flicker) - they can flicker 1 out of 10 or 10 out of 10, once a second or once every 20 seconds.
All this is in the event structure, which is in the while structure (see block diagram).
And the question is - how to remove this flicker?
P.S. I apologize that the screenshots have a lot in Russian, but I hope the essence is clear.

P.p.s. By the way, can someone else know how to increase the font size in the cursor name?

1.png2.png

0 Kudos
Message 1 of 6
(2,057 Views)

Hi fizikaman,

 

why did you edit your message to replace all that English message text by Russian? You are limiting the number of people being able to help a lot…

Ok, now it's English again…

 

Comments on your block diagram image:

Way too much code! Way too many Rube-Goldberg constructs!

Use loops to repeat the same steps!

Why do you need to bundle a cluster just to unbundle in the next step?

And do you really need to call all those property nodes for all cursors in parallel?

How often is this user event called?

Why do those terminals miss their labels?

I recommend to use one FormatIntoString function instead of two NumericToString, one two ConcatString and some string constants to simplify the code…

 

Please attach the VI (LV2017 preferred) to get more/specific help.

Best regards,
GerdW


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

"Way too much code!"

this is just a small part of a large program that controls spectrometers, lasers, etc.

 

"Why do you need to bundle a cluster just to unbundle in the next step?"

In the future, I want to make a subVI with one input.

 

"And do you really need to call all those property nodes for all cursors in parallel?"

Yes, because the calculations go in parallel.

 

"How often is this user event called?"

after measurement or after changing the number in the "standard (эталон on front panel)" window

 

Only all your questions are off topic of my problem. All of these calculations do not affect the flickering of cursors. But also I can’t understand what makes them flicker.

0 Kudos
Message 3 of 6
(2,024 Views)

Hi Fizikaman,

 


@Fizikaman wrote:

Only all your questions are off topic of my problem. All of these calculations do not affect the flickering of cursors. But also I can’t understand what makes them flicker.


The cursors can flicker when they are redrawn.

They are redrawn when you change their properties or when the plots are redrawn.

 

So my comments on using all those property nodes do relate to your problem of flickering cursors! And so does the question on graph update rate…

 


@Fizikaman wrote:

"Way too much code!"

this is just a small part of a large program that controls spectrometers, lasers, etc.

 

"Why do you need to bundle a cluster just to unbundle in the next step?"

In the future, I want to make a subVI with one input.


When even this small part of your code is so bloated then you really should cleanup your whole project…

Even when you want to create a subVI then an array instead of a cluster would be more reasonable: keep in mind the comment on using loops instead of duplicated code!

Best regards,
GerdW


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

@Fizikaman wrote:

"Way too much code!"

this is just a small part of a large program that controls spectrometers, lasers, etc.

 

"Why do you need to bundle a cluster just to unbundle in the next step?"

In the future, I want to make a subVI with one input.

 

"And do you really need to call all those property nodes for all cursors in parallel?"

Yes, because the calculations go in parallel.

 

"How often is this user event called?"

after measurement or after changing the number in the "standard (эталон on front panel)" window

 

Only all your questions are off topic of my problem. All of these calculations do not affect the flickering of cursors. But also I can’t understand what makes them flicker.


It seems like you don't want to take GerdW's excellent advice. You can try, no guarantees, to defer Front panel updates before your event and then enable when done.

 

Another note, property nodes execute in the UI thread, which is single threaded, thus property nodes in parallel do not execute in parallel. You should use a loop construct, no change in execution but easier to maintain.

 

mcduff

0 Kudos
Message 5 of 6
(1,981 Views)

There is no way to troubleshoot this from a picture.

  • Terminals without label.
  • Hidden wires (12 orange wires going on the the property node and 12 wires coming out. No way to tell what's connected to where.
  • Typically you only need to deal with what's changed, not "everything"
  • Use arrays and FOR loops and consolidate all these duplicate instances into one, put the property nodes in a case structure that only operates on the changed values.
  • All you needs is a single formatting operation with two inputs, no need to do all these concatenations. 
  • Properly written, this entire code could fit on a postcard and be significantly more efficient.
  • Where is the data of the graph written? How many points? How often?
  • What do you think is the active cursor for the cursor.visible property in the upper left? No way to tell because of race conditions!
  • Are there overlapping objects on the front panel?
  • Why are most of your values Inf? (division by zero?)
0 Kudos
Message 6 of 6
(1,971 Views)