LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

my program doesn't graph

Hi Moe,

 

I understand you are trying to acquire data and you only wish to graph the data after some condition is met. The easiest way to do this (as I understand it) is to read data in the while loop, and place the graph inside of the TRUE case of a case structure. You will always have the data input to a measurement VI that will find the peak outside of the case structure, and you can compare this peak to some level you wish. When they are greater than or equal, for instance, this will cause the case structure to go into the TRUE case and the graph will update with the data. Hope this helps,

Daniel S.
National Instruments
0 Kudos
Message 41 of 49
(1,650 Views)
Thanks a lot. I got it. When I put in 4 xy graphs into a mixed signal graph using a bundle vi I get an error. Do you have any idea why?
0 Kudos
Message 42 of 49
(1,635 Views)

Hi Moe,

 

What kind of error do you receive? If you want all the signals to appear together on one graph, you will need to build an array of the XY clusters. I have attached an image of how this should be done (I created 4 arrays with the same X values and offset Y values and bundled each X and Y array together before combining them into a 2D array with the Build Array function). If you simply try to bundle all of the arrays together, it will not work with the graph data type. Hope this helps,

Daniel S.
National Instruments
0 Kudos
Message 43 of 49
(1,607 Views)

It was saying that I had a cluster of 4 elements connected to it while it should receive a cluster of 6 elements. Somehow it started to work haha don't know why. I'm also having problems changing the background of the graph to white so when I print it off I could see the traces. The default is black but I can't seem to find the setting to change the background colour. Do you have any idea?

Also I have attached my program below and wondering if you have any idea of some logic to solve this problem. What you see when you open the program is that I have a current time that is outside the while loop and then 4 current times for each of the graphs. When the program is in automode I need it to graph when a tone is detected and the y value comes from the elapsed time between the current time and the time of start of unit. The problem is that the time vi outside the while loop gives me the current time when the program starts and then by the time the tone is detected(because the audio starts off with noise first and then tone appears) the difference between the current time and the start time of the graphing is huge resulting that the y coordinate doesn't start from 0. I need the current time to start when the graph starts graphing but at the same time not want it to increment because that would be used as a reference and that needs to be done with all 4 graphs. I hope I made some sense there. Its a hard concept to warp my head around and hope you dansch or someone to have a look at it.

 

Thanks a lot in advance

 

Moe

0 Kudos
Message 44 of 49
(1,596 Views)
0 Kudos
Message 45 of 49
(1,595 Views)

Any help would be greatly appreciated

 

This is the last problem I've got and got a couple of days left on the project and it seems easy but I just can't figured it out. If anyone has any ideas that I could implement that would be great.

0 Kudos
Message 46 of 49
(1,558 Views)

Hi Moe,

 

You can change the color of most objects by using the paintbrush tool in the tools pallette.  You can open the tools pallette from your front panel by either shift+right-click, or navigate to View >> Tools Pallette.  Once you select the paintbrush tool, simply right-click on your graph and you should be able to select the desired color.

 

"I need the current time to start when the graph starts graphing but at the same time not want it to increment because that would be used as a reference and that needs to be done with all 4 graphs."

You can manually write the t0 value of your graphs if you wish using the Build Waveform function, this may be what you want to do but I am not exactly sure what you are asking.

 

 

 

 

 

Out of curiosity what is the resolution of your monitor?  It can sometimes be difficult for those of us with normal size displays to follow code that is so spread-out.

 

-John

Message Edited by John P on 04-24-2009 01:37 PM
John Passiak
0 Kudos
Message 47 of 49
(1,556 Views)

Sorry attached below is the condensed version. I need that current time vi that is just outside the while loop to only time stamp when the graph starts to graph. Do you see how the graph is being triggered to graph?

 

0 Kudos
Message 48 of 49
(1,547 Views)

Hi Moe,

 

I'm still not entirely sure what you are asking, but the Get Date/Time in Seconds function will return the the time on the OS clock when it is called.  If you put it outside the loop as you have it now, it will get the time right before you enter the while loop and will not update.

 

If you are looking for the time right before you graph the data, you need to call Get Date/Time in Seconds at that time.  I'm a bit confused about the part of the code that takes the difference between two timestamps, multiplies by 1.52, then plots on the Y axis which is labelled DEPTH (M).

 

It looks like you are "triggering" the graph by checking if the value of a certain tone is above a threshhold.  How are you using the timestamp in your application?

 

-John 

John Passiak
0 Kudos
Message 49 of 49
(1,484 Views)