08-05-2009 02:52 PM
I have an application that displays one or more signals in a WvfmGraph. The X Axis is set by a hardware encoder giving signals vs. distance (measured length). I would like to change the caption of the XScale according to the values of one of the signals. Its similar to an XY graph, but differs in that I want to see the data unrolled.
The problem is that the X Axis scale markers are fixed. I would like to ask the graph what is range property of the X Axis scale. Then use that information and a derived position signal to replace the marker values with values from a derived signal that includes relative motion.
For example, measuring a unit 100 feet long results in measurements of 200 feet worth of data (out and back). The customer would like to see this data unwrapped 0, 50, 100, 50, 0.
One alternative is to use an XY Graph, but the data on top of itself. Not necessarily a bad thing, but not the same as what they have always had.
I found a similar post to display the scale at a rotation (CW or CCW) and was able to get it to work for my specific case. The problem is that my picture marker values are not aligning nicely with the corresponding gridlines.
08-06-2009 02:40 PM
Hi Kenneth,
Have you been able to use a property node to do this? Under X Scale»Range there are a myriad of options for changing the scale values of the graph.
08-06-2009 03:36 PM
Stephen,
Thanks for replying to my post. XScale.Range does not handle this situation. In "rigorous" terms, LV does the right thing with X axis scale markers and put them where you want. I tried to set custom Marker values as: {0, 50, 100, 50, 0} and only saw the first three values. My guess is that under the hood, the spacing is set to 'Arbitrary' and my custom values are overwritten. Not what I intended, but I admit my task is not the normal use case.
Today I am prototyping the entire application with each WvfmGraph replaced with XYGraph's. Good thing I used a modular design and passed Refnums around to all my subVI's. Depending on a review of this prototype, I might skip this graph scale formatting.
FYI, the original graph issue wanted to rotate the marker labels CCW. They hid the graphs XScale and used a custom picture to display the new scale. There is a VI that formats an axis with custom labels, where the font, text, etc. can be customized. I have a working example of that custom scale on a Wvfm graph. I stopped refinement when I tried to consider use cases for how the user would zoom on the data, how the graph's label's would appear if the DAQ signal indicated that the part reversed on itself. All the data is better visualized on an XY Graph.
p.s. are you one of the Waterloo Labs engineers? Great stuff!
08-06-2009 03:45 PM
Hi Kenneth,
That does sound like a pretty unique use case, but with so many people using LabVIEW, you never know. I would encourage you to post an example of your code once you get it working with the XY Graphs to the NI Community. Way to be a savvy programmer and use the references, etc.
Also, yes, I am one of the Waterloo Labs engineers. I'm really glad that you liked the videos! Let us know if you have any ideas for DIY projects we should attempt. You can either comment on our blog or on our YouTube channel. Thanks for watching!!