LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with chart and refining my program.

Solved!
Go to solution

Hey there guys.  I am very new to using LabVIEW.  This is actually my first fully functional program, and I had a few questions about some of the finer points.  The program functions just how I want it. It starts and sends a signal to a power supply, turning it on.  Then 4 thermocouples are measured in a while loop until a specific temperatures is reached (set to 30C right now so I can stop the program with my hand). Five temperature readings are averaged together to smooth out the curves.  The readings are them displayed on thermometer read outs as well as graphed.  Once the limit temperature is reached the programs ends the while loop and a off signal is sent to the power supply. 

 

Everything works so you may be wondering while I am here.  Well first off I feel like the way that I used a sequence to turn the power supply off and on is kind of chunky and wanted to see if there was a simplier way.  Also I was trying to add a boolean LED to indicate that the heater is off or on, but could not figure out how to add it.  Also I was wondering how I get my graph x-scale to start from 0.  Currently I have it on relative time, but it starts from about 3.4 billion and then counts each second from there. This can be seen in the jpeg below.  Also is there a way to add a grid to a wave form chart?

 

Well thank you for your help and anything you can offer is much appreciated.

0 Kudos
Message 1 of 4
(2,379 Views)
Despite your use of a sequence structure, there are potential race conditions. For example clearing the history and writing the first points to the chart occurs in parallel and whatever executes first wins. Your gpib constants are in duplicate, so a small code change would need similar changes in different program locations. Use a single contant and wire to bith locations. If you wire it across the while loop, data dependency fully determines execution order and the sequence is no longer needed. (Sorry, posting via phone. I'll have more comments later)
0 Kudos
Message 2 of 4
(2,374 Views)
Solution
Accepted by topic author kgould

@kgould wrote:

Also I was trying to add a boolean LED to indicate that the heater is off or on, but could not figure out how to add it.  Also I was wondering how I get my graph x-scale to start from 0.  Currently I have it on relative time, but it starts from about 3.4 billion and then counts each second from there. This can be seen in the jpeg below.  Also is there a way to add a grid to a wave form chart?



OK, here are a few more suggestions.

 

  • To indicate running or not, you could just invert the value going to the stop condition and display it in a boolean indicator.
  • Set the X-scale format to relative time.
  • Your loop runs at about 2Hz (5 samples at 10Hz), so you should set the increment of the x scale to 0.5.
  • That song and dance with dynamic data seems ill advised. I would probably use low level DAQ functions instead.
  • Don't duplicate all these averaging functions, use a FOR loop.
  • Use a cluster for the chart and thermometers: simpler diagram.
  • Notice that at least one input to the "off" function needs to go through the loop to ensure that the function waits until the loop has finished.
  • To add a grid, modify the property for the scales and select a non-transparent color.

Here's a quck draft. Maybe it can give you some ideas.... 😉 (I have not implemented lower level DAQ functions yet)

 

There are probably a few little bugs. Make sure the dynamic data to 2D array is configured correctly.

 

(The sequence frame is currently needed because the GPIB subVI does not have an output (I don't have the VI!). This ensures that it completes before the while loop starts. It probably has an "error out" that you can wire to the loop edge, eliminating the sequence frame).

 

 

 

Message 3 of 4
(2,359 Views)

Wow thank you very much that helped out perfectly.  This is exactly why I love this forum.  But thanks again and I am sure I will be back soon.

0 Kudos
Message 4 of 4
(2,355 Views)