From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

reading independant values in a channel

Solved!
Go to solution

Hello,

 

I want to read the value of a chanel.

 

I suppose that every chanel is store like an array with an index and a value.

I would like to read a value of a chanel with his number index, then make some computations and then write in it.

 

For exemple:

Chanel 1:
index value
1           1
2           1
3           1
4           2
5           1
6           1

at beginning index = 0
value>1?
if no check the next one
if yes do something

Do you have an exemple of script to read a single value in a chanel?

 

Regards,

 

Frederic MANUEL

0 Kudos
Message 1 of 5
(4,470 Views)

Can you please let us know which DIAdem version you are using ?

Thanks

0 Kudos
Message 2 of 5
(4,468 Views)

sure 🙂

 

Its the evaluation version, 2012

 

 

0 Kudos
Message 3 of 5
(4,465 Views)
Solution
Accepted by topic author fmanuel

Ok, then this should work

 

Dim   oChn,K,dValue
' get access to the channel you are interested in
Set oChn = data.GetChannel("Time")

' loop over all values
For K = 1 To oChn.Size
  dValue = oChn(K)
  If ( dValue > 1 ) Then
    ' do something 
    MsgBox(" Value GT 1")
  End If
Next

0 Kudos
Message 4 of 5
(4,462 Views)

that is what i was searching, thank you for fast solution 😉

0 Kudos
Message 5 of 5
(4,458 Views)