Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Using External Code in LabVIEW.pdf
Скачиваний:
48
Добавлен:
29.05.2015
Размер:
1.85 Mб
Скачать

Chapter 6 Function Descriptions

AZPtrToHand/DSPtrToHand

MgErr AZPtrToHand(p, hp, size);

MgErr DSPtrToHand(p, hp, size);

Purpose

Creates a new handle of size bytes and copies size bytes from the address referenced by p to the handle.

Parameters

Name

Type

Description

 

 

 

 

 

 

p

UPtr

Source of data you want to copy to the handle

 

 

pointed to by hp.

 

 

 

hp

UHandle

Pointer to handle you want to duplicate. A

 

 

pointer to the resulting handle is returned in

 

 

this parameter. Refer to the Pointers as

 

 

Parameters section in Chapter 3, CINs, for

 

 

more information about using this parameter.

 

 

 

size

int32

Number of bytes to copy from p to the new

 

 

handle.

 

 

 

Return Value

mgErr, which can contain the following errors:

NoErr

No error.

MFullErr

Not enough memory to perform the operation.

Using External Code in LabVIEW

6-30

www.ni.com

Chapter 6 Function Descriptions

AZPtrToXHand/DSPtrToXHand

MgErr AZPtrToXHand(p, h, size);

MgErr DSPtrToXHand(p, h, size);

Purpose

Copies size bytes from the address referenced by p to the existing handle h, resizing h, if necessary, to hold the results.

Parameters

Name

Type

Description

 

 

 

 

 

 

p

UPtr

Source of data you want to copy to the handle

 

 

h.

 

 

 

h

UHandle

Destination handle.

 

 

 

size

int32

Number of bytes to copy from p to the

 

 

existing handle.

 

 

 

Return Value

mgErr, which can contain the following errors:

NoErr

No error.

MFullErr

Not enough memory to perform the operation.

mZoneErr

Handle or pointer not in specified zone.

© National Instruments Corporation

6-31

Using External Code in LabVIEW

Chapter 6 Function Descriptions

AZRecoverHandle/DSRecoverHandle

UHandle AZRecoverHandle(p);

UHandle DSRecoverHandle(p);

Purpose

Given a pointer to a block of memory that was originally declared as a handle, this function returns a handle to the block of memory.

This function is useful when you have the address of a block of memory that you know is a handle, and you need to get a true handle to the block of memory.

Parameters

Name

Type

Description

 

 

 

 

 

 

p

UPtr

Pointer to a relocatable block of memory.

 

 

 

Return Value

A handle to the block of memory to which p refers. If an error occurs, this function returns

NULL.

Using External Code in LabVIEW

6-32

www.ni.com

Chapter 6 Function Descriptions

AZSetHandleSize/DSSetHandleSize

MgErr AZSetHandleSize(h, size);

MgErr DSSetHandleSize(h, size);

Purpose

Changes the size of the block of memory referenced by the specified handle.

While LabVIEW arrays are stored in DS handles, do not use this function to resize array handles. Many platforms have memory alignment requirements that make it difficult to determine the correct size for the resulting array. Instead, use either NumericArrayResize or SetCINArraySize, described in the Resizing Arrays and Strings section in Chapter 4, Programming Issues for CINs. Do not use these functions on a locked handle.

Parameters

Name

Type

Description

 

 

 

 

 

 

h

UHandle

Handle you want to resize.

 

 

 

size

int32

New size, in bytes, of the handle.

 

 

 

Return Value

mgErr, which can contain the following errors:

NoErr

No error.

MFullErr

Not enough memory to perform the operation.

mZoneErr

Handle or pointer not in specified zone.

© National Instruments Corporation

6-33

Using External Code in LabVIEW

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