LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory considerations while using the Queue and Functional Global techniques

Nice!! I never knew that about the enumeration type... I have always wished there was a way to have the name of the selected function appear at the top of the case statement.

 

I am going to check out your Action Engine Nugget Ben.

 

Thanks guys 

0 Kudos
Message 51 of 64
(1,837 Views)

I don't know the details of how the memory re-use will work each time you call your function with a new 1-D array.  If LabVIEW can't re-use the existing 1-D array then it will deallocate it, so you're not losing memory.  If the number of elements is smaller the second time then there's a good chance the buffer can be reused.  Since you'll be calling this function multiple times I'd be surprised if you'll see any benefit to requesting deallocation - you'll just reallocate on each call - and your code may run slower.

 

The other replies cover the advantages of using an enumeration - just be sure you make it a type definition so it will be consistent everywhere when you make changes.  The only time I regularly use rings is on the front panel when I need to update the list of items programmatically.  In most other situations an enumeration is better.

Message 52 of 64
(1,833 Views)
Sorry for the bump, but RE: my post up the page a bit, is using the wire or queue name better? I always assume the wire because it is the pointer to the data or reference etc. Espescially in primitive VIs.
_____________________________
- Cheers, Ed
Message 53 of 64
(1,795 Views)

For performance issues I really wouldn't care about that. By name would mean to find the reference in a hash table, if the compilere can't resolve it during compilation time.

I would say, it is a matter of personal preferences. If you are wire-dogmatic, you only go by wire. If you really miss that text based #DEF, you would always go for the nostalgic name. It is personal falavour... No, no, no, don't tell me that you need a performance increase in a lousy one time called vi...

 

Felix

Message 54 of 64
(1,763 Views)

I knew there wouldn't be much in it, thanks Felix. I think I will stick with wires anyway, I find it aids visual dataflow.

 

However, we are all engineers here, and as such crave efficiency ^_^

_____________________________
- Cheers, Ed
Message 55 of 64
(1,745 Views)
The wire is much faster, but you have to ensure that the creator of the wire always stays in memory.  In my code, I usually have an initialization VI which lives in my main VI which does all singleton object (single-element queue) creation.  I pass around a single queue reference which contains a cluster of all my other queue references.  I usually name my queues so I can peek at them with debug code, but pass the references around for efficiency.
0 Kudos
Message 56 of 64
(1,733 Views)

@nathand wrote:

 

The other replies cover the advantages of using an enumeration - just be sure you make it a type definition so it will be consistent everywhere when you make changes.  The only time I regularly use rings is on the front panel when I need to update the list of items programmatically.  In most other situations an enumeration is better.


Thanks so much for the info on the enumeration and type defs. I have never used either before. Using type defs greatly reduces the amount of work needed to make changes to the code!! I started using the type defs just for the enumeration controls for the AE's but am using type defs for so many other things now, thanks for the help!

 

I have an U8 variable that I made a type definition out of. I am making this variable a type definition because the size of it may need to be incresed to say U16 in the future. Is there a best way to convert LV integers to my type definition U8 variable. For example, I have a for loop that is iterating through an array, and if I know that the array size is not going to be greater than 256, what is the best way to convert the I32 iteration count to my type definition U8 variable? I tried using the type cast function but it does'nt work because it takes the higher bits of the I32 integer not the lower bits. Any help is greatly appreciated.

 

Also, on another note..... I am looking to buy a  comprehensive and useful LabVIEW book that covers the majority of advandved LabVIEW programming techniques such as Action Engines, Optimizing Performance of VIs, Memory Management, etc.... Is there a "Best Book" out there, or maybe a list of some of the best?

 

Thanks for your help

 

-Anthony 

0 Kudos
Message 57 of 64
(1,655 Views)

amaglio wrote:
...

 

Also, on another note..... I am looking to buy a  comprehensive and useful LabVIEW book that covers the majority of advandved LabVIEW programming techniques such as Action Engines, Optimizing Performance of VIs, Memory Management, etc.... Is there a "Best Book" out there, or maybe a list of some of the best?

 

Thanks for your help

 

-Anthony 


While waiting for book suggestions you may want to explore the Tags for these topics.

 

Action Engine Tags

 

Performance Tags

 

And don't just stop with those links. Make sure you explore the "related tags" (View all) to see related topics. I have worked up the start of a "tree of LabVIEW knowledge" if you chase down all of the branhes.

 

Just trying to help,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 58 of 64
(1,650 Views)

Thanks Ben, I will check these tags out, thanks for helping me find my way around all of the knowledge here on this board. By the way I checked out your Action Engine Nugget... The information there was very useful. Thanks again for you help :smileyhappy:

 

-Anthony 

0 Kudos
Message 59 of 64
(1,646 Views)

amaglio wrote:

Thanks Ben, I will check these tags out, thanks for helping me find my way around all of the knowledge here on this board. By the way I checked out your Action Engine Nugget... The information there was very useful. Thanks again for you help :smileyhappy:

 

-Anthony 


 

Thank you very much for the kind words Anthony! If you have a chance to punch a couple of "Kudos" buttons as you go, I would very greatful.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 60 of 64
(1,641 Views)