04-01-2021 05:45 AM - edited 04-01-2021 06:10 AM
I have a program where I need to display several data from multiple DAQmx channels in separate graphs. Putting a graph in a cluster in an array works, but you cannot separately modify axes for example.
Because I know beforehand how many graphs I have, I've building upon the work done by user "tst" in this post: http://forums.ni.com/t5/LabVIEW/User-interface-problem-list-of-clusters/m-p/2311770#M726599. Basically, you create a VI with multiple subpanels, and have the graph in a separate VI which you load one by one into the subpanels. They use the 'Run VI' method to start, which doesn't allow you to input data to the VI.This works well for their case, but I need to communicate data to subVIs. I want to do this with a message queue. I create a separate queue for each instance of the graph VI and send the data to the corresponding queue when I need to.
The problem I have is regarding cloning the VI instances. Please see the attached LabVIEW project for my efforts so far. Running the VIs asynchronously using the 0x80 option allows me to run the graph VI in the subpanels. Then using the queue I'm able to send the data to these VIs. However this load the same VI into the different subpanels, so this doesn't work well. For this I've added the 0x40 option (according to this reference), this should make a clone of the VI when I call it, but now the data is not being sent anymore and I can't figure out why.
Can someone take a look at my program and understand why I have this problem?
Solved! Go to Solution.
04-01-2021 05:51 AM
Hi Basjong,
@Basjong53 wrote:
Please see the attached LabVIEW project for my efforts so far.Can someone take a look at my program and understand why I have this problem?
Not as long as you don't provide that attachment…
04-01-2021 05:55 AM - edited 04-01-2021 05:56 AM
@GerdW ha scritto:
Hi Basjong,
@Basjong53 wrote:
Please see the attached LabVIEW project for my efforts so far.Can someone take a look at my program and understand why I have this problem?
Not as long as you don't provide that attachment…
Oops, you're right. I clicked send too fast 🤐. Should be attached now.
04-01-2021 08:11 AM
First understand that I can't see your code from my phone. I'm still going to chime in.
You have a set of queues and you want several clones to have their very own queue reference. The simple way is to name the queues. Then, instead of passing in the queue reference pass in the queue name and obtain the reference in the clone.
04-01-2021 08:18 AM
Maybe I was diving in too deep too quickly. I've made a minimal working example and I still not able to get it to work:
Here I simply start 2 asynchonrously calls using the 0x40 options to enable reentrancy (without 0x40, it loads the same VI twice, i.e. doesn't make a clone). Then I display it into the subpanels. Though the two VIs are displayed, the indicators on the front panel don't update at all. The 2 you see in the input is directly wired to an output in the 'Graph Plugin' vi, yet it is not updated. The VIs are running according to the Exec.State property.
So yeah, I'm stuck...
04-01-2021 08:24 AM
I don't know if it's connected to your problem, but i once had an array of graphs (in clusters) as you mentioned, but they didn't update correctly. I had to use some invoke node with a Redraw or something, could be worth a look. 🙂
04-01-2021 08:35 AM
@JÞB ha scritto:
First understand that I can't see your code from my phone. I'm still going to chime in.
You have a set of queues and you want several clones to have their very own queue reference. The simple way is to name the queues. Then, instead of passing in the queue reference pass in the queue name and obtain the reference in the clone.
At the moment I create an array of queues, and index them in the for-loop where I call the VIs, I pass the indexed queue to the specific VI clone. It should have the same result as your method.
@Yamaeda ha scritto:
I don't know if it's connected to your problem, but i once had an array of graphs (in clusters) as you mentioned, but they didn't update correctly. I had to use some invoke node with a Redraw or something, could be worth a look. 🙂
I tried to force a redraw using the "defer front panel updates' property of the corresponding VI (according to https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000g0R1SAI), but not luck.
04-01-2021 08:46 AM - edited 04-01-2021 08:59 AM
@Basjong53 wrote:
@JÞB ha scritto:
First understand that I can't see your code from my phone. I'm still going to chime in.
You have a set of queues and you want several clones to have their very own queue reference. The simple way is to name the queues. Then, instead of passing in the queue reference pass in the queue name and obtain the reference in the clone.
At the moment I create an array of queues, and index them in the for-loop where I call the VIs, I pass the indexed queue to the specific VI clone. It should have the same result as your method.
Why? Which clone did you pull from the clone pool on each iteration? Did you need to spawn a new Clone? Nope, you only thought that that would produce the same 1:1 clone to queue relationship. Now go back and do what I said. 😄😄😄
But, thank you for proving my signature quote!
04-01-2021 09:06 AM
@JÞB ha scritto:
@Basjong53 wrote:
@JÞB ha scritto:
First understand that I can't see your code from my phone. I'm still going to chime in.
You have a set of queues and you want several clones to have their very own queue reference. The simple way is to name the queues. Then, instead of passing in the queue reference pass in the queue name and obtain the reference in the clone.
At the moment I create an array of queues, and index them in the for-loop where I call the VIs, I pass the indexed queue to the specific VI clone. It should have the same result as your method.
Why? Which clone did you pull from the clone pool on each iteration? Did you need to spawn a new Clone? Nope, you only thought that that would produce the same 1:1 clone to queue relationship. Now go back and do what I said. 😄😄😄
But, thank you for proving my signature quote!
I did, and it doesn't work. Or I did something wrong, or it 'is' the same result as I had before
Top level program:
Graph plugin:
04-01-2021 09:26 AM
that way. Long quote chain
Yup, same result! Your indexing the reference to enqueue data to by creation order not by name! You simply demonstrated that the order of clone instances has no relation to the order of queue creation. (Restated, I'm right you're wrong) This is why we named the queues you have to use that name to get the data element to the right clone instance.