09-22-2022 06:23 AM
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?
09-22-2022 06:25 AM
Link to VI:
09-22-2022 06:31 AM - edited 09-22-2022 06:40 AM
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…
09-23-2022 08:04 AM
@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.
09-25-2022 11:42 PM
Can you please help with your idea a little bit.. Can you provide me a VI?
09-26-2022 01:58 AM
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…
09-26-2022 03:00 AM
@AndrazS wrote:
Can you please help with your idea a little bit.. Can you provide me a VI?
Note that in this example I might as well have used autoindexing... Pre-allocating the array matches your original example better, IIRC.
09-26-2022 08:08 AM
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
09-26-2022 09:05 AM
@James_W wrote:Of course I could be totally wrong about the architecture as it stands.😉
There's no architecture involved:
It's slow because each Draw Point.vi adds 34 bytes, including 24 to set the pen that never changes.