| libvkdaq VKINGING DAQ Library API Reference |

Loading...
Searching...
No Matches
Offline mode enters real time mode
Temporary task flow chart

Note
  Steps:
  1.Get device attribute: TransferMode VkDaqGetDeviceAttribute
  2.Set device attribute: TransferMode to Online VkDaqSetDeviceAttribute

Example of Offline mode enters real time mode Process Diagram

C language reference
#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)
Get device attribute value.
VkDaqSetDeviceAttribute
int32_t VkDaqSetDeviceAttribute(const char *dev, const char *attrName, const char *attrValue)
Set device attribute value.
VkDaqGetLastErrorInfo
const char * VkDaqGetLastErrorInfo(void)
Get the error message of the last execution.