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: 

Long drawing time and lag when using draw points to display intensity image

I have to implement drawing magnetic field of a magnet that is in circular shape. There is a intensity plot tool in labview but there is not intensity plot in cartesian coordinate system. 

 

I'm trying to implement it using draw tools in labview. In the attached VI, there are radious (R) and theta (in degrees) of a point in kartesian coordinate system that I want to draw. If I do this, drawing last very very long and also PC starts to lag when the image is drawn. 

 

Please help if there is any way of speeding up draw tools, remove lag, why there is lag? 

0 Kudos
Message 1 of 9
(1,201 Views)
0 Kudos
Message 2 of 9
(1,199 Views)

Hi Andraz,

 

please attach files always in this forum, don't use some obscure 3rd party websites for file uploads!

 

Why don't you use an IntensityGraph instead of your 2DPicture?

Just a sketch, you need to handle correct graph/array size…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Download All
0 Kudos
Message 3 of 9
(1,189 Views)

@AndrazS wrote:

I have to implement drawing magnetic field of a magnet that is in circular shape. There is a intensity plot tool in labview but there is not intensity plot in cartesian coordinate system. 

 

I'm trying to implement it using draw tools in labview. In the attached VI, there are radious (R) and theta (in degrees) of a point in kartesian coordinate system that I want to draw. If I do this, drawing last very very long and also PC starts to lag when the image is drawn. 

 

Please help if there is any way of speeding up draw tools, remove lag, why there is lag? 


Of course that's slow. Look inside those picture control VIs. You're basically building a huge string, that is then parsed by the picture control's renderer.

 

Make a 2D array, and replace elements in it. Then, write this 2D array as a pixmap into the picture control.

 

And reading properties (that never change) inside a loop also makes things slow.

 

And updating controls inside a loop is also slow.

0 Kudos
Message 4 of 9
(1,147 Views)

Can you please help with your idea a little bit.. Can you provide me a VI?

0 Kudos
Message 5 of 9
(1,118 Views)

Hi Andraz,

 


@AndrazS wrote:

Can you please help with your idea a little bit.. Can you provide me a VI?


Can you specify what "you"/"your idea" refers to?

 

Suggestion: use the "quote" feature of the message editor to refer to other posts…

Best regards,
GerdW


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

@AndrazS wrote:

Can you please help with your idea a little bit.. Can you provide me a VI?


Array To Pixmap.png

 

Note that in this example I might as well have used autoindexing... Pre-allocating the array matches your original example better, IIRC. 

0 Kudos
Message 7 of 9
(1,081 Views)

Haven't looked at the VI on the external website, but I use intensity graphs.
I'm going to make a bet that the OP hasn't looked at the different LabVIEW execution systems and has most VIs running in the same execution system as the caller - with lots of property nodes and thread swaps causing the code to slow due to most of it running in the UI execution system!
I'm also going to bet that there is no delay in passing results data to the intensity plot - and therefore no throttling of the screen redraw.
A simple queue with the processed data being put into it and then only the latest data pulled from the queue to display should sort that (and then a timer in the screen redraw loop to maximize redraw rate.)

Of course I could be totally wrong about the architecture as it stands.😉

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 8 of 9
(1,063 Views)

@James_W wrote:

Of course I could be totally wrong about the architecture as it stands.😉


There's no architecture involved:

wiebeCARYA_0-1664200922422.png

 

It's slow because each Draw Point.vi adds 34 bytes, including 24 to set the pen that never changes.

0 Kudos
Message 9 of 9
(1,042 Views)