libvkdaq
VKINGING DAQ Library API Reference
 
Loading...
Searching...
No Matches
Get device channel attribute value

Functions

int32_t VkDaqGetChannelAttribute (const char *chan, const char *attrName, char attrValue[], int32_t size)
 Get device channel attribute value.
 

Detailed Description

Function Documentation

◆ VkDaqGetChannelAttribute()

int32_t VkDaqGetChannelAttribute ( const char *  chan,
const char *  attrName,
char  attrValue[],
int32_t  size 
)

Get device channel attribute value.

data type parameter describe
const char* chan Channel name., such as "dev1/AIN1", "dev1/MIN1", "dev1/DIN1", "dev1/AOUT1", etc.
const char* attrName Attribute name.
char[] attrValue[] Character array, used to store attribute values, multiple values ​​are separated by commas.
int32_t size The size of the attrValue arrays.

Returns
On success, return value >= 0.
On failure, returns a negative error number.For detail, please Call VkDaqGetLastErrorInfo
Note
For detailed information about channel properties, please refer to the property reference of the corresponding acquisition card below:
1. VP8388_VP8384_Channel_Attributes
2. VK7016_VK7018_Channel_Attributes
3. VP6068_Channel_Attributes

C language reference

#include <stdio.h>
#include "libvkdaq.h"
int main(int argc, char* argv[])
{
const char* chan = "dev1/AIN1";
const char* attrName = "InputType";
char attrValue[4096] = { 0 };
int32_t size = sizeof(attrValue);
int32_t result = VkDaqGetChannelAttribute(chan, attrName, attrValue, size);
printf("InputType = %s \n", attrValue);
if (result >= 0) {
printf("Successful\n");
}
else {
printf("Failed\n");
}
return 0;
}
int32_t VkDaqGetChannelAttribute(const char *chan, const char *attrName, char attrValue[], int32_t size)
Get device channel attribute value.