LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Take x and y measurement, plot xy graph and save data

Hello everybody,

I'm trying to measure x and y (y depends on x) values using the same instrument, where x is changed manually without involving the instrument. I want to plot a xy graph real-time and save the xy data to excel. If you have a vi which does a similar job, please share it with me.

Thanks

0 Kudos
Message 1 of 8
(943 Views)

This is a very basic task. What do you need help with?

 

  • What have you tried so far?
  • Can you send X to the instrument?
  • Can you read Y from the instrument?
  • Do you want to read exactly one Y whenever X changes or do you want to measure at a defined rate, even if X does not change (for example if Y has noticeable noise)
  • Does it need to be Excel (proprietary Microsoft format) or would be a delimited spreadsheet file be sufficient?
  • etc.

 

Also note the learning resources listed at the top of the forum?

0 Kudos
Message 2 of 8
(907 Views)

Thank you for your reply.

I figured out creating a  xy graph real-time. Now, I'm having trouble saving all x and y data points measured for the graph in an excel sheet/text file. 

I've attached a sample vi with stimulated data. Sorry, it needs more proper arrangements. I'm trying to get it work first.

Could you please suggest how I can save all x and y points measured?

Also, if you know how to control the temperature unit using LabVIEW measured by a Keithly 2000 multimeter, please let me know.

Thank you for your help so far.

0 Kudos
Message 3 of 8
(891 Views)

Please "save for previous" (2020 or older) and attach again. I cannot open VIs in LabVIEW 2021.

0 Kudos
Message 4 of 8
(885 Views)
0 Kudos
Message 5 of 8
(880 Views)

Thanks.

 

  • None of your sequences are needed.
  • There is no need for a greedy loop
  • Use a state machine instead of a dead-end loop. Don't have loop rates longer than a fraction of a second. 15 seconds is way too long to react to the button press)
  • Collect the data in a shift register instead.
  • Please don't maximize the windows to the screen.
  • Your feedback nodes should be initialized.
  • Your formatting belongs after the loop. That's the only place where you need the output
  • %1.5f is a very unusual format.

Here's a quick draft that can potentially give you some ideas.

0 Kudos
Message 6 of 8
(874 Views)

Thank you very much for the detailed instructions.

I'm writing this VI to control a Keithly 2000 multimeter.
The objective of my project is 
- To measure temperature(x) and resistance(y) of a wire/electrolyte by varying temperature using a heater (Get x and y simultaneously with 1 minute time gaps)

-To be able to select "Kelvin" unit for temperature measurement in the vi itself.

-Plot y vs x real-time
-Plot R/R0(y/initial y) vs T(x), use linest function to obtain linearly fit xy graph and slope.

-Save the x,y,y/initial y data points measured in an excel/text file.


I've attached the initial vi I had drafted and the modified vi with shift registers. The feedback node used in the previous vi was just to get model x and y values for me to troubleshoot others parts of the vi. I cannot attach a 2020 version vi here with the keithly palette icons for some reason.

I used a sequence because the multimeter cannot take 2 different measurements at the same time.

More guidance would be much appreciated.

Thank you so much for your help so far.

0 Kudos
Message 7 of 8
(865 Views)

@Zhulfaa wrote:

I used a sequence because the multimeter cannot take 2 different measurements at the same time..


If you line functions up along an error wire, execution order is automatically enforced and hte next cannot start until the previous has completed. The magic of dataflow! Flat sequences are rarely needed and stacked sequences are never needed (there is a reason they disappeared from the palettes years ago!). They make the code extremely difficult to follow and debug. Sequence locals also require ugly wiring. (Stacked sequences had their limited use 25 years ago when monitors were tiny, but now they are simply a hallmark of poor code. You will never see them in well written programs).

 

Sorry, I won't look at an album of code pictures. We prefer the actual VIs..

 

As I said, all you need is a state machine with a single outer loop and a few states (idle, wait for next measurement, take measurement, write file, etc.). Accumulate measurement data in shift registers, etc. If the measurements are minutes apart, you might as well do the fit with every graph update as I showed. Doesn't cost much.

0 Kudos
Message 8 of 8
(860 Views)