DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Subtract array position from channel

Solved!
Go to solution

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

 

 

 

0 Kudos
Message 1 of 3
(5,451 Views)
Solution
Accepted by topic author Leillo

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

Message 2 of 3
(5,447 Views)

Thank you very much!

0 Kudos
Message 3 of 3
(5,444 Views)