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
 LabTalk Forum
 Script for multiple plots
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

mloving

5 Posts

Posted - 09/19/2011 :  1:40:13 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8.1 and Service Release (Select Help-->About Origin): ??
Operating System: Windows XP

Hi,
I am trying to create a sript for importing data, doing a few simple opertations and then creating multiple plots.

Through the import wizard I am inputing the lab talk code into the filter option.

So far I have:


col(A1)=col(F)/col(D);
Col(A1)[L]$=Tot1/Io1 [TEY +];

col(B1)=col(G)/col(N);
Col(B1)[L]$=Tot1/Io1 [TEY -];

col(C1)=col(H)/col(D);
Col(C1)[L]$=Tot1/Io1 [TFY +];

col(D1)=col(I)/col(E);
Col(D1)[L]$=Tot1/Io1 [TFY -];

col(E1)=col(a1)-col(b1);
col(E1)[L]$=prelim TEY XMCD;

col(F1)=col(c1)-col(d1);
col(f1)[L]$=prelim TFY XMCD;

plotxy iy:=((3,26),(3,27)) plot:=200;

plotxy iy:=((3,28),(3,29)) plot:=200;

plotxy iy:=(3,30) plot:=200;

plotxy iy:=(3,31) plot:=200;



But this only plots the first graph. How can I change it to plot all 4?

Thanks in advance!

-Melissa

Penn

China
644 Posts

Posted - 09/20/2011 :  01:20:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mellisa,

In your script, for the first time you call plotxy, the active window is the worksheet, into which you import data. However, after the plotxy makes the first graph, which becomes the active window, the second call on plotxy will try to get the data from this graph, of course it will fail. That is why you can only get one graph.

So, if you try to call plotxy again, you need to activate the worksheet again in your script. You can use the window command to activate a window. For example, you can change your script like:

string pageName$ = page.name$;  // get the window name
plotxy iy:=((3,26),(3,27)) plot:=200;
win -a %(pageName$);  // activate the window again
plotxy iy:=((3,28),(3,29)) plot:=200;
win -a %(pageName$);  // activate the window again
plotxy iy:=(3,30) plot:=200;
win -a %(pageName$);  // activate the window again
plotxy iy:=(3,31) plot:=200;


Penn
Go to Top of Page

mloving

5 Posts

Posted - 09/20/2011 :  08:32:03 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Is this generic for the file being imported - ie is it possible to use this for multiple files being imported at once?

Thanks again,
-Melissa
Go to Top of Page

Penn

China
644 Posts

Posted - 09/20/2011 :  9:51:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Melissa,

In Origin 8.1, when you import multiple files, the script will run after all the files are imported. However, in current latest version, Origin 8.5.1, you can specify when to execute the script, after all files imported, or after each file imported. Maybe you can download a demo from this page to have a try. You can refer to this document.

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