Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 69090

multiple queues management

$
0
0

Hello!

 

I am an student and I am making project that requires me to go beyound 2 loops.

I want to make architecture that will allow to comunicate each loop to each without hard modifications.

I am wondering how to make code clean without queue references wires messing around and going from one loop to another.

 

- My first Idea was to remove all queue wires and connect to queue by its name like in frame 3:

 

1.jpg

 

But Desktop trace execution Toolkit shows that I have memory leak. Documentation says that new queue ref is created when I obtain queue that exists and adresses shows that is true.

 

 

 

-My secound Idea was to use variant atribute and global variable and create functions that will allow me to create, exit , enq and dequeue from whom and whenever I want. Schematic idea looks like this

 

create

2.jpg

enq

4.jpg

deq

3.jpg

exit

5.jpg

 

This time I didn't have leaks so may I assume this is correct way?

But people always tell to avoid global variables so I am not sure.

 

 

-My third idea was to bundle all queues into cluster and then bundle and unbundle by name whenever I want, There is openG function that allows me to get value from cluster by name so if I name queues it should be easy to do. So I will only have 1 wire for cluster and 1 wire for error for each loop. In this case data flow is keept because all stays with cluster.

 

-My forth ide was to create functional global to store all queues but it didn;t worked at all :)

 

If someone has done that before please give me a hint :)

Best regards

pawhan11


Viewing all articles
Browse latest Browse all 69090

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>