08-07-2012 03:59 AM
Hello again,
I've tried to set up a consumer/producer structure but I'm unsure of what to do next for it, such as what further wires do I need to place etc. I tried looking at examples on here but the vi's all looked too complicated for me to learn from.
The latest version of my vi is attached if anyone cares to look at it.
Thanks.
08-07-2012 08:40 AM - edited 08-07-2012 08:41 AM
I've cleaned the structure up a bit and have attached it to this post, but still I can't get it to work. I can't wire the merge signals into the enqueue function?
I would really appreciate some help to get this working, so it would be great if someone could modify my vi slightly?
08-07-2012 09:16 AM
You need to supply the data type to the queue. I would use a cluster with the signals and a boolean for the stop. Also, the two loops cannot have any data dependency or else they can't run in parallel. To visualize it better, put the consumer loop below the producer loop. I also tend to let the consumer loop close out the queue just to make sure all of the data was processed. If you don't understand something, ask. The point here is for you to learn.
08-07-2012 10:12 AM
Many thanks, it helps to see it on a vi as I'm very new to this! Much appreciated.
I follow what you say and have done, however I'm still not sure about the Bundle by Name function: do I have to name the three elements before it works? The other thing I don't understand is the box in pink above it, what is this and what do I have to do to it?
Sorry if these questions are on the boring scale by the way!
Thanks again.
08-07-2012 10:45 AM
@AT12 wrote:
Many thanks, it helps to see it on a vi as I'm very new to this! Much appreciated.
I follow what you say and have done, however I'm still not sure about the Bundle by Name function: do I have to name the three elements before it works? The other thing I don't understand is the box in pink above it, what is this and what do I have to do to it?
Sorry if these questions are on the boring scale by the way!
Thanks again.
Actually, there are only 2 items in the main cluster. Apparently the dynamic data is really a cluster of array of cluster. I think the little pink box you are referring to is a cluster shown in icon form (right click it and uncheck "view cluster as icon" if you don't believe me). I did that only to save space. To use the bundle by name, just label the constants inside the cluster. Looking at my code again, it looks like I labeled the array inside the cluster that is inside the cluster (confusing enough?). All you care about is the dynamic data and the boolean.
08-07-2012 10:51 AM
Right, thank you! I'll do battle with it again and let you know how I get on.
Cheers!
08-07-2012 12:06 PM
Actually, there are only 2 items in the main cluster. Apparently the dynamic data is really a cluster of array of cluster. OK I think the little pink box you are referring to is a cluster shown in icon form (right click it and uncheck "view cluster as icon" if you don't believe me). YES I did that only to save space. To use the bundle by name, just label the constants inside the cluster How is this done?. Looking at my code again, it looks like I labeled the array inside the cluster that is inside the cluster (confusing enough?). All you care about is the dynamic data and the boolean.
I've highlighted some sections of your above reply including one question. Also, my second question is do I have to do the same to the Cluster Icon that feeds into the Obtain Queue function.
08-07-2012 12:26 PM
Right click on an element inside the cluster and choose Visibile Items->Label. Change the labels to whatever you want. Whatever you label them is what will show up in the Bundle By Name and Unbundle by Name.
08-07-2012 03:11 PM
Brilliant, thanks for that. I shall give it a go.