ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

X-Y Graph Question

Hello All,

I'm reading in two channels of data from a SR830 lock-in amplifier, and trying to plot X vs. Y. I can display both X and Y on a waveform graph, but for some reason when I plug both X and Y into "build X-Y graph" nothing shows up on the front panel. Strangely, if I change the values of X and Y via the lock-in amp the graph's axes scale. Anyone know what's going on?

Regards,
Danny
0 Kudos
Message 1 of 9
(3,290 Views)
You may be only displaying a single point which won't be visible unless the point style is a dot.  Click the plot legend and select a point style besides the default (none).  If you see a point then, you're just not sending an array of data to the graph, only one point.  post your code if you need more help.
LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 2 of 9
(3,277 Views)
Thanks for your help. You're right, it does only show one point. How do I turn two realtime streams of numbers into an array that will display a meaningful x-y plot?

I'm not sure what you mean by "code" (I'm very new to labview), but here's the part of my schematic that I'm using. Sorry, it's a little messy, but the basic idea is that it recieves two numbers on two different lines from a serial port, then splits the string, converts them into floats, and then feeds both those numbers directly into the plot.


0 Kudos
Message 3 of 9
(3,269 Views)
Do you really need to plot X VERSUS Y, or do you just want to graph two channels of data?
 
If #1, then you will need to enclose your code (in LV, the block diagram IS the code) in a while loop and use shift registers with the build array function concatinating the data on each iteration.  The continously updating arrays are then wired to the graph.
 
If #2, then a waveform chart would be more appropriate.  You can just wire the floats into a chart because it stores a history of data points.
 
In either case check out some of the shipped examples for charts.  Help>find examples> Building User Interfaces>Displaying Data>Graphs and Charts.
 
I would also suggest you look for the LabVIEW style guidlines tutorials (search the forum) because your code is making me hungry... FOR SPAGETTI! Smiley Very Happy
LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 4 of 9
(3,260 Views)
Actually, if it's #1, then a False constant can be wired to the Reset input of the Build XY Graph.
0 Kudos
Message 5 of 9
(3,254 Views)

Thanks Dennis,

I'm still using LV7 and miss these neat little tricks in the new versions.  Time to upgradeSmiley Wink.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 6 of 9
(3,236 Views)
The Express XY Graph was introduced in version 7.0.
0 Kudos
Message 7 of 9
(3,230 Views)
HaHa, you're right!  I don't think I've ever opened the express palette.  I always convert those VIs as soon as I see them.  I like knowing what's inside and how they work.  I used to drive my Mom nuts by taking apart every appliance in the house.  Some things never change Smiley Tongue.
LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 8 of 9
(3,221 Views)
Yep, that worked. Thanks everyone.

Danny
0 Kudos
Message 9 of 9
(3,199 Views)