DIAdem

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

Assigning channel value to variable

Solved!
Go to solution

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
(291 Views)
Solution
Accepted by topic author Adalbertus
11-27-2018 07:20 AM
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
Next

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

0 Kudos
Message 2 of 3
(276 Views)

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

 

Dim a
a = cX1Chn.Values(3)
msgbox(a)

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

0 Kudos
Message 3 of 3
(271 Views)