06-29-2010 02:08 PM
Having found some additional information, i feel am closer to a solution but am still confused as to the cause of the problem. My understanding is that the brown cluster contains elements of the same type and the pink cluster contains elements of different types. However, the cluster (which is currently pink) should contain elements of the same type [see below]
The meter I use to read the data returns a string containing the voltage and current in the following format [voltage1, current1, voltage2, current2, voltage3.....]. I convert this string to an array of data type double and then deliminate the string to get voltag and current as seperate 1-D arrays (type double). If both arrays are the same size and of the same type, creating a cluster from these two arrays should mean that the elements are of the same type. The arrays are wired to the build xy graph express vi and the output is a pink cluster (elements of different type).
Any ideas as to why this problem is happening?
06-29-2010 05:09 PM - edited 06-29-2010 05:09 PM
@pjr1121 wrote:
Any ideas as to why this problem is happening?
Yes. It's because you're using one of those evil Express VIs. That Express VI is actually creating a 1D array of clusters, not an individual cluster.
06-30-2010 08:46 AM - edited 06-30-2010 08:47 AM
Smercurio,
Thank you for your reply and this explanation does make some sense. However, it did not fix the problem. I've attached a small vi demonstrating the error I am enountering. There is a class conflict (error list says renum types are different) when wiring the xy graph reference from the main vi to the sub vi. I think this has to do with the fact that the clusters in the main and sub are different, but I do not know why they are different.
These were made with Labview 8.6
06-30-2010 09:06 AM
You probably created the reference before the datatype for the XY graph had been set and moved the reference to the subVI's front panel to create the control. Since the reference control on the subVI has the "Include Data Type" option checked (right-click on the control), the data type has to match.
Graphs are tricky when it comes to creating references for them. You need to make sure you create the reference after you've wired the plot data, as this will update the data type of the graph. The default data type of the XY graph is a 1D array of clusters, with each cluster being 2 DBLs. Thus, if you place an XY graph on a front panel and create a reference, you get a reference to a data type of 1D array of clusters of 2 DBLs. If you then wire the plot data to the graph the reference on the main VI gets updated as far as data type, but the reference control on the subVI does not, since it's still based on the original data type.
So, you can either update the reference on the subVI with a new reference from the main VI, or you can uncheck the "Include Data Type" option on the reference control on the subVI. The latter means the Value property will return a variant which you will then need to cast to the appropriate data type using the Variant To Data function.
06-30-2010 03:53 PM
Thank you,
Although attempting the update the reference resulted in the same error, I did manage to get the void to data conversion to work. My program is now fully functional.
06-30-2010 04:53 PM
The difference between the pink and brown wires are that the brown wires refer to numeric values only inside of a cluster as part of an array. The pink wire is anything else, ie, arrays in clusters. The sample VI should show what I mean.
06-30-2010 05:30 PM
@pjr1121 wrote:
Thank you,
Although attempting the update the reference resulted in the same error, I did manage to get the void to data conversion to work. My program is now fully functional.
I don't see how that could have happened unless you did things out of order. I had tested it out just to make sure it would work, and it works just fine. Starting with the VIs that you posted:
Once you do the above you should not have any broken wires.
P.S. It's a variant, not a void. Big difference.
07-01-2010 08:24 AM
Tried replacing the reference again and it worked this time. I must have made a small mistake last time that I didn't notice.
In regards to the void vs variant, I thought I had typed variant in my last post but apparently I typed void out of habit.
Thank you again for all of your help.