LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't Get my Plot to Format Correctly

Solved!
Go to solution

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 Smiley Wink

0 Kudos
Message 1 of 11
(3,266 Views)

You did not include the subVI.

 

Also place some typical default data into the numeric controls ("make ucrrent values default" before saving.)

0 Kudos
Message 2 of 11
(3,262 Views)

Sorry about that, here it is.

0 Kudos
Message 3 of 11
(3,258 Views)

Also the two hidden clusters need default values. Even easier, turn them into diagram constants after filling correct values.

0 Kudos
Message 4 of 11
(3,253 Views)

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 Smiley Wink

0 Kudos
Message 5 of 11
(3,243 Views)
Solution
Accepted by topic author amaglio

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)

Message 6 of 11
(3,239 Views)

Thanks altenbach, works like a charm now.

0 Kudos
Message 7 of 11
(3,231 Views)
0 Kudos
Message 8 of 11
(3,225 Views)

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 Smiley Wink

0 Kudos
Message 9 of 11
(3,160 Views)

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.

Fred Visser -- SystemLink R&D -- National Instruments
0 Kudos
Message 10 of 11
(3,129 Views)