LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform chart time to start at 0 and end at elapsed time

Solved!
Go to solution

Good afternoon,

I'm trying to make a waveform chart with 2 plots to start the relative time at 0 (the moment you run the program) and end at the elapsed time, auto scaling itself if possible. The vi is a symplification of another bigger one I'm working with, where you have 2 numbers shown in the chart and then a dwell time when those numbers are the same value. Right now, the problem is that the left limit of the x-value (minimum) changes with time, so a lot of changes in the imput numbers before they become the same value are lost. I've tried to uncheck the auto-scale value of the x-axis values and set the minimum to 0, but that doesn't seem to work since it becomes 0:00 as in the time off day.

I add the VI that I'm working with.

Thanks a lot.

0 Kudos
Message 1 of 7
(2,766 Views)

Assuming that the points are spaced equally, all you need to set is dt for the x-axis, e.g. with a property node.

 

(I would recommend further training, because most of your code is convoluted or even dangerous).

 

  • Never do equal comparisons on DBLs
  • No need for inner loops. (all you need is one outer loop and a proper architecture, e.g. state machine)
  • No need for dynamic data.
  • Your Stop control has the wrong mechanical action
  • terminals should not be hidden deep inside structures.
  • Why do you divide elapsed time(s) by 60 to get elapsed time(s)?????
  • There is no need for local variables.
  • What exactly determines the loop timing? I am sure you don't want to to spin millions of times per second.
  • Maybe a chart is not the right indicator if you have a known number of points at the end.

 

0 Kudos
Message 2 of 7
(2,747 Views)

Can you take a step back and explain what the code should do and how it is used? I am sure properly done the code would fit on half a postcard.

0 Kudos
Message 3 of 7
(2,742 Views)

Thank you for your answer. As I said, this is just a symmulation of a bigger program, that's why many things don't make a lot of sense. I've used this VI to try and test things for the other program, that's why it's a little bit messed up, but I thought the idea behind my question would get there, although it's true that I might need to practice more.

  To answer your question, the program is for the control of a furnace. The two numbers represent the real temperature and setpoint temperature of said furnace, and when those two are the same, it's supposed to wait an amount of time specified by the programmer. The temperatures need to be put in a chart/waveform showing both and how the real temperature slowly comes close to the setpoint one until they reach the same value, then the dwell time.

Also, could you elaborate more on how to do your solution? As I said, I'm a bit of a labview noob and I haven't really worked with property nodes.

Thanks again

 

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

How are you measuring temperature? It is very unlikely that they are ever exactly the same. You probably need to define a valid range of what is "close enough".

 

So your program has two states and you have an outer loop that measures certain things and when a condition is met (e.g. temperature close enough to the setpoint) you switch to the next state until some other condition is met. No need for inner loops!

 

Your chart has a history of 20000 points and once you feed it additional points, the oldest points are lost, i.e. the first value shown no longer has x=0.

Do you want x0=0 when the program starts of when the temperature is reached?

 

These are not really LabVIEW problems, but general architectural considerations valid in any programming language.

 

  • What is the condition of the furnace when the program starts?
  • What is the rate of temperature measurements? (MHz? Hz? less?)
  • What makes the temperature go up? Is there a heater?
  • Is the over temperature regulated by some external thermostat?
  • Does it continue to regulate once the target temperature has been reached?
  • What should happen after the temperature has been equilibrated for the desired amount of time?
  • ...
  • ...
0 Kudos
Message 5 of 7
(2,701 Views)

I appreciate that you are trying to fix everything wrong with the program, but as I said, this one is a VI that I've been using to test a lot of things for a bigger VI, so a lot of the issues you pressent have already been solved, and the only thing I need advise on is in the original question. 

So going back into that, after the furnace reaches a temperature and does the dwell time, it has to go to other temperature and do that again, and do that 10 times. How could I save all those temperatures into one single chart, without loosing points of temperaturw? Would it be better if I use a waveform graph instead?

To answer your question, I would want x0 to be at the start of the program.

Thanks again.

0 Kudos
Message 6 of 7
(2,681 Views)
Solution
Accepted by topic author sanwinner

X0=0 is the default, so nothing needs to be done. All you need is to set dt (or dx) to your loop time and you'll get correct relative time information, assuming you use a suitable format for the markers.

0 Kudos
Message 7 of 7
(2,667 Views)