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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Executing Origin C from LabVIEW

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
JSchoeck Posted - 04/07/2008 : 11:08:45 AM
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
2   L A T E S T    R E P L I E S    (Newest First)
JSchoeck Posted - 04/16/2008 : 10:00:19 AM
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.
easwar Posted - 04/07/2008 : 5:05:01 PM
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



The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000