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
 Importing files and plotting with Labtalk 7.5
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

stingray21

8 Posts

Posted - 02/08/2012 :  11:15:37 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 7.5G SR3
Operating System: Win XP

Hallo,

at home I have origin 8.6 and I'm getting along with Labtalk quite well. If I have a problem, I'm searching in the "scripting guide"-pdf, the labtalk-wiki or this forum and usually I find a solution.

Now I'm trying to write a labtalk-script at work, but here I have only Origin 7.5 and I absolutly have no clue how to work with this version. And all the stuff I find on the internet, doesn't work in 7.5.

I want to import 3 files (.dat) with tabulator separated measuring data. One file with data before the actual measurement, the main data and the third file with data after the main measurement.
So the files 1 and 3 have the same structure and file number 2 has a different header and less columns.
I'd like to import the files with import filters, if that's possible (because of the different headers).
Then I need two plots (I have templates for those plots, so I'd like to use them). In one plot there are the values of file 1 and 3, and in the second plot there is the data of file 2.
How can I put the data of file 1 (column 2, 4,6) as a group in the plot and then add the data of file 2 (also column 2, 4, 6) as a group in the same plot?

I know it's a lot to ask for, but I would appriciate it, if you could give me some hints, how to do some of that stuff.
Or at least somebody knows a good tutorial for labtalk 7.5, where I could get some examples of similar tasks.

Thank you.

stingray21

8 Posts

Posted - 02/09/2012 :  05:18:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I decided to start with only the plotting. I imported the files and renamed manually the first and third file in "el1" and "el2".

Now I found two solutions to plot the data, but both aren't doing the job the way I need it.

1)
It's works for the first file, but I don't now how to do this for the next file (in the same plot):

for(i=2;i<=wks.ncols;i+=2) wks.colSel(i,1);
worksheet -p 200 Templates\electric.otp;

2)
This is my second attempt, but I have to know the names of the columns and the data isn't grouped:

win -t p "Templates\electric.otp" origin Electric;

layer.x.from = 0;
layer.x.to = 12;
layer.y.from = 0;

layer -i el1_b el1_d el1_f el1_h el1_j el1_l el1_n;
layer -i el2_b el2_d el2_f el2_h el2_j el2_l el2_n;

Edited by - stingray21 on 02/09/2012 05:20:11 AM
Go to Top of Page

Penn

China
644 Posts

Posted - 02/14/2012 :  02:34:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

1) It seems that the import filter cannot be used in LabTalk script in Origin 7.5. However, you can try the ascimport object (better to search in help document for Origin 7.5).

2) Origin 7.5 is so old, and I am not sure whether there is a command for adding grouped plots into the graph layer (I am afraid no). As a workaround, you can add another layer to the graph, and then add plots from another worksheet to this layer, then group all the plots in this layer. For example:

layer -n;  // add a new layer to the active graph
layer -i el2_b el2_d el2_f;  // add plots to the new layer
layer -g;  // group the plots in the layer


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