DIAdem Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Andrea_Perin

Analysis function to split one channel in N channel with the same length

Status: Declined

Hello Andrea,

Thank you for your request. We understand your suggestion but given that that just a few sponsors are supporting your entry and nearly no other customer asked this extension direct to us, we have decided to decline this suggestion. Nevertheless, we keep it in ore list of possible extensions however with a low priority and prefer to develop more frequently requested features instead. We hope you understand this.

 

Here is a script which solves this request:

 

dim oSourceChn, oResChn, oResGroupChns, iLoop, iChnLen, iNoOfNewChn
iChnLen           = 100
set oResGroupChns = Data.Root.ChannelGroups.Add("Results").Channels
set oSourceChn    = Data.Root.ChannelGroups(1).Channels(2)
iNoOfNewChn       = oSourceChn.Size \ iChnLen
if iNoOfNewChn  > 0 then
  for iLoop = 1 to iNoOfNewChn
    set oResChn = oResGroupChns.Add("Res_" & str(iLoop), DataTypeChnFloat64)
    call oResChn.SetValuesBlock(oSourceChn.GetValuesBlock((iLoop - 1) * iChnLen + 1, iChnLen))
  next
end if

 

Greetings

Walter

Hi all,

DIAdem could feature a new interactive function to be used to split one channel (let's say 1000 values long) in N channels (N=10) with the same length (100 values).

It is a very simple function but today with requires scripting in DIAdem using the Data API.

When managing time-related data it often happens to have the need to observe/analyze the data in constant time intervals.

Such an interactive function would provide an easier entry point in this kind of tasks. 

Regards

1 Comment
Walter_Rick
NI Employee (retired)
Status changed to: Declined

Hello Andrea,

Thank you for your request. We understand your suggestion but given that that just a few sponsors are supporting your entry and nearly no other customer asked this extension direct to us, we have decided to decline this suggestion. Nevertheless, we keep it in ore list of possible extensions however with a low priority and prefer to develop more frequently requested features instead. We hope you understand this.

 

Here is a script which solves this request:

 

dim oSourceChn, oResChn, oResGroupChns, iLoop, iChnLen, iNoOfNewChn
iChnLen           = 100
set oResGroupChns = Data.Root.ChannelGroups.Add("Results").Channels
set oSourceChn    = Data.Root.ChannelGroups(1).Channels(2)
iNoOfNewChn       = oSourceChn.Size \ iChnLen
if iNoOfNewChn  > 0 then
  for iLoop = 1 to iNoOfNewChn
    set oResChn = oResGroupChns.Add("Res_" & str(iLoop), DataTypeChnFloat64)
    call oResChn.SetValuesBlock(oSourceChn.GetValuesBlock((iLoop - 1) * iChnLen + 1, iChnLen))
  next
end if

 

Greetings

Walter