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
 Need help for automation project
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

jean_galy

Germany
Posts

Posted - 02/24/2005 :  07:51:32 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi all,

I need some help in building a VB project which would send data to origin and draw a graph but with options defined in the VB project.
My biggest lack of information is about the origin object properties and methods.


So far I have:

Public Sub makegraph()
'make a connection to Origin
Set myorig = GetObject("", "Origin.ApplicationSI")

myorig.Execute ("Reset")

'Put data in range datasheet
myorig.GetWorksheet("data",) <--- here I dunno what are the parameters to be put in

then for the graph how car I set up the parameters (ranges, axes, etc)??

'Wait for the Origin AutoUpdate process to finish
myorig.Run


'end origin
'myorig.Execute ("exit")

End Sub

----

Any help is welcome.

Many thanks in advance.

Jean

NB: I know that thereR examples in the Samples folder but they don't describe the details I need :-(





Origin Version (Select Help-->About Origin):7.5
Operating System: Windows XP SP2

easwar

USA
1965 Posts

Posted - 02/24/2005 :  09:35:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Jean,

All methods and properties currently available for the Origin COM server object are documented in the help files. With these current methods and properties, there is no direct access to all Origin objects and their associated properties such as graphs etc. There is a general .Execute method that can send script command strings that you are already familiar with. This method can then be used to run Origin C routines as well, and under Origin C there is ample access to all Origin objects and their properties.

So in other words, there is no direct access to everything to code it all in VB - you will need to either send script command strings, or call Origin C functions. Note that script commands can be sent to load and compile specific Origin C functions, or such functions can already be present in the default Origin workspace. Another method is to have custom Origin projects that have attached Origin C files that perform specific tasks, which is what some of the examples in this area utilize.

Easwar
OriginLab


Go to Top of Page

jean_galy

Germany
Posts

Posted - 02/24/2005 :  10:04:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Easwar,

Thanks for the prompt answer ;-)

So if I understand correctly, I could prepare script for changing the scale of the graph in a defined project and call it through my VB application and pass to the origin embedded script the parameter. is that right?
OK I'm gonna try that.

On the other hand, under the Help/Programming I couldn't find teh desription of the ".getworksheet", ".putworksheet" and etc. Am I looking at the right place?

Many thanks again for the help.

Jean

Go to Top of Page

easwar

USA
1965 Posts

Posted - 02/24/2005 :  11:11:53 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:

So if I understand correctly, I could prepare script for changing the scale of the graph in a defined project and call it through my VB application and pass to the origin embedded script the parameter. is that right?



Hi Jean,

Yes, you can prepare LabTalk script .OGS files in advance, or Origin C functions in advance and call either from your VB app by seding the appropriate LabTalk command (run.section(filename, section name) for OGS files for example, and directly calling the OC function name for Origin C for example).

Look at the Excel example (which uses VB macro) under \Samples\Automation Server\Excel\DoseResponseCurveFitting.XLS for example.

As for documentation of methods, that should be under the following help file:
Programming help file, and section:
Calling Origin from Other Applications(Automation Sever)->Methods and Properties.

I also recommend you get the free SR5 patch for your 7.5 installation if you have not already. A new method of connecting called ApplicationCOMSI was added in this patch, which then enables the client to repeatedly connect to one consistent instance of Origin even if there are multiple Origin sessions running on the machine.

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