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 Origin C
 Executing Origin C from LabVIEW
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

JSchoeck

Germany
Posts

Posted - 04/07/2008 :  11:08:45 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version: 7.5 E
Operating System: WinXP

Hello all,

is it possible to execute Origin C from within the LabVIEW VI OAExecute (delivered with the Origin installation)? LabTalk script works, but I have problem with Origin C.

What I want to do is, for example, call a script like this:
void Run_ApplyFormat()
{
Page pg = Project.Pages();
pg.ApplyFormat("themes\\Ticks All In.OTH");
}


Do I have to save it in a .c file and run it with the runOC command?

And how can I refer to the "user files" path? I couldn't find a constant for it in the Origin help.

Thanks for your time!
Johannes

easwar

USA
1965 Posts

Posted - 04/07/2008 :  5:05:01 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Johannes,

Yes, the OC file needs to be loaded, compiled and linked, for the function to be callable from script - OAExecute just executes script comamnds (which can be an OC function name).

You could add the function to your system branch in code builder so that it gets loaded and compiled automatically for every sessions.

As for EXE and UFF paths:

string strEXEPath = GetAppPath(TRUE);
string strUFFPath = GetAppPath();
printf("EXE path: %s\n", strEXEPath);
printf("UFF path: %s\n", strUFFPath);



Easwar
OriginLab


Go to Top of Page

JSchoeck

Germany
Posts

Posted - 04/16/2008 :  10:00:19 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
For anyone else interested in this issue: I found a solution!

Creating the following VI allows you to execute Origin C from within LabVIEW and even retrieve variables (%Y is the Labtalk variable of the User File directory).
-OAExecute with "run.LoadOC("%Y\\SOURCEFILE.c",4);" as script
-OAGetLTStr with "%Y" as name to import the path into LabVIEW
-OAExecute with "Function_from_SOURCEFILE("PARAMETERS");"

This for example allows you to apply a theme to a graph from LabVIEW.
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