| libvkdaq VKINGING DAQ Library API Reference |

Loading...
Searching...
No Matches
Functions
Create MI channel
libvkdaq Function interface » Channel configuration

## Functions
int32_t | VkDaqCreateMIChan (const char *task, const char *chans, const char *reserved1, const char *source, uint32_t maxVal)
| Create MI channel.

## Detailed Description

## Function Documentation

## ◆ VkDaqCreateMIChan()

int32_t VkDaqCreateMIChan | ( | const char * | task,
|  | const char * | chans,
|  | const char * | reserved1,
|  | const char * | source,
|  | uint32_t | maxVal
| ) |  |

Create MI 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/MIN1,dev1/MIN2", "dev1/MIN1:2", etc.
`const char*` | `reserved1` | Reserved.
`const char*` | `source` | Miscellaneous input sources, such as "VirtualCounter", "Counter1", "Counter2", "Counter3", "Counter4", "Encoder1", "Encoder2", etc.
`int32_t` | `maxVal` | Maximum value of miscellaneous input sources.

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";
const char* source = "VirtualCounter";
int32_t maxVal = 4294967295;
int32_t result = VkDaqCreateTask(task);
result = VkDaqCreateMIChan(task, "dev1/DIN1", "", source, maxVal);
if (result >= 0) {
printf("Successful\n");
}
else {
printf("Failed\n");
}
return 0;
}
VkDaqCreateMIChan
int32_t VkDaqCreateMIChan(const char *task, const char *chans, const char *reserved1, const char *source, uint32_t maxVal)
Create MI channel.
VkDaqCreateTask
int32_t VkDaqCreateTask(const char *task)
Create task.