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
 using pkFind function
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

nicolas777

4 Posts

Posted - 06/24/2010 :  10:06:02 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin 8.0.63.988 SR6
v8.0988
Operating System: Windows

I wrote a loop-based program that runs the pkFind function on several data columns contained in several data sheets.
If the function pkfind cannot find any peaks, it stops and shows an error message asking me to change my parameters.
But I would like it not to stop and to move on to the next sheet.

How can I do that ?

Thanks

Nicolas Murer

VincentLiu

China
Posts

Posted - 06/25/2010 :  03:37:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You could use a pair of curly braces ("{" and "}") to enclose a part of the script that might generate an error. Then Origin will encounter the error and resume with the rest part of the script, which is outside the braces.

The following page has given a example to show you how to do this.

http://wiki.originlab.com/~originla/wiki/index.php?title=Script:Error_Handling

OriginLab Technical Services
Go to Top of Page

SteffenG

Germany
Posts

Posted - 07/23/2010 :  09:25:25 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Use the -sb option switch within your pkfind-command. This will prevent the X-Function to report errors and results to the results log.

Look inside of the LabTalk-Help for chapter 'X-Function Execution Options'. There you will find a complete list of option switches for all X-Functions.

Example:
pkfind -sb dir:=b method:=max smooth:=200 ocenter:=peakindex ocenter_x:=peakx ocenter_y:=peaky iy:=(targetx,targety);

Regards,
Steffen
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