08-05-2013 04:01 AM
Hi Guys
I am calculating offsets from a set of channels and saving these offsets in an array. Then, I am trying to subtract an offset (which is in an given position in the array) from a channel but it doesn't work as the result is a channel with NO values....
This is what I am typing in VBS and doesn't work:
Call Calculate("Ch(""ResultVBS"") = Ch(""Strg_Angle"")-offset(3)") 'offset is the array of offset and 3 is a random position
or
Call Calculate("Ch(""ResultVBS"") = Ch(""Strg_Angle"")-Cint(offset(3))")
Things that work but are of NO use to this specific script:
Call Calculate("Ch(""ResultVBS"") = Ch(""Strg_Angle"")-statarithmean")
Call Calculate("Ch(""ResultVBS"") = Ch(""Strg_Angle"")-13") 'being 13 a random value
Things that DON'T work and I don't understand why:
Dim a
a=13
Call Calculate("Ch(""ResultVBS"") = Ch(""Strg_Angle"")-a")
Can someone help?
Thanks
Solved! Go to Solution.
08-05-2013 05:05 AM
Hello Leillo,
A is a VBS variable and the DIAdem command Calculate doesn’t know these kind of variables. The solution is to use the interpreted content of a.
Dim a
a=13
Call Calculate("Ch(""ResultVBS"") = Ch(""Strg_Angle"")-" & a & "")
Alternatively you can use the DIAdem command “ChnOffset” (ANALYSIS -> Base functions -> Offset correction)
Greetings
Walter
08-05-2013 05:12 AM
Thank you very much!