Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

fopen (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info
Download Help (Windows Only)

Owning Class: support

Requires: MathScript RT Module

Syntax

fid = fopen('all')

fid = fopen(filename)

fid = fopen(filename, mode)

Description

Opens a file.

Details

Examples

Inputs

Name Description
'all' Returns the specifiers for all open files.
filename Specifies the path to the file you want to open. If filename is a relative path, LabVIEW searches for the file in the current directory. filename is a string.
mode Specifies how to open the file. mode is a string that accepts the following values.

'a' Opens an existing file as write-only or creates a new file. LabVIEW appends new data to the end of the existing file.
'a+' Opens an existing file as read-write or creates a new file. LabVIEW appends new data to the end of the existing file.
'r' (default) Opens an existing file as read-only.
'r+' Opens an existing file as read-write.
'w' Opens an existing file as write-only or creates a new file. LabVIEW discards the contents of the existing file.
'w+' Opens an existing file as read-write or creates a new file. LabVIEW discards the contents of the existing file.

Outputs

Name Description
fid Returns an identifier for the file you opened. You can use fid to specify the file you want to use with the fread or fwrite functions. fid is an integer. If you specify fopen('all'), fid returns the identifiers for all open files as a vector of integers.

Details

If you use this function in a stand-alone application or shared library and filename is a relative path, LabVIEW searches for the file in the path where you installed the application or shared library. (Real-Time Module) If you deploy this function to an RT target and filename is a relative path, LabVIEW searches for the file in the path returned by the Default Data Directory VI.

The following table lists the support characteristics of this function.

Supported in the LabVIEW Run-Time Engine Yes
Supported on RT targets Yes
Suitable for bounded execution times on RT No (affects entire script)

Examples

fid = fopen('Test.m');
fclose(fid);

Related Topics

fclose
fread
fseek
fwrite


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit