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
 Values won't refresh/get deleted when using 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

zaph0d

1 Posts

Posted - 11/09/2015 :  2:52:31 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 2015G (32-Bit) Sr2
Operating System:Mac OsX

Hi I'm getting a pretty strange behaviour when using custom functions in a worksheet.
I'm trying to execute the following script:

CountnumberFromChannel(col(A)) / (HeNumber * DetectorSolidAngle * WQFromDepth(DepthFromEnergy(EnergyFromChannel(col(A)))))

with
Function double EnergyFromChannel(int channel) {
  return channel * 1,708 + 15,1;
}

Function double DepthFromEnergy(double energy) {
  return (1491.325 - energy) / 0.52236;
}

Function double WQFromDepth(double depth) {
  return (4.73 + depth * 0.0014 + depth^2 * 5.71429e-7) * 1e-24;
}

Function double CountnumberFromChannel(int channel) {
  return 0.29619 + 9766.6711 / ( 28.42699 * sqrt(pi / 2)) * exp(-2 * (channel - 801.57007)^2 / 28.42699^2);
}

Const HeNumber = 2e-5 / (1.60217646e-19);
Const DetectorSolidAngle = 3.362e-3;

as the script inserted. I imported this project from a colleague with colums depending on the coloumn of this script. But after I used str+q to look at the script and pressed ok all the column values vanished to --(on my partners computer it works just fine he's using the same version on windows!). What is causing that behaviour?

Edited by - zaph0d on 11/09/2015 2:53:23 PM

AmandaLu

439 Posts

Posted - 11/10/2015 :  03:59:52 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi zaph0d,

Please check the separator Origin uses. I am not sure if you use E version virtual Windows, which uses "." as separator by default. The script you provided uses "," as separator. It may cause problem in an E OS. You can select Tools: Options from Origin menu, activate Numeric Format tab and set Separators as "1.000,0". Then run the script again and see if it works.

Thanks,
Amanda
OriginLab Technical Service
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