| libvkdaq VKINGING 数据采集库 API 文档 |

载入中...
搜索中...
未找到
函数
创建DAC通道
libvkdaq函数接口 » 通道配置

## 函数
int32_t | VkDaqCreateAOVoltageChan (const char *task, const char *chans, const char *reserved1, double minVal, double maxVal, int32_t units, const char *reserved2)
| 创建DAC通道

## 详细描述

## 函数说明

## ◆ VkDaqCreateAOVoltageChan()

int32_t VkDaqCreateAOVoltageChan | ( | const char * | task,
|  | const char * | chans,
|  | const char * | reserved1,
|  | double | minVal,
|  | double | maxVal,
|  | int32_t | units,
|  | const char * | reserved2
| ) |  |

创建DAC通道

数据类型 | 参数 | 说明
--- | --- | ---
`const char*` | `task` | 任务名.
`const char*` | `chans` | 通道列表，多个通道之间使用逗号分隔或使用冒号指定连续多个通道，如"dev1/AOUT1,dev1/AOUT2", "dev1/AOUT1:2"等.
`const char*` | `reserved1` | 保留.
`double` | `minVal` | 电压最小值.
`double` | `maxVal` | 电压最大值.
`const char*` | `source` | 电压单位.
`const char*` | `reserved2` | 保留.

返回
  成功时, 返回值 >= 0
  失败时, 返回为负值的错误编号.获取详细信息,请调用 VkDaqGetLastErrorInfo

C语言参考
#include <stdio.h>
#include "libvkdaq.h"
int main(int argc, char* argv[])
{
const char* task = "task1";
const char* source = "VirtualCounter";
int32_t maxVal = 4294967295;
int32_t result = VkDaqCreateTask(task);
result = VkDaqCreateAOVoltageChan(task, "dev1/AOUT1", "", -9, 9, VkDaq_Val_Volts, "");
if (result >= 0) {
printf("Successful\n");
}
else {
printf("Failed\n");
}
return 0;
}
VkDaqCreateAOVoltageChan
int32_t VkDaqCreateAOVoltageChan(const char *task, const char *chans, const char *reserved1, double minVal, double maxVal, int32_t units, const char *reserved2)
创建DAC通道
VkDaqCreateTask
int32_t VkDaqCreateTask(const char *task)
创建任务