Chapter 6 Building Multiplatform Applications
LabWindows/CVI Programmer Reference Manual 6-2
©
National Instruments Corporation
Low-Level I/O Functions section in Chapter1, LabWindows/CVI Compiler, of this manual,
for more information on how to use system library calls.
Under UNIX, the low-level I/O functions open, close, read, write, lseek, and eof are
available in the UNIX C library. Refer to the Using the Low-Level I/O Functions section
Chapter 1, LabWindows/CVI Compiler, of this manual, for more information on how to use
UNIX C low-level functions. These functions are portable to Windows if you include
lowlvlio.h in your Windows application.
In general, the ANSI C, User Interface, Analysis, Formatting and I/O, Utility, GPIB, VXI,
RS-232, and TCP libraries are portable across platforms. However, a few functions are not
multi-platform. The majority of these functions are in the Utility Library. The documentation
and function panels for the non-portable functions contain notes that list the platforms to
which they apply.
Only LabWindows/CVI for Windows has DDE, Data Acquisition, and Easy I/O for DAQ
libraries. The X Property Library is available only under UNIX. The ActiveX Automation
Library is available only under Windows 95/NT.
Although LabWindows/CVI provides the TCP Library on all platforms, you are responsible
for ensuring that the system has hardware and software support for the TCP server.
Various processor architectures store integers and floating point numbers in different byte
order. To circumvent these inconsistencies, us e the [o] modifier in the Formatting and I/O
Library to describe the byte ordering of device data. In a Fmt/Scan function, use the [o]
modifier to describe the byte ordering for the buffer that contains the raw device data. Do no t
use the [o] modifier on the buffer that holds the data in the byte ordering of the host
processor. For example, if you use a GPIB instrument that sends two-byte binary data in Intel
byte order, use the following code:
short instr_buf[100];
short prog_buf[100];
status = ibrd (ud, instr_buf, 200);
Scan (instr_buf, "%100d[b2o01]>%100d[b2]", prog_buf);
If you use a GPIB instrument that sends two-byte binary data in Motorola byte order, use
Scan as shown in the following example:
Scan (instr_buf, "%100d[b2o10]>%100d[b2]", prog_buf);
In either case, use the [o] modifier only on the buffer that contains the raw data from the
instrument (instr_buf). LabWindows/CVI ensures that the program buffer (prog_buf)
uses the proper byte order for the host processor. For a full description of the [o] modifier,
refer to Chapter 2, Formatting and I/O Library, of the LabWindows/CVI Standard Libraries
Reference Manual.
00ProRef.book : 06chap06.fm Page 2 Monday, March 9, 1998 3:23 PM