09-13-2011 05:25 PM
Hi,
I need to create a new channel with only a portion of data.
I want to use the command : ChnTimeAreaCopy but I get always the same error : Invalid numeric entry
my code is
Dim myvalue02
myvalue02 = str(chd(ChnFind("Ch(""[2]/velocity"")<0",1),"[2]/Time"),"d.ddd")
Call ChnTimeAreaCopy("[2]/Time","[2]/Displacement","[2]/Time_enj","[2]/Displacement_enj",0,myvalue02) '... XW,Y,E,E,TimeAreaCopyBeg,TimeAreaCopyEnd
my intention is to assign to myvalue02 the value of Time channel when the "velocity" channel i less than 0 (first value)
Then I want to create new channels "Displacement_enj" and "Time_enj" with only a portion of data between Time =0 and Time = myvalue02.
I suppose the problem is that myvalue02 is a text value.
How can I convert to numeric value?
Solved! Go to Solution.
09-16-2011 04:33 AM
Hello Giova 🙂
Yes, you are right, you assigned myvalue02 as a string, while ChnTimeAreaCopy(XW, Y, E, E, TimeAreaCopyBeg, TimeAreaCopyEnd) should be a real variable.
By writing
myvalue02 = val(myvalue02)
you will convert your string into a numeric.
Try to write it after your second line where you declare myvalue02 and I think you will not be receiving the same error any more.
09-16-2011 05:23 PM
Thanks!