LabVIEW:Simple NLFit

From OriginLab Wiki

Jump to: navigation, search

This example shows how to do different kinds of Nonlinear fitting with the same data. And to access the fitting results in Origin.

It is to demonstrate the following:

  1. Connect to Origin with OA_ConnectToOrigin.vi which maps to the ApplicationSI method in Origin.
  2. Load an Origin Analysis Template (an OGW file) under Origin program folder.
  3. Specify a path to load 1peak.txt, which is under <Origin Program Folder>\Samples\Automation Server.
  4. Send the data to a sheet named "Data" in the Analysis Template.
  5. And then you can select a nonlinear fitting function in the dropdown list.
  6. Trigger Recalculate in Origin. The Analysis Template will automatically update the "WaveformEnvelope" sheet.
  7. Send the fitting curve and the fitting results from Origin to LabView.
  8. Repeat the step 5 and step 7 to do different kinds of fitting until you press the Stop button.
  9. Exit the Origin.

This example is mainly composed of two parts.

  • The figure below is to read data from an ASCII file and send the data to the Origin worksheet
    Image:SimpleNLFit1.png
  • The figure below is to perform the fitting process. And then send the fitting results to LabView.
    Image:SimpleNLFit2.png