07-18-2011 10:30 AM
Hi all. I'm making a subVI for a work project. Both myself and my boss have run out of ideas and the deadline's drawing near!!
I'm a noob to Labview but I'll try to explain what my subVI does (or should do).
Basically my subVI reads in 24 channels of data from a VI. My subVI should then turn these elements of data into an array and output 24 seperate bars on a bar graph to represent the voltage level of each channel.
This it does, however, the graph only shows 20 channels and no more.
I know for a fact that the SubVI recieves all 24 channels and processes (if that's the right word) the se 24 channels all the way to the end. But no matter what I do I can't get the graph to display the last 4 channels.
Both myself and my boss (who know a lot more about Labview than me!) are stuck. Please help!!
I have attached my subVI. It is commented, so hopefully it will be a lot easier to understand by looking at it rather than me try to make ham-fisted attempt at explaining it in words! (Test bar graph 2)
I have also attached the orginal bar graph VI that I adapted to make my subVI (Bar graph example)
One final thing: "Bar graph example" was made in LV 10 and "Test bar graph 2" was made in LV 8.6 - because it had to be compatible with previous VI's. Sorry! (Bloody labview and it's non-compatibility issues!)
Solved! Go to Solution.
07-18-2011 10:48 AM - edited 07-18-2011 10:48 AM
Noooooo!!!!!
OK, the bar graph example has virtually no resemblance to the other VI. What is the significance? Whay does it have a chart???
The subVI is a Rube Goldberg construct beyond belief and probably could be done with 1% of the current code. Could you make it so that the "array" contains some typical default data so we can actually test?
Do you really need different colors for all the bars?
07-18-2011 11:07 AM - edited 07-18-2011 11:10 AM
Your location array only has 10 elements, thus the location loop will only spin 10 times, and not 12 due to autoindexing.
Try something like the attached. It does about the same as your code. To change the x-axis spacing, modify dx, no need for the locations array)
07-19-2011 06:05 AM - edited 07-19-2011 06:11 AM
Brilliant help, cheers!
Thanks to you, I've got got my "Rube Goldberg machine" 😄 working (Test bar graph 3), and I've also modified your and got that working too (Test bar graph 4).
Just for future reference: To get the Rube Goldberg working I just had to right-click on the array on the front panel and click Data Operations -> Insert Element Before, then add two more elements and re-number them from 0-55
I'm going to use your version; much more simple, plus it numbers each bar 0-23.
Still, I'm not ashamed of my Rube Goldburg! Afterall, part of becoming a good programmer is making mahoosive code and then learning how to make it small and clever 😄
Thanks again
PS. LV colours each bar graph automatically. For the purpose of my subVI it's a good thing anyway
07-19-2011 08:55 AM - edited 07-19-2011 08:58 AM
Kahinde wrote:Still, I'm not ashamed of my Rube Goldburg! Afterall, part of becoming a good programmer is making mahoosive code and then learning how to make it small and clever 😄
Note that you could send the raw input array directly to the graph and you would get the same graph, but all bars in the same color. That might be sufficient for all practial purpose.
Looking at the two VIs you have attached, they are still more complicated than really needed..
Image 1:
Image 2: