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
 Batch processing using "set value as"
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ivydong

USA
14 Posts

Posted - 05/21/2014 :  05:22:11 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 9.0
Operating System: Windows 8

I'm trying to use batch processing(saved as a analysis workbook) to import a file, subtract baseline, calculate a functional value and then peak fit with a result. All peak fitting and baseline part was fine for me, but somehow I can't use the function "set value as" to do column calculation. Any help is appreciated. Here is the details:

After subtract the baseline, a column D was generated.
I copied a column from a different sheet of the same workbook into the next column. (The copied column is constant for all samples.)
Col(E) = r1
script: r1 = bg!D;

Then for the next column, I want to multiply the column E with a fraction. This fraction is decided by the 400th cell in calculated column D and a constant. Here is the setting value

Col(F)= col(D)- col(e)*col(D)[400]/1000

I peak fitted the col F and saved the workbook as an analysis template.

I don't really know where the problem is. But all the generated files only have empty column F. If I open it and manually press "apply" in the "set value as" window, it would work. Feels like the command of column value calculation was not carried out by the template. Should I use other method? Or is there anyway this could work? Thank you so much.

lkb0221

China
497 Posts

Posted - 05/21/2014 :  09:27:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Can you try Copy Columns to... to copy bg!D to col(E) (right click on bg!D)?
And add "run -p au;" to the before script in col(F).

Zheng
OriginLab

Edited by - lkb0221 on 05/21/2014 09:29:24 AM
Go to Top of Page

ivydong

USA
14 Posts

Posted - 05/21/2014 :  6:08:27 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It didn't work. I still get an empty col(e) and col(f)
Go to Top of Page

ivydong

USA
14 Posts

Posted - 05/21/2014 :  6:45:08 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
When I use the batch processing, the script was always trying to look for the source from the same book. I wanted it to look back at the original template book for the copied source(the similar way that it would looked up an existing baseline). How can I do that? Thank you.
Go to Top of Page

ivydong

USA
14 Posts

Posted - 05/21/2014 :  8:10:05 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I got the numeric calculation part figured out, but I still can't copy the data from the same template to the new column. I guess it's something similar to the baseline subtraction command? But I don't know the code. (I set all the recalculate mode as "Auto".) Thank you for your help. I tried both of two followed code in the "before script" for "set value as", didn't work.

copydata irng:=[book4]bg!col(D) orng:=col(E);

or

range r1=[book4]bg!col(D)
(then in the set as value box, it is "r1")
Go to Top of Page

ivydong

USA
14 Posts

Posted - 05/21/2014 :  8:16:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Forgot to mention, for the first code, after the batch processing, I can manually press "apply" and the empty column will be filled with the number I need. But not automatically. I can do basically the same thing for the second code (By adding a space and delete it in the dialog box, not really changing anything. Otherwise, the "apply" button is grey). Thank you!!!
Go to Top of Page

lkb0221

China
497 Posts

Posted - 05/22/2014 :  09:35:23 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Better if you can send the template and some sample data file to us so we can test to address the problem.

Where is the value of bg!D come from? All I can think of is there is some kind of speed issue, that when col(E) is looking for bg!D, it's still blank.

Zheng
OriginLab
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