06-23-2011 09:09 AM
Sorry, normally this is straight forward enough to push through on my own.
Purpose:
Pass Refnum of XY graph to subvi -->
Subvi's purpose : PRINT XYGRAPH to file/pdf/bmp, manipulate xy graph further (change back ground color to optomize for printing, optomize xy graph size for printing, move legend), perform some simple analysis on the data (rms, pkp etc)
Problem Statements:
1:) When using a refnum, writing any changes to the refnums property value will also change the parent i.e. the subvi xygraph. This is not desired, so an exact copy of the xygraph must be made. HOW DO YOU DO THIS?
2:) When using a refnum for an xygraph, how does one retrieve the xy values? If the property node for value is selected, a variant is produced. (which after careful examination I was still not able to make heads or tales of this particular variant)
p.s. A refnum is used because the xygraph already has formatting applied to its legend, plots, axis, etc. A refnum passed to a subvi is the only way I know to pass all formating etc for the graph.
p.p.s. I understand that there is an invoke node that will export an image, it contains certain limitations (such as requiring the subvi be opened, since it works by similar rules to a printscrn) that make it un applicable to this problem.
Solved! Go to Solution.
06-23-2011 09:17 AM
eximo wrote:
Problem Statements:
1:) When using a refnum, writing any changes to the refnums property value will also change the parent i.e. the subvi xygraph.
I don't understand this statement. Does the subVI have a graph also? Obviously, if you make changes to properties via the refnum, then the graph it's pointing to will change.
p.p.s. I understand that there is an invoke node that will export an image, it contains certain limitations (such as requiring the subvi be opened, since it works by similar rules to a printscrn) that make it un applicable to this problem.
Again, I don't understand. Where's the graph? On the main VI, or the subVI? If it's on the main VI, why would this be an issue? Wouldn't the main VI window be open?
06-23-2011 09:48 AM
ah, sorry for the confusion.
The main vi is also a subvi. It's part of an automated test suite, so it will not be displayed when the test are being run.
It is NOT desired to change the parent graph.
The subvi will have a copy of the xygraph from the parent vi. An exact copy, which will have all attributes.
I'm writing because if I go to the property node for the refnum value i am returned a variant. I don't know what to do with a variant to turn it into an xygraph.
06-23-2011 09:54 AM
You need to use Variant to Data to convert the variant back into the native data. XY graphs can take data in multiple formats, so you can just create a constant from your XY Graph, emptying any data to get the proper format.
06-23-2011 10:08 AM
ok....
DUH!
Thanks, what would I do without you Mathew Kelton, hahah.