---
title: 全变量模式数据读取
description: "char类型全变量模式数据读取。"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpckit/devg/userg_hyperio_0078.html
sourcePath: /source/zh/kunpenghpcs/hpckit/devg/userg_hyperio_0078.html
indexId: 0237fbe447324f268b9527b8c1805e215e3b6bce8f31d665286b106af5fccef058
---
# 全变量模式数据读取

#### 函数定义

char类型全变量模式数据读取。

int ncmpi_get_var_text_all(int fileId, int varId, char *buf)


#### 参数

| 参数名 | 描述 | 取值范围 | 输入/输出 |
| --- | --- | --- | --- |
| fileId | 文件ID | 非负整数 | 输入 |
| varId | variable ID | 非负整数 | 输入 |
| \*buf | 指向读取数据的指针 | 非空 | 输出 |


#### 返回值

- 成功：返回NC_NOERR。
- 失败：返回错误码。


#### 错误码

| 错误码 | 描述 |
| --- | --- |
| NC\_EBADID | 无效ncid |
| NC\_ENOTINDEP | 在集合数据模式下尝试独立I/O操作 |
| NC\_EINVALCOORDS | 指定的索引超出了指定变量的秩的范围 |
| NC\_ENOTVAR | 无效的varid |
