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

Functions

int32_t VkDaqGetDeviceAttribute (const char *dev, const char *attrName, char attrValue[], int32_t size)
 Get device attribute value.
 

Detailed Description

Function Documentation

◆ VkDaqGetDeviceAttribute()

int32_t VkDaqGetDeviceAttribute ( const char *  dev,
const char *  attrName,
char  attrValue[],
int32_t  size 
)

Get device attribute value.

data type parameter describe
const char* dev Device name or Channel name, such as "dev1", "dev2",etc.
const char* attrName Attribute name, such as "Model", "SamplingFrequency", etc
char[] attrValue[] Character array, used to store attribute values.
const char* 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 device properties, please refer to the property reference of the corresponding acquisition card below:
1. VP8388_VP8384_Device_Attributes
2. VK7016_VK7018_Device_Attributes
3. VP6068_Device_Attributes

C language reference

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