LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Emulate array of graphs using multiple subpanels

Solved!
Go to solution

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?

0 Kudos
Message 1 of 21
(1,517 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 21
(1,509 Views)

@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.

0 Kudos
Message 3 of 21
(1,493 Views)

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.


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 21
(1,451 Views)

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:

Clone VI to multiple subpanels.png

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...

0 Kudos
Message 5 of 21
(1,448 Views)

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. 🙂

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 21
(1,445 Views)

@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.

0 Kudos
Message 7 of 21
(1,439 Views)

@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!


"Should be" isn't "Is" -Jay
Message 8 of 21
(1,434 Views)

@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:

Clone VI to multiple subpanels.png

 

Graph plugin:

Graph Plugin.png

 

Download All
0 Kudos
Message 9 of 21
(1,426 Views)

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.


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 21
(1,423 Views)