Showing results for 
Search instead for 
Did you mean: 

Assigning channel value to variable

Go to solution

Assigning channel value to variable

tl;dr: how to put a particular channel value to a variable?

I have a channel with several numbers which I need to use as variables (they are indexes I need to point band cursor at), all I need is to grab a value from channel and assign it to a variable. I tried it simple, I tried it complicated, ChannelsToArray doesn't seem to help either (got type mismatch).


It should be really simple, shouldn't it?

0 Kudos
Message 1 of 3
Accepted by topic author Adalbertus
11-27-2018 07:20 AM

Re: Assigning channel value to variable

dim chO : set chO = Data.Root.ChannelGroups(1).Channels("Time")
dim i : for i = 1 to chO.Size
  dim chVal : chVal = chO.values(i)
  MsgLineDisp chVal

The channel object has a "values" attached to it.

0 Kudos
Message 2 of 3

Re: Assigning channel value to variable

Well, now I am not sure what I did wrong, cause among others I also tried


Dim a
a = cX1Chn.Values(3)

I guess something else was wrong and I just falsely took it as bad syntax, anyway thanks.

0 Kudos
Message 3 of 3