Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
3 ratings:
 4 out of 5     Rate this Document

ChnFind Fails when Evaluting the Equivalency of Floating Point Numbers

Primary Software: DIAdem
Primary Software Version: 10.2
Primary Software Fixed Version: N/A
Secondary Software: DIAdem

Problem:
When I use the ChnFind command with an "=" operator in the expression, it fails to evaluate floating point numbers correctly. Find works correctly, but I want to use ChnFind.

Solution:
When you use the ChnFind command in DIAdem, the complete calculation is done by the VB script engine. In order to check floating point values with the "=" operator, it must be tested against an Epsilon. This Epsilon test range is integrated in the Find function, so in such a formula you can use the "=" operator. With the ChnFind command, the comparison takes place via the script engine, and there is no way to integrate an Epsilon test. This is why the ValEqual function was created. For example, instead of using:

i = ChnFind("Ch(""YourChannelName"") = CMax(""YourChannelName"")")

Use the following:

i = ChnFind("ValEqual(Ch(""YourChannelName""), CMax(""YourChannelName""))")

Related Links:

Attachments:





Report Date: 08/30/2007
Last Updated: 08/30/2007
Document ID: 4CTI5KSN

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit