04-11-2016 11:44 PM - edited 04-11-2016 11:49 PM
I have a problem in using the general histogram.vi, the internal library of LabVIEW.
The error screen shows some element (left side of error.jpg) in my program, and the same data in general histogram.vi (right side).
and you can also check general histogram.vi (right side) showed the histogram graph rightly on the panel.
But in my program, the graph (left side) cannot be generated though XY axis informations are right.
My environment is LabVIEW 2014 32 bit and windows 8.1 (64 bit).
In previous time, I had no any trouble in using this vi but I have no idea this is special according to my data.
Can you suggest any clues to check for this trouble?
Attachment: the screenshot of this trouble and source code. (LabVIEW 2014)
04-15-2016 03:30 AM
Hi!
I checked on my pc (LabVIEW 2015 32bit & Windows 7 64bit) and the behavior is the same.
Also recreating the VI and trying with a modified version of the histogram function I am using gives the same problem.
The graph receives the data (you can see it if you change it to a constant) and the autoscale works correctly but nothing is displayed.
The only solutions I found are:
- creating a different XY graph from the front panel
- editing the plot properties
Both ways works, but I don't understand why the standard indicator is not displaying anything.
04-15-2016 04:52 AM
Thanks for the interesting.
Can you tell me your procedure you tried in your program?
In my case, I couldn't generate any graph with various options.
I don't want to do research with this trouble but I want to know the alternative way.
labmaster, Ph.D in Physics.
04-15-2016 09:47 AM
I also played with this. The problem is that the Histogram Graph, for some reason, is not producing Bar Plots (I think this is a bug). It also needs to have the Y axis set to AutoScale. Here's your Histogram where I've set Y to AutoScale and have changed the Plot Type to Points (right-click the pale area just to the right of the words "histogram count", choose Common Plots, and choose another Style).
Also, there's no need to sort the data -- the Histogram function works just fine with unsorted data (it does its own sort).
Bob Schor
04-15-2016 10:15 AM
It's odd in that the histogram graph works just fine within the subVI. And when your right click and create indicator from the terminal on the subVI icon, it should be recreating that that same graph with all the same properties.
I feel like I've used that histogram before and a right click, create indicator. But I don't remember having a problem with it. Yet, I see the proplems that labmaster is seeing when running his VI in LV14 SP1
04-15-2016 10:31 AM
I figured it out! Here is the Histogram you want, looking just fine ...
So I looked at the data, then looked at how the data were being processed. I never did like the Spreadsheet functions, so I wrote my own "Break this huge string up into an array of strings (there are over 75,000 of them in there!), use Scan from String to make them Dbls, then simply pass that to the Histogram function, specifying 50 bins. The result (above) speaks for itself.
Bob Schor
04-15-2016 10:43 AM
I don't think your VI modifications solved it unless somehow you worked with the graph itself to fix its properties and its display of data.
I simplifed Labmaster's VI down to just a single 1-D array of doubles. (That string constant in the original VI is just nasty in how long it is.) I also deleted the histogram graph and created a new one by right clicking on the subVI's terminal. It still fails to show the graph in the main VI, but shows it fine on the subVI's front panel.
04-15-2016 11:18 AM
Here's my code. The only thing I used for the original post was the giant string. I actually coded my own "parse lines to array" using pattern matching, but the OpenG function is much faster. The Histogram Graph was created by right-clicking the output of the Histogram function and saying "Create Indicator" -- What You See Is What I Got (Wysiwig, alternate spelling).
Bob Schor
04-15-2016 11:36 AM
Just to be sure, I replaced the OpenG function with my own (much slower) function. We get the same answer, I was just much slower. The OpenG guys really did some tricky and clever manipulation!
BS
04-15-2016 12:26 PM
Okay. I took a step way back, used the array constant I had created from the original VI. Copied that over to a new VI. Dropped the histogram function and right clicked created teh graph indicator. (Also wired in the 50 constant.) It works just fine.
It can't be a problem with the histogram subVI itself because it is the same one in memory and installed on my PC.
I've gone and deleted everything in the original VI, copied back in the the double array from the new, good, working VI. Dropped a new histogram subVI, created the constant and the graph indicator. The original VI still has a problem with the graph.
The only thing I can figure is that there is some small corruption in the original VI that keeps the graph from working.
I think just create a new VI to fix the problem. Perhaps someone from NI can look behind the scenes of your original VI to see why it is acting funny.