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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Origin in Batch + NLSF questions

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Leo.C Posted - 06/12/2006 : 09:52:57 AM
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
3   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 06/12/2006 : 1:14:34 PM
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

Leo.C Posted - 06/12/2006 : 12:55:39 PM
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!
easwar Posted - 06/12/2006 : 10:06:45 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000