01-23-2020 06:52 AM
My goodness
I have been using the function StatBlockCalc for years and I have begun to switch my scripts over to be compatible with 2019. It appears this function is no longer supported and has been replaced by ChnStatisticsBlockCalc & ChnStatisticsChannelCalc.
The constructs of the new functions are radically different from the legacy function.
Here is what I used to code to get the stat values of the even rows of channel 1
Call StatBlockCalc("Channel", "2,4,6,8,10,12", 1)
And I would use the variables StatMax, or StatMin to return those values
How would one perform the same calculation on channel 1 in group 1?
Call ChnStatisticsChannelCalc("[1]/[1]", 24, 2, 12, False, False, False, "NameName")
StatsResult(eStatsMinimum)
StatsResult(eStatsMaximum)
This returns the max and min values for all rows between 2 and 12 with this notation where I only want the results from the even rows.
Thanks
01-23-2020 11:29 AM
Hi Tim
I don't think the new statistics commands actually support your use case of "only even rows from 2 to 12". However, as of DIAdem 2019 SP1, I can verify that the StatBlockCalc() command still works, even though the Help system and SCRIPT highlighting indicate otherwise.
I'm checking with R&D to see if there is some way to use the new commands to cover this use case, and for any forward-looking comment they can make about how long the old StatBlockCalc() command will continue to (secretly) execute in future DIAdem versions.
Brad Turpin
Senior Technical Support Engineer
National Instruments
01-24-2020 11:26 AM
Hi Tim,
I confirmed with R&D that the new stat functions only process a contiguous range of rows in the selected channel(s). The old stat function is the only one which can process selected rows by building a row string and passing it as a parameter. R&D suggests that a way forward for them would be to focus on making a general purpose function to extract selected rows from ChannelA and send them to ChannelB. In the meantime, you can either continue to use the old StatBlockCalc() command or extract those selected rows yourself with the Channel.Values() method.
Brad Turpin
Senior Technical Support Engineer
National Instruments
02-04-2020 05:03 AM