LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph Spawn

Hello everybody
I am trying to spawn a graph. Hereby I attached a simple case in which I put two random inputs for the graphs.
My question is how can I have the updated graph on each one?
Any suggestion?
VI is the main and Cp is the vi used in the main.


Download All
0 Kudos
Message 1 of 10
(3,340 Views)

It depends very much on what you want exactly. It's not exactly clear.

 

If you want the data at the time the button is pressed in the new graph, you'd need to set that data using the set control value method, before running it.

 

If you want each graph to continuously update the data, you need to put it in something global. Either a global, a functional global, a channel wire, a DVR, a queue... Anything that can be referenced asynchronously. And then perhaps you need to pass the reference to the graph VI, unless you're going for a FG, or chose to use a named queue, or to put the reference in a (F)G, and so on...

 

Note that the event structure (used like this) is not a stable timer... Of course it's OK for a mockup.

Message 2 of 10
(3,334 Views)

First of all, thank you for your response.
Actually, in the end, I want to measure continuously different points temperature and show them on the graphs. I have used a random number instead. So I mean continuously update the date and by pressing the spawn graph button show a new graph with the same values and also updating.

I have found a solution for spawning but if I use "Call by reference" block to update the values there is no data on the graphs.

0 Kudos
Message 3 of 10
(3,309 Views)

@Rez.mhni wrote:

I have found a solution for spawning but if I use "Call by reference" block to update the values there is no data on the graphs.


In the posted VI, that makes sense. How would the VI get the data? There's no link to the data...

Message 4 of 10
(3,295 Views)

This is exactly my question. If I use "Call By Reference " as you can see in the picture the value would not be shown on the graphs.

I am not sure that using call by reference is the correct way for updating data.
Do you have any idea?

0 Kudos
Message 5 of 10
(3,286 Views)

@Rez.mhni wrote:

Do you have any idea?


Yes, as mentioned:

 

If you want the data at the time the button is pressed in the new graph, you'd need to set that data using the set control value method, before running it.

 

If you want each graph to continuously update the data, you need to put it in something global. Either a global, a functional global, a channel wire, a DVR, a queue... Anything that can be referenced asynchronously. And then perhaps you need to pass the reference to the graph VI, unless you're going for a FG, or chose to use a named queue, or to put the reference in a (F)G, and so on...

 

As an alternative that was not mentioned, you can start the VI, and get a graph control reference (in 10 different ways). Then the main VI can put the data in those references when updating.

Message 6 of 10
(3,275 Views)

Actually, I did not get what you said.  because if I use control reference or something like that I will miss the spanning part. 
To be more precise I attached the picture of my VI in which I can have the data continuously but the problem here I can not have spawning anymore. I want both of them at the same time. 

0 Kudos
Message 7 of 10
(3,252 Views)

Don't you need to Open VI ref when using Start Asynchronous call?

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
Message 8 of 10
(3,245 Views)

Take a look at these VIs. At the first VIs I have Spawning but not updating data and in these VIs specifically upper part I have updating data but not Spawning. 
I need to have every time a new windows with updating graph by pushing that button. 
 

Download All
0 Kudos
Message 9 of 10
(3,242 Views)

The problem is that you are passing in a snaphot of the graphs data rather than a reference to that data.

 

You need someway of referencing the data itself like :

1.pngAlthough personally, I'd rather use a Notifier. (you don't have to poll fo val changed like you do with the DVR) as this could spawn multiple independent graphs


"Should be" isn't "Is" -Jay
Message 10 of 10
(3,237 Views)