09-05-2018 02:58 AM
Hi,
I am new to Scripting in DIAdem 2014.
I am trying to divide the channel "s_delta_L_R" by a value stored in my variable "track".
But when running the script, I always get the error message "Variable 'track' not defined".
This is my code:
dim track
track = 2 'in m
Call Calculate("Ch(""[1]/angle_L_R"")=Ch(""[1]/s_delta_L_R"")",NULL,NULL,"")
Call Calculate( "track=2000" )
Ch("[1]/angle_L_R")=ArcSin( Ch("[1]/s_delta_L_R") / track )
Thanks for your help!
Jonas
09-07-2018 03:17 PM - edited 09-07-2018 03:22 PM
Dim track
track = 2 'in m
Call Calculate("Ch(""[1]/angle_L_R"")=Ch(""[1]/s_delta_L_R"")",NULL,NULL,"")
Call Calculate("Ch(""[1]/angle_L_R"")=asin(ch(""[1]/s_delta_L_R"")) / " & (track*1000) & "",NULL,NULL,"")
But line 3 seems redundant
09-13-2018 10:42 AM - edited 09-13-2018 10:43 AM
Thanks a lot! That works great.
It took me a while though to figure out that DIAdem Script doesn't allow to use floating point variables in the "Calculate" function.
The error message always said "Expected end of command" which didn't exactly help 😉
But now that I make sure all variables are rounded to integers before computing, it works perfectly.
Seems like VBS and me are becoming friends after all.