04-04-2017 12:40 PM
Hi all,
First time posting on the forums, but I have read many others and have found them very helpful.
I'm writing an interface for a pressure scanner, and I have a very particular bar graph in mind. On the X-axis of the graph, I have an auto scaling of the pressure response based upon the largest pressure value read by the scanner. The Y-axis corresponds to the 16 channels from the pressure scanner. My goal is to have the corresponding pressure value next to the appropriate channel (in a professional/visually appealing manner, ie not what I did in the screenshot). I want this value to update when the bar graph updates (at about 5 Hz). What you are seeing in the screenshot is the values from the scanner which I have unbundled and displayed in an array overlapping the the XY Graph. Is there a better or cleaner way to do this with a custom control?
Any thoughts or suggestions would be a big help.
Solved! Go to Solution.
04-04-2017 01:36 PM - edited 04-04-2017 01:41 PM
Why not just use a vertical 1D array of horizontal progress bars or similar?
You can even show the digital display, eliminating the extra indicators.
You can even make the container and frames transparent for a cleaner look.
(an old example is shown here, just with horizontal elements)
04-04-2017 01:45 PM
@altenbach wrote:
Why not just use a vertical 1D array of horizontal progress bars or similar?
You can even show the digital display, eliminating the extra indicators.
You can even make the container and frames transparent for a cleaner look.
(an old example is shown here, just with horizontal elements)
That same thought crossed my mind but I could not figure out how to get the fill to work correctly for both positive and negative numbers without getting complicated, adding sliders and adjusting the fill options to adapt for negative numbers.
What you showed there is a an array of clusters ?
Alternatively an cluster of clusters is another option where the names will line up nicely with the indicator.
Ben
04-04-2017 01:46 PM
Also please attach your VI, there are serious beginner mistakes and race conditions.
Why do you need to reinit the stop boolean 5x/second? depending on the execution order between reading the local variable and executing that node, your VI can never be stopped. What does the subVI do? How often do you need to set the scale max&min? Why do some wires go right-to-left? Where does the data of the local variables come from?
04-04-2017 01:53 PM - edited 04-04-2017 02:27 PM
@Ben wrote:
What you showed there is a an array of clusters ?
Here we use cluster because each element also has a label string. You can use a plain array instead.
Yes, the fill seems a bit tricky. You could use two sliders. Maybe you could add two bars next to each other, one for negative and one for positive values and calculate the right values.
Of course another option would be a picture indicator where you can freely draw any boxes and text you want. The image creation could be isolated to a simple subVI based on the data (data in, image out).
04-04-2017 02:17 PM
Note that this question is about the graph control, not about how the VI stops or how often I need to set the scale.
The data from the local variable comes from a TCP Read which grabs the binary data from the pressure scanner, and a DLL converts it to a CSV. The SubVI parses and compares the values which outputs to the case structure for graph scaling.
The pressure scanner can scan at rates up to 500Hz. The bargraph is to display data updated at a reasonable rate for a person, and not every frame of data is important to the graph.
Please see my initial request about the graph control.
04-04-2017 02:19 PM
I appreciate the solution, and I stumbled into this before. However, I am dealing with positive and negative numbers which I see as a downfall to the progress bars. For the user's benefit I went with the bar graph as it seems like a more intuitive visual aid.
04-04-2017 02:33 PM - edited 04-04-2017 02:35 PM
Your VI is a bit too messy for me to study, but here is an example how you could deal with positive and negative values.
I assume the x-scale is fixed, so you need to set that to your liking (currently -10..10).
There is a bit of a kludge if the value is zero because the fill to above/below does not work if all three sliders are zero (we get full fill instead of no fill). I have not studied if element reordering would fix it.
You could easily make the array element an outer cluster and add another numeric indicator as a second element to show the value (first element is the slider cluster).
04-04-2017 02:39 PM
Your attached VI is similar to what my original bar graph program does. I need a graphical display with the bars AND their current numeric values in a way that could be visually appealing.
04-04-2017 02:53 PM - edited 04-04-2017 02:58 PM