Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Creating a CIN That Compares Two Numbers

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

This example shows only the block diagram and the code. Complete the following steps to create a CIN that compares two single-precision numbers.

Note  LabVIEW must be installed on the computer you use to create the CIN.
  1. Create the CIN. The following illustration shows the block diagram for this CIN.

  2. Save the VI as aequalb.vi.
  3. Create a .c file for the CIN and name it aequalb.c. LabVIEW creates the following.c file. If the first number is greater than the second one, the return value is TRUE. Otherwise, the return value is FALSE.

/*

* CIN source file

*/

#include "extcode.h"

CIN MgErr CINRun(float32 *A, float32 *B,
LVBoolean *compare);

CIN MgErr CINRun(float32 *A, float32 *B,
LVBoolean *compare) {

if (*A == *B)

*compare = LVTRUE;

else

*compare= LVFALSE;

return noErr;

}

Refer to the Determine if two numbers are equal VI in the labview\examples\cins\aequalb directory for an example of a CIN that compares two numbers.


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit