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: 

cluster struct with refnum slows down V:I execution

hello..to  to pass variables among various V.Is in a single struct i have had to adopt  to a system where by i have a cluster composed of an integer element and a refnum that points to an array of clusters...however ,the execution of various operations seems to have slowed down greatly. the .PNG image i have attached shows an example of how am currently accessing these variables..I would like to ask if there is any improvements i can make to help speed up the duration of execution   ..thank you                                                                                                                       

0 Kudos
Message 1 of 5
(2,469 Views)

Yes it'll be slow, as control refnums will work on the front panel control in the UI thread. Why dont you wire the cluster array and index it directly instead?

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 2 of 5
(2,462 Views)

Yeah, using property nodes to get/set values is terribly slow.  And I am talking 1000s times slower.  That is why that is one of my pet peeves with some people's code.

 

I agree that you should just have the actual array in your cluster.  It'll make like so much easier on you.  Either that or use a Data Value Reference.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 5
(2,448 Views)

thank you both for ideas,,they should solve my prob..i was hoping i could just optimise the current structure but i guess i have to change it

0 Kudos
Message 4 of 5
(2,436 Views)

If you typedef'd the cluster, it might not be too big of a deal.  The only thing that would happen - other than making the front panel all out of whack for each VI using it - would be that you'd have to deal with the data directly instead of getting it from a value property node.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 5
(2,406 Views)