03-21-2013 03:42 PM - edited 03-21-2013 03:43 PM
Hi altenbach,
Please see the attached code.
03-21-2013 04:09 PM
Hi Altenbach,
Please see the attached code. No more gibberish, just the code 🙂
While we're at it, I also occasionally get the Invalid Property Value whenever I run the code by opening up a few files, then on subsequent run open up several files.
03-21-2013 04:34 PM
To be perfectly blunt your code really should be re-written. You should consider using more subVIs, less local variables, and get rid of all of the sequence structures. The best way to describe this code is that you are trying to turn a data flow language into a traditional text based sequential language. Trust me, you can write large complicated applications without using any global variables, local variables (with the exception of some UI code) or sequence structures. Learn how to use data flow effectively. This code if it lives for any length of time will be difficult to maintain and enhance. One of the stables of LabVIEW is a state machine. Your code looks like it could easily be turned into a state machine. Then you could get rid of all those local variables by using shift registers.
03-21-2013 04:42 PM
Thansk Mark. I am actually trying to make the code simpler and modular precisely for the reasons you mentioned, like code maintenance.
As a matter of fact, I am making chucks of my code into sub VIs, but as of now I am not familiar with state machines. So I have to learn and then apply.
For now, I already got rid of the sequence and local variables, but I still see the same problem. Once I simply the code, I'll see if it goes away.
03-21-2013 04:57 PM
murchak wrote:While we're at it, I also occasionally get the Invalid Property Value whenever I run the code by opening up a few files, then on subsequent run open up several files.
Well, you don't seem to wire most error output, so we don't really know where they occur. My best guess is that you are writing propertis for more plots than you currently have. Make sure to draw the data first, before changing plot properties. For example if the old dataset had 5 plots, and the next one has seven, writing properties for the last two will fail if you do that first.
03-21-2013 06:26 PM
I think cross usually posts these links, but look here:
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
🙂
03-21-2013 06:49 PM - edited 03-21-2013 06:54 PM
Ah floating indicators over a HUGE tab control in an area normally off screen. Have I ever mentioned I hate that tab container! Buggy buggers, especially with huge panels! You almost Have to defer FP updates to get all that junk into and out of the UI thread. Use wires rather than locals.
03-21-2013 10:02 PM
Hi Altenbach,
Before I could fix my code, I wrote a very simple code that plots data from a number of files (file1 to file 10). The user can choose any number of files.
The code is supposed to plot Y vs. X and plot error bars as well such that the color and point style match the main curves.
The code works fine, but when I make it a subVI and call it from another code, it doesn't update the line colors, point style, etc.
How could this happen?
03-21-2013 10:32 PM
You are updating the properties of the graph that is within the subVI. You are not updating the properties of the graph of the main VI.
What you need to do is pass the reference of the graph in the main VI to the subVI. The subVI will need a control on the connected to the connector pane that is a graph reference so that it accepts the reference passed in from the main VI.
03-21-2013 10:47 PM
Thank you RavensFan! Minutes after I posted that, I saw what I was doing wrong.
I am fixing this now. Thank you for your help. I will continue to keep this link open because the original issue has not been solved.