Page 3 - Warranty; Copyright
Warranty The media on which you receive National Instruments software are warranted not to fail to execute programminginstructions, due to defects in materials and workmanship, for a period of 90 days from date of shipment, asevidenced by receipts or other documentation. National Instruments will, a...
Page 5 - Contents; About This Manual
© National Instruments Corporation v LabWindows/CVI Standard Libraries Contents _____________________________________________________________________________ About This Manual ...........................................................................................................xvii Organization...
Page 15 - Glossary
Contents © National Instruments Corporation xv LabWindows/CVI Standard Libraries Channel String for Analog Output Functions ..................................................10-7Valid Counters for the Counter/Timer Functions ............................................10-7 Easy I/O for DAQ Function ...
Page 16 - Tables
Contents LabWindows/CVI Standard Libraries xvi © National Instruments Corporation Tables Table 1-1. ANSI C Standard Library Classes .........................................................................1-1Table 1-2. C Locale Information Values ........................................................
Page 17 - Organization of This Manual
© National Instruments Corporation xvii LabWindows/CVI Standard Libraries About This Manual The LabWindows/CVI Standard Libraries Reference Manual contains information about theLabWindows/CVI standard libraries—the Graphics Library, the Analysis Library, the Formattingand I/O Library, the GPIB Libra...
Page 19 - Conventions Used in This Manual; The following conventions are used in this manual:; bold; italic; File » Page Setup » Options » Substitute Fonts; paths
About This Manual © National Instruments Corporation xix LabWindows/CVI Standard Libraries Conventions Used in This Manual The following conventions are used in this manual: bold Bold text denotes a parameter, menu item, return value, functionpanel item, or dialog box button or option. italic Italic...
Page 20 - The LabWindows/CVI Documentation Set
About This Manual LabWindows/CVI Standard Libraries xx © National Instruments Corporation The LabWindows/CVI Documentation Set For a detailed discussion of the best way to use the LabWindows/CVI documentation set, see thesection Using the LabWindows/CVI Documentation Set in Chapter 1, Introduction t...
Page 21 - ANSI C library of the external compiler.; Class
© National Instruments Corporation 1-1 LabWindows/CVI Standard Libraries Chapter 1ANSI C Library This chapter describes the ANSI C Standard Library as implemented in LabWindows/CVI. Note: When you link your executable or DLL with an external compiler, you are using the ANSI C library of the external...
Page 22 - Standard Language Additions
ANSI C Library Chapter 1 LabWindows/CVI Standard Libraries 1-2 © National Instruments Corporation Table 1-1. ANSI C Standard Library Classes (Continued) General Utilities <stdlib.h> String to Arithmetic Expression Random Number Generation Memory Management Searching and Sorting Integer Arithme...
Page 23 - Name
Chapter 1 ANSI C Library © National Instruments Corporation 1-3 LabWindows/CVI Standard Libraries Table 1-2. C Locale Information Values Name Type C locale Value Description decimal_point char * "." Decimal point character for non-monetaryvalues. thousands_sep char * "" Non-monetary ...
Page 24 - Value of iNegCurr
ANSI C Library Chapter 1 LabWindows/CVI Standard Libraries 1-4 © National Instruments Corporation Under Windows, LabWindows/CVI implements the default locale by using the appropriate itemsfrom the Intl section of the WIN.INI file and appropriate Microsoft Windows functions. Anything not mentioned he...
Page 25 - Character Processing
Chapter 1 ANSI C Library © National Instruments Corporation 1-5 LabWindows/CVI Standard Libraries • islower maps to the Windows function isCharLower . • isupper maps to the Windows function isCharUpper . • tolower maps to the Windows function AnsiLower . • toupper maps to the Windows function AnsiUp...
Page 26 - Input/Output Facilities; Mathematical Functions
ANSI C Library Chapter 1 LabWindows/CVI Standard Libraries 1-6 © National Instruments Corporation Input/Output Facilities The function rename fails if the target file already exists. Under Microsoft Windows, rename fails if the source and target files are on different disk drives. Under UNIX, rename...
Page 27 - Control Functions
Chapter 1 ANSI C Library © National Instruments Corporation 1-7 LabWindows/CVI Standard Libraries The AAA and BBB fields specify the names of the standard and daylight savings time zones, respectively (such as EST for Eastern Standard Time and EDT for Eastern Daylight Time). Theoptional sign field S...
Page 28 - GetProcUserDefinedHandle
ANSI C Library Chapter 1 LabWindows/CVI Standard Libraries 1-8 © National Instruments Corporation or by creating another .pif file. Refer to your Microsoft Windows documentation for help on creating and editing .pif files. If the function is passed a null pointer, LabWindows/CVI returns a non zero v...
Page 29 - ANSI C Library Function Reference; fdopen
Chapter 1 ANSI C Library © National Instruments Corporation 1-9 LabWindows/CVI Standard Libraries The UNIX version of LabWindows/CVI works with all the signals supported by UNIX inaddition to the ANSI C signals. ANSI C Library Function Reference For ANSI C function descriptions, consult a reference ...
Page 30 - Parameter Discussion; fopen
ANSI C Library Chapter 1 LabWindows/CVI Standard Libraries 1-10 © National Instruments Corporation Parameter Discussion mode is the same as the mode parameter to fopen . You should use a mode value that is consistent with the mode in which you originally opened thefile. If you use write capabilities...
Page 31 - Formatting and I/O Library Function Overview; The Formatting and I/O Library Function Panels
© National Instruments Corporation 2-1 LabWindows/CVI Standard Libraries Chapter 2Formatting and I/O Library This chapter describes the functions in the LabWindows/CVI Formatting and I/O Library, andcontains many examples of how to use them. The Formatting and I/O Library contains functionsthat inpu...
Page 32 - String Manipulation
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-2 © National Instruments Corporation Table 2-1. The Formatting and I/O Library Function Tree Formatting and I/O File I/O Open File OpenFile Close File CloseFile Read from File ReadFile Write to File WriteFile Array to File Arra...
Page 33 - The String Manipulation Functions; For instance, a single
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-3 LabWindows/CVI Standard Libraries • The Data Formatting function panels perform intricate formatting operations with a singlefunction call. – Formatting Functions, a subclass of Data Formatting, contains function panels that...
Page 34 - Formatting and I/O Library Function Reference; ArrayToFile
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-4 © National Instruments Corporation described in detail in the Using the Formatting and Scanning Functions section later in thischapter. You may find the formatting and scanning functions more difficult to learn than otherLabW...
Page 35 - Return Value
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-5 LabWindows/CVI Standard Libraries Return Value status integer Indicates success/failure. Return Codes 0 Success. -1 Error attempting to open file. -2 Error attempting to close file. -3 An I/O error occurred. -4 Invalid dataT...
Page 37 - CloseFile
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-7 LabWindows/CVI Standard Libraries CloseFile int status = CloseFile ( int fileHandle); Purpose Closes the file associated with fileHandle. fileHandle is the file handle that was returned fromthe OpenFile function and specifie...
Page 38 - CompareStrings
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-8 © National Instruments Corporation Return Value result integer Result of the compareoperation. Return Codes -1 Bytes from buffer#1 less than bytes from buffer#2. 0 Bytes from buffer#1 identical to bytes from buffer#2. 1 Bytes...
Page 39 - CopyBytes
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-9 LabWindows/CVI Standard Libraries Return Value result integer Result of the compareoperation. Return Codes -1 Bytes from string#1 less than bytes from string#2. 0 Bytes from string#1 identical to bytes from string#2. 1 Bytes...
Page 40 - CopyString
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-10 © National Instruments Corporation Parameter Discussion Both sourceIndex and targetIndex are zero-based. You can use this function even when sourceBuffer and targetBuffer overlap. CopyString void CopyString ( char targetStri...
Page 41 - FileToArray
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-11 LabWindows/CVI Standard Libraries FileToArray int status = FileToArray ( char *fileName, void *array, int dataType, int numberOfElements, int numberOfGroups, int arrayDataOrder, int fileLayout, int fileType); Purpose Reads ...
Page 43 - FillBytes
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-13 LabWindows/CVI Standard Libraries FillBytes void FillBytes ( char buffer [] , int startingIndex, int numberofBytes, int value); Purpose Sets the numberofBytes bytes starting at position startingIndex of buffer to the value ...
Page 44 - integer; Return Code; . The first occurrence is skipped because startingIndex is 3. Of the; ab; Fmt; int; Purpose
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-14 © National Instruments Corporation Return Value ndx integer Index in buffer where patternwas found. Return Code -1 Pattern not found. Parameter Discussion The buffer searched is the set of numberofBytes bytes starting at pos...
Page 45 - Formatting and Scanning Functions section later in this chapter.; FmtFile
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-15 LabWindows/CVI Standard Libraries Parameters Input formatString String. source1,…,sourcen Types must match formatString contents. Output target Type must match formatString contents. Return Value n integer Number of source ...
Page 46 - FmtOut
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-16 © National Instruments Corporation Return Value n integer Number of source formatspecifiers satisfied. Return Codes -1 Format string error -2 I/O error. Using This Function The return value indicates how many source format s...
Page 47 - GetFileInfo
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-17 LabWindows/CVI Standard Libraries Using This Function The return value indicates how many source format specifiers were satisfied, -1 if the format string is in error, or -2 if there was an I/O error. A complete discussion ...
Page 48 - GetFmtErrNdx; GetFmtIOError
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-18 © National Instruments Corporation GetFmtErrNdx int n = GetFmtErrNdx ( void ); Purpose Returns the zero-based index into the format string where an error occurred in the last formattingor scanning call. Parameters None Retur...
Page 49 - GetFmtIOErrorString
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-19 LabWindows/CVI Standard Libraries error). If the last function that performs I/O encountered an I/O error, GetLastFmtIOErrorreturns a nonzero value. Return Value status integer Indicates success or failure of last function ...
Page 50 - NumFmtdBytes
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-20 © National Instruments Corporation NumFmtdBytes int n = NumFmtdBytes ( void ); Purpose Returns the number of bytes formatted or scanned by the previous formatting or scanning call. Parameters None Return Value n integer Numb...
Page 52 - ReadFile
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-22 © National Instruments Corporation fileType specifies whether to treat file as ASCII or binary. When performing I/O on a file inbinary mode, no special treatment is given to carriage returns ( CR ) and line feeds ( LF ). Whe...
Page 53 - ReadLine
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-23 LabWindows/CVI Standard Libraries Using This Function The return value can be less than number of bytes requested if end of file was reached beforebyte count was satisfied. Notice that if you open the file in ASCII mode, ea...
Page 54 - Scan
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-24 © National Instruments Corporation carriage-return/linefeed combination will be treated as a linefeed. If fileHandle is zero, the linewill be read from the standard input. lineBuffer is a character buffer. It should be large...
Page 55 - ScanFile
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-25 LabWindows/CVI Standard Libraries ScanFile int n = ScanFile ( int fileHandle, char *formatString, targetptr1,…,targetptrn); Purpose Performs the same basic operation as the Scan function, except that the source material is ...
Page 56 - SetFilePtr
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-26 © National Instruments Corporation Parameters Input formatString String. Output targetptr1,…,targetptrn Types must match formatString contents. Return Value n integer Number of target formatspecifiers satisfied. Return Codes...
Page 57 - long integer; The valid values of origin are as follows:; beginning of file
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-27 LabWindows/CVI Standard Libraries Return Value position long integer Offset of the new file pointerposition from the beginning ofthe file. Return Code -1 Error due to an invalid file handle, an invalid originvalue, or an of...
Page 58 - StringLength; StringLowerCase; void; string
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-28 © National Instruments Corporation result = WriteFile(handle, "Hello, World!", 13); if (result == -1) FmtOut("error writing to file"); } else FmtOut("error positioning file pointer"); CloseFile(handle...
Page 59 - StringUpperCase
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-29 LabWindows/CVI Standard Libraries Return Value None StringUpperCase void StringUpperCase ( char string [] ); Purpose Converts all lowercase alphabetic characters in the NUL-terminated string to uppercase. Parameter Input/Ou...
Page 60 - WriteLine
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-30 © National Instruments Corporation Return Code -1 Error. Parameter Discussion fileHandle is the file handle that was returned from the OpenFile function. If fileHandle =1 , data is written to STDOUT and no prior OpenFile cal...
Page 61 - OpenFile; Using This Function; Using the Formatting and Scanning Functions; Formatting functions; Introductory Formatting and Scanning Examples
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-31 LabWindows/CVI Standard Libraries Return Code -1 I/O error. Parameter Discussion If numberofBytes is -1, only the bytes in lineBuffer before the first ASCII NUL are written,followed by a linefeed. fileHandle is the file han...
Page 62 - Formatting Functions
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-32 © National Instruments Corporation Convert the integer value 23 to its ASCII representation and place the contents in a stringvariable: char a[5]; int b,n; b = 23; n = Fmt (a, "%s<%i", b); After the Fmt call, a co...
Page 63 - Formatting Functions—Format String
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-33 LabWindows/CVI Standard Libraries Each of these formatting functions return the number of source format specifiers satisfied. If there is an error in the format string, -1 is returned. The formatting functions are used to f...
Page 65 - Formatting Modifiers
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-35 LabWindows/CVI Standard Libraries f real number. This source or target specifier indicates that the corresponding parameter isa real number, or if rep is present, a real array. The function performs conversions to ASCII whe...
Page 66 - pc; Specify Padding. The; onnnn; Specify Byte Ordering. The
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-36 © National Instruments Corporation the integer is converted to a string format. You can enter any non-negative valuehere. If n is less than the number of digits required to represent the integer, an asterisk ( * ) will be in...
Page 67 - in
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-37 LabWindows/CVI Standard Libraries Note: When using both the b n and o n modifiers on an integer specifier, the b n modifier must be first. Formatting Floating-Point Modifiers (%f) bn Specify Length. The b floating-point mod...
Page 68 - Specify Array Offset. The; wn; Specify String Size. When modifying a source format specifier, the
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-38 © National Instruments Corporation t Truncate. The t floating-point modifier indicates that in floating-point to integer transformations, the floating-point value is truncated instead of rounded. This is thedefault. r Round....
Page 69 - Terminate on Character. When applied to a source string, the
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-39 LabWindows/CVI Standard Libraries tn Terminate on Character. When applied to a source string, the t string modifier specifies that the source string is terminated on the first occurrence of the character n , where n is the ...
Page 70 - Fmt, FmtFile, FmtOut—Literals in the Format String; Scanning Functions
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-40 © National Instruments Corporation Fmt, FmtFile, FmtOut—Literals in the Format String Literal characters appearing in a formatting function format string indicate that the literalcharacters are to be combined with the source...
Page 71 - Scanning Functions—Format String
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-41 LabWindows/CVI Standard Libraries Scanning Functions—Format String Consider the following scanning function: n = Scan(source, formatstring, targetptr1, ..., targetptrn); where formatstring contains the information to transf...
Page 72 - formatcode
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-42 © National Instruments Corporation formatcode is specified with one of the following codes: s string. As a source or target specifier this indicates that the corresponding parameter is acharacter string. As a source specifie...
Page 73 - Scanning Modifiers
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-43 LabWindows/CVI Standard Libraries f real number. As a source or target specifier, this indicates that the correspondingparameter is a real number, or if rep is present, a real array. As a source specifier in conversions to ...
Page 74 - Specify String Size. The
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-44 © National Instruments Corporation rn Specify Radix. The r integer modifier specifies the radix of the integer argument, which is important if the integer is converted from a string format. Legal radixes are8 (octal), 10 (de...
Page 77 - Append with Spacing. When the source is a string and the; tn
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-47 LabWindows/CVI Standard Libraries than the number of bytes available from the source, the remaining bytes are filledwith ASCII NULs if the q modifier is used or blanks if the q modifier is not present. When the w modifier i...
Page 78 - Discard Terminator. When applied to a target string, the
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-48 © National Instruments Corporation x Discard Terminator. When applied to a target string, the x modifier specifies that the terminating character be discarded before the next target is filled in. Using %s>%s[xt59]%s[xt59]...
Page 79 - Formatting and I/O Library Programming Examples
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-49 LabWindows/CVI Standard Libraries Some formats may have been correctly detected in the input, and the corresponding targetparameters will have been filled in. Formats situated after the literal which did not appear,however,...
Page 80 - at Beginning of File; Integer to String
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-50 © National Instruments Corporation String to Integer and RealString to StringString to Integer and StringString to Real, Skipping over Non-Numeric Characters in the StringString to Real, after Finding a Semicolon in the Stri...
Page 81 - Remarks; Long Integer to String; buf; Real to String in Floating-Point Notation
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-51 LabWindows/CVI Standard Libraries Fmt (buf, "%s<%i[w6p0]", a); /* result: "001234" */ a = 1234; Fmt (buf, "%s<%i[w2]", a); /* result: "*4" */ Remarks The results shown are the contents ...
Page 82 - Real to String in Scientific Notation
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-52 © National Instruments Corporation Fmt (buf, "%s<%f[p0]", x); /* result: "12." */ x = 12.345; Fmt (buf, "%s<%f[p6]", x); /* result: "12.345000" */ x = -12.345; Fmt (buf, "%s<%f[w1...
Page 83 - Integer and Real to String with Literals; Two Integers to ASCII File with Error Checking; Real Array to ASCII File in Columns and with Comma Separators
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-53 LabWindows/CVI Standard Libraries Integer and Real to String with Literals char buf[20]; int f, r; double v; f = 4; r = 3; v = 1.2; Fmt (buf, "%s<F%iR%i; V%f;", f, r, v); Remarks After the Fmt call, buf contains ...
Page 85 - Real Array to Binary File, Assuming a Variable Number of Elements
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-55 LabWindows/CVI Standard Libraries Real Array to Binary File, Assuming a Variable Number of Elements void StoreArray (double x[], int count, char filename[]) { int file_handle; file_handle = OpenFile (filename, 2, 0, 0); Fmt...
Page 86 - Concatenating Two Strings; switch; Appending to a String
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-56 © National Instruments Corporation Concatenating Two Strings char buf[30]; int wave_type, signal_output; char *wave_str, *signal_str; int nbytes; wave_type = 1; signal_output = 0; switch (wave_type) { case 0: wave_str = "...
Page 88 - In this example, the output is as follows:; ' from the format string. The output in this example is as follows.
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-58 © National Instruments Corporation Writing a Line Containing an Integer with Literals to the Standard Output int a, b; a = 12; b = 34; FmtOut ("%s<A = %i\n", a); FmtOut ("%s<B = %i\n", b); Remarks In th...
Page 89 - String to Integer
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-59 LabWindows/CVI Standard Libraries Scan/ScanFile/ScanIn Examples in C This section contains examples of program code that use the Scan , ScanFile , and ScanIn functions from the Formatting and I/O Library. To eliminate redun...
Page 90 - String to Long Integer; String to Real
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-60 © National Instruments Corporation Scan considers the occurrence of a non-numeric character (such as the x in 32x1 ) to mark the end of the integer. s = "32567"; n = Scan (s, "%s>%i[w3]", &a); /* resul...
Page 91 - String to Integer and Real
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-61 LabWindows/CVI Standard Libraries When locating a real number in a string, Scan skips over white space characters. If a non- numeric character other than a white space character, + , or - is found before the first numeric c...
Page 92 - String to String
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-62 © National Instruments Corporation String to String char *s; char buf[10]; int n; s = " abc "; n = Scan (s, "%s>%s", buf); /* result: buf = "abc" */ s = " abc "; n = Scan (s, "%s>%s[...
Page 93 - String to Integer and String; Note: Do not put spaces between specifiers in; String to Real, Skipping over Non-Numeric Characters in the String
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-63 LabWindows/CVI Standard Libraries String to Integer and String char *s; char buf[10]; int a, n; s = "32abc"; n = Scan (s, "%s>%i%s", &a, buf); /* result: a = 32, buf = "abc", n = 2 */ s = "...
Page 94 - String to Real, After Finding a Semicolon in the String
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-64 © National Instruments Corporation String to Real, After Finding a Semicolon in the String char *s; double x; int n; s = "TIME 12:45:00; 7.34"; n = Scan (s, "%s>%s[xdt59]%f", &x); /* result: x = 7.34, ...
Page 95 - String with Comma-Separated ASCII Numbers to Real Array
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-65 LabWindows/CVI Standard Libraries String with Comma-Separated ASCII Numbers to Real Array char *s; int n; double a[5]; /* 5 8-byte real numbers */ s = "12.3, 45, 6.5, -1.3E-2, 4"; n = Scan (s, "%s>%5f[x]"...
Page 96 - ivals
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-66 © National Instruments Corporation This code shows how to insert an ASCII NUL at the end of the transferred bytes. After theassignment, s is NUL-terminated. Integer Array to Real Array int ivals[100]; double dvals[100]; Scan...
Page 98 - ASCII File to Two Integers with Error Checking
Formatting and I/O Library Chapter 2 LabWindows/CVI Standard Libraries 2-68 © National Instruments Corporation The first call to Scan assumes that the real number is at the beginning of s . The second call assumes that the real number starts at the sixth byte of s . The i5 modifier causes the first ...
Page 99 - Binary File to Integer Array, Assuming a Fixed Number of Elements
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-69 LabWindows/CVI Standard Libraries then reads the correct number of elements into values . The x modifier causes the comma separators to be discarded. Binary File to Integer Array, Assuming a Fixed Number of Elements int rea...
Page 101 - Reading a Line from the Standard Input
Chapter 2 Formatting and I/O Library © National Instruments Corporation 2-71 LabWindows/CVI Standard Libraries writing beyond the end of filename . Notice that the width specified is one less than the size of filename . This allows room for the ASCII NUL that ScanIn appends at the end of filename . ...
Page 102 - Analysis Library Function Overview; The Analysis Library Function Panels; Analysis; Clear1D
© National Instruments Corporation 3-1 LabWindows/CVI Standard Libraries Chapter 3Analysis Library This chapter describes the functions in the LabWindows/CVI Analysis Library. The AnalysisLibrary Function Overview section contains general information about the Analysis Libraryfunctions and panels. T...
Page 104 - Hints for Using Analysis Function Panels
Chapter 3 Analysis Library © National Instruments Corporation 3-3 LabWindows/CVI Standard Libraries The classes and subclasses in the function tree are described here. • The Array Operations function panels perform arithmetic operations on 1D and 2D arrays. – 1D Operations, a subclass of Array Opera...
Page 105 - Reporting Analysis Errors; Analysis Library Function Reference; outputArray; inputArray; Output; outputArray; Absolute value of input array.
Analysis Library Chapter 3 LabWindows/CVI Standard Libraries 3-4 © National Instruments Corporation large amounts of data. Large double-precision arrays consume a lot of memory. If theresults you want do not require that you keep the original array or intermediate arrays of data,perform analysis ope...
Page 108 - CxAdd
Chapter 3 Analysis Library © National Instruments Corporation 3-7 LabWindows/CVI Standard Libraries Return Value status integer Refer to error codes inTable 3-2. Copy1D int status = Copy1D ( double inputArray [] , int numberofElements, double outputArray [] ); Purpose Copies the elements of the inpu...
Page 109 - CxAdd1D
Analysis Library Chapter 3 LabWindows/CVI Standard Libraries 3-8 © National Instruments Corporation Parameters Input xReal double-precision Real part of x. xImaginary double-precision Imaginary part of x. yReal double-precision Real part of y. yImaginary double-precision Imaginary part of y. Output ...
Page 110 - CxDiv
Chapter 3 Analysis Library © National Instruments Corporation 3-9 LabWindows/CVI Standard Libraries Return Value status integer Refer to error codes inTable 3-2. CxDiv int status = CxDiv ( double xReal, double xImaginary, double yReal, yImaginary, double *outputReal, double *outputImaginary); Purpos...
Page 111 - CxDiv1D
Analysis Library Chapter 3 LabWindows/CVI Standard Libraries 3-10 © National Instruments Corporation CxDiv1D int status = CxDiv1D ( double arrayXReal [] , double arrayXImaginary [] , double arrayYReal [] , double arrayYImaginary) [] , int numberofElements, double outputArrayReal [] , double outputAr...
Page 112 - CxLinEv1D
Chapter 3 Analysis Library © National Instruments Corporation 3-11 LabWindows/CVI Standard Libraries CxLinEv1D int status = CxLinEv1D ( double arrayXReal [] , double arrayXImaginary [] , int numberofElements, double aReal, double aImaginary, double bReal, double bImaginary, double outputArrayReal []...
Page 113 - CxMul
Analysis Library Chapter 3 LabWindows/CVI Standard Libraries 3-12 © National Instruments Corporation CxMul int status = CxMul ( double xReal, double xImaginary, double yReal, double yImaginary, double *outputReal, double *outputImaginary); Purpose Multiplies two complex numbers. The function obtains...
Page 114 - CxRecip
Chapter 3 Analysis Library © National Instruments Corporation 3-13 LabWindows/CVI Standard Libraries The function performs the operations in place; that is, the input and output complex arrays can bethe same. Parameters Input arrayXReal double-precisionarray Real part of x. arrayXImaginary double-pr...
Page 115 - CxSub
Analysis Library Chapter 3 LabWindows/CVI Standard Libraries 3-14 © National Instruments Corporation Parameters Input xReal double-precision Real part of x. xImaginary double-precision Imaginary part of x. Output outputReal double-precision Real part of y. outputImaginary double-precision Imaginary ...
Page 116 - CxSub1D; zr
Chapter 3 Analysis Library © National Instruments Corporation 3-15 LabWindows/CVI Standard Libraries CxSub1D int status = CxSub1D ( double arrayXReal [] , double arrayXImaginary [] , double arrayYReal [] , double arrayYImaginary [] , int numberofElements, double outputArrayReal [] , double outputArr...
Page 117 - Determinant
Analysis Library Chapter 3 LabWindows/CVI Standard Libraries 3-16 © National Instruments Corporation Determinant int status = Determinant ( void *inputMatrix, int matrixSize, double *determinant); Purpose Finds the determinant of a matrixSize by matrixSize 2D input matrix. Parameters Input inputMatr...
Page 119 - DotProduct
Analysis Library Chapter 3 LabWindows/CVI Standard Libraries 3-18 © National Instruments Corporation Return Value status integer Refer to error codes inTable 3-2. DotProduct int status = DotProduct ( double vectorX [] , double vectorY [] , int numberofElements, double *dotProduct); Purpose Computes ...
Page 120 - GetAnalysisErrorString; hist
Chapter 3 Analysis Library © National Instruments Corporation 3-19 LabWindows/CVI Standard Libraries GetAnalysisErrorString char *message = GetAnalysisErrorString ( int errorNum) Purpose Converts the error number returned by an Analysis Library function into a meaningful errormessage. Parameters Inp...
Page 121 - InvMatrix
Analysis Library Chapter 3 LabWindows/CVI Standard Libraries 3-20 © National Instruments Corporation Parameters Input inputArray double-precisionarray Input array. numberofElements integer Number of elements in Input Array. base double-precision Lower range. top double-precision Upper range. interva...
Page 122 - LinEv1D; a x
Chapter 3 Analysis Library © National Instruments Corporation 3-21 LabWindows/CVI Standard Libraries Return Value status integer Refer to error codes in nTable 3-2. LinEv1D int status = LinEv1D ( double inputArray [] , int numberofElements, double multiplier, double additiveConstant, double outputAr...
Page 123 - LinEv2D
Analysis Library Chapter 3 LabWindows/CVI Standard Libraries 3-22 © National Instruments Corporation LinEv2D int status = LinEv2D ( void *inputArray, int numberofRows, int numberofColumns, double multiplier, double additiveConstant, void *outputArray); Purpose Performs a linear evaluation of a 2D ar...
Page 124 - MatrixMul
Chapter 3 Analysis Library © National Instruments Corporation 3-23 LabWindows/CVI Standard Libraries MatrixMul int status = MatrixMul ( void *matrixX, void *matrixY, int #ofRowsInX, int cols/rowsInX/Y, int #ofColumnsInY, void *outputMatrix); Purpose Multiplies two 2D input matrices. The function obt...
Page 125 - MaxMin1D
Analysis Library Chapter 3 LabWindows/CVI Standard Libraries 3-24 © National Instruments Corporation MaxMin1D int status = MaxMin1D ( double inputArray [] , int numberofElements, double *maximumValue, int *maximumIndex, double *minimumValue, int *minimumIndex); Purpose Finds the maximum and minimum ...
Page 126 - Mean
Chapter 3 Analysis Library © National Instruments Corporation 3-25 LabWindows/CVI Standard Libraries Parameters Input inputArray double-precision2D array Input array. numberofRows integer Number of elements in firstdimension of inputArray. numberofColumns integer Number of elements in seconddimensio...
Page 130 - Sort
Chapter 3 Analysis Library © National Instruments Corporation 3-29 LabWindows/CVI Standard Libraries Sort int status = Sort ( double inputArray [] , int numberofElements, int direction, double outputArray [] ); Purpose Sorts the input array in ascending or descending order. The function performs the...
Page 133 - Subset1D; mag
Analysis Library Chapter 3 LabWindows/CVI Standard Libraries 3-32 © National Instruments Corporation Subset1D int status = Subset1D ( double inputArray [] , int numberofElements, int index, int length, double outputArray [] ); Purpose Extracts a subset of the inputArray input array containing the nu...
Page 134 - ToPolar1D; The phaseRadians value is in the range of [ -; to
Chapter 3 Analysis Library © National Instruments Corporation 3-33 LabWindows/CVI Standard Libraries Parameters Input xReal double-precision X coordinate. yImaginary double-precision X coordinate. Output magnitude double-precision Magnitude. phaseRadians double-precision Phase (in radians). Return V...
Page 135 - ToRect
Analysis Library Chapter 3 LabWindows/CVI Standard Libraries 3-34 © National Instruments Corporation Parameters Input arrayXReal double-precisionarray X coordinate. arrayYImaginary double-precisionarray Y coordinate. numberofElements integer Number of elements. Output magnitude double-precisionarray...
Page 136 - ToRect1D
Chapter 3 Analysis Library © National Instruments Corporation 3-35 LabWindows/CVI Standard Libraries Return Value status integer Refer to error codes inTable 3-2. ToRect1D int status = ToRect1D ( double magnitude [] , double phaseRadians [] , int numberofElements, double outputArrayReal [] , double ...
Page 137 - Transpose
Analysis Library Chapter 3 LabWindows/CVI Standard Libraries 3-36 © National Instruments Corporation Transpose int status = Transpose ( void *inputMatrix, int numberofRows, int numberofColumns, void *outputMatrix); Purpose Finds the transpose of a 2D input matrix. The (ith, jth) element of the resul...
Page 138 - Error Conditions; Symbolic Name; Base must be less than Top.
Chapter 3 Analysis Library © National Instruments Corporation 3-37 LabWindows/CVI Standard Libraries Error Conditions If an error condition occurs during a call to any of the functions in the LabWindows/CVIAnalysis Library, the status return value contains the error code. This code is a value thatsp...
Page 139 - GPIB Library Function Overview; GPIB Functions Library Function Panels
© National Instruments Corporation 4-1 LabWindows/CVI Standard Libraries Chapter 4GPIB/GPIB-488.2 Library This describes the NI-488 and NI-488.2 functions in the LabWindows/CVI GPIB Library, aswell as the Device Manager functions in LabWindows/CVI. The GPIB Library FunctionOverview section contains ...
Page 140 - Configuration
GPIB/GPIB-488.2 Library Chapter 4 LabWindows/CVI Standard Libraries 4-2 © National Instruments Corporation Table 4-1. The GPIB Functions Library Function Tree GPIB/GPIB-488.2 Library Open/Close Open Device OpenDev Close Device CloseDev Close Instrument Devices CloseInstrDevs Find Board/Device ibfind...
Page 141 - Bus Control
Chapter 4 GPIB/GPIB-488.2 Library © National Instruments Corporation 4-3 LabWindows/CVI Standard Libraries Table 4-1. The GPIB Functions Library Function Tree (Continued) Bus Control Send Interface Clear ibsic Become Active Controller ibcac Go to Standby ibgts Set/Clear Remote Enable ibsre Send Comm...
Page 142 - SRQ and Serial Polls
GPIB/GPIB-488.2 Library Chapter 4 LabWindows/CVI Standard Libraries 4-4 © National Instruments Corporation Table 4-1. The GPIB Functions Library Function Tree (Continued) SRQ and Serial Polls Test SRQ line TestSRQ Wait for SRQ WaitSRQ Find Requesting Device FindRQS Read Status Byte ReadStatusByte Se...
Page 143 - ibsgnl; GPIB Library Concepts; GPIB Libraries and the GPIB Dynamic Link Library/Device Driver
Chapter 4 GPIB/GPIB-488.2 Library © National Instruments Corporation 4-5 LabWindows/CVI Standard Libraries • The Bus Control function panels provide low-level control of the GPIB bus. • The Board Control function panels provide low-level control of the GPIB board. Thesefunctions are normally used wh...
Page 144 - Guidelines and Restrictions for Using the GPIB Libraries
GPIB/GPIB-488.2 Library Chapter 4 LabWindows/CVI Standard Libraries 4-6 © National Instruments Corporation drivers are packaged with your GPIB interface board and are not included withLabWindows/CVI. LabWindows/CVI does not require any special procedures for installing andusing the device driver. Fo...
Page 145 - and; Device and Board Functions; call with the RQS bit
Chapter 4 GPIB/GPIB-488.2 Library © National Instruments Corporation 4-7 LabWindows/CVI Standard Libraries Note: When writing instrument modules, you must use the Device Manager functions ( OpenDev and CloseDev ) instead of ibfind or ibdev . You must also use the Device Manager functions in applicat...
Page 146 - Autopolling Compatibility; Hardware Interrupts and Autopolling
GPIB/GPIB-488.2 Library Chapter 4 LabWindows/CVI Standard Libraries 4-8 © National Instruments Corporation included in the wait mask. Aside from the difficulty caused by ESRQ in waiting for RQS, theerror will have no detrimental effects on other GPIB operations. If you call the serial poll function ...
Page 147 - IBCONF; Read and Write Termination; ibeos; Timeouts; ibtmo
Chapter 4 GPIB/GPIB-488.2 Library © National Instruments Corporation 4-9 LabWindows/CVI Standard Libraries • The last GPIB call was a board call. Autopolling is re-instated after a subsequent device call. • GPIB I/O is in progress. In particular, during asynchronous GPIB I/O, autopolling will not oc...
Page 148 - Global Variables for the GPIB Library; ibsta; Driver Name; Compatibility driver.
GPIB/GPIB-488.2 Library Chapter 4 LabWindows/CVI Standard Libraries 4-10 © National Instruments Corporation Global Variables for the GPIB Library The following global variables are used by the GPIB Library and the GPIB-488.2 Library: • Status Word ( ibsta ) • Error ( ibcnt , ibcntl ) These variables...
Page 149 - Compatibility Driver; Windows NT; Limitations on Transfer Size
Chapter 4 GPIB/GPIB-488.2 Library © National Instruments Corporation 4-11 LabWindows/CVI Standard Libraries If you want to use GPIB under Windows 95 and you have an older board, it is recommended thatyou upgrade to one of the boards in this list. Compatibility Driver The compatibility driver is a 32...
Page 150 - Notification of SRQ and Other GPIB Events; Synchronous Callbacks
GPIB/GPIB-488.2 Library Chapter 4 LabWindows/CVI Standard Libraries 4-12 © National Instruments Corporation Notification of SRQ and Other GPIB Events Synchronous Callbacks Under Windows 3.1, you can use ibInstallCallback to specify a function to be called when an SRQ is asserted on the GPIB or when ...
Page 151 - GPIB Function Reference; previous LabWindows version.; CloseDev
Chapter 4 GPIB/GPIB-488.2 Library © National Instruments Corporation 4-13 LabWindows/CVI Standard Libraries GPIB Function Reference Most of the functions in the GPIB/GPIB-488.2 Library are described in the software referencemanual that you received with your GPIB board. This section contains descrip...
Page 152 - CloseInstrDevs; rather than
GPIB/GPIB-488.2 Library Chapter 4 LabWindows/CVI Standard Libraries 4-14 © National Instruments Corporation CloseInstrDevs int result = CloseInstrDevs ( char *instrumentPrefix); Purpose Closes instrument devices. Parameter Input instrumentPrefix string Must be null-terminated. Return Value result in...
Page 153 - Parameters
Chapter 4 GPIB/GPIB-488.2 Library © National Instruments Corporation 4-15 LabWindows/CVI Standard Libraries The callback function is called when any of the GPIB events specified in the Event Maskparameter have occurred on the board or device, but only while you allow the system to processevents. The...
Page 155 - CallbackFunction; ibNotify
Chapter 4 GPIB/GPIB-488.2 Library © National Instruments Corporation 4-17 LabWindows/CVI Standard Libraries CallbackFunction The callback function must have the following form. void CallbackFunctionName ( int boardOrDevice, int mask, void * callbackData); The mask and callbackData parameters are the...
Page 157 - parameter to make sure that one of the
Chapter 4 GPIB/GPIB-488.2 Library © National Instruments Corporation 4-19 LabWindows/CVI Standard Libraries SRQI, RQS, and Auto Serial Polling If you want to install a callback for the SRQI (board-level) event, Auto Serial Polling must be disabled. You can disable Auto Serial Polling with the follow...
Page 158 - Restrictions on Operations in Asynchronous Callbacks
GPIB/GPIB-488.2 Library Chapter 4 LabWindows/CVI Standard Libraries 4-20 © National Instruments Corporation If invoked because an asynchronous I/O operation (started by ibrda , ibwrta , or ibcmda ) completed, the callback function should contain the following call: ibwait (boardOrDevice, TIMO | CMPL...
Page 159 - OpenDev
Chapter 4 GPIB/GPIB-488.2 Library © National Instruments Corporation 4-21 LabWindows/CVI Standard Libraries OpenDev int bd = OpenDev ( char *deviceName, char *instrumentPrefix); Purpose Opens a GPIB device. Parameters Input deviceName string Must be null-terminated. instrumentPrefix string Must be n...
Page 160 - ThreadIbcnt
GPIB/GPIB-488.2 Library Chapter 4 LabWindows/CVI Standard Libraries 4-22 © National Instruments Corporation ThreadIbcnt int threadSpecificCount = ThreadIbcnt ( void ); Note: This function is available only under Windows 95 and NT. This function returns the value of the thread-specific ibcnt variable...
Page 161 - ThreadIberr
Chapter 4 GPIB/GPIB-488.2 Library © National Instruments Corporation 4-23 LabWindows/CVI Standard Libraries If you are not using multiple threads, the value returned by this function is identical to the valueof the ibcntl global variable. Parameters none Return Value threadSpecificCount longinteger ...
Page 162 - Return Codes
GPIB/GPIB-488.2 Library Chapter 4 LabWindows/CVI Standard Libraries 4-24 © National Instruments Corporation Return Codes DefinedConstant Value Description EDVR 0 Operating system error. The system-specific error code is returned by ThreadIbcntl . ECIC 1 Function requires GPIB-PC to be CIC. ENOL 2 No...
Page 163 - See Also; ThreadIbsta; Note: This function is available only under Windows 95 and NT.
Chapter 4 GPIB/GPIB-488.2 Library © National Instruments Corporation 4-25 LabWindows/CVI Standard Libraries See Also ThreadIbsta, ThreadIbcnt, ThreadIbcntl. ThreadIbsta int threadSpecificStatus = ThreadIbsta ( void ); Note: This function is available only under Windows 95 and NT. This function retur...
Page 164 - The return value is a sum of the following bits.; Hex Value; Device requesting service.
GPIB/GPIB-488.2 Library Chapter 4 LabWindows/CVI Standard Libraries 4-26 © National Instruments Corporation Return Codes The return value is a sum of the following bits. DefinedConstant Hex Value Condition ERR 8000 GPIB error. END 2000 END or EOS detected. SRQI 1000 SRQ is on. RQS 800 Device request...
Page 165 - aioread; RS-232 Library Function Overview; The RS-232 Library Function Panels
© National Instruments Corporation 5-1 LabWindows/CVI Standard Libraries Chapter 5RS-232 Library This chapter describes the functions in the LabWindows/CVI RS-232 Library. The RS-232Library Function Overview section contains general information about the RS-232 Libraryfunctions and panels. The RS-23...
Page 166 - XModem
RS-232 Library Chapter 5 LabWindows/CVI Standard Libraries 5-2 © National Instruments Corporation Table 5-1. The RS-232 Library Function Tree (Continued) Read To File ComToFile Write Buffer ComWrt Write Byte ComWrtByte Write From File ComFromFile XModem XModem Send File XModemSend XModem Receive Fil...
Page 167 - Reporting RS-232 Errors
Chapter 5 RS-232 Library © National Instruments Corporation 5-3 LabWindows/CVI Standard Libraries Using RS-485 You can use all of the functions in the RS-232 Library with the National Instruments RS-485AT-Serial board. The ComSetEscape function allows you to control the transceiver mode of the board...
Page 168 - RS-232 Cable Information; Pin
RS-232 Library Chapter 5 LabWindows/CVI Standard Libraries 5-4 © National Instruments Corporation All functions, except the Open and Close functions, require the com port to be opened with OpenCom or OpenComConfig. If the program writes data to the output queue and then immediately closes the com po...
Page 169 - Connect pins as indicated:
Chapter 5 RS-232 Library © National Instruments Corporation 5-5 LabWindows/CVI Standard Libraries All serial devices are either of the type Data Communication Equipment (DCE) or DataTransmission Equipment (DTE). The PC is of type DTE. The difference between the twodevices is in the meaning assigned ...
Page 170 - Handshaking; Software Handshaking; The
RS-232 Library Chapter 5 LabWindows/CVI Standard Libraries 5-6 © National Instruments Corporation application. Refer to the Hardware Handshaking section later in this chapter for moreinformation about using the lines 4, 5, 6, and 20. Another area that requires special attention is the gender of the ...
Page 171 - Hardware Handshaking; SetCTSMode
Chapter 5 RS-232 Library © National Instruments Corporation 5-7 LabWindows/CVI Standard Libraries Hardware Handshaking The SetCTSMode function enables hardware handshaking. For hardware handshaking to work, two conditions must exist. First, the serial devices must follow the same or similar hardware...
Page 172 - If the port is closed, the library lowers RTS and DTR.; RS-232 Library Function Reference; CloseCom
RS-232 Library Chapter 5 LabWindows/CVI Standard Libraries 5-8 © National Instruments Corporation – If the input queue of the port is nearly full, the library lowers RTS and DTR. – If the input queue of the port is nearly empty, the library raises RTS and DTR. – If the port is closed, the library lo...
Page 173 - ComBreak; Generates a break signal.; ComFromFile
Chapter 5 RS-232 Library © National Instruments Corporation 5-9 LabWindows/CVI Standard Libraries Parameter Discussion The function does nothing if the port numbers are invalid (port is not open or parameter value isnot in the range 1 through 32). ComBreak int result = ComBreak ( int COMPort, int br...
Page 175 - ComRd
Chapter 5 RS-232 Library © National Instruments Corporation 5-11 LabWindows/CVI Standard Libraries ComRd int nbytes = ComRd ( int COMPort, char buffer [] , int count); Purpose Reads count bytes from input queue of the specified port and stores them in buffer. Returnseither on time-out or when count ...
Page 176 - ComRdByte; ComRdTerm
RS-232 Library Chapter 5 LabWindows/CVI Standard Libraries 5-12 © National Instruments Corporation ComRdByte int byte = ComRdByte ( int COMPort); Purpose Reads a byte from the input queue of the specified port. Returns an integer whose low-order bytecontains the byte read. Returns either on time-out...
Page 178 - ComSetEscape
RS-232 Library Chapter 5 LabWindows/CVI Standard Libraries 5-14 © National Instruments Corporation ComSetEscape int result = ComSetEscape ( int COMPort, int escapeCode); Purpose Directs the specified com port to carry out an extended function such as clearing or setting theRTS signal line or setting...
Page 179 - ComToFile
Chapter 5 RS-232 Library © National Instruments Corporation 5-15 LabWindows/CVI Standard Libraries The following values may be used only with the RS-485 serial driver developed by NationalInstruments: WIRE_4 —Sets the transceiver to Four Wire Mode. WIRE_2_ECHO —Sets the transceiver to Two Wire DTR c...
Page 180 - ComWrt
RS-232 Library Chapter 5 LabWindows/CVI Standard Libraries 5-16 © National Instruments Corporation for ComRdTerm . If both count and terminationByte are disabled, the function terminates on error (which can include a time-out). Using This Function The function returns an error if the output queue re...
Page 181 - GetOutQLen; ComWrtByte
Chapter 5 RS-232 Library © National Instruments Corporation 5-17 LabWindows/CVI Standard Libraries the port, call GetOutQLen . GetOutQLen returns the number of bytes remaining in the output queue. The function returns an error if the port is not open or parameter values are invalid. Example /* Place...
Page 182 - FlushInQ
RS-232 Library Chapter 5 LabWindows/CVI Standard Libraries 5-18 © National Instruments Corporation Parameter Discussion This function times out if the output queue has not been updated in the specified time-out period.This can occur if the output queue is full and no further data can be sent because...
Page 183 - FlushOutQ; GetComStat
Chapter 5 RS-232 Library © National Instruments Corporation 5-19 LabWindows/CVI Standard Libraries FlushOutQ int status = FlushOutQ ( int COMPort); Purpose Removes all characters from the output queue of the specified port. Parameter Input COMPort integer Range 1 through 32. Return Value status inte...
Page 184 - Mnemonic; SetXMode; GetInQLen
RS-232 Library Chapter 5 LabWindows/CVI Standard Libraries 5-20 © National Instruments Corporation Table 5-5. Bit Definitions for the GetComStat Function HexValue Mnemonic Description 0001 INPUT LOST Input queue filled and input characters lost (characterswere not removed fast enough). 0002 ASYNCH E...
Page 186 - InstallComCallback
RS-232 Library Chapter 5 LabWindows/CVI Standard Libraries 5-22 © National Instruments Corporation GetRS232ErrorString char *message = GetRS232ErrorString ( int errorNum) Purpose Converts the error number returned by an RS-232 Library function into a meaningful errormessage. Parameters Input errorNu...
Page 187 - function at higher baud rates, some
Chapter 5 RS-232 Library © National Instruments Corporation 5-23 LabWindows/CVI Standard Libraries Note: The callback function may receive more than one event at a time. When using this function at higher baud rates, some LWRS_RXCHAR events may be missed. It is recommended to use LWRS_RECEIVE or LWR...
Page 189 - OpenCom
Chapter 5 RS-232 Library © National Instruments Corporation 5-25 LabWindows/CVI Standard Libraries The following table further describes the events. Event ConstantName Description LWRS_RXCHAR Set when any character is received and placed in thereceiving queue. LWRS_RXFLAG Set when the event characte...
Page 190 - and so on; OpenComConfig
RS-232 Library Chapter 5 LabWindows/CVI Standard Libraries 5-26 © National Instruments Corporation Return Value result integer Refer to error codes in Table 5-6. Parameter Discussion deviceName is the name of the com port in the ASCII string. For example, COM1 for com port 1 on Microsoft Windows usi...
Page 193 - SetComTime
Chapter 5 RS-232 Library © National Instruments Corporation 5-29 LabWindows/CVI Standard Libraries SetComTime int result = SetComTime ( int COMPort, double timeoutSeconds); Purpose Sets time-out limit for input/output operations. Parameters Input COMPort integer Range 1 through 32. timeoutSeconds do...
Page 195 - XModemConfig
Chapter 5 RS-232 Library © National Instruments Corporation 5-31 LabWindows/CVI Standard Libraries SetXMode int result = SetXMode ( int COMPort, int mode); Purpose Enables or disables software handshaking by enabling or disabling XON/XOFF sensitivity ontransmission and reception of data. Parameters ...
Page 196 - XModemSend
RS-232 Library Chapter 5 LabWindows/CVI Standard Libraries 5-32 © National Instruments Corporation Parameters Input COMPort integer Range 1 through 32. startDelay double-precision 0.0 selects the default value10.0 seconds. maximum#ofRetries integer 0 selects the default value 10. waitPeriod double-p...
Page 197 - XModemReceive
Chapter 5 RS-232 Library © National Instruments Corporation 5-33 LabWindows/CVI Standard Libraries for an acknowledgment before it re-sends the current packet. When LabWindows/CVI plays therole of receiver, it waits for up to waitPeriod seconds for the next packet after it sends out anacknowledgment...
Page 199 - HELLO
Chapter 5 RS-232 Library © National Instruments Corporation 5-35 LabWindows/CVI Standard Libraries Return Value result integer Result of the XModem sendoperation. <0 Failure. 0 Success. Using This Function The file is opened in binary mode. Carriage returns and linefeeds are not treated as ASCIIc...
Page 200 - Code
RS-232 Library Chapter 5 LabWindows/CVI Standard Libraries 5-36 © National Instruments Corporation Error Conditions If an error condition occurs during a call to any of the functions in the LabWindows/CVI RS-232Library, the function returns an error code and the global variable rs232err contains tha...
Page 201 - Checksum
Chapter 5 RS-232 Library © National Instruments Corporation 5-37 LabWindows/CVI Standard Libraries Table 5-6. RS-232 Library Error Codes (Continued) -258 Packet not sent within retry limit. -259 Packet not received within retry limit. -260 End of transmission character encountered when start ofdata ...
Page 202 - DDE Library Function Overview; The DDE Library Function Panels; Server Functions
© National Instruments Corporation 6-1 LabWindows/CVI Standard Libraries Chapter 6DDE Library This chapter describes the functions in the LabWindows/CVI DDE (Dynamic Data Exchange)Library. The DDE Library Function Overview section contains general information about theDDE Library functions and panel...
Page 203 - DDE Clients and Servers
DDE Library Chapter 6 LabWindows/CVI Standard Libraries 6-2 © National Instruments Corporation DDE Clients and Servers Interprocess communication with DDE involves a client and a server in each DDE conversation.A DDE server can execute commands sent from another application, and send and receiveinfo...
Page 205 - xType; DDE Links
DDE Library Chapter 6 LabWindows/CVI Standard Libraries 6-4 © National Instruments Corporation Table 6-2. DDE Transaction Types (xType) xType Server Client When ? DDE_CONNECT Y N When a new client requests aconnection. DDE_DISCONNECT Y Y When conversation partner quits. DDE_DATAREADY Y Y When conver...
Page 206 - A DDE Library Example Using Microsoft Excel and LabWindows/CVI; ConnectToDDEServer; topic name—The Excel system or file in Excel involved.
Chapter 6 DDE Library © National Instruments Corporation 6-5 LabWindows/CVI Standard Libraries A DDE Library Example Using Microsoft Excel and LabWindows/CVI LabWindows/CVI includes a sample program called ddedemo.prj that uses DDE to send data to Microsoft Excel. The example program can be found in...
Page 207 - DDE Library Function Reference; AdviseDDEDataReady
DDE Library Chapter 6 LabWindows/CVI Standard Libraries 6-6 © National Instruments Corporation When the DDE_DATAREADY transaction is received in the callback function, a numeric display is updated by passing the data pointer value to a numeric control on the UIR file.When the DDE event is DDE_DISCON...
Page 209 - in a tight loop because the; BroadcastDDEDataReady
DDE Library Chapter 6 LabWindows/CVI Standard Libraries 6-8 © National Instruments Corporation If successful, this function returns the number of bytes sent. Otherwise, this function returns anegative error code. See the help for the status control for the error code values. Note: Your program shoul...
Page 210 - ClientDDEExecute; commandString
Chapter 6 DDE Library © National Instruments Corporation 6-9 LabWindows/CVI Standard Libraries Parameter Discussion serverName, topicName, and itemName must be strings of length from 1 to 255. They are usedwithout regard to case. Using this Function This function allows your program, acting as a DDE...
Page 211 - ClientDDERead
DDE Library Chapter 6 LabWindows/CVI Standard Libraries 6-10 © National Instruments Corporation Purpose Called by client to send a command to be executed by a DDE server application. Parameters Input conversationHandle unsigned integer Uniquely identifies theconversation. commandString string Comman...
Page 212 - ClientDDEWrite
Chapter 6 DDE Library © National Instruments Corporation 6-11 LabWindows/CVI Standard Libraries dataFormat unsigned integer Valid data format; for example, CF_TEXT . dataSize unsigned integer Number of bytes to read.Limited to 64 KB underWindows 3.1 and Windows 95. timeout unsigned integer Timeout i...
Page 213 - system
DDE Library Chapter 6 LabWindows/CVI Standard Libraries 6-12 © National Instruments Corporation Purpose Called by client to write data to a DDE server application. Parameters Input conversationHandle unsigned integer Uniquely identifies theconversation. itemName string Uniquely identifies the output...
Page 215 - Note: In the case of
DDE Library Chapter 6 LabWindows/CVI Standard Libraries 6-14 © National Instruments Corporation clientCallbackFunction defines a callback function through which all messages from the serverwill be routed. The callback function must be of the following form: int (*ddeFuncPtr) (int handle, char *topic...
Page 216 - DisconnectFromDDEServer
Chapter 6 DDE Library © National Instruments Corporation 6-15 LabWindows/CVI Standard Libraries DisconnectFromDDEServer int status = DisconnectFromDDEServer ( unsigned int conversationHandle); Purpose Disconnects your client program from a server application. Parameters Input conversationHandle unsi...
Page 217 - RegisterDDEServer
DDE Library Chapter 6 LabWindows/CVI Standard Libraries 6-16 © National Instruments Corporation Return Value message string Explanation of error. RegisterDDEServer int status = RegisterDDEServer ( char serverName [] , ddeFuncPtr serverCallbackFunction, void *callbackData); Purpose Registers your pro...
Page 218 - when Windows terminates the connection due to an internal error.
Chapter 6 DDE Library © National Instruments Corporation 6-17 LabWindows/CVI Standard Libraries DDE_DISCONNECTDDE_DATAREADYDDE_REQUESTDDE_ADVISELOOPDDE_ADVISESTOPDDE_EXECUTE DDE_CONNECT —This transaction type is received when a client is requesting a connection. The topicName parameter specifies the...
Page 219 - If you do not want to use the callback data, you can pass zero.
DDE Library Chapter 6 LabWindows/CVI Standard Libraries 6-18 © National Instruments Corporation This function registers your program as a DDE server with the specified name. Clientsattempting to connect to your program must use the specified name. Thereafter, all requests bythe client will be routed...
Page 220 - ServerDDEWrite
Chapter 6 DDE Library © National Instruments Corporation 6-19 LabWindows/CVI Standard Libraries ServerDDEWrite int status = ServerDDEWrite ( unsigned int conversationHandle, char itemName [] , unsigned int dataFormat, void *dataPointer, unsigned int dataSize, unsigned int timeout); Purpose Writes da...
Page 221 - SetUpDDEHotLink
DDE Library Chapter 6 LabWindows/CVI Standard Libraries 6-20 © National Instruments Corporation Refer to Microsoft programmers' documention for Windows 3.x for an in-depth discussion ofDDE programming and meaning of each data format type. Using This Function This function allows your program, acting...
Page 222 - when the data item is changed at the server site, and the new; SetUpDDEWarmLink
Chapter 6 DDE Library © National Instruments Corporation 6-21 LabWindows/CVI Standard Libraries Return Value status integer Refer to error codes in Table 6-3. Parameter Discussion The itemName represents the information in the server application where the DDE link isestablished. For example, the ite...
Page 223 - TerminateDDELink
DDE Library Chapter 6 LabWindows/CVI Standard Libraries 6-22 © National Instruments Corporation Parameter Discussion The itemName represents the information in the server application where the DDE link isestablished. For example, the item name could represent an Excel range of cells by using therang...
Page 224 - UnregisterDDEServer
Chapter 6 DDE Library © National Instruments Corporation 6-23 LabWindows/CVI Standard Libraries UnregisterDDEServer int status = UnregisterDDEServer ( char serverName [] ); Purpose Unregisters your application program as a DDE server. Parameters Input serverName string Name of the server application...
Page 225 - DDE error codes starting from 0x4000.
DDE Library Chapter 6 LabWindows/CVI Standard Libraries 6-24 © National Instruments Corporation Table 6-3. DDE Library Error Codes Code Error Message 0 kDDE_NoError -1 -kDDE_UnableToRegisterService -2 -kDDE_ExistingServer -3 -kDDE_FailedToConnect -4 -kDDE_ServerNotRegistered -5 -kDDE_TooManyConversa...
Page 226 - In order to use this library in Microsoft Windows, a version of; TCP Library Function Overview; The TCP Library Function Panels; Table 7-1. The TCP Library Function Tree
© National Instruments Corporation 7-1 LabWindows/CVI Standard Libraries Chapter 7TCP Library This chapter describes the functions in the LabWindows/CVI TCP (Transmission ControlProtocol) Library. The TCP Library Function Overview section contains general informationabout the TCP Library functions a...
Page 227 - TCP Clients and Servers; The TCP Callback Function
TCP Library Chapter 7 LabWindows/CVI Standard Libraries 7-2 © National Instruments Corporation TCP Clients and Servers Network communication using the TCP library involves a client and a server in each connection.A TCP server can send and receive information to and from a client application through ...
Page 228 - TCP Library Function Reference; ClientTCPRead; conversationHandle,
Chapter 7 TCP Library © National Instruments Corporation 7-3 LabWindows/CVI Standard Libraries program is invoked to process the request. The parameter prototypes for the TCP callbackfunctions in LabWindows/CVI are defined below: int CallbackFunction (int handle, int xType, int errCode, void *callba...
Page 229 - ClientTCPWrite
TCP Library Chapter 7 LabWindows/CVI Standard Libraries 7-4 © National Instruments Corporation Parameters Input conversationHandle unsigned integer Uniquely identifies theconversation. dataBuffer void pointer Buffer in which to receive data. dataSize unsigned integer Maximum number of bytes toread. ...
Page 230 - ConnectToTCPServer
Chapter 7 TCP Library © National Instruments Corporation 7-5 LabWindows/CVI Standard Libraries Return Value status integer Returns the number of byteswritten, or a negative error codeif an error occurs; Refer to errorcodes in Table 7-3. See Also ConnectToTCPServer , ClientTCPRead ConnectToTCPServer ...
Page 232 - DisconnectFromTCPServer
Chapter 7 TCP Library © National Instruments Corporation 7-7 LabWindows/CVI Standard Libraries See Also RegisterTCPServer , DisconnectFromTCPServer DisconnectFromTCPServer int status = DisconnectFromTCPServer ( unsigned int conversationHandle); Purpose Disconnects your client program from a server a...
Page 233 - GetTCPErrorString
TCP Library Chapter 7 LabWindows/CVI Standard Libraries 7-8 © National Instruments Corporation See Also RegisterTCPServer GetTCPErrorString char *message = GetTCPErrorString ( int errorNum) Purpose Converts the error number returned by a TCP Library function into a meaningful error message. Paramete...
Page 234 - ServerTCPRead
Chapter 7 TCP Library © National Instruments Corporation 7-9 LabWindows/CVI Standard Libraries Return Value status integer Refer to error codes inTable 7-3. Parameter Discussion serverCallbackFunction is the name of the function to be called to process client requests. The callback function must be ...
Page 236 - ServerTCPWrite
Chapter 7 TCP Library © National Instruments Corporation 7-11 LabWindows/CVI Standard Libraries ServerTCPWrite int status = ServerTCPWrite ( unsigned int conversationHandle, void *dataPointer, unsigned int dataSize, unsigned int timeout); Purpose Writes data to a TCP client application. Parameters I...
Page 237 - RegisterTCPServer
TCP Library Chapter 7 LabWindows/CVI Standard Libraries 7-12 © National Instruments Corporation Return Value status integer Refer to error codes in Table 7-3. See Also RegisterTCPServer Error Conditions If an error condition occurs during a call to any of the functions in the LabWindows/CVI TCPLibra...
Page 238 - The Utility Library Function Panels
© National Instruments Corporation 8-1 LabWindows/CVI Standard Libraries Chapter 8Utility Library This chapter describes the functions in the LabWindows/CVI Utility Library. The UtilityLibrary contains functions that do not fit into any of the other LabWindows/CVI libraries. TheUtility Library Funct...
Page 239 - File Utilities
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-2 © National Instruments Corporation Table 8-1. The Utility Library Function Tree (Continued) File Utilities Delete File DeleteFile Rename File RenameFile Copy File CopyFile Get File Size GetFileSize Get File Date GetFileDate Set File Dat...
Page 241 - Launching Executables
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-4 © National Instruments Corporation Table 8-1. The Utility Library Function Tree (Continued) Launching Executables Launch Executable LaunchExecutable Extended Functions Launch Executable Extended LaunchExecutableEx Has Executable Termina...
Page 242 - Utility Library Function Reference; Beep; None
Chapter 8 Utility Library © National Instruments Corporation 8-5 LabWindows/CVI Standard Libraries • Standard Input/Output Window functions control various attributes of the StandardInput/Output Window. • Run-Time Error Reporting functions enable and disable the feature which breaks executionwhen a ...
Page 243 - Breakpoint
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-6 © National Instruments Corporation Breakpoint void Breakpoint ( void ); Purpose During execution of a program, a call to Breakpoint suspends program operation. While the program is suspended, you can inspect or modify variables, and use...
Page 244 - Cls; CopyFile
Chapter 8 Utility Library © National Instruments Corporation 8-7 LabWindows/CVI Standard Libraries Cls void Cls ( void ); Purpose In the LabWindows/CVI environment, this function clears the Standard I/O window. Parameters None Return Value None CopyFile int result = CopyFile ( char sourceFileName []...
Page 245 - CVILowLevelSupportDriverLoaded; loaded = CVILowLevelSupportDriverLoaded (
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-8 © National Instruments Corporation Parameter Discussion sourceFileName and targetFileName may contain wildcard characters ‘?’ and ‘*’. IfsourceFileName has wildcards, all matching files are copied. If targetFileName has wildcards,it wil...
Page 246 - DateStr; char; Delay
Chapter 8 Utility Library © National Instruments Corporation 8-9 LabWindows/CVI Standard Libraries Return Value loaded integer Indicates whether the LabWindows/CVI low-levelsupport driver was loaded at startup. Return Codes 1 Low-level support driver was loaded at startup. 0 Low-level support driver...
Page 247 - DeleteDir; DeleteFile
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-10 © National Instruments Corporation Parameter Input numberofSeconds double-precision Number of seconds to wait. Return Value None DeleteDir int result = DeleteDir ( char directoryName [] ); Purpose Deletes an existing directory. Paramet...
Page 248 - GetFirstFile; DisableBreakOnLibraryErrors
Chapter 8 Utility Library © National Instruments Corporation 8-11 LabWindows/CVI Standard Libraries Parameter Input fileName string File to delete. Return Value result integer Result of delete operation. Return Codes 0 Success. -1 File not found or directory in path not found. -3 General I/O error o...
Page 249 - Note: This function has been superseded by; DisableInterrupts; level support driver must be loaded.; Parameter; DisableTaskSwitching
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-12 © National Instruments Corporation You can use this function in conjunction with EnableBreakOnLibraryErrors to temporarily suppress the Break on Library Errors feature around a segment of code. It does notaffect the state of the Break ...
Page 250 - Disabling the Task List; Forcing Window to Cover Entire Screen; panel; Alternatives in Windows 3.1
Chapter 8 Utility Library © National Instruments Corporation 8-13 LabWindows/CVI Standard Libraries • The <Alt-Tab>, <Alt-Esc>, or <Ctrl-Esc> key combination under Windows 3.1 or Windows 95. • The Switch To item in the system menu under Windows 3.1. This function affects the behavi...
Page 251 - Alternatives in Windows 95; Preventing Interference With Real-Time Processing
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-14 © National Instruments Corporation your standalone application to be brought up in place of the Program Manager when Windowsboots. You can do this by changing the following line in your system.ini [boot] section. shell = progman.exe to...
Page 252 - Do not use the Standard I/O Window in your final application.; EnableBreakOnLibraryErrors; EnableBreakOnLibraryErrors (; to temporarily suppress the; EnableInterrupts
Chapter 8 Utility Library © National Instruments Corporation 8-15 LabWindows/CVI Standard Libraries • Do not use the Standard I/O Window in your final application. • If you use any of the built-in pop-ups in the User Interface Library, make the following calls. SetSystemPopupsAttribute (ATTR_MOVABLE...
Page 253 - EnableTaskSwitching
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-16 © National Instruments Corporation Note: For you to be able to use this function under Windows 95, the LabWindows/CVI low- level support driver must be loaded. Note: Under Windows NT, the EnableInterrupts and DisableInterrupts function...
Page 254 - for more information.; GetBreakOnLibraryErrors
Chapter 8 Utility Library © National Instruments Corporation 8-17 LabWindows/CVI Standard Libraries Return Value status integer Result of operation. Return Codes -1 Handle is invalid. 0 Executable is still running. 1 Executable has been terminated. Note: If you launch another LabWindows/CVI executab...
Page 255 - GetBreakOnProtectionErrors
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-18 © National Instruments Corporation GetBreakOnProtectionErrors int state = GetBreakOnProtectionErrors ( void ); Purpose This function returns the state of the break on protection errors feature. It returns a 1 if theoption is enabled, o...
Page 256 - Nnn; GetCurrentPlatform
Chapter 8 Utility Library © National Instruments Corporation 8-19 LabWindows/CVI Standard Libraries Return Codes Nnn Where N.nn is the LabWindows/CVI version. GetCurrentPlatform int platformCode = GetCurrentPlatform ( void ); Purpose This function returns a code representing the operating system und...
Page 257 - GetDir; GetDrive
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-20 © National Instruments Corporation GetDir int result = GetDir ( char currentDirectory [] ); Purpose Gets the current working directory on the default drive. Parameter Output currentDirectory string Current directory. Return Value resul...
Page 258 - GetExternalModuleAddr
Chapter 8 Utility Library © National Instruments Corporation 8-21 LabWindows/CVI Standard Libraries Return Value result integer Result of operation. Return Codes 0 Success. -1 Current directory is on a network drive that is not mapped to a local drive.(currentDriveNumber is set correctly, but number...
Page 259 - Undefined references.; LoadExternalModule; Example
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-22 © National Instruments Corporation Return Codes 0 Success. -1 Out of memory. -4 Invalid file format. -5 Undefined references. -8 Cannot open file. -9 Invalid module ID. -10 Identifier not defined globally in module. -25 DLL initializat...
Page 260 - GetFileAttrs
Chapter 8 Utility Library © National Instruments Corporation 8-23 LabWindows/CVI Standard Libraries GetFileAttrs int result = GetFileAttrs ( char fileName [] , int *read-only, int *system, int *hidden, int *archive); Note: Only available on the Windows version of LabWindows/CVI. Purpose Gets the fol...
Page 261 - GetFileDate
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-24 © National Instruments Corporation Parameter Discussion Each attribute parameter will contain one of the following values: 0—attribute is not set 1—attribute is set fileName may be the empty string ( "" ), in which case the att...
Page 262 - GetFileSize
Chapter 8 Utility Library © National Instruments Corporation 8-25 LabWindows/CVI Standard Libraries Return Codes 0 Success. -1 File not found or directory in path not found. -3 General I/O error occurred. -4 Insufficient memory to complete operation. -5 Invalid path (for example, c:filename in Windo...
Page 263 - GetFileTime
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-26 © National Instruments Corporation Return Codes 0 Success. -1 File not found or directory in path not found. -3 General I/O error occurred. -4 Insufficient memory to complete operation. -5 Invalid path (for example, c:filename in Windo...
Page 266 - GetFullPathFromProject
Chapter 8 Utility Library © National Instruments Corporation 8-29 LabWindows/CVI Standard Libraries Parameter Discussion searchPath may contain the wildcard characters '*' and '?'. Each attribute parameter can have one of the following values: 0— do not search for files with the attribute 1— search ...
Page 267 - GetInterruptState; GetKey
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-30 © National Instruments Corporation Using This Function This function is useful when your program needs to access a file in the project and you do notknow what directory the file is in. Example char *fileName; char fullPath[MAX_PATHNAME...
Page 268 - GetModuleDir
Chapter 8 Utility Library © National Instruments Corporation 8-31 LabWindows/CVI Standard Libraries Parameters None Return Value k integer Key code. Using This Function The values returned are the same as the key values used in the User Interface Library. See userint.h . Keystroke Return Value <b...
Page 270 - GetNextFile
Chapter 8 Utility Library © National Instruments Corporation 8-33 LabWindows/CVI Standard Libraries GetNextFile int result = GetNextFile ( char fileName [] ); Purpose Gets the next file found in the search starting with GetFirstFile . Parameters Output fileName string Next file found. Return Value r...
Page 271 - GetProjectDir
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-34 © National Instruments Corporation GetProjectDir int result = GetProjectDir ( char directoryName [] ); Purpose Gets the name of the directory containing the currently loaded project file. Parameters Output directoryName string Director...
Page 272 - GetStdioPort; GetStdioWindowOptions
Chapter 8 Utility Library © National Instruments Corporation 8-35 LabWindows/CVI Standard Libraries GetStdioPort void GetStdioPort ( int *stdioPort); Purpose Gets a value indicating the current destination for data written to the standard output (and thesource of data read from the standard input.) ...
Page 273 - GetStdioWindowPosition; GetStdioWindowPosition (
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-36 © National Instruments Corporation Parameters Output maxNumLines integer The maximum number of linesthat can be stored in the StandardInput/Output window. If thisamount is exceeded, lines arediscarded from the top. bringToFrontWhenModi...
Page 274 - GetStdioWindowSize; GetStdioWindowVisibility
Chapter 8 Utility Library © National Instruments Corporation 8-37 LabWindows/CVI Standard Libraries Parameters Output top integer The current distance, in pixels,from the top of client area of theStandard Input/Output windowto the top of the screen. left integer The current distance, in pixels,from ...
Page 275 - GetSystemDate
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-38 © National Instruments Corporation Parameters Output visible integer 1 = Standard I/O window isvisible. 0 = Standard I/O window is notvisible. GetSystemDate int status = GetSystemDate ( int *month, int *day, int *year); Note: This func...
Page 276 - GetSystemTime
Chapter 8 Utility Library © National Instruments Corporation 8-39 LabWindows/CVI Standard Libraries GetSystemTime int status = GetSystemTime( int *hours, int *minutes, int *seconds); Note: This function is only available on the Windows version of LabWindows/CVI. Purpose Obtains the system time in nu...
Page 277 - InitCVIRTE
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-40 © National Instruments Corporation Parameters Output visible integer 0, if window is to be hidden;1, if window is to be displayed. zoomState integer ATTR_NO_ZOOM —normal display; ATTR_MINIMIZEATTR_MAXIMIZE . Return Value None Example I...
Page 279 - included by; inp; inpw
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-42 © National Instruments Corporation /* your other DETACH code */ CloseCVIRTE (); } return 1; } Note: The prototypes for InitCVIRTE and CloseCVIRTE are in cvirte.h , which is included by utility.h . inp char byteRead = inp ( int portNumb...
Page 280 - InStandaloneExecutable; KeyHit
Chapter 8 Utility Library © National Instruments Corporation 8-43 LabWindows/CVI Standard Libraries Parameters Input portNumber integer The port. Return Value wordRead short Word read from port. InStandaloneExecutable int standalone = InStandaloneExecutable( void ); Purpose Returns a non-zero value ...
Page 281 - Called SetStdioPort to set the port to; LaunchExecutable
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-44 © National Instruments Corporation Return Codes 0 Key has not been pressed. 1 Key has been pressed. Using This Function The function returns 1 if a keystroke is available in the keyboard buffer, 0 otherwise. After akeystroke is availab...
Page 282 - vfork
Chapter 8 Utility Library © National Instruments Corporation 8-45 LabWindows/CVI Standard Libraries Refer to your DOS documentation for further help with command.com . DOS executables ( .exe , .com , and .bat files) use the settings in _default.pif (in your Windows directory) when they are running. ...
Page 283 - Return Codes under Microsoft Windows; PATH
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-46 © National Instruments Corporation Return Codes under Microsoft Windows 0 Command was successfully started. -1 System was out of memory, executable file was corrupt, or relocations were invalid. -3 File was not found. -4 Path was not f...
Page 284 - LaunchExecutableEx
Chapter 8 Utility Library © National Instruments Corporation 8-47 LabWindows/CVI Standard Libraries LaunchExecutableEx int result = LaunchExecutableEx ( char *fileName, int windowState, int *handle); Purpose LaunchExecutableEx performs the same operation as LaunchExecutable with the following extend...
Page 285 - Checking Termination of CVI Executables Under Windows 3.1
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-48 © National Instruments Corporation A handle can be passed to ExecutableHasTerminated and TerminateExecutable . When you no longer need the handle, you should call RetireExecutableHandle . When you do not want to obtain a handle, you ca...
Page 287 - LoadExternalModuleEx
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-50 © National Instruments Corporation Return Codes (Continued) -21 Could not load the DLL. -22 Could not find the DLL header file. -23 Could not load the DLL header file (out of memory or the file is corrupted). -24 Syntax error in the DL...
Page 289 - pathName
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-52 © National Instruments Corporation 3. If the file has not been found and its extension is .dll , LoadExternalModule searches for the file in the directories specified in the Windows LoadLibrary call. If it is a relative pathname with o...
Page 291 - MakeDir
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-54 © National Instruments Corporation command in the Build menu of the Project Window to create an object file containing the table.You must include this object file in the external compiler project you use to create the DLL. LoadExternal...
Page 292 - MakePathname
Chapter 8 Utility Library © National Instruments Corporation 8-55 LabWindows/CVI Standard Libraries Example /* make a new directory named \DATA\WAVEFORM on drive C /* /* assuming that C:\DATA does not exist */ MakeDir ("C:\\DATA"); MakeDir ("C:\\DATA\\WAVEFORM"); MakePathname void Ma...
Page 293 - outp; outpw
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-56 © National Instruments Corporation outp char byteWritten = outp( int portNumber, char byteToWrite); Note: This function is available only on the Windows versions of LabWindows/CVI. Purpose Writes a byte to a port. Note: For you to be a...
Page 294 - ReadFromPhysicalMemory
Chapter 8 Utility Library © National Instruments Corporation 8-57 LabWindows/CVI Standard Libraries ReadFromPhysicalMemory int status = ReadFromPhysicalMemory ( unsigned int physicalAddress, void *destinationBuffer, unsigned int numberOfBytes); Note: This function is available only on the Windows ve...
Page 295 - ReadFromPhysicalMemoryEx
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-58 © National Instruments Corporation ReadFromPhysicalMemoryEx int status = ReadFromPhysicalMemoryEx ( unsigned int physicalAddress, void * destinationBuffer, unsigned int numberOfBytes, int bytesAtATime); Note: This function is available...
Page 296 - ReleaseExternalModule
Chapter 8 Utility Library © National Instruments Corporation 8-59 LabWindows/CVI Standard Libraries ReleaseExternalModule int status = ReleaseExternalModule ( int moduleID); Purpose Decreases the reference count for a module loaded using LoadExternalModule . When LoadExternalModule is called success...
Page 297 - RenameFile
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-60 © National Instruments Corporation RenameFile int result = RenameFile ( char existingFileName [] , char newFileName [] ); Purpose Renames an existing file. Parameters Input existingFileName string Existing file name. newFileName string...
Page 298 - RetireExecutableHandle
Chapter 8 Utility Library © National Instruments Corporation 8-61 LabWindows/CVI Standard Libraries Under UNIX, if the arguments to RenameFile specify files on different file systems, RenameFile copies the source to the target and then deletes the source file. RetireExecutableHandle int status = Ret...
Page 299 - RunExternalModule
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-62 © National Instruments Corporation Return Value n long Result of the rounding operation. Example long n; n = round (1.2); /* result: 1L */ n = round (1.8); /* result: 2L */ n = round (1.5); /* result: 2L */ n = round (0.5); /* result: ...
Page 300 - returns. buffer is a character array in; which you can pass information to and from the module.; SetBreakOnLibraryErrors
Chapter 8 Utility Library © National Instruments Corporation 8-63 LabWindows/CVI Standard Libraries Parameter Discussion moduleID is the value LoadExternalModule returns. buffer is a character array in which you can pass information to and from the module. RunExternalModule requires that the module ...
Page 301 - SetBreakOnProtectionErrors
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-64 © National Instruments Corporation If debugging is disabled, this function has no effect. Run-time errors are never reported whendebugging is disabled. Parameters Input newState integer Pass a nonzero value to enable. Pass zero to disa...
Page 303 - SetDir; SetDrive
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-66 © National Instruments Corporation SetDir int result = SetDir ( char directoryName [] ); Purpose Sets the current working directory to the specified directory. Under Windows 3.1, this functioncan change the current working directory on...
Page 304 - SetFileAttrs
Chapter 8 Utility Library © National Instruments Corporation 8-67 LabWindows/CVI Standard Libraries Return Value result integer Result of operation. Return Codes 0 Success. -1 Invalid drive number. Using This Function The mapping between the drive number and the logical drive letter is 0 = A, 1 = B,...
Page 305 - SetFileDate
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-68 © National Instruments Corporation Return Value result return value Result of operation. Return Codes 0 Success. -1 One of the following errors occurred: • File not found.• Attribute cannot be changed. Parameter Discussion Each attribu...
Page 307 - SetFileTime
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-70 © National Instruments Corporation SetFileTime int result = SetFileTime ( char fileName [] , int hours, int minutes, int seconds); Purpose Sets the time of a file. Parameters Input fileName string File to set date. hours integer Hours ...
Page 308 - SetPersistentVariable; SetPersistentVariable (; value; SetStdioPort
Chapter 8 Utility Library © National Instruments Corporation 8-71 LabWindows/CVI Standard Libraries SetPersistentVariable void SetPersistentVariable ( int value); Purpose Lets you store an integer value across multiple builds and executions of your project in theLabWindows/CVI development environmen...
Page 309 - SetStdioWindowOptions
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-72 © National Instruments Corporation Parameters Input stdioPort integer CVI_STDIO_WINDOW (0) = the CVI Standard Input/Outputwindow. HOST_SYSTEM_STDIO (1) = the host system's standardoutput. Return Value status integer Indicates whether t...
Page 311 - SetStdioWindowPosition
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-74 © National Instruments Corporation showLineNumbers—In an executable, the default value is 0 ("do not show line numbers"). Inthe CVI Development System, the default value is the current state of the Line Numbers optionin the Vie...
Page 312 - SetStdioWindowSize
Chapter 8 Utility Library © National Instruments Corporation 8-75 LabWindows/CVI Standard Libraries Parameter Discussion To vertically center the Standard Input/Output window client area within the area of the screen,pass VAL_AUTO_CENTER as the top parameter. To horizontally center the Standard Inpu...
Page 313 - SetStdioWindowVisibility
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-76 © National Instruments Corporation SetStdioWindowVisibility void SetStdioWindowVisibility ( int visible); Purpose Either brings to the front or hides the Standard Input/Output window. Parameters Input visible integer 1 = Standard I/O w...
Page 314 - SetSystemTime
Chapter 8 Utility Library © National Instruments Corporation 8-77 LabWindows/CVI Standard Libraries SetSystemTime int status = SetSystemTime( int hours, int minutes, int seconds); Note: This function is only available on the Windows version of LabWindows/CVI. Under Windows NT, you must have system a...
Page 316 - SyncWait
Chapter 8 Utility Library © National Instruments Corporation 8-79 LabWindows/CVI Standard Libraries SyncWait void SyncWait ( double beginTime, double interval); Purpose Waits until the number of seconds indicated by interval have elapsed since beginTime. Parameters Input beginTime double-precision V...
Page 317 - WINDOWS
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-80 © National Instruments Corporation Parameters Input helpFile string Points to a string containing thehelp file that the Helpapplication is to display. command unsigned integer Specifies the type of helprequested. additionalLongData uns...
Page 318 - MAP
Chapter 8 Utility Library © National Instruments Corporation 8-81 LabWindows/CVI Standard Libraries HELP_CONTEXTPOPUP —Displays in a pop-up window a particular Help topic identified by a context number that has been defined in the [ MAP ] section of the .HPJ file. The main help window is not display...
Page 319 - TerminateExecutable
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-82 © National Instruments Corporation TerminateExecutable int status = TerminateExecutable ( int executableHandle); Purpose Attempts to terminate an executable if it has not already terminated. Under Windows the system terminates an execu...
Page 320 - Timer; resolution is 55 milliseconds.; The resolution on Sun Solaris is 1 millisecond.; TimeStr
Chapter 8 Utility Library © National Instruments Corporation 8-83 LabWindows/CVI Standard Libraries Timer double t = Timer ( void ); Purpose Returns the number of seconds that have elapsed since the first call to Timer , Delay , or SyncWait or the first operation on a timer control. The value is nev...
Page 321 - TruncateRealNumber
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-84 © National Instruments Corporation TruncateRealNumber double y = TruncateRealNumber ( double inputRealNumber); Purpose Truncates the fractional part of inputRealNumber and returns the result as a real number. Parameters Input inputReal...
Page 322 - WriteToPhysicalMemory
Chapter 8 Utility Library © National Instruments Corporation 8-85 LabWindows/CVI Standard Libraries Example int module_id; int status; char *pathname' pathname = "PROG.OBJ"; module_id = LoadExternalModule (pathname); if (module_id <0) FmtOut ("Unable to load %s\n", pathname); else...
Page 323 - WriteToPhysicalMemoryEx
Utility Library Chapter 8 LabWindows/CVI Standard Libraries 8-86 © National Instruments Corporation Return Value status integer Indicates whether the functionsucceeded. Return Codes 1 Success. 0 Failure reported by the operating system, or low-levelsupport driver not loaded. WriteToPhysicalMemoryEx ...
Page 325 - X Property Library Overview; The X Property Library Function Panels
© National Instruments Corporation 9-1 LabWindows/CVI Standard Libraries Chapter 9X Property Library _____________________________________________________________________________ This chapter describes the functions in the Lab/Windows CVI X Property Library. The XProperty Library contains functions ...
Page 326 - Accessing Remote Hosts; X Interclient Communication
X Property Library Chapter 9 LabWindows/CVI Standard Libraries 9-2 © National Instruments Corporation Table 9-1. The X Property Library Function Tree Accessing Remote Hosts Connect To X Server ConnectToXDisplay Disconnect From X Server DisconnectFromXDisplay Managing Property Types Create New Proper...
Page 327 - Property Handles and Types; Property Type; Communicating with Local Applications
Chapter 9 X Property Library © National Instruments Corporation 9-3 LabWindows/CVI Standard Libraries With the LabWindows/CVI X Property Library functions, you can connect to X displays andobtain the root window ID, read and write properties on windows, and monitor when specificproperties change. Pr...
Page 328 - Property Callback Functions
X Property Library Chapter 9 LabWindows/CVI Standard Libraries 9-4 © National Instruments Corporation not delete it, the property remains there indefinitely. Second, because there is only one rootwindow, there may be conflicts when multiple applications attempt to access the same properties. To over...
Page 329 - Constant Name
Chapter 9 X Property Library © National Instruments Corporation 9-5 LabWindows/CVI Standard Libraries Table 9-3. X Property Library Error Types and Descriptions Constant Name Value Description NoXErr 0 The function was successful. InvalidParamXErr -1 The value passed to one or more of the parameters...
Page 331 - Using the Library Outside of LabWindows/CVI; X Property Library Function Reference; ConnectToXDisplay
Chapter 9 X Property Library © National Instruments Corporation 9-7 LabWindows/CVI Standard Libraries Using the Library Outside of LabWindows/CVI You can use the LabWindows/CVI X Property Library in applications developed outside ofLabWindows/CVI. By linking your program with the library file libxpr...
Page 333 - CreateXProperty
Chapter 9 X Property Library © National Instruments Corporation 9-9 LabWindows/CVI Standard Libraries See Also Refer to the Xlib Programming Manual or to Xlib—C Language X Interface, MIT X ConsortiumStandard for more information about the XOpenDisplay and DefaultRootWindow functions. _______________...
Page 334 - Return Values; CreateXPropType
X Property Library Chapter 9 LabWindows/CVI Standard Libraries 9-10 © National Instruments Corporation Return Values The return value indicates the success or failure status of the function call. A negative valueindicates an error. The following table shows status values. NoXErr 0 The function was s...
Page 336 - unit of 1 and then explicitly perform byte swapping where needed.; DestroyXProperty
X Property Library Chapter 9 LabWindows/CVI Standard Libraries 9-12 © National Instruments Corporation Parameter Discussion Usually, you can use the expression sizeof ( TYPE ) for the size parameter, where TYPE is the C data type ( char , int , and others) used to store the property value. This valu...
Page 337 - DestroyXPropType
Chapter 9 X Property Library © National Instruments Corporation 9-13 LabWindows/CVI Standard Libraries Parameter Input property PropertyHandleX Handle to the property information to bedestroyed. This value must either be oneof the predefined property types or be avalue returned by CreateXPropType . ...
Page 338 - DisconnectFromXDisplay
X Property Library Chapter 9 LabWindows/CVI Standard Libraries 9-14 © National Instruments Corporation Return Values The return value indicates the success or failure status of the function call. A negative valueindicates an error. The following table shows status values. NoXErr 0 The function was s...
Page 339 - GetXPropErrorString
Chapter 9 X Property Library © National Instruments Corporation 9-15 LabWindows/CVI Standard Libraries See Also Refer to the Xlib Programming Manual or to Xlib—C Language X Interface, MIT X ConsortiumStandard for more information about the XCloseDisplay function. GetXPropErrorString char *message = ...
Page 340 - The propertyName pointer points to memory allocated by; GetXPropertyType
X Property Library Chapter 9 LabWindows/CVI Standard Libraries 9-16 © National Instruments Corporation Warning: The propertyName pointer points to memory allocated by CreateXProperty . You must not attempt to free this pointer or to change its contents. Return Values The return value indicates the s...
Page 341 - GetXPropTypeName; must not attempt to free this pointer or to change its contents.
Chapter 9 X Property Library © National Instruments Corporation 9-17 LabWindows/CVI Standard Libraries Return Values The return value indicates the success or failure status of the function call. A negative valueindicates an error. The following table shows status values. NoXErr 0 The function was s...
Page 342 - GetXPropTypeSize; -1 NULL was passed to the size parameter.
X Property Library Chapter 9 LabWindows/CVI Standard Libraries 9-18 © National Instruments Corporation See Also CreateXPropType GetXPropTypeSize PropLibXErrType status = GetXPropTypeSize ( PropTypeHandleX propertyType, unsigned int *size); Purpose Gets a property type size. This function returns the...
Page 343 - GetXPropTypeUnit; Get a property type unit.; NULL was passed to the unit parameter.
Chapter 9 X Property Library © National Instruments Corporation 9-19 LabWindows/CVI Standard Libraries GetXPropTypeUnit PropLibXErrType status = GetXPropTypeUnit ( PropTypeHandleX propertyType, unsigned int *unit); Purpose Get a property type unit. This function returns the unit associated with the ...
Page 344 - GetXWindowPropertyItem
X Property Library Chapter 9 LabWindows/CVI Standard Libraries 9-20 © National Instruments Corporation GetXWindowPropertyItem PropLibXErrType status = GetXWindowPropertyItem ( DisplayPtrX display, WindowX window, PropertyHandleX property, void *propertyItem); Purpose Get a single property item from ...
Page 346 - GetXWindowPropertyValue; numberofItemsRequested,; Get the value of a property on a window.
X Property Library Chapter 9 LabWindows/CVI Standard Libraries 9-22 © National Instruments Corporation See Also Refer to the Xlib Programming Manual or to Xlib—C Language X Interface, MIT X ConsortiumStandard for more information about the XGetWindowProperty function. GetXWindowPropertyValue PropLib...
Page 347 - DisplayPtrX
Chapter 9 X Property Library © National Instruments Corporation 9-23 LabWindows/CVI Standard Libraries Parameters Input display DisplayPtrX A pointer to the display of theX server to which the windowbelongs. window WindowX The window from which theproperty value is to be obtained. property PropertyH...
Page 349 - InstallXPropertyCallback; Install a property callback function.; Input display; unsigned integer
Chapter 9 X Property Library © National Instruments Corporation 9-25 LabWindows/CVI Standard Libraries See Also Refer to the Xlib Programming Manual or to Xlib—C Language X Interface, MIT X ConsortiumStandard for more information about the XGetWindowProperty function. InstallXPropertyCallback PropLi...
Page 351 - PutXWindowPropertyItem
Chapter 9 X Property Library © National Instruments Corporation 9-27 LabWindows/CVI Standard Libraries default root window of the display used by LabWindows/CVI. Use &CVIXHiddenWindow to specify the hidden window associated with your application. If numberofProperties is 0 or the propertyList va...
Page 353 - PutXWindowPropertyValue
Chapter 9 X Property Library © National Instruments Corporation 9-29 LabWindows/CVI Standard Libraries PutXWindowPropertyValue PropLibXErrType status = PutXWindowPropertyValue ( DisplayPtrX display, WindowX window, PropertyHandleX property, unsigned int numberofItems, int mode, void *propertyValue);...
Page 355 - RemoveXWindowProperty
Chapter 9 X Property Library © National Instruments Corporation 9-31 LabWindows/CVI Standard Libraries The following values are valid for the mode parameter: ReplaceXPropMode —Replace the existing property value with the new value. PrependXPropMode —Add the new property value to the beginning of the...
Page 357 - UninstallXPropertyCallback; status = UninstallXPropertyCallback; Uninstall a property callback function.; The function that was installed with; The function was successful.
Chapter 9 X Property Library © National Instruments Corporation 9-33 LabWindows/CVI Standard Libraries UninstallXPropertyCallback PropLibXErrType status = UninstallXPropertyCallback ( PropertyCallbackTypeX *callbackFunction); Purpose Uninstall a property callback function. After a callback function ...
Page 358 - Easy I/O for DAQ Library Function Overview; directory. These sample programs are discussed in the EASYIO; Advantages of Using the Easy I/O for DAQ Library; In the Data Acquisition Library you may have to use
© National Instruments Corporation 10-1 LabWindows/CVI Standard Libraries Chapter 10Easy I/O for DAQ Library This chapter describes the functions in the Easy I/O for DAQ Library. The Easy I/O for DAQLibrary Function Overview section contains general information about the functions, andguidelines and...
Page 359 - Limitations of Using the Easy I/O for DAQ Library; Analog Input
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-2 © National Instruments Corporation The Easy I/O for DAQ functions are device independent which means that you can use the samefunction on a Lab series board, an MIO board, an EISA-A2000 or SCXI module. Limitations of Using th...
Page 360 - Miscellaneous
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-3 LabWindows/CVI Standard Libraries Table 10-1. Easy I/O for DAQ Function Tree (Continued) Digital Input/Output Read From Digital Line ReadFromDigitalLine Read From Digital Port ReadFromDigitalPort Write To Digital Line WriteT...
Page 361 - Device Numbers; The syntax for the Channel String is as follows:
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-4 © National Instruments Corporation Device Numbers The first parameter to most of the Easy I/O for DAQ functions is the device number of the DAQdevice you want to use for the given operation. After you have followed the instal...
Page 362 - The SCXI channel syntax is as follows:
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-5 LabWindows/CVI Standard Libraries • If you are using a Lab-PC+, DAQCard-500/700/1200, DAQPad-1200, PC-LPM-16:These devices can only sample input channels in descending order, and you must end withchannel 0 ( "3:0" )....
Page 363 - Command Strings; AISampleChannels
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-6 © National Instruments Corporation Command Strings You can use command strings within the Channel String to set per-channel limits and aninterchannel sample rate. For example, "cmd hi 10.0 low -10.0; 7:4; cmd hi 5.0 low -...
Page 364 - Channel String for Analog Output Functions; , that you can view on screen and also print.; Valid Counters for the Counter/Timer Functions; Device Type
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-7 LabWindows/CVI Standard Libraries Channel String for Analog Output Functions The second parameter to most of the analog output functions is the channel string containing theanalog output channels that are to be driven. Refer...
Page 365 - Easy I/O for DAQ Function Reference; AIAcquireTriggeredWaveforms; channelString
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-8 © National Instruments Corporation Easy I/O for DAQ Function Reference This section describes each function in the Easy I/O for DAQ Library. The function descriptionsare arranged alphabetically. AIAcquireTriggeredWaveforms sh...
Page 368 - Trigger Level, and Trigger Source parameters of this function.
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-11 LabWindows/CVI Standard Libraries For example, if the A/D conversions (represented by x 's) on the waveform shown below are placed side-by-side, they represent one cycle of the waveform. _ _ _ x _ _ _ / \ / \ x \ / \ / x / ...
Page 369 - timeOutErr
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-12 © National Instruments Corporation When the A/D conversions are placed side-by-side, they represent the original waveform as if ithad been sampled at a high frequency. x x x x x x x edgeSlope specifies whether the trigger oc...
Page 370 - AIAcquireWaveforms
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-13 LabWindows/CVI Standard Libraries waveforms is an array containing the voltages acquired on the channels specified in thechannelString. The acquired voltages are placed into the array in the order specified byfillMode. This...
Page 371 - or
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-14 © National Instruments Corporation Return Value error shortinteger Refer to error codes in Table 10-5. Parameter Discussion channelString is the analog input channels that are to be sampled. Refer to the Channel Stringfor An...
Page 372 - AICheckAcquisition
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-15 LabWindows/CVI Standard Libraries AICheckAcquisition short error = AICheckAcquisition ( unsigned long taskID, unsigned long * scanBacklog); Purpose This function can be used to determine the backlog of scans that have been ...
Page 373 - AIReadAcquisition
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-16 © National Instruments Corporation AIReadAcquisition short error = AIReadAcquisition ( unsigned long taskID, long scanstoRead, unsigned short readMode, unsigned long * scanBacklog, short fillMode, double waveforms [] ); Purp...
Page 374 - AISampleChannel
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-17 LabWindows/CVI Standard Libraries from the internal circular buffer, where n is scanstoRead. Calling AIReadAcquisition in this mode resets the scanBacklog to zero. scanBacklog returns the backlog of scans that have been acq...
Page 376 - AIStartAcquisition
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-19 LabWindows/CVI Standard Libraries AIStartAcquisition short error = AIStartAcquisition ( short device, char channelString [] , int bufferSize, double scansPerSecond, double highLimitVolts, double lowLimitVolts, double * actu...
Page 377 - AOClearWaveforms; short; AOGenerateWaveforms
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-20 © National Instruments Corporation AOClearWaveforms short error = AOClearWaveforms ( unsigned long taskID); Purpose This function clears the waveforms generated by AOGenerateWaveforms when you passed 0 for its Iterations par...
Page 379 - AOUpdateChannel; singleChannel; double
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-22 © National Instruments Corporation updatesPerChannel is the number of D/A conversions that compose a waveform for a particularchannel. If updatesPerChannel is 10, then each waveform is composed of 10 elements from thewavefor...
Page 380 - AOUpdateChannels
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-23 LabWindows/CVI Standard Libraries Parameters Input device short integer Assigned by configuration utility. singleChannel string The analog output channel to which the voltage areapplied. voltage double The voltage that is a...
Page 381 - then; ContinuousPulseGenConfig; counter; You can also call the
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-24 © National Instruments Corporation Parameter Discussion channelString is the analog output channels to which the voltages are applied. Refer to theChannel String for Analog Output Functions subsection of the Easy I/O for DAQ...
Page 382 - CounterStart
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-25 LabWindows/CVI Standard Libraries Parameters Input device shortinteger Assigned by configuration utility. counter string The counter to be used for the counting operation. frequency double The desired repetition rate of the...
Page 383 - CounterEventOrTimeConfig
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-26 © National Instruments Corporation gateMode specifies how the signal on the counter's GATE pin is used. The options are: • UNGATED_SOFTWARE_START —ignore the gate signal and start when CounterStart is called. • COUNT_WHILE_G...
Page 385 - If you use; Valid internal timebase frequencies are:
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-28 © National Instruments Corporation • If you use TWO_COUNTERS , counter+1 is cascaded with the specified counter. Counter+1 is defined as shown in Table 10-3. Table 10-3. Definition of Am 9513: Counter +1 counter counter+1 1 ...
Page 386 - CounterMeasureFrequency
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-29 LabWindows/CVI Standard Libraries sourceEdge is the edge of the counter source or timebase signal on which it increments, and thisparameter accepts the following attributes: • COUNT_ON_RISING_EDGE • COUNT_ON_FALLING_EDGE ga...
Page 389 - CounterRead
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-32 © National Instruments Corporation Return Value error shortinteger Refer to error codes in Table 10-5. Parameter Discussion counter is the counter to be used for the counting operation. The valid counters are shown inTable 1...
Page 391 - CounterStop; Stops a count operation immediately.; DelayedPulseGenConfig
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-34 © National Instruments Corporation CounterStop short error = CounterStop ( unsigned long taskID); Purpose Stops a count operation immediately. Parameters Input taskID unsignedlong integer The reference number assigned to the...
Page 393 - timebaseSource is
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-36 © National Instruments Corporation • pulseWidth is the desired duration of the pulse (phase 2) after the delay • The unit is seconds if timebaseSource is USE_INTERNAL_TIMEBASE and cycles if timebaseSource is USE_COUNTER_SOUR...
Page 394 - FrequencyDividerConfig; and a pulsed output, an output; If gateMode is not
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-37 LabWindows/CVI Standard Libraries FrequencyDividerConfig short error = FrequencyDividerConfig ( short device, char counter [] , double sourceTimebase, double timebaseDivisor, unsigned short gateMode, unsigned short outputBe...
Page 397 - GetAILimitsOfChannel
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-40 © National Instruments Corporation GetAILimitsOfChannel short error = GetAILimitsOfChannel ( short device, char channelString [] , char singleChannel [] , double initialHighLimitVolts, double initialLowLimitVolts, double * h...
Page 398 - GetChannelIndices
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-41 LabWindows/CVI Standard Libraries initialHighLimitVolts specifies the maximum voltage that is measured for all channels in thechannel string listed before a command string that specifies a new high limit. For the followingc...
Page 399 - GetChannelNameFromIndex
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-42 © National Instruments Corporation Parameters Input device short integer Assigned by configuration utility. channelString string The analog channel string. channelSubString string A sub-string of the channelString. channelTy...
Page 400 - GetDAQErrorString
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-43 LabWindows/CVI Standard Libraries Parameters Input device short integer Assigned by configuration utility. channelString string Analog input channels that are to be sampled. index long integer The index of a particular chan...
Page 401 - GetNumChannels
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-44 © National Instruments Corporation GetNumChannels short error = GetNumChannels ( short device, char channelString [] , short channelType, unsigned long * numberOfChannels); Purpose Determines the number of channels contained...
Page 402 - ICounterControl
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-45 LabWindows/CVI Standard Libraries If you acquire data in "grouped by scan" mode, you need to reorder the array into "grouped bychannel" mode before it can be passed to graph plotting functions, analysis func...
Page 404 - PlotLastAIWaveformsPopup
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-47 LabWindows/CVI Standard Libraries • 5: I_HARDWARE_TRIGGERED_STROBE —similar to mode 4, except that a rising edge at the gate input triggers the count to start. • 6: I_READ —read the counter and return the value in the readV...
Page 405 - PulseWidthOrPeriodMeasConfig
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-48 © National Instruments Corporation PulseWidthOrPeriodMeasConfig short error = PulseWidthOrPeriodMeasConfig ( short device, char counter [] , unsigned short typeOfMeasurement, double sourceTimebase, unsigned long * taskID); P...
Page 406 - ReadFromDigitalLine; portNumber
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-49 LabWindows/CVI Standard Libraries Parameter Discussion typeOfMeasurement identifies the type of pulse width or period measurement to make. Thisparameter accepts the following attributes: • MEASURE_HIGH_PULSE_WIDTH —measure ...
Page 408 - ReadFromDigitalPort
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-51 LabWindows/CVI Standard Libraries • The portWidth for the 8255-based digital I/O ports (including all digital ports on Labboards, SCXI-1200, DAQPad-1200, DAQCard-1200, DIO-24, DIO-32F, DIO-96, andAT-MIO-16DE-10/AT-MIO-16D p...
Page 409 - short integer; is the chassis ID and
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-52 © National Instruments Corporation Return Value error short integer Refer to error codes in Table 10-5. Parameter Discussion portNumber specifies the digital port this function configures. A portNumber value of 0 signifies p...
Page 410 - SetEasyIOMultitaskingMode
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-53 LabWindows/CVI Standard Libraries SetEasyIOMultitaskingMode void SetEasyIOMultitaskingMode ( int multitaskingMode); Purpose By default, if you call the non-timed Easy I/O for DAQ functions repetitively, these functions dono...
Page 412 - WriteToDigitalPort
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-55 LabWindows/CVI Standard Libraries • The portWidth for the 8255-based digital I/O ports (including all digital ports on Labboards, SCXI-1200, DAQPad-1200, DAQCard-1200, DIO-24, DIO-32F, DIO-96, andAT-MIO-16DE-10/AT-MIO-16D p...
Page 416 - oldDriverErr The driver is out of date.
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-59 LabWindows/CVI Standard Libraries Table 10-5. Easy I/O for DAQ Error Codes (Continued) -10091 badIterationsErr The analog output buffer iterations count is invalid. It must be 0(for indefinite iterations) or 1. -10100 badPo...
Page 418 - noIntAvailErr No interrupt level is available for use.
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-61 LabWindows/CVI Standard Libraries Table 10-5. Easy I/O for DAQ Error Codes (Continued) -10414 reservedPinErr Selected signal indicates a pin reserved by NI-DAQ. You cannotconfigure this pin yourself. -10440 sysOwnedRsrcErr ...
Page 419 - notArmedErr The specified resource is not armed.
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-62 © National Instruments Corporation Table 10-5. Easy I/O for DAQ Error Codes (Continued) -10457 badDMAGroupErr DMA cannot be configured for the specified group because it istoo small, too large, or misaligned. Consult the use...
Page 420 - postTrigErr No posttrigger source has been assigned.
Chapter 10 Easy I/O for DAQ Library © National Instruments Corporation 10-63 LabWindows/CVI Standard Libraries Table 10-5. Easy I/O for DAQ Error Codes (Continued) -10614 badGroupDirErr The specified group does not support the specified transferdirection. -10615 masterClkErr The clock configuration ...
Page 421 - DMAnotAllowedErr You must use interrupts. DMA does not work.
Easy I/O for DAQ Library Chapter 10 LabWindows/CVI Standard Libraries 10-64 © National Instruments Corporation Table 10-5. Easy I/O for DAQ Error Codes (Continued) -10684 badChanInputModeErr All channels of this device must have the same inputrange. -10685 clkExceedsBrdsMaxConvRate The clock rate se...
Page 424 - Electronic Services; Bulletin Board Support
© National Instruments Corporation A-1 LabWindows/CVI Standard Libraries Appendix ACustomer Communication For your convenience, this appendix contains forms to help you gather the information necessaryto help us solve technical problems you might have as well as a form you can use to comment onthe p...
Page 425 - FTP Support; Fax and Telephone Support; Telephone
Customer Communication Appendix A LabWindows/CVI Standard Libraries A-2 © National Instruments Corporation FTP Support To access our FTP site, log on to our Internet host, ftp.natinst.com , as anonymous and use your Internet address, such as [email protected] , as your password. The support file...
Page 426 - Technical Support Form
Technical Support Form Photocopy this form and update it each time you make changes to your software or hardware, and use the completedcopy of this form as a reference for your current configuration. Completing this form accurately before contactingNational Instruments for technical support helps ou...
Page 427 - Hardware and Software Configuration Form; National Instruments Products
Hardware and Software Configuration Form Record the settings and revisions of your hardware and software on the line to the right of each item. Complete anew copy of this form each time you revise your software or hardware configuration, and use this form as areference for your current configuration...
Page 428 - Documentation Comment Form
Documentation Comment Form National Instruments encourages you to comment on the documentation supplied with our products. Thisinformation helps us provide quality products to meet your needs. Title: LabWindows ® /CVI Standard Libraries Reference Manual Edition Date: July 1996 Part Number: 320682C-0...
Page 429 - Prefix; AC
© National Instruments Corporation G-1 LabWindows/CVI Standard Libraries Glossary Prefix Meaning Value n- nano- 10 -9 µ - micro- 10 -6 m- milli- 10 -3 k- kilo- 10 3 M- mega- 10 6 Numbers/Symbols 1D One-dimensional. 2D Two-dimensional. A A Analog input. A/D Analog-to-digital. AC Alternating current. ...
Page 433 - SetAxRange
Glossary © National Instruments Corporation G-5 LabWindows/CVI Standard Libraries K KB Kilobytes of memory. kS 1,000 samples. ksamples 1,000 samples. L LSB Least significant bit. M manual scaling Where SetAxRange is called to explicitly set the maximum and minimum X and Y values. MB Megabytes of mem...
Page 436 - Index
© National Instruments Corporation I-1 LabWindows/CVI Standard Libraries Index Numbers/Symbols 1D array functions. See one-dimensional array operation functions. 1D complex operation functions. See one- dimensional complex operation functions. 2D array functions. See two-dimensional array operation ...
Page 438 - TCP Library functions
Index © National Instruments Corporation I-3 LabWindows/CVI Standard Libraries B Beep function, 8-5board control functions, GPIB, 4-7board control functions, GPIB Library, 4-3break on library error functions DisableBreakOnLibraryErrors, 8-11 to 8-12 EnableBreakOnLibraryErrors, 8-15GetBreakOnLibraryE...
Page 439 - data acquisition functions. See Easy I/O for
Index LabWindows/CVI Standard Libraries I-4 © National Instruments Corporation CxRecip, 3-13 to 3-14CxSub, 3-14CxSub1D, 3-15ToPolar, 3-32 to 3-33ToPolar1D, 3-33 to 3-34ToRect, 3-34 to 3-35ToRect1D, 3-35 ComRd function, 5-11ComRdByte function, 5-12ComRdTerm function, 5-12 to 5-13ComSetEscape function...
Page 441 - Easy I/O for DAQ Library
Index LabWindows/CVI Standard Libraries I-6 © National Instruments Corporation DisconnectTCPClient function, 7-7Div1D function, 3-16 to 3-17Div2D function, 3-17 to 3-18documentation conventions used in manual, xixLabWindows/CVI documentation set, xxorganization of manual, xvii-xviiirelated documenta...
Page 442 - error conditions
Index © National Instruments Corporation I-7 LabWindows/CVI Standard Libraries error conditions Analysis Library functions, 3-37DDE Library functions, 6-23 to 6-24Easy I/O for DAQ Library, 10-57 to 10-66 RS-232 Library functions, 5-36 to 5-37TCP Library functions, 7-12 Error control, GPIB, 4-6Error ...
Page 444 - global variables. See also status functions.
Index © National Instruments Corporation I-9 LabWindows/CVI Standard Libraries integer modifiers (%i, %d, %x, %o, %c), 2-35 to 2-37 string modifiers (%s), 2-38 to 2-39 FrequencyDividerConfig function, 10-37 to 10-39 G gender changer, 5-6GetAILimitsOfChannel function, 10-40 to 10-41 GetAnalysisErrorS...
Page 445 - port I/O utility functions
Index LabWindows/CVI Standard Libraries I-10 © National Instruments Corporation hardware interrupts and autopolling, 4-8 to 4-9 overview, 4-1platform and board considerations, 4-10 to 4-11 read and write termination, 4-9status and error controls, 4-6timeouts, 4-9Windows 95 support, 4-10 to 4-11 comp...
Page 446 - keyboard utility functions
Index © National Instruments Corporation I-11 LabWindows/CVI Standard Libraries hardware interrupts and autopolling, 4-8 to 4-9 InvMatrix function, 3-20 to 3-21 K keyboard utility functions GetKey, 8-30 to 8-31KeyHit, 8-43 to 8-44 L LaunchExecutable function, 8-44 to 8-46LaunchExecutableEx function,...
Page 448 - RQS events, and auto serial polling
Index © National Instruments Corporation I-13 LabWindows/CVI Standard Libraries R read termination, GPIB, 4-9ReadFile function, 2-22 to 2-23ReadFromDigitalLine function, 10-49 to 10-51 ReadFromDigitalPort function, 10-51 to 10-52 ReadFromPhysicalMemory function, 8-57ReadFromPhysicalMemoryEx function...
Page 450 - SRQI event, and auto serial polling
Index © National Instruments Corporation I-15 LabWindows/CVI Standard Libraries SetStdioWindowOptions function, 8-72 to 8-74 SetStdioWindowPosition function, 8-74 to 8-75 SetStdioWindowSize function, 8-75SetStdioWindowVisibility function, 8-76SetSystemDate function, 8-76SetSystemTime function, 8-77S...
Page 454 - XModem file transfer functions
Index © National Instruments Corporation I-19 LabWindows/CVI Standard Libraries PutXWindowPropertyValue, 9-29 to 9-31 RemoveXWindowProperty, 9-31 to 9-32 UninstallXPropertyCallback, 9-4, 9-33void HandlePropertyNotifyEvent, 9-7void_InitXPropertyLib, 9-7 function tree (table), 9-2hidden window, 9-3ove...