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

Chapter 6 Function Descriptions

FAddPath

MgErr FAddPath(basePath, relPath, newPath);FAddPath

Purpose

Creates an absolute path by appending a relative path to an absolute path. You can pass the same path variable for the new path that you use for basePath or relPath. Therefore, you can call this function in the following three ways:

FAddPath(basePath, relPath, newPath);

/* the new path is returned in a third path variable */

FAddPath(path, relPath, path);

/* the new path writes over the old base path */

FAddPath(basepath, path, path);

/* the new path writes over the old relative path */

Parameters

Name

Type

Description

 

 

 

 

 

 

basePath

Path

Absolute path to which you want to append a

 

 

relative path.

 

 

 

relPath

Path

Relative path you want to append to the

 

 

existing base path.

 

 

 

newPath

Path

Path returned by FAddPath.

 

 

 

Return Value

mgErr, which can contain the following errors:

mgArgErr

A bad argument was passed to the function. Verify the path.

mFullErr

Insufficient memory.

Using External Code in LabVIEW

6-50

www.ni.com

Chapter 6 Function Descriptions

FAppendName

MgErr FAppendName(path, name);

Purpose

Appends a file or directory name to an existing path.

Parameters

Name

Type

Description

 

 

 

 

 

 

path

Path

Base path to which you want to append a new

 

 

file or directory name. FAppendName returns

 

 

the resulting path in this parameter.

 

 

 

name

PStr

File or directory name you want to append to

 

 

the existing path.

 

 

 

Return Value

mgErr, which can contain the following errors:

mgArgErr

A bad argument was passed to the function. Verify the path.

mFullErr

Insufficient memory.

© National Instruments Corporation

6-51

Using External Code in LabVIEW

Chapter 6 Function Descriptions

FAppPath

MgErr FAppPath(p);

Purpose

Indicates the path to the LabVIEW application currently running.

Parameters

Name

Type

Description

 

 

 

 

 

 

p

Path

Path in which FAppPath stores the path to

 

 

the current application. p must already be an

 

 

allocated path.

 

 

 

Return Value

mgErr, which can contain the following errors:

mgArgErr

A bad argument was passed to the function. Verify the path.

mFullErr

Insufficient memory.

FNotFound

File not found.

FIOErr

Unspecified I/O error.

Using External Code in LabVIEW

6-52

www.ni.com

Chapter 6 Function Descriptions

FArrToPath

MgErr FArrToPath(arr, relative, path);

Purpose

Converts a one-dimensional LabVIEW array of strings to a path of the type specified by relative. Each string in the array is converted in order into a component name of the resulting path.

If no error occurs, path is set to a path whose component names are the strings in arr. If an error occurs, path is set to the canonical invalid path.

Parameters

Name

Type

Description

 

 

 

 

 

 

arr

UHandle

DS handle containing the array of strings you

 

 

want to convert to a path.

 

 

 

relative

Bool32

If TRUE, the resulting path is relative.

 

 

Otherwise, the resulting path is absolute.

 

 

 

path

Path

Path where FArrToPath stores the resulting

 

 

path. This path must already have been

 

 

allocated.

 

 

 

Return Value

mgErr, which can contain the following errors:

mgArgErr

A bad argument was passed to the function. Verify the path.

mFullErr

Insufficient memory.

© National Instruments Corporation

6-53

Using External Code in LabVIEW

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