Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Labview Code Interface Reference Manual.pdf
Скачиваний:
33
Добавлен:
29.05.2015
Размер:
1.13 Mб
Скачать

Chapter 5 Manager Overview

The second line creates a block of memory in the data space that is large enough to hold a single int32. DSNewHandle places the address of the memory block as an entry in the master pointer list and returns the address of the master pointer entry. Finally, this line sets myInt32H to refer to the master pointer.

The third line places the value 5 in the memory location to which myInt32H refers. Because myInt32H is a handle, you use the * operator twice to get to the data.

The fourth line sets x equal to the value referenced by myInt32H plus 7.

Finally, the last line frees the handle.

This example shows only the simplest aspects of how to work with pointers and handles in C. Other examples throughout this manual show different aspects of using pointers and handles. Refer to a C manual for a list of other operators that you can use with pointers and a more detailed discussion of how to work with pointers.

Reference to the Memory Manager

See the Online Reference for descriptions of the routines used for managing memory in external code segments of LabVIEW. For every function, if XX is AZ, the referenced handle, pointer, or block of memory is in the application zone. If XX is DS, the referenced handle, pointer, or block of memory is in the data space zone.

Memory Manager Data Structures

The memory manager defines generic handle and pointer data types as follows.

typedef uChar *Ptr;

typedef uChar **UHandle;

File Manager

This section describes the file manager, a set of platform-independent routines for creating and manipulating files and directories.

LabVIEW Code Interface Reference Manual

5-12

© National Instruments Corporation

Chapter 5 Manager Overview

Note: For descriptions of specific file manager functions, see the Function and VI Reference topic in LabVIEW’s Online Reference, or the Code Interface Node Reference online manual.

Introduction

The file manager supports routines for opening and creating files, reading data from and writing data to files, and closing files. In addition, with these routines you can manipulate the end-of-file mark of a file and position the current read or write mark to an arbitrary position in the file. With other file routines you can move, copy, and rename files, determine and set file characteristics and delete files.

The file manager contains a number of routines for directories. With these routines you can create and delete directories. You can also determine and set directory characteristics and obtain a list of a directory's contents.

LabVIEW supports concurrent access to the same file, so you can have a file open for both reading and writing simultaneously. When you open a file, you can indicate whether you want the file to be read from and written to concurrently. You can also lock a range of the file, if you need to ensure that a range is nonvolatile at a given time.

Finally, the file manager provides many routines for manipulating paths (short for pathnames) in a platform-independent manner. The file manager supports the creation of path descriptions, which are either relative to a specific location or absolute (the full path). With file manager routines you can create and compare paths, determine characteristics of paths, and convert a path between platform-specific descriptions and the platform-independent form.

Identifying Files and Directories

When you perform operations on files and directories, you need to identify the target of the operation. The platforms that LabVIEW supports use a hierarchical file system, meaning that files are stored in directories, possibly nested several levels deep. These file systems support the connection of multiple discrete storage media, called volumes. For example, DOS-based systems support multiple drives connected to the system. For most of these file systems, you must include the volume name to completely specify the location of a file. On other systems, such as UNIX, you do not specify the volume name

© National Instruments Corporation

5-13

LabVIEW Code Interface Reference Manual

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]