The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Origin in Batch + NLSF questions
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Leo.C

Brazil
Posts

Posted - 06/12/2006 :  09:52:57 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5 SR4
Operating System: WinXP

Hello, I have a project where I need to call Origin from Windows to execute a C script. The script will open several files in a folder, prepare data, make a nlsf fitting with a custom function, write data in an excel worksheet and close.

In order to be able to do that, I need help with the :

1 - how to open Origin from windows (using vb, batch mode, etc) and call the origin c script with parameters?

2 - Could I have an example of calling nlsf with a custom function? That would make my work a lot easier...

thanks in advance

easwar

USA
1965 Posts

Posted - 06/12/2006 :  10:06:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Leo.C,

You mentioned "using vb" and so I wanted to point out that Origin 7.5 can be run as an Automation COM Sever where client applications such as a VB app can launch Origin and exchange data and send commands to Origin to run script etc.

If you wish to pursue the above route, you could look at examples in the \Samples\Automation Server directory of the Origin installation. You can look at the "Dose Response Curve Fitting.xls" file under \Excel subfolder and this XLS file has VB macro code to perform curve fitting with Origin from Excel.

Origin could also be launched by a Windows batch file and in that scenairo Origin could be made to run a particular script file on launching. You can see more details in the Programming Help file under Programming Guide->Distributing Custom Applications section. If however you plan to push many datasets and generate eventually an Excel report, the automation server method may work better.

Regarding calling custom fitting function, as long as your fitting function has been defined and is part of the NLSF collection of functions, calling your function is no different from calling a built-in function. You may need to either write initialization code for paramters or simply assign initial values directly in your code with statements such as
nlsf.p1=some_value;
etc

Easwar
OriginLab



Edited by - easwar on 06/12/2006 10:12:13 AM
Go to Top of Page

Leo.C

Brazil
Posts

Posted - 06/12/2006 :  12:55:39 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Easwar, I will try the batch file method since it is a repetitive task and part of my script code is ready. I will keep in contact if I have any dificulties.

Regarding the NLSF with custom function, I have another question. Is it possible to integrate directly the function in the script, as a subfunction, without the need to include it in the nonlinear curve fitting window? That would allow me to excecute my script across many machines automatically, without the need to configure each machine individually.

thanks again!
Go to Top of Page

easwar

USA
1965 Posts

Posted - 06/12/2006 :  1:14:34 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Leo.C,

For the fitting to work, the function needs to be added to each machine so that the fitter "knows" the function exsits. Adding across the network on multiple machines can be done by editing/pushing a new INI file that contains the information on the function, and also of course adding/pushing the FDF file to the user machines etc.

Tech support can help you directly with this issue. Please contact them at tech@originlab.com

Easwar
OriginLab

Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000