| Author |
Topic  |
|
|
jean_galy
Germany
Posts |
Posted - 02/24/2005 : 07:51:32 AM
|
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
|
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
|
 |
|
|
jean_galy
Germany
Posts |
Posted - 02/24/2005 : 10:04:21 AM
|
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
|
 |
|
|
easwar
USA
1965 Posts |
Posted - 02/24/2005 : 11:11:53 AM
|
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
|
 |
|
| |
Topic  |
|
|
|