| libvkdaq VKINGING DAQ Library API Reference |

Loading...
Searching...
No Matches
Functions
Create AI Voltage Channel
libvkdaq Function interface » Channel configuration

## Functions
int32_t | VkDaqCreateAIVoltageChan (const char *task, const char *chans, const char *reserved1, int32_t terminalConfig, double minVal, double maxVal, int32_t units, const char *reserved2)
| Create AI Voltage Channel.

## Detailed Description

## Function Documentation

## ◆ VkDaqCreateAIVoltageChan()

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

Create AI Voltage Channel.

data type | parameter | describe
--- | --- | ---
`const char*` | `task` | Task name.
`const char*` | `chans` | Channel list, Use commas to separate multiple channels or use colons to specify multiple channels in a row, such as "dev1/AIN1,dev1/AIN2,dev1/AIN3,dev1/AIN4", "dev1/AIN1:4", etc. Obtain Raw value: prefix RAW before AIN channel, for example: AIN1 returns Raw value, AIN2 returns voltage value "dev1/RAWAIN1, dev1/AIN2"
`const char*` | `reserved1` | Reserved.
`int32_t` | `terminalConfig` | The input terminal configuration for the channel. 0: SingleEnded. 1: Differential
`double` | `minVal` | The minimum value, in units, that you expect to measure.
`double` | `maxVal` | The maximum value, in units, that you expect to measure.
`int32_t` | `units` | Unit. 0: V
`const char*` | `reserved2` | Reserved.

Returns
  On success, return value >= 0.
  On failure, returns a negative error number.For detail, please Call VkDaqGetLastErrorInfo

C language reference
#include <stdio.h>
#include "libvkdaq.h"
int main(int argc, char* argv[])
{
const char* task = "task1";
char value[4096] = { 0 };
int32_t size = sizeof(value);
int32_t result = VkDaqCreateTask(task);
result = VkDaqCreateAIVoltageChan(task, "dev1/AIN1", "", VkDaq_Val_SingleEnded, -10.0, 10.0, VkDaq_Val_Volts, "");
if (result >= 0) {
printf("Successful\n");
}
else {
printf("Failed\n");
}
return 0;
}
VkDaqCreateAIVoltageChan
int32_t VkDaqCreateAIVoltageChan(const char *task, const char *chans, const char *reserved1, int32_t terminalConfig, double minVal, double maxVal, int32_t units, const char *reserved2)
Create AI Voltage Channel.
VkDaqCreateTask
int32_t VkDaqCreateTask(const char *task)
Create task.