10-03-2012 11:26 AM
Hi
I am trying to perform the same Calculation in several groups, which share the same channel names i.e.
Group2
...
The Calculation will be Result = A*B+C for instance. So far I have created a calculation script using the Calculation Manager for 1 of the groups, and I also have been playing with the wildcards but only get 1 result. I would like to know if there is a way using the Calculation Manager with wildcards to perform this calculation for all the available groups and store the result Channel ("Result") in each group
Group2
...
Thank you very much
Solved! Go to Solution.
10-05-2012 11:57 AM
Hello,
You can use a script like this:
Option Explicit 'Forces the explicit declaration of all the variables in a script.
Dim sFormula, aSymbol(1),aValues(1),iLoop
sFormula ="Ch(""[iLoop]/Result"")=Ch(""[iLoop]/A"")*Ch(""[iLoop]/B"")+Ch(""[iLoop]/B"")"
aSymbol(1) = "iLoop"
For iLoop=1 To 3 'You only must change 3 for the number of groups that you have
aValues(1) = iLoop
Call Calculate (sFormula, aSymbol, aValues)
Next
You just need to change the number of iteration in for loop, change the number 3 for the number of groups you have.
Let me know if this script solve your problem.
Regards,
10-10-2012 09:40 AM
Hi Plinio
Thank you for your response.
I actually figured it out without the scripting part. To perform the calculation within all the groups (or several) in the data portal, you just have to use the @@CCR@@ Current Cycle Number. So, for the example you have to create two inputs and name them A, B and C, select Channel as a DataType and put [@@CCR@@]/"ChannelName", as is showed in the figure. Then you switch to the extended part and put in the field cycles the number of groups you want to process, in this case all of them (you put GroupCount).
And That's it
Give it a try
Cheers
Daniel