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
 Origin Forum
 expotr from Delphi6 to OriginPro7.5
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

bigspoon

Russia
Posts

Posted - 12/29/2004 :  08:41:41 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version : 7
Operating System: win 2000/xp

I want to export data from my delphi-programm to OriginPro worksheets.
I don't know something about COM-server of OriginPro.


Edited by - bigspoon on 12/11/2006 10:21:50 PM

easwar

USA
1965 Posts

Posted - 12/29/2004 :  12:55:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

The COM-server feature was introduced in version 7.5 so you could try this with the demo. Origin Standard can also act as a COM server and so Pro is not required for this feature.

If you download the 7.5 demo, you will find a \Samples\Automation SErver\ subfolder under which there are examples of accessing Origin as server from client applications such as Excel, VB, VC, MATLAB, LabVIEW etc.

Easwar
OriginLab

Go to Top of Page

bigspoon

Russia
Posts

Posted - 12/29/2004 :  10:27:03 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
easwar, thanks
but I have only origin 7.0220 (B220) and can not download demo file (it is very big for me).
easwar, post demo code in this topic, please

Edited by - bigspoon on 12/29/2004 10:44:02 PM
Go to Top of Page

bigspoon

Russia
Posts

Posted - 01/01/2005 :  02:09:55 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply

well... i downloaded Origin75demo and setup it.
i wrote in my delphi-program:

var
origin : variant;
strFile: string;

begin

origin := createoleobject('Origin.Application');

origin.Execute ('doc -mc 1;');

strFile := ExtractFilePath(ParamStr(0)) + oseResponseCurveFitting.opj';

origin.Load(strFile);

origin := Unassigned;

end;

I can to open Origin, but can't to load any opj-file to Origin.
why i can't to do it?
Go to Top of Page

bigspoon

Russia
Posts

Posted - 01/02/2005 :  06:35:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
i can load my opj-file to origin75demo.
I want using OriginPro7.0 as an Automation Server.
where can i dowload origin.tlb for OriginPro7.0.
Go to Top of Page

bigspoon

Russia
Posts

Posted - 01/02/2005 :  1:42:02 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
i want add new worksheet from my application. tell me about method or function which do it. may be this function is

function TApplicationSI.CreatePage(type_: Integer): WideString;
begin
DefaultInterface.CreatePage(type_, EmptyParam, EmptyParam, EmptyParam);
end;

but i don't know somethig about it's arguments.
Go to Top of Page

easwar

USA
1965 Posts

Posted - 01/02/2005 :  9:51:23 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

My apologies for a delayed response...

Automation (COM) server is supported only in 7.5 - there is no tlb file for version 7 - so you really need version 7.5

All methods and properties supported by Origin can be found in the Programming Help files under the topic "Origin Automation Server Reference". If you downloaded the demo, you will need to download the help files separately by using the "Help->Check for Updates" menu item in Origin.

Note that one of the methods is "Execute" which just sends a string to Origin that is then interpreted as a LabTalk script command. So client application can send any script command using this method. A script command can in turn call an Origin C function as well.

Easwar
OriginLab

Go to Top of Page

bigspoon

Russia
Posts

Posted - 01/05/2005 :  02:32:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
hi, easwar

I want via LabTalk script add data from worksheets Data1 to graph Graph1.

My code is below.

ModuleModel.origin.Execute('doc -mc 1;'); // open origin
ModuleModel.origin.Load('template\v.opj'); // load my file v.opj
ModuleModel.origin.PutWorksheet('Data1', qdata ); // load data to my worksheets Data1
ModuleModel.origin.Execute('Data1 -p 200 v'); // ???

I setup Layer contents of my graph Graph1 only two curve
(Data1: A(X):B(Y) and Data1: A(X):C(Y)) in Origin. But in my array (which is called qdata)
may bee more 10 colunm. How can I increase Layer contents of my graph Graph1 by script?
Go to Top of Page

Mike

USA
357 Posts

Posted - 01/05/2005 :  12:46:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
hi bigspoon,

Use the layer -i dataSetName command or the system macro graph dataSetName to add a data set to the active layer of the active graph window.

For more information, see the Origin Programming Help file (Help:Origin), index keywords = Layer command and Layer > adding data into.

Mike
OriginLab
Go to Top of Page

bigspoon

Russia
Posts

Posted - 01/06/2005 :  2:34:10 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
well,
I wrote code and I can to import data from my application to Graph of Origin.
But when load data repeatedly I saw that correct load only 1-st column (X), next column load as Disregard and Numeric (Whorksheet Colunm Format->Option->Plot Designation, Format) and without title. If correct Format and Plot Designation in Origin by hands the data of columns are loss.
what can i do?
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 01/06/2005 :  2:49:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Best if you can just set up your v.opj with fake data and all the columns you will need, and plot all the graphs you need, then goto your worksheets and do a Clear Worksheet Data, and then save that OPJ. If the v.opj already prepared with all the needed columns and their appropriate types, then PutWorksheet will just fill in all the data and you should not have problems with additional columns not having the right type.

CP


Go to Top of Page

bigspoon

Russia
Posts

Posted - 01/06/2005 :  3:09:35 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I am download origin.tlb, import this file to origin_tlb.pas via delphi6. Connect origin_tlb.pas to my delphi-project and wrote:

var MyOriginOb: TApplicationSI;

begin

MyOriginOb:=TApplicationSI.Create(Self);
MyOriginOb.Execute('doc -mc 1'); // error Class don't registred!

end;

What can I do to registred class in my oper.system?


Edited by - bigspoon on 12/11/2006 10:27:49 PM
Go to Top of Page

sami1984

USA
Posts

Posted - 05/17/2007 :  06:24:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi.
I want to know how to set a column value with an if string, for example:
if col(x)> 0.001, then set value 0, otherwise set 1.
how can i do that?
thanks
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 05/17/2007 :  07:47:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This question has nothing to with the current topic so you should have started a new thread. However, the answer is short...

If you are setting only one row use this...

col(colName)[rowNumber] = col(colName)[rowNumber]>0.001 ? 0 : 1;


To set all rows use this...

col(colName) = col(colName)>0.001 ? 0 : 1;

Mike Buess
Origin WebRing Member
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