07-25-2014 05:58 PM
Not sure why I get this error code. The left Y-axis (Plot.YScaleIdx = 0) is for curves 1 and 2, the right Y-axis (Plot.YScaleIdx=1) is for curve 3.
Solved! Go to Solution.
07-25-2014 07:03 PM
How can dx = 0 be a valid value? That would pile all the points on top of each other.
Lynn
07-25-2014 07:07 PM
Sorry Lynn....I didn't get what you were saying. Where is dx=0? What am I overlooking?
07-25-2014 07:32 PM
My apologies. I mis-read your post. You are looking at the scale Index. I was thinking of something else, which does not actually exist in the form I was thinking of.
I get that error if I enter a scale index number larger than the number of scales -1. Are you sure that the scales exist? The VI you posted only has one scale. I do not know if it is possible to create scales via property nodes. Right click on the Y scale and select Duplicate Scale. Then you can adjust and manipulate the scales. When I create three scale on your graph, the error goes away.
Lynn
07-25-2014 08:03 PM
Thanks Lynn,
I am getting close, but still don't get the curves to come out right. I right clicked on the XYGraph Y-axis and selected duplicate Y-axis, the swapped the sides.
See the new VI. Still, the Y-axis min and max values don't work out the way I want them.
07-25-2014 08:36 PM
The X-axis array goes to the top terminal on the Bundle node for the XY Graph. The Context Help window shows this when you move the cursor over the graph terminal on the BD.
You do not need the sequence structure. Use dataflow!
I moved the properties which never change outside the case structure. Functionally this makes no difference but it is a form of self-documentation. If it is outside it does not change. If it is inside it changes.
Lynn
07-25-2014 08:41 PM
Thank you!
07-26-2014 04:13 PM
Hi Lynn,
I need a little more help. I applied your ideas to my specific situation, and I still get the same error.
The code below plots data from two tables, A and B. The State can be the following: plot A only, B only, both A and B, and neither A nor B.
You can select the state, then run the code. I still get the invalid property value error.
07-26-2014 05:22 PM
When the graph arrays are empty, there are no plots. So setting the Active Plot property to to any non-zero value creates the error.
One way to fix that is simple but a bit sneaky. Change the tunnels where the A Graph and B Graph arrays connect to the for loops to be indexing tunnels. Why does this work? If a for loop has two or more indexing tunnels, the number of iterations of the loop is determined by the smallest length of the connected arrays. So when "A off " is selected, the A Graph wire contains an empty array and the A loop executes zero times.
If you have situations in your real code where the arrays are not empty or where the number of plots varies, this will still work. If the number of plots is greater than the number of elements in the Plot Colors arrays, then that number will limit the number of times the loop iterates. It is a good idea to document such "sneaky" techniques so when you come back to the code next year, there will be something there to remind you whay you did that.
Lynn
07-26-2014 11:42 PM
Thank you very much Lynn. I don't think I could've figured that out on my own. That part was bugging me for the past few days.
I have been reading the "LabVIEW for Everyone" book by Travis and King, and I had learned that a for loop uses the minimal index tunnel,
but I wouldn't have been able to use that concept to take care of this problem.
I should also starting using error clusters in my code. This is something that is definitely overlooked by LabVIEW beginners like myself.