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 Automation Server/COM and LabVIEW
 C# attch to multiple Origin instances
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

newuser_ca

70 Posts

Posted - 06/22/2012 :  3:06:00 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 8.6 in Win7.

I have a GUI written in C# to connect to my Origin project to do some plots.
I initialize the GUI window in my origin C function:
LT_execute("run -e C:\\MYPATH\\OriginPlotGUI.exe;");

When the GUI window starts, it connects to the existing Origin instance. The C# codes are:
private Origin.IOApplication m_originApp; // Origin object reference
m_originApp = new Origin.ApplicationSI(); // SI to connect to existing Origin.


If I have multiple Origin windows open, how can my GUI window connect to the Origin window I want? I was told by Penn (from Penn's email by supporting some other questions) that it will connect to the last launched instance. However, this is not the case. My GUI window always attaches to a certain Origin window.

Here is an example:
My origin worksheet has 2 columns. I want to display them in my GUI.
As it is shown below, the left side is my worksheet and the right side is my GUI.



If I have second Origin project running, my GUI didn't display the column informaion correctly.
It works well when there is only one Origin window is running (as below).

Penn

China
644 Posts

Posted - 06/24/2012 :  10:16:17 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Sorry that I made a mistake on the Origin instance to be attached. Our developer tells me that which instance will be connected to is decided by the operating system, and it is really unpredictable.

In your case, you want to connect to a specific instance, that is because you want to operate the project in this instance? If so, I think you can save your project first, and then connect to some Origin instance, then open this saved project.

Penn
Go to Top of Page

newuser_ca

70 Posts

Posted - 06/26/2012 :  10:51:32 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks, Penn.

To solove this problem, I modified the Origin function call from the front end software.
Now my front end software calls my PlotGUI and my PlotGUI calls the Origin project. I can point my PlotGUI to any Origin project.

I have 2 general questions about Origin.
1. Is there a way to speed up opening Origin window and load the project? when Origin opens, I can see the progress box with message "compiling ...".

2. How to show "Project Explorer" window instead of "Message Log". Origin was invoked by my GUI. when Origin window opens, I import some files. The "Message Log" window was activated to show some message. How can I disable this window and bring up "Project Explorer" window in Origin C (instead of from menu View-> ..)?
Go to Top of Page

Penn

China
644 Posts

Posted - 06/28/2012 :  04:33:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

1. Maybe you have defined lots of Origin C functions in the file attached to the project. Then each time open the project, it will take a long time to compile these Origin C functions. So, you can try to put the file to the System Folder (in Code Builder), but not attach to the project. Then to see whether it is faster.

2. It seems that no way to do such things in Origin C. Sorry for that.

Penn
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