Quantcast
Channel: DIAdem topics
Viewing all articles
Browse latest Browse all 3197

Chnfind unable to find the decimal type by variable and sometimes "Round" command

$
0
0

Dear all,

 

During the work with Diadem I got two troubles. Could you please take a look and show me the wrong if you find the issue?

 

1.) Here is my trouble as we see the photo below. It is most important problem which I have. I really have no idea why it could happened. It is alway happened to find a value with decimal type's variable, and even that variable is changed  to "str()".

 

setlocale("en-gb")
dim Min_point,Index_low,result

Min_point=val(Data.Root.ChannelGroups(1).Channels("CopyYangle").Properties("minimum").Value)
Min_point=round(Min_point,6)
Min_point=str(Min_point)
msgbox("The Min.Value is:   "&Min_point)

Index_low=Chnfind("ch(""CopyYangle"")<="&Min_point&"", 1)
msgbox("Index No. of Min. Value is:   "&Index_low)

Index_low=Chnfind("ch(""CopyYangle"")<=-0.11374 ", 1)
msgbox("Index No. of Min. Value is:   "&Index_low)

 

 

 

Diadem_ChnFind_mit_setlocale_EN.jpg

 

 

 

 

 

 

2.) Still the problem with ChnFind()  or  ChnFindreverse().   If I change the Rounds off a number to the nearest integer with the function "Round()" it might not work in ChnFindreverse(). Such like it works under 4, 6, 8 and even 7 but doesn't work with 3 and 5. Is this logical?

setlocale("en-gb")

Dim  XE, Xchannel, Ychannel,round_N0

Xchannel = "[2]/Right"

T1 = Xchannel

R1 =val(Data.Root.ChannelGroups(2).Channels("Right").Properties("maximum").Value)
round_N0=4   ' <========= 3 and 5 Not work,  4, 6, 7, 8 .... work
R1 =round(R1,round_N0)  ' <=========
msgbox("Max. point is:     " &R1  &VbCrlf&  "Round Nr is:        "&round_N0)

L1 = ChnFindReverse ("Ch(T1)>=R1",0)     
msgbox("Index number for Max.Point is:    "&L1  &VbCrlf& "Round Nr is:      "&round_N0)

 

Diadem_ChnFind_round_with_4_OK.jpg

 

Diadem_ChnFind_round_with_3_not_work.jpgDiadem_ChnFind_round_with_5_Not OK.jpg

 

 .tdx is a valid extensions for an attachement?

If you couldn't open the TMD file. Please remove ".tdv" the attacments file name to make sure it is "ChnFind.tdx" but not "ChnFind.tdx.tdv".

 

Kind regards / Mit freundlichen Grüßen

 

J.Huang


Viewing all articles
Browse latest Browse all 3197

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>