DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

chnfind with timechannels

Solved!
Go to solution

 

Hello, everyone!

 

I'm trying to run this script with the attached timechannels. Idea behind ´the script is very basic: just message three times a "100" -  100 being the line in which chnfind() should get the next bigger value after line 99

 

but -  it won't work!

 

 

dim i

for i = 1 to groupcount
  msgbox myLineNo(i)
next

function myLineNo(i)
  R1 = chv(99,cnoxget(i,1))
  myLineNo = chnfind("ch(""["& i &"]/RecordTimestamp"") >"& str(R1,"d.dddd"))
end function

 

thx for all help!

 

bamboocopter

0 Kudos
Message 1 of 3
(5,241 Views)
Solution
Accepted by topic author bamboocopter

Hi bamboocopter,

 

The problem is the string to value (and vice versa) converting in VBS. In DIAdem the date/time channel counts the seconds since the year 0. That means that there are just a view digits for the fractions of seconds. So if we can prevent the converting the channel find function will work fine.

 

a) chd and chdx are DIAdem function running direct on the values. Chv is using vbs (advantage: works with numeric and string)

b) R1 is a hard coded variable which can be integrated in the ChnFind function string.

 

The following works fine

 

dim i

for i = 1 to groupcount
  msgbox myLineNo(i)
next

function myLineNo(i)
  R1 = chd(99,cnoxget(i,1))
  myLineNo = chnfind("ch(""["& i &"]/RecordTimestamp"") > r1")
end function

 

Greetings

Walter

 

0 Kudos
Message 2 of 3
(5,237 Views)

Great!

Thanks a lot for your help and explanation! 

 

makes life a lot easier....:Smiley Very Happy

 

 

 

0 Kudos
Message 3 of 3
(5,233 Views)