01-28-2011 07:30 AM
I have an array in VBS memory and would like to create an channel in the data-portal based on that data-set, I currently use this code construct to copy the data:
' intChannelCount is the number of samples
'MaxHold is the data array to be copied
'oFFTMaxHold is the data channel that is the target of the data
for counter = 1 to intChannelCount
oFFTMaxHold.Values(counter)=MaxHold(counter)
next
It is rather slow (and if the data preview is open in the data portal) even much slower.
Is there a method to copy the whole array in one operation to a channel?
Ton
Solved! Go to Solution.
01-28-2011 11:23 PM
Hi Ton,
If you have DIAdem 10.2 or later you can use the following command to do this with one command-- passing the array of values as one of the command's parameters-- this is a common situation when querying records from a data base that you want to load into the Data Portal as channels.
ChanRefsArray = ArrayToChannels(ValuesArray, ChanNamesArray)
In the case of your example below, that would be:
Call ArrayToChannels(MaxHold, Array(oFFTMaxHold.Name))
Brad Turpin
DIAdem Product Support Engineer
National Instruments