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

载入中...
搜索中...
未找到
离线模式进入实时模式
临时任务流程图

注解
  步骤：
  1.读取设备属性：TransferMode VkDaqGetDeviceAttribute
  2.修改设备属性：TransferMode 为 Online VkDaqSetDeviceAttribute

离线模式进入实时模式流程图示例

C语言参考
#include <stdio.h>
#include "libvkdaq.h"
#define VkDaqErrChk(functionCall) if( VkDaqFailed(error=(functionCall)) ) goto Error; else
int main(void)
{
int32_t error = 0;
char attrValue[256];
// VkDaq Start Code
VkDaqErrChk(VkDaqGetDeviceAttribute("dev1", "TransferMode", attrValue, sizeof(attrValue)));
printf("Current TransferMode = %s\n", attrValue);
if (attrValue == "Offline") {
VkDaqErrChk(VkDaqSetDeviceAttribute("dev1", "TransferMode", "Online"));
}
//Check
VkDaqErrChk(VkDaqGetDeviceAttribute("dev1", "TransferMode", attrValue, sizeof(attrValue)));
printf("Check after setting up,TransferMode = %s\n", attrValue);
Error:
if (VkDaqFailed(error))
printf("VkDaq Error: %s\n", VkDaqGetLastErrorInfo());
printf("End of program, press Enter key to quit\n");
getchar();
return 0;
}
VkDaqGetDeviceAttribute
int32_t VkDaqGetDeviceAttribute(const char *dev, const char *attrName, char attrValue[], int32_t size)
获取设备属性值
VkDaqSetDeviceAttribute
int32_t VkDaqSetDeviceAttribute(const char *dev, const char *attrName, const char *attrValue)
设置设备属性值
VkDaqGetLastErrorInfo
const char * VkDaqGetLastErrorInfo(void)
获取最后一次执行的错误信息