thanks for the answer, I have few more things to do in this case. When a user select channels I want to creat a 1D array where the channels selected are in ascending oder and each element is seperated by comma in brakets, i.e, [1,2,5,9,30] means that a user has chosen channels 1,2,5,9,and 30. This is part of my command to send to retrieve data for these channels. Also if all the channels are selected I dont need to creat this range and the device will automately retrieve data for entire range. Thanks guys