Hi Phex,
The problem is the variable CurrChnNo which represents the "flat" channel number and runs from 1 to to the whole number of all channels. CurrChnNo is more or less because of compatibility. If you work with the Data-API (which we recommend) then you need to use the variable CurrChnIdx instead.
Greetings
Walter