I'm trying to work with the results of a call to StatBlockCalc to several channels and was hoping to do it efficiently without creating a new channel. The script I'm trying to create would ideally do the following:
I need to call this several times for different subsets of rows (in my case 720 times) such that each subset looks like:
So I'd prefer not to have to create 720 new channels and then delete them or call StatBlockCalc 720 times for each channel.
My current code that just makes new channels (but is slow) looks like:
For iLoop1 = 1 to 720 'sRows is a function of iLoop1 Call StatBlockCalc("Channel", sRows, ChnList) sMeanChn = "[" & iAvgIndex & "]/ArithmeticMean" Set oMeanChn = Data.GetChannel(sMeanChn) 'Do something with oMeanChn Data.Root.ChannelGroups(iAvgIndex).Channels.Remove("ArithmeticMean") Next
I tried using the solution in this post: http://forums.ni.com/t5/forums/v3_1/forumtopicpage/board-id/60/thread-id/10442/page/1, but it seems the only way the ResultStatArithMean property is created is if the rows are set to "1-"
Is there any way that I can avoid creating and deleting 720 channels?
At the bottom of that link you mentioned there is a long list of the global variables populated every time the StatBlockCalc() command is run. You just need to read out the value from, say, the StatArithMean variable and save it to the target array variable you want to fill.
DIAdem Product Support Engineer