LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display data in pop-up graph window

Solved!
Go to solution

I am trying to display data continuously in a pop up chart. When I press a button the chart should pop up and show all the previous values as well as those being continuously generated. If possible I want to do this without using local or global variables. This question was asked before too at http://forums.ni.com/ni/board/message?board.id=170&message.id=315949&query.id=9049787#M315949    but I was unable to understand the proposed solution. I am a civil engineer, meaning it will be difficult for me to understand advanced concepts and at times even simple concepts related to computer programming.  I have attached two VIs just to illustrate what I am trying to do.

 

Thanks

Download All
0 Kudos
Message 1 of 7
(4,457 Views)

Which solution are you referring to?

 

As for your specific VI, the problem you have is that for the Open VI Reference you've specific a VI with the name "Untitled06". The subVI on the block diagram inside the loop is called "Untitled 06" (note the space). The VI you posted is "Popupgraph_subVI". I would suggest picking one name and sticking with it.

 

As for what you're actually doing, since you are calling the subVI directly on the block diagram, there is no need to run it dynamically using the "Run VI" invoke node. This actually doesn't really do anything because the subVI has no loop. Thus it will run and then stop. As for using the VI Server to open the front panel you can eliminate this since you can configure the subVI's properties to "Show front panel when called".

 

As for the data that you're feeding the chart, I'm not sure where you're going with this, but you don't really need to keep changing the t0 at each iteration. The chart moves as you feed data to it, and has a history buffer. Thus, you can just feed it the value you want to plot, and set the start just once. Take a look at the chart examples that ship with LabVIEW.

0 Kudos
Message 2 of 7
(4,438 Views)

Sorry, those uploaded VIs were just for a demonstration of my problem.

 

As for the Untitled06, when I was trying them in my computer I had named it "Untitled06" but when uploading to this forum I changed the name. Forgot about the invoke node.

 

What I was asking is, if it was possible to acquire data using one VI and show any temporary graph/chart in a separate subvi. I did it like attached. Seems like it will work for me.

 

 

Any other (obviously better) solutions? then please do let me know. The only requirement is that chart should appear in a separate VI, it is just a temporary chart and I do not want it to take up space in my main VI front panel.
 
Thanks

 

 

 

 

Download All
0 Kudos
Message 3 of 7
(4,413 Views)

This MAY be a little too advanced but I'll post the link incase others are served.

 

In that thread I posted code that shows how to create a sepearte window from part of a LV GUI.

 

Instead of using a random number generator to get the data, you could read it from an Action Engine (see link in my signature about Race Condition).

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 7
(4,406 Views)
Solution
Accepted by topic author sharmaa

A few tips:

  • The subVI should be placed inside the Timeout case since that's the only place where it's getting used.
  • You do not need to convert to a DBL in order to subtract timestamps. The subtract operation works with timestamps (it's polymorphic), and will give you a DBL. This allows you to eliminate a few operations.
  • In the subVI rather than using a property node to hide the control (which is executed every time you call the VI), simply hide the control by right-clicking the terminal on the block diagram and selecting "Hide Control". You can also set the "Visible" property by right-clicking on the control and selecting Properties. Or, you can simply resize the front panel of the subVI so that the control is off to the side.
  • Tunnels out of the events case are initially set to "Use Default if Unwired". For a Boolean this would be False. Thus, you only need to have the Stop_Program case actually have a True constant wired to the tunnel. All of the others can be left disconnected. The "Use Default if Unwired" is both a good and bad thing. On the one hand it can identify missing wiring if you leave that unchecked so you can catch situations where you are not generating data out of a case when you should. In this case, however, it's perfectly safe. 
Message 5 of 7
(4,399 Views)

Thanks,

 

I got what I was looking for. 

 

But regarding subtracting time stamps. When I write waveform to the subtract operator then there are two red dots. I read everywhere in the forum that red dots are bad, that was the reason I used that DBL converter.

 

So when are red dots not that bad.

0 Kudos
Message 6 of 7
(4,383 Views)

sharmaa wrote:

Thanks,

 

I got what I was looking for. 

 

But regarding subtracting time stamps. When I write waveform to the subtract operator then there are two red dots. I read everywhere in the forum that red dots are bad, that was the reason I used that DBL converter.

 

So when are red dots not that bad.


Coercion dots are LV's way of telling you "I am converting this data type for you". So the answer to your quesion is the same as the question;

 

"when is converting dat type bad?"

 

Converting data types is bad under at least two conditions.

 

1) When you loose or corrupt data.

 

2) When the data type conversion requires duplicating a large data set.

 

If the data is not corrupted and ther is no danger of of buffer duplication then the coercion dots are OK (Christian, being a purist may have something to add).

 

In the case of the timstamps, there is no data corruption nor a large data set involved so they are OK or...

 

"When are Coercion Dots Good?"

 

I believe (I have not looked at your example) that the case of the time stamps is one of those cases where the coercion dot si actually faster than the same code without an explicit node to convert the dat type and avoid the dot.

 

I hope that help,

 

Ben

 

* If you have not passed the CLAD CLD or CLA exams, please forget what I said above.

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 7 of 7
(4,379 Views)