DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How Do I Combine 10 Variables Into One New Channel of Data?

Hi:

 

Suppose I have a script that finds the maximum values of 10 different spots in a set of data.  Each time it finds a new maximum, it saves it to a variable.

 

How do I combine those 10 variables into a new channel of data?  For example:

 

Row

Value

1

10

2

20

3

30

4

40

5

50

6

60

7

70

8

80

9

90

10

100

 

 

 

0 Kudos
Message 1 of 2
(3,882 Views)

Hello Gatsby,

 

Here is some code that will create a new channel and write the value of the variable Peak01_Ch02 into the first row of the newly created data channel.

 

This code assumes there is at least one channel group in the data portal already.

 

Dim Peak01_Ch02, ChObj
Call Data.Root.ChannelGroups(1).Channels.Add("Channel",DataTypeFloat64,1)
Set ChObj = Data.Root.ChannelGroups(1).Channels("Channel")
ChObj(1) = Peak01_Ch02

 

You can easily put the channel object into a loop to fill multiple rows of the channel ...

 

Hope this helps,

 

     Otmar

Otmar D. Foehner
0 Kudos
Message 2 of 2
(3,879 Views)