01-05-2011 03:21 PM
Hi Guys,
I am capturing a trace from a Spectrum Analyzer, so in the end I have Frequency Data and Amplitude Data. I then plot the data, and try to format the graph to match what is shown on the Spectrum Analyzer. For some reason when I go from a narrow span to a much larger span the graph does not format properly. I am adjusting all kinds of things on the graph and I am assuming they have to be done in some order but I can't figure it out.... If I put all of the formatting stuff in a loop and run it twice it works fine, but I want to know what I am doing wrong so I can do it the right way. I attached the code, hopefully somebody has ran into this problem before and knows whats going on. There is a switch on the FP that can be used to change from one span to the other. Thanks for your help
Solved! Go to Solution.
01-05-2011 03:26 PM - edited 01-05-2011 03:27 PM
You did not include the subVI.
Also place some typical default data into the numeric controls ("make ucrrent values default" before saving.)
01-05-2011 03:29 PM
Sorry about that, here it is.
01-05-2011 03:34 PM
Also the two hidden clusters need default values. Even easier, turn them into diagram constants after filling correct values.
01-05-2011 03:44 PM
Ah, yes... Sorry about that.. This should do it.
Also, while trying to get the plot to format correctly I added many different graph properties trying to figure out why it takes 2 cycles to format properly. I would prefer to be able to use the minimum number of properties to get it formatted. I am sure once we figure out the proper order there can be some things we can eliminate.
Thanks so much
01-05-2011 03:56 PM
Property nodes execute to to bottom. You need to set offset and multiplier beofre setting the range max and min.
(offset and multiplier define the linear relationship between array index and x value)
01-05-2011 04:02 PM
Thanks altenbach, works like a charm now.
01-05-2011 04:10 PM
Here's a quick remake.
01-10-2011 08:38 AM
Okay, so I got that issue resolved now I am trying to figure out why the plot does not format correctly the first time. For example when you first start the VI, it takes 2 iterations for the plot to come out correctly. To mimic the behavior I am seeing just take the hand tool for the plot and swipe from left to right to mess up the major/minor increments and all the other settings, then run the VI. Thanks for your help
01-12-2011 08:26 AM
Hi amaglio,
From what I can see with your previous examples here, if you set all of the properties in a single property node, you'll have to run the VI twice to see the correct formatting. If you (as you had originally done) use two property nodes; one for scale properties and the second for increment properties, everything appears to work correctly.
Hopefully this functions as a useful workaround. I'll also file a CAR on the behavior, as having to use multiple properties nodes is unexpected and undocumented.
I've attached a slightly modified version of your original subVI.