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
 Origin Forum
 Accessing selected data range in a plot via a script
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

a_user

USA
0 Posts

Posted - 08/12/1998 :  5:24:00 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

Origin has a handy feature for selecting a range of data for doing operations
on (e.g. fitting, or copying to another worksheet). In a line graph, you click
on the data range selector tool (in the toolbox), drag the handles to the
desired location and hit enter. Presto! You can now copy and paste that range
or do fitting operations on it.

However, I would like to do some operations on the selected data range via a
script (attached to a button), but I cannot find the variable names that define
the selected data range in the LabTalk manual.

If anybody outhere knows the variable names that define and contain the
selected data range I would appreciate it if those could be posted.

Thanks

a_user

USA
0 Posts

Posted - 08/12/1998 :  5:25:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Re:Accessing selected data range in a plot via a script

MKS1 and MKS2, the script below will set marker on current dataset
between 100 and 200
MKS1=100; MKS2=200; clr;

while this will clear the markers:
MKS1=-1;MKS2=-1;clr;

Go to Top of Page

a_user

USA
0 Posts

Posted - 08/13/1998 :  7:52:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Accessing selected range via script

Hi!

I have got almost the same problem. We are using Origin to evaluate
measurements of IU-plots of metal-semicondutor contacts. To gain the
wanted parameters one has to do several linear fits. I programmed some
buttons to automise this process as good as possible. When I use the
selector tool with
doToolbox 4;
in a script and afterwards try to read the index (with MKS1 and MKS2 as
proposed), it fails. The script does not wait to finish the input with the
selector tool. What is missing is a kind of a loop or something. Does
somebody know how to handle this problem? What can I do to stop my script
until I choosed the range?

Andre Stebens, HMI Berlin

Go to Top of Page

a_user

USA
0 Posts

Posted - 08/13/1998 :  7:54:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Response

The proposed solution works fine after some slight changes:

(1) The definition of the PointProc macro has to come after the
dotool 4 command. (Why? No idea! Otherwise the definition of
the macro is lost!)
(2) Right at the beginning should stand ii=0. I have got better
experiences with
if (ii>0) dotool 0;
rather than
if (ii==2) dotool 0;
in the definition of the PointProc macro.

Hence a script should look like:

ii=0;
dotool 4;
define PointProc { as proposed }

This works fine!

Go to Top of Page

a_user

USA
0 Posts

Posted - 08/13/1998 :  7:55:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
PointProc

You are right, PointProc should be after doTool as doTool
defines PointProc to blank and expects PointProc to be
defined after the tools are activated. In fact, PointProc can
be redefined during the course of the tool stage to act
according to situation.

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